From f174447661b711e040d7be71082cd21059a28ec6 Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Mon, 11 Nov 2024 19:43:34 +0000 Subject: [PATCH] Regenerated Clients --- .../0f332045557a478eb1c98fbb6ed38937.json | 8 + .../148bcacd6af047c1b60f14b336341a9c.json | 8 + .../3ff83efb8b054353ab043d3cf7754103.json | 8 + .../a87793418a8448aa948ce29966037636.json | 8 + .../d7cbcd2fef5346938476e496625097cc.json | 8 + .../bedrock/internal/endpoints/endpoints.go | 35 + service/cloudfront/api_op_GetDistribution.go | 6 +- service/cloudfront/api_op_GetInvalidation.go | 6 +- .../api_op_GetStreamingDistribution.go | 6 +- .../api_op_ListOriginAccessControls.go | 8 +- service/cloudfront/api_op_ListPublicKeys.go | 96 ++ .../cloudfront/api_op_UpdateDistribution.go | 7 +- ..._op_UpdateDistributionWithStagingConfig.go | 2 +- service/inspector2/api_op_GetSbomExport.go | 2 +- service/inspector2/api_op_ListCoverage.go | 2 +- service/inspector2/api_op_StopCisSession.go | 2 +- service/inspector2/deserializers.go | 5 + service/inspector2/serializers.go | 7 + service/inspector2/types/enums.go | 78 +- service/inspector2/types/errors.go | 3 - service/inspector2/types/types.go | 5 +- service/inspector2/validators.go | 5 + service/lambda/types/enums.go | 2 + service/opensearch/api_op_AssociatePackage.go | 8 + .../opensearch/api_op_AssociatePackages.go | 164 +++ service/opensearch/api_op_CreatePackage.go | 14 + .../opensearch/api_op_DissociatePackages.go | 164 +++ service/opensearch/api_op_UpdatePackage.go | 6 + .../opensearch/api_op_UpdatePackageScope.go | 175 +++ service/opensearch/deserializers.go | 1071 +++++++++++++-- service/opensearch/generated.json | 3 + service/opensearch/serializers.go | 489 +++++++ .../snapshot/api_op_AssociatePackages.go.snap | 41 + .../api_op_DissociatePackages.go.snap | 41 + .../api_op_UpdatePackageScope.go.snap | 41 + service/opensearch/snapshot_test.go | 72 + service/opensearch/types/enums.go | 52 +- service/opensearch/types/types.go | 121 ++ service/opensearch/validators.go | 280 ++++ service/outposts/api_op_GetCapacityTask.go | 13 + ...api_op_GetOutpostSupportedInstanceTypes.go | 8 +- service/outposts/api_op_ListAssetInstances.go | 274 ++++ ...op_ListBlockingInstancesForCapacityTask.go | 270 ++++ service/outposts/api_op_StartCapacityTask.go | 40 +- service/outposts/deserializers.go | 1161 ++++++++++++++--- service/outposts/generated.json | 2 + service/outposts/serializers.go | 264 ++++ .../api_op_ListAssetInstances.go.snap | 41 + ...stBlockingInstancesForCapacityTask.go.snap | 41 + service/outposts/snapshot_test.go | 48 + service/outposts/types/enums.go | 69 +- service/outposts/types/types.go | 78 ++ service/outposts/validators.go | 87 +- 53 files changed, 5110 insertions(+), 345 deletions(-) create mode 100644 .changelog/0f332045557a478eb1c98fbb6ed38937.json create mode 100644 .changelog/148bcacd6af047c1b60f14b336341a9c.json create mode 100644 .changelog/3ff83efb8b054353ab043d3cf7754103.json create mode 100644 .changelog/a87793418a8448aa948ce29966037636.json create mode 100644 .changelog/d7cbcd2fef5346938476e496625097cc.json create mode 100644 service/opensearch/api_op_AssociatePackages.go create mode 100644 service/opensearch/api_op_DissociatePackages.go create mode 100644 service/opensearch/api_op_UpdatePackageScope.go create mode 100644 service/opensearch/snapshot/api_op_AssociatePackages.go.snap create mode 100644 service/opensearch/snapshot/api_op_DissociatePackages.go.snap create mode 100644 service/opensearch/snapshot/api_op_UpdatePackageScope.go.snap create mode 100644 service/outposts/api_op_ListAssetInstances.go create mode 100644 service/outposts/api_op_ListBlockingInstancesForCapacityTask.go create mode 100644 service/outposts/snapshot/api_op_ListAssetInstances.go.snap create mode 100644 service/outposts/snapshot/api_op_ListBlockingInstancesForCapacityTask.go.snap diff --git a/.changelog/0f332045557a478eb1c98fbb6ed38937.json b/.changelog/0f332045557a478eb1c98fbb6ed38937.json new file mode 100644 index 00000000000..2f0bf4af20d --- /dev/null +++ b/.changelog/0f332045557a478eb1c98fbb6ed38937.json @@ -0,0 +1,8 @@ +{ + "id": "0f332045-557a-478e-b1c9-8fbb6ed38937", + "type": "feature", + "description": "Adds support for filePath filter.", + "modules": [ + "service/inspector2" + ] +} \ No newline at end of file diff --git a/.changelog/148bcacd6af047c1b60f14b336341a9c.json b/.changelog/148bcacd6af047c1b60f14b336341a9c.json new file mode 100644 index 00000000000..b06e6906b77 --- /dev/null +++ b/.changelog/148bcacd6af047c1b60f14b336341a9c.json @@ -0,0 +1,8 @@ +{ + "id": "148bcacd-6af0-47c1-b60f-14b336341a9c", + "type": "feature", + "description": "This release updates StartCapacityTask to allow an active Outpost to be modified. It also adds a new API to list all running EC2 instances on the Outpost.", + "modules": [ + "service/outposts" + ] +} \ No newline at end of file diff --git a/.changelog/3ff83efb8b054353ab043d3cf7754103.json b/.changelog/3ff83efb8b054353ab043d3cf7754103.json new file mode 100644 index 00000000000..11f8b7e4869 --- /dev/null +++ b/.changelog/3ff83efb8b054353ab043d3cf7754103.json @@ -0,0 +1,8 @@ +{ + "id": "3ff83efb-8b05-4353-ab04-3d3cf7754103", + "type": "feature", + "description": "Add Python 3.13 (python3.13) support to AWS Lambda", + "modules": [ + "service/lambda" + ] +} \ No newline at end of file diff --git a/.changelog/a87793418a8448aa948ce29966037636.json b/.changelog/a87793418a8448aa948ce29966037636.json new file mode 100644 index 00000000000..ff6392f8585 --- /dev/null +++ b/.changelog/a87793418a8448aa948ce29966037636.json @@ -0,0 +1,8 @@ +{ + "id": "a8779341-8a84-48aa-948c-e29966037636", + "type": "feature", + "description": "Adds Support for new AssociatePackages and DissociatePackages API in Amazon OpenSearch Service that allows association and dissociation operations to be carried out on multiple packages at the same time.", + "modules": [ + "service/opensearch" + ] +} \ No newline at end of file diff --git a/.changelog/d7cbcd2fef5346938476e496625097cc.json b/.changelog/d7cbcd2fef5346938476e496625097cc.json new file mode 100644 index 00000000000..071cc748254 --- /dev/null +++ b/.changelog/d7cbcd2fef5346938476e496625097cc.json @@ -0,0 +1,8 @@ +{ + "id": "d7cbcd2f-ef53-4693-8476-e496625097cc", + "type": "feature", + "description": "No API changes from previous release. This release migrated the model to Smithy keeping all features unchanged.", + "modules": [ + "service/cloudfront" + ] +} \ No newline at end of file diff --git a/service/bedrock/internal/endpoints/endpoints.go b/service/bedrock/internal/endpoints/endpoints.go index 7432bd0f133..bc9c9869b79 100644 --- a/service/bedrock/internal/endpoints/endpoints.go +++ b/service/bedrock/internal/endpoints/endpoints.go @@ -644,6 +644,14 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "bedrock-fips-us-gov-east-1", + }: endpoints.Endpoint{ + Hostname: "bedrock-fips.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + }, endpoints.EndpointKey{ Region: "bedrock-fips-us-gov-west-1", }: endpoints.Endpoint{ @@ -652,6 +660,14 @@ var defaultPartitions = endpoints.Partitions{ Region: "us-gov-west-1", }, }, + endpoints.EndpointKey{ + Region: "bedrock-runtime-fips-us-gov-east-1", + }: endpoints.Endpoint{ + Hostname: "bedrock-runtime-fips.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + }, endpoints.EndpointKey{ Region: "bedrock-runtime-fips-us-gov-west-1", }: endpoints.Endpoint{ @@ -660,6 +676,14 @@ var defaultPartitions = endpoints.Partitions{ Region: "us-gov-west-1", }, }, + endpoints.EndpointKey{ + Region: "bedrock-runtime-us-gov-east-1", + }: endpoints.Endpoint{ + Hostname: "bedrock-runtime.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + }, endpoints.EndpointKey{ Region: "bedrock-runtime-us-gov-west-1", }: endpoints.Endpoint{ @@ -668,6 +692,14 @@ var defaultPartitions = endpoints.Partitions{ Region: "us-gov-west-1", }, }, + endpoints.EndpointKey{ + Region: "bedrock-us-gov-east-1", + }: endpoints.Endpoint{ + Hostname: "bedrock.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + }, endpoints.EndpointKey{ Region: "bedrock-us-gov-west-1", }: endpoints.Endpoint{ @@ -676,6 +708,9 @@ var defaultPartitions = endpoints.Partitions{ Region: "us-gov-west-1", }, }, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{}, diff --git a/service/cloudfront/api_op_GetDistribution.go b/service/cloudfront/api_op_GetDistribution.go index 5c045064514..fd843778c92 100644 --- a/service/cloudfront/api_op_GetDistribution.go +++ b/service/cloudfront/api_op_GetDistribution.go @@ -183,7 +183,7 @@ type DistributionDeployedWaiterOptions struct { MinDelay time.Duration // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, DistributionDeployedWaiter will use default max delay of 120 + // set to zero, DistributionDeployedWaiter will use default max delay of 2100 // seconds. Note that MaxDelay must resolve to value greater than or equal to the // MinDelay. MaxDelay time.Duration @@ -214,7 +214,7 @@ type DistributionDeployedWaiter struct { func NewDistributionDeployedWaiter(client GetDistributionAPIClient, optFns ...func(*DistributionDeployedWaiterOptions)) *DistributionDeployedWaiter { options := DistributionDeployedWaiterOptions{} options.MinDelay = 60 * time.Second - options.MaxDelay = 120 * time.Second + options.MaxDelay = 2100 * time.Second options.Retryable = distributionDeployedStateRetryable for _, fn := range optFns { @@ -249,7 +249,7 @@ func (w *DistributionDeployedWaiter) WaitForOutput(ctx context.Context, params * } if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second + options.MaxDelay = 2100 * time.Second } if options.MinDelay > options.MaxDelay { diff --git a/service/cloudfront/api_op_GetInvalidation.go b/service/cloudfront/api_op_GetInvalidation.go index ae4ce5e173e..7a5588ae217 100644 --- a/service/cloudfront/api_op_GetInvalidation.go +++ b/service/cloudfront/api_op_GetInvalidation.go @@ -185,7 +185,7 @@ type InvalidationCompletedWaiterOptions struct { MinDelay time.Duration // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, InvalidationCompletedWaiter will use default max delay of 120 + // set to zero, InvalidationCompletedWaiter will use default max delay of 600 // seconds. Note that MaxDelay must resolve to value greater than or equal to the // MinDelay. MaxDelay time.Duration @@ -216,7 +216,7 @@ type InvalidationCompletedWaiter struct { func NewInvalidationCompletedWaiter(client GetInvalidationAPIClient, optFns ...func(*InvalidationCompletedWaiterOptions)) *InvalidationCompletedWaiter { options := InvalidationCompletedWaiterOptions{} options.MinDelay = 20 * time.Second - options.MaxDelay = 120 * time.Second + options.MaxDelay = 600 * time.Second options.Retryable = invalidationCompletedStateRetryable for _, fn := range optFns { @@ -251,7 +251,7 @@ func (w *InvalidationCompletedWaiter) WaitForOutput(ctx context.Context, params } if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second + options.MaxDelay = 600 * time.Second } if options.MinDelay > options.MaxDelay { diff --git a/service/cloudfront/api_op_GetStreamingDistribution.go b/service/cloudfront/api_op_GetStreamingDistribution.go index 0b087c2f20c..aa4bc72291c 100644 --- a/service/cloudfront/api_op_GetStreamingDistribution.go +++ b/service/cloudfront/api_op_GetStreamingDistribution.go @@ -185,7 +185,7 @@ type StreamingDistributionDeployedWaiterOptions struct { // MaxDelay is the maximum amount of time to delay between retries. If unset or // set to zero, StreamingDistributionDeployedWaiter will use default max delay of - // 120 seconds. Note that MaxDelay must resolve to value greater than or equal to + // 1500 seconds. Note that MaxDelay must resolve to value greater than or equal to // the MinDelay. MaxDelay time.Duration @@ -217,7 +217,7 @@ type StreamingDistributionDeployedWaiter struct { func NewStreamingDistributionDeployedWaiter(client GetStreamingDistributionAPIClient, optFns ...func(*StreamingDistributionDeployedWaiterOptions)) *StreamingDistributionDeployedWaiter { options := StreamingDistributionDeployedWaiterOptions{} options.MinDelay = 60 * time.Second - options.MaxDelay = 120 * time.Second + options.MaxDelay = 1500 * time.Second options.Retryable = streamingDistributionDeployedStateRetryable for _, fn := range optFns { @@ -252,7 +252,7 @@ func (w *StreamingDistributionDeployedWaiter) WaitForOutput(ctx context.Context, } if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second + options.MaxDelay = 1500 * time.Second } if options.MinDelay > options.MaxDelay { diff --git a/service/cloudfront/api_op_ListOriginAccessControls.go b/service/cloudfront/api_op_ListOriginAccessControls.go index 5577c620dfc..07185b10bc3 100644 --- a/service/cloudfront/api_op_ListOriginAccessControls.go +++ b/service/cloudfront/api_op_ListOriginAccessControls.go @@ -11,14 +11,18 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets the list of CloudFront origin access controls in this Amazon Web Services -// account. +// Gets the list of CloudFront origin access controls (OACs) in this Amazon Web +// Services account. // // You can optionally specify the maximum number of items to receive in the // response. If the total number of items in the list exceeds the maximum that you // specify, or the default maximum, the response is paginated. To get the next page // of items, send another request that specifies the NextMarker value from the // current response as the Marker value in the next request. +// +// If you're not using origin access controls for your Amazon Web Services +// account, the ListOriginAccessControls operation doesn't return the Items +// element in the response. func (c *Client) ListOriginAccessControls(ctx context.Context, params *ListOriginAccessControlsInput, optFns ...func(*Options)) (*ListOriginAccessControlsOutput, error) { if params == nil { params = &ListOriginAccessControlsInput{} diff --git a/service/cloudfront/api_op_ListPublicKeys.go b/service/cloudfront/api_op_ListPublicKeys.go index 076807e6fb1..5b81e8137e8 100644 --- a/service/cloudfront/api_op_ListPublicKeys.go +++ b/service/cloudfront/api_op_ListPublicKeys.go @@ -151,6 +151,102 @@ func (c *Client) addOperationListPublicKeysMiddlewares(stack *middleware.Stack, return nil } +// ListPublicKeysPaginatorOptions is the paginator options for ListPublicKeys +type ListPublicKeysPaginatorOptions struct { + // The maximum number of public keys you want in the response body. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListPublicKeysPaginator is a paginator for ListPublicKeys +type ListPublicKeysPaginator struct { + options ListPublicKeysPaginatorOptions + client ListPublicKeysAPIClient + params *ListPublicKeysInput + nextToken *string + firstPage bool +} + +// NewListPublicKeysPaginator returns a new ListPublicKeysPaginator +func NewListPublicKeysPaginator(client ListPublicKeysAPIClient, params *ListPublicKeysInput, optFns ...func(*ListPublicKeysPaginatorOptions)) *ListPublicKeysPaginator { + if params == nil { + params = &ListPublicKeysInput{} + } + + options := ListPublicKeysPaginatorOptions{} + if params.MaxItems != nil { + options.Limit = *params.MaxItems + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListPublicKeysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPublicKeysPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListPublicKeys page. +func (p *ListPublicKeysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPublicKeysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxItems = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListPublicKeys(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + if result.PublicKeyList != nil { + p.nextToken = result.PublicKeyList.NextMarker + } + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// ListPublicKeysAPIClient is a client that implements the ListPublicKeys +// operation. +type ListPublicKeysAPIClient interface { + ListPublicKeys(context.Context, *ListPublicKeysInput, ...func(*Options)) (*ListPublicKeysOutput, error) +} + +var _ ListPublicKeysAPIClient = (*Client)(nil) + func newServiceMetadataMiddleware_opListPublicKeys(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudfront/api_op_UpdateDistribution.go b/service/cloudfront/api_op_UpdateDistribution.go index 693c1222ba5..38a721e345b 100644 --- a/service/cloudfront/api_op_UpdateDistribution.go +++ b/service/cloudfront/api_op_UpdateDistribution.go @@ -25,12 +25,13 @@ import ( // - Update the distribution configuration that was returned in the response. // Note the following important requirements and restrictions: // -// - You must rename the ETag field to IfMatch , leaving the value unchanged. -// (Set the value of IfMatch to the value of ETag , then remove the ETag field.) +// - You must copy the ETag field value from the response. (You'll use it for the +// IfMatch parameter in your request.) Then, remove the ETag field from the +// distribution configuration. // // - You can't change the value of CallerReference . // -// - Submit an UpdateDistribution request, providing the distribution +// - Submit an UpdateDistribution request, providing the updated distribution // configuration. The new configuration replaces the existing configuration. The // values that you specify in an UpdateDistribution request are not merged into // your existing configuration. Make sure to include all fields: the ones that you diff --git a/service/cloudfront/api_op_UpdateDistributionWithStagingConfig.go b/service/cloudfront/api_op_UpdateDistributionWithStagingConfig.go index 0e3c6229192..f84e105ce62 100644 --- a/service/cloudfront/api_op_UpdateDistributionWithStagingConfig.go +++ b/service/cloudfront/api_op_UpdateDistributionWithStagingConfig.go @@ -58,7 +58,7 @@ type UpdateDistributionWithStagingConfigInput struct { // The current versions ( ETag values) of both primary and staging distributions. // Provide these in the following format: // - // , + // , IfMatch *string // The identifier of the staging distribution whose configuration you are copying diff --git a/service/inspector2/api_op_GetSbomExport.go b/service/inspector2/api_op_GetSbomExport.go index ca370011670..96d17ebf7e0 100644 --- a/service/inspector2/api_op_GetSbomExport.go +++ b/service/inspector2/api_op_GetSbomExport.go @@ -55,7 +55,7 @@ type GetSbomExportOutput struct { // The report ID of the software bill of materials (SBOM) report. ReportId *string - // Contains details of the Amazon S3 bucket and KMS key used to export findings. + // Contains details of the Amazon S3 bucket and KMS key used to export findings S3Destination *types.Destination // The status of the software bill of materials (SBOM) report. diff --git a/service/inspector2/api_op_ListCoverage.go b/service/inspector2/api_op_ListCoverage.go index 4a93aa0937c..9765d1c3c70 100644 --- a/service/inspector2/api_op_ListCoverage.go +++ b/service/inspector2/api_op_ListCoverage.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists coverage details for you environment. +// Lists coverage details for your environment. func (c *Client) ListCoverage(ctx context.Context, params *ListCoverageInput, optFns ...func(*Options)) (*ListCoverageOutput, error) { if params == nil { params = &ListCoverageInput{} diff --git a/service/inspector2/api_op_StopCisSession.go b/service/inspector2/api_op_StopCisSession.go index 9614ef6828c..307e0d906ac 100644 --- a/service/inspector2/api_op_StopCisSession.go +++ b/service/inspector2/api_op_StopCisSession.go @@ -14,7 +14,7 @@ import ( // Stops a CIS session. This API is used by the Amazon Inspector SSM plugin to // // communicate with the Amazon Inspector service. The Amazon Inspector SSM plugin -// calls this API to start a CIS scan session for the scan ID supplied by the +// calls this API to stop a CIS scan session for the scan ID supplied by the // service. func (c *Client) StopCisSession(ctx context.Context, params *StopCisSessionInput, optFns ...func(*Options)) (*StopCisSessionOutput, error) { if params == nil { diff --git a/service/inspector2/deserializers.go b/service/inspector2/deserializers.go index 9340df8036b..8cc90ca1ece 100644 --- a/service/inspector2/deserializers.go +++ b/service/inspector2/deserializers.go @@ -17049,6 +17049,11 @@ func awsRestjson1_deserializeDocumentPackageFilter(v **types.PackageFilter, valu return err } + case "filePath": + if err := awsRestjson1_deserializeDocumentStringFilter(&sv.FilePath, value); err != nil { + return err + } + case "name": if err := awsRestjson1_deserializeDocumentStringFilter(&sv.Name, value); err != nil { return err diff --git a/service/inspector2/serializers.go b/service/inspector2/serializers.go index 28414add6a5..4c0b13fb013 100644 --- a/service/inspector2/serializers.go +++ b/service/inspector2/serializers.go @@ -7190,6 +7190,13 @@ func awsRestjson1_serializeDocumentPackageFilter(v *types.PackageFilter, value s } } + if v.FilePath != nil { + ok := object.Key("filePath") + if err := awsRestjson1_serializeDocumentStringFilter(v.FilePath, ok); err != nil { + return err + } + } + if v.Name != nil { ok := object.Key("name") if err := awsRestjson1_serializeDocumentStringFilter(v.Name, ok); err != nil { diff --git a/service/inspector2/types/enums.go b/service/inspector2/types/enums.go index ae27244e908..78e70dafb8e 100644 --- a/service/inspector2/types/enums.go +++ b/service/inspector2/types/enums.go @@ -1394,23 +1394,24 @@ type PackageManager string // Enum values for PackageManager const ( - PackageManagerBundler PackageManager = "BUNDLER" - PackageManagerCargo PackageManager = "CARGO" - PackageManagerComposer PackageManager = "COMPOSER" - PackageManagerNpm PackageManager = "NPM" - PackageManagerNuget PackageManager = "NUGET" - PackageManagerPipenv PackageManager = "PIPENV" - PackageManagerPoetry PackageManager = "POETRY" - PackageManagerYarn PackageManager = "YARN" - PackageManagerGobinary PackageManager = "GOBINARY" - PackageManagerGomod PackageManager = "GOMOD" - PackageManagerJar PackageManager = "JAR" - PackageManagerOs PackageManager = "OS" - PackageManagerPip PackageManager = "PIP" - PackageManagerPythonpkg PackageManager = "PYTHONPKG" - PackageManagerNodepkg PackageManager = "NODEPKG" - PackageManagerPom PackageManager = "POM" - PackageManagerGemspec PackageManager = "GEMSPEC" + PackageManagerBundler PackageManager = "BUNDLER" + PackageManagerCargo PackageManager = "CARGO" + PackageManagerComposer PackageManager = "COMPOSER" + PackageManagerNpm PackageManager = "NPM" + PackageManagerNuget PackageManager = "NUGET" + PackageManagerPipenv PackageManager = "PIPENV" + PackageManagerPoetry PackageManager = "POETRY" + PackageManagerYarn PackageManager = "YARN" + PackageManagerGobinary PackageManager = "GOBINARY" + PackageManagerGomod PackageManager = "GOMOD" + PackageManagerJar PackageManager = "JAR" + PackageManagerOs PackageManager = "OS" + PackageManagerPip PackageManager = "PIP" + PackageManagerPythonpkg PackageManager = "PYTHONPKG" + PackageManagerNodepkg PackageManager = "NODEPKG" + PackageManagerPom PackageManager = "POM" + PackageManagerGemspec PackageManager = "GEMSPEC" + PackageManagerDotnetCore PackageManager = "DOTNET_CORE" ) // Values returns all known values for PackageManager. Note that this can be @@ -1436,6 +1437,7 @@ func (PackageManager) Values() []PackageManager { "NODEPKG", "POM", "GEMSPEC", + "DOTNET_CORE", } } @@ -1673,21 +1675,27 @@ type Runtime string // Enum values for Runtime const ( - RuntimeNodejs Runtime = "NODEJS" - RuntimeNodejs12X Runtime = "NODEJS_12_X" - RuntimeNodejs14X Runtime = "NODEJS_14_X" - RuntimeNodejs16X Runtime = "NODEJS_16_X" - RuntimeJava8 Runtime = "JAVA_8" - RuntimeJava8Al2 Runtime = "JAVA_8_AL2" - RuntimeJava11 Runtime = "JAVA_11" - RuntimePython37 Runtime = "PYTHON_3_7" - RuntimePython38 Runtime = "PYTHON_3_8" - RuntimePython39 Runtime = "PYTHON_3_9" - RuntimeUnsupported Runtime = "UNSUPPORTED" - RuntimeNodejs18X Runtime = "NODEJS_18_X" - RuntimeGo1X Runtime = "GO_1_X" - RuntimeJava17 Runtime = "JAVA_17" - RuntimePython310 Runtime = "PYTHON_3_10" + RuntimeNodejs Runtime = "NODEJS" + RuntimeNodejs12X Runtime = "NODEJS_12_X" + RuntimeNodejs14X Runtime = "NODEJS_14_X" + RuntimeNodejs16X Runtime = "NODEJS_16_X" + RuntimeJava8 Runtime = "JAVA_8" + RuntimeJava8Al2 Runtime = "JAVA_8_AL2" + RuntimeJava11 Runtime = "JAVA_11" + RuntimePython37 Runtime = "PYTHON_3_7" + RuntimePython38 Runtime = "PYTHON_3_8" + RuntimePython39 Runtime = "PYTHON_3_9" + RuntimeUnsupported Runtime = "UNSUPPORTED" + RuntimeNodejs18X Runtime = "NODEJS_18_X" + RuntimeGo1X Runtime = "GO_1_X" + RuntimeJava17 Runtime = "JAVA_17" + RuntimePython310 Runtime = "PYTHON_3_10" + RuntimePython311 Runtime = "PYTHON_3_11" + RuntimeDotnetcore31 Runtime = "DOTNETCORE_3_1" + RuntimeDotnet6 Runtime = "DOTNET_6" + RuntimeDotnet7 Runtime = "DOTNET_7" + RuntimeRuby27 Runtime = "RUBY_2_7" + RuntimeRuby32 Runtime = "RUBY_3_2" ) // Values returns all known values for Runtime. Note that this can be expanded in @@ -1711,6 +1719,12 @@ func (Runtime) Values() []Runtime { "GO_1_X", "JAVA_17", "PYTHON_3_10", + "PYTHON_3_11", + "DOTNETCORE_3_1", + "DOTNET_6", + "DOTNET_7", + "RUBY_2_7", + "RUBY_3_2", } } diff --git a/service/inspector2/types/errors.go b/service/inspector2/types/errors.go index 05520deab84..9efd636e01c 100644 --- a/service/inspector2/types/errors.go +++ b/service/inspector2/types/errors.go @@ -8,9 +8,6 @@ import ( ) // You do not have sufficient access to perform this action. -// -// For Enable , you receive this error if you attempt to use a feature in an -// unsupported Amazon Web Services Region. type AccessDeniedException struct { Message *string diff --git a/service/inspector2/types/types.go b/service/inspector2/types/types.go index 8d2fc96123d..6aee16b16c7 100644 --- a/service/inspector2/types/types.go +++ b/service/inspector2/types/types.go @@ -1275,7 +1275,7 @@ type CoverageFilterCriteria struct { ResourceType []CoverageStringFilter // The filter to search for Amazon EC2 instance coverage by scan mode. Valid - // values are EC2_SSM_AGENT_BASED and EC2_HYBRID . + // values are EC2_SSM_AGENT_BASED and EC2_AGENTLESS . ScanMode []CoverageStringFilter // The scan status code to filter on. Valid values are: ValidationException , @@ -2747,6 +2747,9 @@ type PackageFilter struct { // An object that contains details on the package epoch to filter on. Epoch *NumberFilter + // An object that contains details on the package file path to filter on. + FilePath *StringFilter + // An object that contains details on the name of the package to filter on. Name *StringFilter diff --git a/service/inspector2/validators.go b/service/inspector2/validators.go index 12712b3d399..1df39f5502b 100644 --- a/service/inspector2/validators.go +++ b/service/inspector2/validators.go @@ -2470,6 +2470,11 @@ func validatePackageFilter(v *types.PackageFilter) error { invalidParams.AddNested("SourceLambdaLayerArn", err.(smithy.InvalidParamsError)) } } + if v.FilePath != nil { + if err := validateStringFilter(v.FilePath); err != nil { + invalidParams.AddNested("FilePath", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/lambda/types/enums.go b/service/lambda/types/enums.go index 545af9db16f..0541d3be93e 100644 --- a/service/lambda/types/enums.go +++ b/service/lambda/types/enums.go @@ -455,6 +455,7 @@ const ( RuntimeProvidedal2023 Runtime = "provided.al2023" RuntimePython312 Runtime = "python3.12" RuntimeJava21 Runtime = "java21" + RuntimePython313 Runtime = "python3.13" ) // Values returns all known values for Runtime. Note that this can be expanded in @@ -501,6 +502,7 @@ func (Runtime) Values() []Runtime { "provided.al2023", "python3.12", "java21", + "python3.13", } } diff --git a/service/opensearch/api_op_AssociatePackage.go b/service/opensearch/api_op_AssociatePackage.go index 775f62691c4..8642534387d 100644 --- a/service/opensearch/api_op_AssociatePackage.go +++ b/service/opensearch/api_op_AssociatePackage.go @@ -44,6 +44,14 @@ type AssociatePackageInput struct { // This member is required. PackageID *string + // The configuration for associating a package with an Amazon OpenSearch Service + // domain. + AssociationConfiguration *types.PackageAssociationConfiguration + + // A list of package IDs that must be associated with the domain before the + // package specified in the request can be associated. + PrerequisitePackageIDList []string + noSmithyDocumentSerde } diff --git a/service/opensearch/api_op_AssociatePackages.go b/service/opensearch/api_op_AssociatePackages.go new file mode 100644 index 00000000000..b2c37df79a6 --- /dev/null +++ b/service/opensearch/api_op_AssociatePackages.go @@ -0,0 +1,164 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opensearch + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/opensearch/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Operation in the Amazon OpenSearch Service API for associating multiple +// packages with a domain simultaneously. +func (c *Client) AssociatePackages(ctx context.Context, params *AssociatePackagesInput, optFns ...func(*Options)) (*AssociatePackagesOutput, error) { + if params == nil { + params = &AssociatePackagesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssociatePackages", params, optFns, c.addOperationAssociatePackagesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssociatePackagesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssociatePackagesInput struct { + + // The name of an OpenSearch Service domain. Domain names are unique across the + // domains owned by an account within an Amazon Web Services Region. + // + // This member is required. + DomainName *string + + // A list of packages and their prerequisites to be associated with a domain. + // + // This member is required. + PackageList []types.PackageDetailsForAssociation + + noSmithyDocumentSerde +} + +type AssociatePackagesOutput struct { + + // List of information about packages that are associated with a domain. + DomainPackageDetailsList []types.DomainPackageDetails + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAssociatePackagesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociatePackages{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociatePackages{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "AssociatePackages"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpAssociatePackagesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociatePackages(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAssociatePackages(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "AssociatePackages", + } +} diff --git a/service/opensearch/api_op_CreatePackage.go b/service/opensearch/api_op_CreatePackage.go index 039d5342de4..25d8edd6e14 100644 --- a/service/opensearch/api_op_CreatePackage.go +++ b/service/opensearch/api_op_CreatePackage.go @@ -48,9 +48,23 @@ type CreatePackageInput struct { // This member is required. PackageType types.PackageType + // The version of the Amazon OpenSearch Service engine for which is compatible + // with the package. This can only be specified for package type ZIP-PLUGIN + EngineVersion *string + + // The configuration parameters for the package being created. + PackageConfiguration *types.PackageConfiguration + // Description of the package. PackageDescription *string + // The encryption parameters for the package being created. + PackageEncryptionOptions *types.PackageEncryptionOptions + + // The vending options for the package being created. They determine if the + // package can be vended to other users. + PackageVendingOptions *types.PackageVendingOptions + noSmithyDocumentSerde } diff --git a/service/opensearch/api_op_DissociatePackages.go b/service/opensearch/api_op_DissociatePackages.go new file mode 100644 index 00000000000..e877f3c5197 --- /dev/null +++ b/service/opensearch/api_op_DissociatePackages.go @@ -0,0 +1,164 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opensearch + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/opensearch/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Dissociates multiple packages from a domain simulatneously. +func (c *Client) DissociatePackages(ctx context.Context, params *DissociatePackagesInput, optFns ...func(*Options)) (*DissociatePackagesOutput, error) { + if params == nil { + params = &DissociatePackagesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DissociatePackages", params, optFns, c.addOperationDissociatePackagesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DissociatePackagesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DissociatePackagesInput struct { + + // The name of an OpenSearch Service domain. Domain names are unique across the + // domains owned by an account within an Amazon Web Services Region. + // + // This member is required. + DomainName *string + + // A list of package IDs to be dissociated from a domain. + // + // This member is required. + PackageList []string + + noSmithyDocumentSerde +} + +type DissociatePackagesOutput struct { + + // A list of package details for the packages that were dissociated from the + // domain. + DomainPackageDetailsList []types.DomainPackageDetails + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDissociatePackagesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDissociatePackages{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDissociatePackages{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DissociatePackages"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDissociatePackagesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDissociatePackages(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDissociatePackages(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DissociatePackages", + } +} diff --git a/service/opensearch/api_op_UpdatePackage.go b/service/opensearch/api_op_UpdatePackage.go index ceb40f6eef5..e151d88bee5 100644 --- a/service/opensearch/api_op_UpdatePackage.go +++ b/service/opensearch/api_op_UpdatePackage.go @@ -47,9 +47,15 @@ type UpdatePackageInput struct { // GetPackageVersionHistoryResponse . CommitMessage *string + // The updated configuration details for a package. + PackageConfiguration *types.PackageConfiguration + // A new description of the package. PackageDescription *string + // Encryption options for a package. + PackageEncryptionOptions *types.PackageEncryptionOptions + noSmithyDocumentSerde } diff --git a/service/opensearch/api_op_UpdatePackageScope.go b/service/opensearch/api_op_UpdatePackageScope.go new file mode 100644 index 00000000000..9e28ee599f9 --- /dev/null +++ b/service/opensearch/api_op_UpdatePackageScope.go @@ -0,0 +1,175 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opensearch + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/opensearch/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the scope of a package. Scope of the package defines users who can view +// and associate a package. +func (c *Client) UpdatePackageScope(ctx context.Context, params *UpdatePackageScopeInput, optFns ...func(*Options)) (*UpdatePackageScopeOutput, error) { + if params == nil { + params = &UpdatePackageScopeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdatePackageScope", params, optFns, c.addOperationUpdatePackageScopeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdatePackageScopeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdatePackageScopeInput struct { + + // The operation to perform on the package scope (e.g., add/remove/override + // users). + // + // This member is required. + Operation types.PackageScopeOperationEnum + + // ID of the package whose scope is being updated. + // + // This member is required. + PackageID *string + + // List of users to be added or removed from the package scope. + // + // This member is required. + PackageUserList []string + + noSmithyDocumentSerde +} + +type UpdatePackageScopeOutput struct { + + // The operation that was performed on the package scope. + Operation types.PackageScopeOperationEnum + + // ID of the package whose scope was updated. + PackageID *string + + // List of users who have access to the package after the scope update. + PackageUserList []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdatePackageScopeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdatePackageScope{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdatePackageScope{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdatePackageScope"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdatePackageScopeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePackageScope(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdatePackageScope(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdatePackageScope", + } +} diff --git a/service/opensearch/deserializers.go b/service/opensearch/deserializers.go index e476959475a..704d3784ff6 100644 --- a/service/opensearch/deserializers.go +++ b/service/opensearch/deserializers.go @@ -633,6 +633,173 @@ func awsRestjson1_deserializeOpDocumentAssociatePackageOutput(v **AssociatePacka return nil } +type awsRestjson1_deserializeOpAssociatePackages struct { +} + +func (*awsRestjson1_deserializeOpAssociatePackages) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpAssociatePackages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorAssociatePackages(response, &metadata) + } + output := &AssociatePackagesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentAssociatePackagesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorAssociatePackages(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentAssociatePackagesOutput(v **AssociatePackagesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *AssociatePackagesOutput + if *v == nil { + sv = &AssociatePackagesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DomainPackageDetailsList": + if err := awsRestjson1_deserializeDocumentDomainPackageDetailsList(&sv.DomainPackageDetailsList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpAuthorizeVpcEndpointAccess struct { } @@ -5915,14 +6082,14 @@ func awsRestjson1_deserializeOpDocumentDissociatePackageOutput(v **DissociatePac return nil } -type awsRestjson1_deserializeOpGetApplication struct { +type awsRestjson1_deserializeOpDissociatePackages struct { } -func (*awsRestjson1_deserializeOpGetApplication) ID() string { +func (*awsRestjson1_deserializeOpDissociatePackages) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDissociatePackages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5940,9 +6107,9 @@ func (m *awsRestjson1_deserializeOpGetApplication) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetApplication(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDissociatePackages(response, &metadata) } - output := &GetApplicationOutput{} + output := &DissociatePackagesOutput{} out.Result = output var buff [1024]byte @@ -5963,7 +6130,7 @@ func (m *awsRestjson1_deserializeOpGetApplication) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetApplicationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDissociatePackagesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5977,7 +6144,7 @@ func (m *awsRestjson1_deserializeOpGetApplication) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDissociatePackages(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6018,12 +6185,12 @@ func awsRestjson1_deserializeOpErrorGetApplication(response *smithyhttp.Response } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) @@ -6046,7 +6213,7 @@ func awsRestjson1_deserializeOpErrorGetApplication(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentGetApplicationOutput(v **GetApplicationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDissociatePackagesOutput(v **DissociatePackagesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6059,72 +6226,239 @@ func awsRestjson1_deserializeOpDocumentGetApplicationOutput(v **GetApplicationOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetApplicationOutput + var sv *DissociatePackagesOutput if *v == nil { - sv = &GetApplicationOutput{} + sv = &DissociatePackagesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "appConfigs": - if err := awsRestjson1_deserializeDocumentAppConfigs(&sv.AppConfigs, value); err != nil { + case "DomainPackageDetailsList": + if err := awsRestjson1_deserializeDocumentDomainPackageDetailsList(&sv.DomainPackageDetailsList, value); err != nil { return err } - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ARN to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } + default: + _, _ = key, value - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + } + *v = sv + return nil +} - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) +type awsRestjson1_deserializeOpGetApplication struct { +} - } - } +func (*awsRestjson1_deserializeOpGetApplication) ID() string { + return "OperationDeserializer" +} - case "dataSources": - if err := awsRestjson1_deserializeDocumentDataSources(&sv.DataSources, value); err != nil { - return err - } +func (m *awsRestjson1_deserializeOpGetApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } - case "endpoint": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Endpoint = ptr.String(jtv) - } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } - case "iamIdentityCenterOptions": - if err := awsRestjson1_deserializeDocumentIamIdentityCenterOptions(&sv.IamIdentityCenterOptions, value); err != nil { - return err - } + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetApplication(response, &metadata) + } + output := &GetApplicationOutput{} + out.Result = output - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentGetApplicationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetApplicationOutput(v **GetApplicationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetApplicationOutput + if *v == nil { + sv = &GetApplicationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "appConfigs": + if err := awsRestjson1_deserializeDocumentAppConfigs(&sv.AppConfigs, value); err != nil { + return err + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "dataSources": + if err := awsRestjson1_deserializeDocumentDataSources(&sv.DataSources, value); err != nil { + return err + } + + case "endpoint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Endpoint = ptr.String(jtv) + } + + case "iamIdentityCenterOptions": + if err := awsRestjson1_deserializeDocumentIamIdentityCenterOptions(&sv.IamIdentityCenterOptions, value); err != nil { + return err + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } case "lastUpdatedAt": if value != nil { @@ -11111,14 +11445,14 @@ func awsRestjson1_deserializeOpDocumentUpdatePackageOutput(v **UpdatePackageOutp return nil } -type awsRestjson1_deserializeOpUpdateScheduledAction struct { +type awsRestjson1_deserializeOpUpdatePackageScope struct { } -func (*awsRestjson1_deserializeOpUpdateScheduledAction) ID() string { +func (*awsRestjson1_deserializeOpUpdatePackageScope) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateScheduledAction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdatePackageScope) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11136,9 +11470,9 @@ func (m *awsRestjson1_deserializeOpUpdateScheduledAction) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateScheduledAction(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdatePackageScope(response, &metadata) } - output := &UpdateScheduledActionOutput{} + output := &UpdatePackageScopeOutput{} out.Result = output var buff [1024]byte @@ -11159,7 +11493,7 @@ func (m *awsRestjson1_deserializeOpUpdateScheduledAction) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateScheduledActionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdatePackageScopeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11173,7 +11507,7 @@ func (m *awsRestjson1_deserializeOpUpdateScheduledAction) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateScheduledAction(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdatePackageScope(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11217,21 +11551,15 @@ func awsRestjson1_deserializeOpErrorUpdateScheduledAction(response *smithyhttp.R case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("SlotNotAvailableException", errorCode): - return awsRestjson1_deserializeErrorSlotNotAvailableException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -11245,7 +11573,7 @@ func awsRestjson1_deserializeOpErrorUpdateScheduledAction(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentUpdateScheduledActionOutput(v **UpdateScheduledActionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdatePackageScopeOutput(v **UpdatePackageScopeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11258,17 +11586,35 @@ func awsRestjson1_deserializeOpDocumentUpdateScheduledActionOutput(v **UpdateSch return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateScheduledActionOutput + var sv *UpdatePackageScopeOutput if *v == nil { - sv = &UpdateScheduledActionOutput{} + sv = &UpdatePackageScopeOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ScheduledAction": - if err := awsRestjson1_deserializeDocumentScheduledAction(&sv.ScheduledAction, value); err != nil { + case "Operation": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PackageScopeOperationEnum to be of type string, got %T instead", value) + } + sv.Operation = types.PackageScopeOperationEnum(jtv) + } + + case "PackageID": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PackageID to be of type string, got %T instead", value) + } + sv.PackageID = ptr.String(jtv) + } + + case "PackageUserList": + if err := awsRestjson1_deserializeDocumentPackageUserList(&sv.PackageUserList, value); err != nil { return err } @@ -11281,14 +11627,14 @@ func awsRestjson1_deserializeOpDocumentUpdateScheduledActionOutput(v **UpdateSch return nil } -type awsRestjson1_deserializeOpUpdateVpcEndpoint struct { +type awsRestjson1_deserializeOpUpdateScheduledAction struct { } -func (*awsRestjson1_deserializeOpUpdateVpcEndpoint) ID() string { +func (*awsRestjson1_deserializeOpUpdateScheduledAction) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateVpcEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateScheduledAction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11306,9 +11652,9 @@ func (m *awsRestjson1_deserializeOpUpdateVpcEndpoint) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateVpcEndpoint(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateScheduledAction(response, &metadata) } - output := &UpdateVpcEndpointOutput{} + output := &UpdateScheduledActionOutput{} out.Result = output var buff [1024]byte @@ -11329,7 +11675,7 @@ func (m *awsRestjson1_deserializeOpUpdateVpcEndpoint) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateVpcEndpointOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdateScheduledActionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11343,7 +11689,7 @@ func (m *awsRestjson1_deserializeOpUpdateVpcEndpoint) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateVpcEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateScheduledAction(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11390,15 +11736,18 @@ func awsRestjson1_deserializeOpErrorUpdateVpcEndpoint(response *smithyhttp.Respo case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("DisabledOperationException", errorCode): - return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) - case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("SlotNotAvailableException", errorCode): + return awsRestjson1_deserializeErrorSlotNotAvailableException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -11412,7 +11761,7 @@ func awsRestjson1_deserializeOpErrorUpdateVpcEndpoint(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentUpdateVpcEndpointOutput(v **UpdateVpcEndpointOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateScheduledActionOutput(v **UpdateScheduledActionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11425,17 +11774,17 @@ func awsRestjson1_deserializeOpDocumentUpdateVpcEndpointOutput(v **UpdateVpcEndp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateVpcEndpointOutput + var sv *UpdateScheduledActionOutput if *v == nil { - sv = &UpdateVpcEndpointOutput{} + sv = &UpdateScheduledActionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "VpcEndpoint": - if err := awsRestjson1_deserializeDocumentVpcEndpoint(&sv.VpcEndpoint, value); err != nil { + case "ScheduledAction": + if err := awsRestjson1_deserializeDocumentScheduledAction(&sv.ScheduledAction, value); err != nil { return err } @@ -11448,14 +11797,14 @@ func awsRestjson1_deserializeOpDocumentUpdateVpcEndpointOutput(v **UpdateVpcEndp return nil } -type awsRestjson1_deserializeOpUpgradeDomain struct { +type awsRestjson1_deserializeOpUpdateVpcEndpoint struct { } -func (*awsRestjson1_deserializeOpUpgradeDomain) ID() string { +func (*awsRestjson1_deserializeOpUpdateVpcEndpoint) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpgradeDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateVpcEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11473,7 +11822,174 @@ func (m *awsRestjson1_deserializeOpUpgradeDomain) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpgradeDomain(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateVpcEndpoint(response, &metadata) + } + output := &UpdateVpcEndpointOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentUpdateVpcEndpointOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateVpcEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateVpcEndpointOutput(v **UpdateVpcEndpointOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateVpcEndpointOutput + if *v == nil { + sv = &UpdateVpcEndpointOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "VpcEndpoint": + if err := awsRestjson1_deserializeDocumentVpcEndpoint(&sv.VpcEndpoint, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpgradeDomain struct { +} + +func (*awsRestjson1_deserializeOpUpgradeDomain) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpgradeDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpgradeDomain(response, &metadata) } output := &UpgradeDomainOutput{} out.Result = output @@ -15552,6 +16068,11 @@ func awsRestjson1_deserializeDocumentDomainPackageDetails(v **types.DomainPackag for key, value := range shape { switch key { + case "AssociationConfiguration": + if err := awsRestjson1_deserializeDocumentPackageAssociationConfiguration(&sv.AssociationConfiguration, value); err != nil { + return err + } + case "DomainName": if value != nil { jtv, ok := value.(string) @@ -15627,6 +16148,11 @@ func awsRestjson1_deserializeDocumentDomainPackageDetails(v **types.DomainPackag sv.PackageVersion = ptr.String(jtv) } + case "PrerequisitePackageIDList": + if err := awsRestjson1_deserializeDocumentPackageIDList(&sv.PrerequisitePackageIDList, value); err != nil { + return err + } + case "ReferencePath": if value != nil { jtv, ok := value.(string) @@ -17420,6 +17946,55 @@ func awsRestjson1_deserializeDocumentJWTOptionsOutput(v **types.JWTOptionsOutput return nil } +func awsRestjson1_deserializeDocumentKeyStoreAccessOption(v **types.KeyStoreAccessOption, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.KeyStoreAccessOption + if *v == nil { + sv = &types.KeyStoreAccessOption{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "KeyAccessRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) + } + sv.KeyAccessRoleArn = ptr.String(jtv) + } + + case "KeyStoreAccessEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.KeyStoreAccessEnabled = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -18451,6 +19026,109 @@ func awsRestjson1_deserializeDocumentOutboundConnectionStatus(v **types.Outbound return nil } +func awsRestjson1_deserializeDocumentPackageAssociationConfiguration(v **types.PackageAssociationConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PackageAssociationConfiguration + if *v == nil { + sv = &types.PackageAssociationConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "KeyStoreAccessOption": + if err := awsRestjson1_deserializeDocumentKeyStoreAccessOption(&sv.KeyStoreAccessOption, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPackageConfiguration(v **types.PackageConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PackageConfiguration + if *v == nil { + sv = &types.PackageConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ConfigurationRequirement": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RequirementLevel to be of type string, got %T instead", value) + } + sv.ConfigurationRequirement = types.RequirementLevel(jtv) + } + + case "LicenseFilepath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LicenseFilepath to be of type string, got %T instead", value) + } + sv.LicenseFilepath = ptr.String(jtv) + } + + case "LicenseRequirement": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RequirementLevel to be of type string, got %T instead", value) + } + sv.LicenseRequirement = types.RequirementLevel(jtv) + } + + case "RequiresRestartForConfigurationUpdate": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.RequiresRestartForConfigurationUpdate = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentPackageDetails(v **types.PackageDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -18473,6 +19151,16 @@ func awsRestjson1_deserializeDocumentPackageDetails(v **types.PackageDetails, va for key, value := range shape { switch key { + case "AllowListedUserList": + if err := awsRestjson1_deserializeDocumentPackageUserList(&sv.AllowListedUserList, value); err != nil { + return err + } + + case "AvailablePackageConfiguration": + if err := awsRestjson1_deserializeDocumentPackageConfiguration(&sv.AvailablePackageConfiguration, value); err != nil { + return err + } + case "AvailablePackageVersion": if value != nil { jtv, ok := value.(string) @@ -18542,6 +19230,11 @@ func awsRestjson1_deserializeDocumentPackageDetails(v **types.PackageDetails, va sv.PackageDescription = ptr.String(jtv) } + case "PackageEncryptionOptions": + if err := awsRestjson1_deserializeDocumentPackageEncryptionOptions(&sv.PackageEncryptionOptions, value); err != nil { + return err + } + case "PackageID": if value != nil { jtv, ok := value.(string) @@ -18560,6 +19253,15 @@ func awsRestjson1_deserializeDocumentPackageDetails(v **types.PackageDetails, va sv.PackageName = ptr.String(jtv) } + case "PackageOwner": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PackageOwner to be of type string, got %T instead", value) + } + sv.PackageOwner = ptr.String(jtv) + } + case "PackageStatus": if value != nil { jtv, ok := value.(string) @@ -18578,6 +19280,11 @@ func awsRestjson1_deserializeDocumentPackageDetails(v **types.PackageDetails, va sv.PackageType = types.PackageType(jtv) } + case "PackageVendingOptions": + if err := awsRestjson1_deserializeDocumentPackageVendingOptions(&sv.PackageVendingOptions, value); err != nil { + return err + } + default: _, _ = key, value @@ -18621,6 +19328,167 @@ func awsRestjson1_deserializeDocumentPackageDetailsList(v *[]types.PackageDetail return nil } +func awsRestjson1_deserializeDocumentPackageEncryptionOptions(v **types.PackageEncryptionOptions, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PackageEncryptionOptions + if *v == nil { + sv = &types.PackageEncryptionOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EncryptionEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.EncryptionEnabled = ptr.Bool(jtv) + } + + case "KmsKeyIdentifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) + } + sv.KmsKeyIdentifier = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPackageIDList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PackageID to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPackageUserList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PackageUser to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPackageVendingOptions(v **types.PackageVendingOptions, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PackageVendingOptions + if *v == nil { + sv = &types.PackageVendingOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "VendingEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.VendingEnabled = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentPackageVersionHistory(v **types.PackageVersionHistory, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -18668,6 +19536,11 @@ func awsRestjson1_deserializeDocumentPackageVersionHistory(v **types.PackageVers } } + case "PackageConfiguration": + if err := awsRestjson1_deserializeDocumentPackageConfiguration(&sv.PackageConfiguration, value); err != nil { + return err + } + case "PackageVersion": if value != nil { jtv, ok := value.(string) diff --git a/service/opensearch/generated.json b/service/opensearch/generated.json index 25d3a9c4136..69aad274525 100644 --- a/service/opensearch/generated.json +++ b/service/opensearch/generated.json @@ -12,6 +12,7 @@ "api_op_AddDataSource.go", "api_op_AddTags.go", "api_op_AssociatePackage.go", + "api_op_AssociatePackages.go", "api_op_AuthorizeVpcEndpointAccess.go", "api_op_CancelDomainConfigChange.go", "api_op_CancelServiceSoftwareUpdate.go", @@ -43,6 +44,7 @@ "api_op_DescribeReservedInstances.go", "api_op_DescribeVpcEndpoints.go", "api_op_DissociatePackage.go", + "api_op_DissociatePackages.go", "api_op_GetApplication.go", "api_op_GetCompatibleVersions.go", "api_op_GetDataSource.go", @@ -73,6 +75,7 @@ "api_op_UpdateDataSource.go", "api_op_UpdateDomainConfig.go", "api_op_UpdatePackage.go", + "api_op_UpdatePackageScope.go", "api_op_UpdateScheduledAction.go", "api_op_UpdateVpcEndpoint.go", "api_op_UpgradeDomain.go", diff --git a/service/opensearch/serializers.go b/service/opensearch/serializers.go index 5ba1917f17c..37799f6a407 100644 --- a/service/opensearch/serializers.go +++ b/service/opensearch/serializers.go @@ -326,6 +326,17 @@ func (m *awsRestjson1_serializeOpAssociatePackage) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentAssociatePackageInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -361,6 +372,115 @@ func awsRestjson1_serializeOpHttpBindingsAssociatePackageInput(v *AssociatePacka return nil } +func awsRestjson1_serializeOpDocumentAssociatePackageInput(v *AssociatePackageInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AssociationConfiguration != nil { + ok := object.Key("AssociationConfiguration") + if err := awsRestjson1_serializeDocumentPackageAssociationConfiguration(v.AssociationConfiguration, ok); err != nil { + return err + } + } + + if v.PrerequisitePackageIDList != nil { + ok := object.Key("PrerequisitePackageIDList") + if err := awsRestjson1_serializeDocumentPackageIDList(v.PrerequisitePackageIDList, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpAssociatePackages struct { +} + +func (*awsRestjson1_serializeOpAssociatePackages) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpAssociatePackages) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AssociatePackagesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2021-01-01/packages/associateMultiple") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentAssociatePackagesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsAssociatePackagesInput(v *AssociatePackagesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentAssociatePackagesInput(v *AssociatePackagesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DomainName != nil { + ok := object.Key("DomainName") + ok.String(*v.DomainName) + } + + if v.PackageList != nil { + ok := object.Key("PackageList") + if err := awsRestjson1_serializeDocumentPackageDetailsForAssociationList(v.PackageList, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpAuthorizeVpcEndpointAccess struct { } @@ -1144,11 +1264,30 @@ func awsRestjson1_serializeOpDocumentCreatePackageInput(v *CreatePackageInput, v object := value.Object() defer object.Close() + if v.EngineVersion != nil { + ok := object.Key("EngineVersion") + ok.String(*v.EngineVersion) + } + + if v.PackageConfiguration != nil { + ok := object.Key("PackageConfiguration") + if err := awsRestjson1_serializeDocumentPackageConfiguration(v.PackageConfiguration, ok); err != nil { + return err + } + } + if v.PackageDescription != nil { ok := object.Key("PackageDescription") ok.String(*v.PackageDescription) } + if v.PackageEncryptionOptions != nil { + ok := object.Key("PackageEncryptionOptions") + if err := awsRestjson1_serializeDocumentPackageEncryptionOptions(v.PackageEncryptionOptions, ok); err != nil { + return err + } + } + if v.PackageName != nil { ok := object.Key("PackageName") ok.String(*v.PackageName) @@ -1166,6 +1305,13 @@ func awsRestjson1_serializeOpDocumentCreatePackageInput(v *CreatePackageInput, v ok.String(string(v.PackageType)) } + if v.PackageVendingOptions != nil { + ok := object.Key("PackageVendingOptions") + if err := awsRestjson1_serializeDocumentPackageVendingOptions(v.PackageVendingOptions, ok); err != nil { + return err + } + } + return nil } @@ -3062,6 +3208,94 @@ func awsRestjson1_serializeOpHttpBindingsDissociatePackageInput(v *DissociatePac return nil } +type awsRestjson1_serializeOpDissociatePackages struct { +} + +func (*awsRestjson1_serializeOpDissociatePackages) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDissociatePackages) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DissociatePackagesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2021-01-01/packages/dissociateMultiple") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDissociatePackagesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDissociatePackagesInput(v *DissociatePackagesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDissociatePackagesInput(v *DissociatePackagesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DomainName != nil { + ok := object.Key("DomainName") + ok.String(*v.DomainName) + } + + if v.PackageList != nil { + ok := object.Key("PackageList") + if err := awsRestjson1_serializeDocumentPackageIDList(v.PackageList, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpGetApplication struct { } @@ -5619,11 +5853,25 @@ func awsRestjson1_serializeOpDocumentUpdatePackageInput(v *UpdatePackageInput, v ok.String(*v.CommitMessage) } + if v.PackageConfiguration != nil { + ok := object.Key("PackageConfiguration") + if err := awsRestjson1_serializeDocumentPackageConfiguration(v.PackageConfiguration, ok); err != nil { + return err + } + } + if v.PackageDescription != nil { ok := object.Key("PackageDescription") ok.String(*v.PackageDescription) } + if v.PackageEncryptionOptions != nil { + ok := object.Key("PackageEncryptionOptions") + if err := awsRestjson1_serializeDocumentPackageEncryptionOptions(v.PackageEncryptionOptions, ok); err != nil { + return err + } + } + if v.PackageID != nil { ok := object.Key("PackageID") ok.String(*v.PackageID) @@ -5639,6 +5887,99 @@ func awsRestjson1_serializeOpDocumentUpdatePackageInput(v *UpdatePackageInput, v return nil } +type awsRestjson1_serializeOpUpdatePackageScope struct { +} + +func (*awsRestjson1_serializeOpUpdatePackageScope) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdatePackageScope) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdatePackageScopeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2021-01-01/packages/updateScope") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdatePackageScopeInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdatePackageScopeInput(v *UpdatePackageScopeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdatePackageScopeInput(v *UpdatePackageScopeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Operation) > 0 { + ok := object.Key("Operation") + ok.String(string(v.Operation)) + } + + if v.PackageID != nil { + ok := object.Key("PackageID") + ok.String(*v.PackageID) + } + + if v.PackageUserList != nil { + ok := object.Key("PackageUserList") + if err := awsRestjson1_serializeDocumentPackageUserList(v.PackageUserList, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpUpdateScheduledAction struct { } @@ -6614,6 +6955,23 @@ func awsRestjson1_serializeDocumentJWTOptionsInput(v *types.JWTOptionsInput, val return nil } +func awsRestjson1_serializeDocumentKeyStoreAccessOption(v *types.KeyStoreAccessOption, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KeyAccessRoleArn != nil { + ok := object.Key("KeyAccessRoleArn") + ok.String(*v.KeyAccessRoleArn) + } + + if v.KeyStoreAccessEnabled != nil { + ok := object.Key("KeyStoreAccessEnabled") + ok.Boolean(*v.KeyStoreAccessEnabled) + } + + return nil +} + func awsRestjson1_serializeDocumentLogPublishingOption(v *types.LogPublishingOption, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6778,6 +7136,114 @@ func awsRestjson1_serializeDocumentOffPeakWindowOptions(v *types.OffPeakWindowOp return nil } +func awsRestjson1_serializeDocumentPackageAssociationConfiguration(v *types.PackageAssociationConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KeyStoreAccessOption != nil { + ok := object.Key("KeyStoreAccessOption") + if err := awsRestjson1_serializeDocumentKeyStoreAccessOption(v.KeyStoreAccessOption, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentPackageConfiguration(v *types.PackageConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.ConfigurationRequirement) > 0 { + ok := object.Key("ConfigurationRequirement") + ok.String(string(v.ConfigurationRequirement)) + } + + if v.LicenseFilepath != nil { + ok := object.Key("LicenseFilepath") + ok.String(*v.LicenseFilepath) + } + + if len(v.LicenseRequirement) > 0 { + ok := object.Key("LicenseRequirement") + ok.String(string(v.LicenseRequirement)) + } + + if v.RequiresRestartForConfigurationUpdate != nil { + ok := object.Key("RequiresRestartForConfigurationUpdate") + ok.Boolean(*v.RequiresRestartForConfigurationUpdate) + } + + return nil +} + +func awsRestjson1_serializeDocumentPackageDetailsForAssociation(v *types.PackageDetailsForAssociation, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AssociationConfiguration != nil { + ok := object.Key("AssociationConfiguration") + if err := awsRestjson1_serializeDocumentPackageAssociationConfiguration(v.AssociationConfiguration, ok); err != nil { + return err + } + } + + if v.PackageID != nil { + ok := object.Key("PackageID") + ok.String(*v.PackageID) + } + + if v.PrerequisitePackageIDList != nil { + ok := object.Key("PrerequisitePackageIDList") + if err := awsRestjson1_serializeDocumentPackageIDList(v.PrerequisitePackageIDList, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentPackageDetailsForAssociationList(v []types.PackageDetailsForAssociation, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentPackageDetailsForAssociation(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentPackageEncryptionOptions(v *types.PackageEncryptionOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EncryptionEnabled != nil { + ok := object.Key("EncryptionEnabled") + ok.Boolean(*v.EncryptionEnabled) + } + + if v.KmsKeyIdentifier != nil { + ok := object.Key("KmsKeyIdentifier") + ok.String(*v.KmsKeyIdentifier) + } + + return nil +} + +func awsRestjson1_serializeDocumentPackageIDList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsRestjson1_serializeDocumentPackageSource(v *types.PackageSource, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6795,6 +7261,29 @@ func awsRestjson1_serializeDocumentPackageSource(v *types.PackageSource, value s return nil } +func awsRestjson1_serializeDocumentPackageUserList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentPackageVendingOptions(v *types.PackageVendingOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.VendingEnabled != nil { + ok := object.Key("VendingEnabled") + ok.Boolean(*v.VendingEnabled) + } + + return nil +} + func awsRestjson1_serializeDocumentS3GlueDataCatalog(v *types.S3GlueDataCatalog, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/opensearch/snapshot/api_op_AssociatePackages.go.snap b/service/opensearch/snapshot/api_op_AssociatePackages.go.snap new file mode 100644 index 00000000000..2d0ef4ab239 --- /dev/null +++ b/service/opensearch/snapshot/api_op_AssociatePackages.go.snap @@ -0,0 +1,41 @@ +AssociatePackages + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/opensearch/snapshot/api_op_DissociatePackages.go.snap b/service/opensearch/snapshot/api_op_DissociatePackages.go.snap new file mode 100644 index 00000000000..9ba058b26c8 --- /dev/null +++ b/service/opensearch/snapshot/api_op_DissociatePackages.go.snap @@ -0,0 +1,41 @@ +DissociatePackages + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/opensearch/snapshot/api_op_UpdatePackageScope.go.snap b/service/opensearch/snapshot/api_op_UpdatePackageScope.go.snap new file mode 100644 index 00000000000..ea221d5d646 --- /dev/null +++ b/service/opensearch/snapshot/api_op_UpdatePackageScope.go.snap @@ -0,0 +1,41 @@ +UpdatePackageScope + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/opensearch/snapshot_test.go b/service/opensearch/snapshot_test.go index 5463f14db4a..aee62e24bdc 100644 --- a/service/opensearch/snapshot_test.go +++ b/service/opensearch/snapshot_test.go @@ -110,6 +110,18 @@ func TestCheckSnapshot_AssociatePackage(t *testing.T) { } } +func TestCheckSnapshot_AssociatePackages(t *testing.T) { + svc := New(Options{}) + _, err := svc.AssociatePackages(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "AssociatePackages") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_AuthorizeVpcEndpointAccess(t *testing.T) { svc := New(Options{}) _, err := svc.AuthorizeVpcEndpointAccess(context.Background(), nil, func(o *Options) { @@ -482,6 +494,18 @@ func TestCheckSnapshot_DissociatePackage(t *testing.T) { } } +func TestCheckSnapshot_DissociatePackages(t *testing.T) { + svc := New(Options{}) + _, err := svc.DissociatePackages(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DissociatePackages") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetApplication(t *testing.T) { svc := New(Options{}) _, err := svc.GetApplication(context.Background(), nil, func(o *Options) { @@ -842,6 +866,18 @@ func TestCheckSnapshot_UpdatePackage(t *testing.T) { } } +func TestCheckSnapshot_UpdatePackageScope(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdatePackageScope(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdatePackageScope") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_UpdateScheduledAction(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateScheduledAction(context.Background(), nil, func(o *Options) { @@ -925,6 +961,18 @@ func TestUpdateSnapshot_AssociatePackage(t *testing.T) { } } +func TestUpdateSnapshot_AssociatePackages(t *testing.T) { + svc := New(Options{}) + _, err := svc.AssociatePackages(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "AssociatePackages") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_AuthorizeVpcEndpointAccess(t *testing.T) { svc := New(Options{}) _, err := svc.AuthorizeVpcEndpointAccess(context.Background(), nil, func(o *Options) { @@ -1297,6 +1345,18 @@ func TestUpdateSnapshot_DissociatePackage(t *testing.T) { } } +func TestUpdateSnapshot_DissociatePackages(t *testing.T) { + svc := New(Options{}) + _, err := svc.DissociatePackages(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DissociatePackages") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetApplication(t *testing.T) { svc := New(Options{}) _, err := svc.GetApplication(context.Background(), nil, func(o *Options) { @@ -1657,6 +1717,18 @@ func TestUpdateSnapshot_UpdatePackage(t *testing.T) { } } +func TestUpdateSnapshot_UpdatePackageScope(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdatePackageScope(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdatePackageScope") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_UpdateScheduledAction(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateScheduledAction(context.Background(), nil, func(o *Options) { diff --git a/service/opensearch/types/enums.go b/service/opensearch/types/enums.go index b86a59cf06d..10bcd535555 100644 --- a/service/opensearch/types/enums.go +++ b/service/opensearch/types/enums.go @@ -304,6 +304,7 @@ const ( DescribePackagesFilterNamePackageStatus DescribePackagesFilterName = "PackageStatus" DescribePackagesFilterNamePackageType DescribePackagesFilterName = "PackageType" DescribePackagesFilterNameEngineVersion DescribePackagesFilterName = "EngineVersion" + DescribePackagesFilterNamePackageOwner DescribePackagesFilterName = "PackageOwner" ) // Values returns all known values for DescribePackagesFilterName. Note that this @@ -317,6 +318,7 @@ func (DescribePackagesFilterName) Values() []DescribePackagesFilterName { "PackageStatus", "PackageType", "EngineVersion", + "PackageOwner", } } @@ -1046,6 +1048,27 @@ func (OverallChangeStatus) Values() []OverallChangeStatus { } } +type PackageScopeOperationEnum string + +// Enum values for PackageScopeOperationEnum +const ( + PackageScopeOperationEnumAdd PackageScopeOperationEnum = "ADD" + PackageScopeOperationEnumOverride PackageScopeOperationEnum = "OVERRIDE" + PackageScopeOperationEnumRemove PackageScopeOperationEnum = "REMOVE" +) + +// Values returns all known values for PackageScopeOperationEnum. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (PackageScopeOperationEnum) Values() []PackageScopeOperationEnum { + return []PackageScopeOperationEnum{ + "ADD", + "OVERRIDE", + "REMOVE", + } +} + type PackageStatus string // Enum values for PackageStatus @@ -1081,8 +1104,10 @@ type PackageType string // Enum values for PackageType const ( - PackageTypeTxtDictionary PackageType = "TXT-DICTIONARY" - PackageTypeZipPlugin PackageType = "ZIP-PLUGIN" + PackageTypeTxtDictionary PackageType = "TXT-DICTIONARY" + PackageTypeZipPlugin PackageType = "ZIP-PLUGIN" + PackageTypePackageLicense PackageType = "PACKAGE-LICENSE" + PackageTypePackageConfig PackageType = "PACKAGE-CONFIG" ) // Values returns all known values for PackageType. Note that this can be expanded @@ -1093,6 +1118,8 @@ func (PackageType) Values() []PackageType { return []PackageType{ "TXT-DICTIONARY", "ZIP-PLUGIN", + "PACKAGE-LICENSE", + "PACKAGE-CONFIG", } } @@ -1134,6 +1161,27 @@ func (PropertyValueType) Values() []PropertyValueType { } } +type RequirementLevel string + +// Enum values for RequirementLevel +const ( + RequirementLevelRequired RequirementLevel = "REQUIRED" + RequirementLevelOptional RequirementLevel = "OPTIONAL" + RequirementLevelNone RequirementLevel = "NONE" +) + +// Values returns all known values for RequirementLevel. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (RequirementLevel) Values() []RequirementLevel { + return []RequirementLevel{ + "REQUIRED", + "OPTIONAL", + "NONE", + } +} + type ReservedInstancePaymentOption string // Enum values for ReservedInstancePaymentOption diff --git a/service/opensearch/types/types.go b/service/opensearch/types/types.go index b42fe4c4329..d8353921a8c 100644 --- a/service/opensearch/types/types.go +++ b/service/opensearch/types/types.go @@ -1015,6 +1015,10 @@ type DomainNodesStatus struct { // [Custom packages for Amazon OpenSearch Service]: https://docs.aws.amazon.com/opensearch-service/latest/developerguide/custom-packages.html type DomainPackageDetails struct { + // The configuration for associating a package with an Amazon OpenSearch Service + // domain. + AssociationConfiguration *PackageAssociationConfiguration + // Name of the domain that the package is associated with. DomainName *string @@ -1039,6 +1043,10 @@ type DomainPackageDetails struct { // The current version of the package. PackageVersion *string + // A list of package IDs that must be associated with the domain before or with + // the package can be associated. + PrerequisitePackageIDList []string + // The relative path of the package on the OpenSearch Service cluster nodes. This // is synonym_path when the package is for synonym files. ReferencePath *string @@ -1633,6 +1641,21 @@ type JWTOptionsOutput struct { noSmithyDocumentSerde } +// The configuration parameters to enable access to the key store required by the +// package. +type KeyStoreAccessOption struct { + + // This indicates whether Key Store access is enabled + // + // This member is required. + KeyStoreAccessEnabled *bool + + // Role ARN to access the KeyStore Key + KeyAccessRoleArn *string + + noSmithyDocumentSerde +} + // Limits for a given instance type and for each of its roles. type Limits struct { @@ -1947,9 +1970,49 @@ type OutboundConnectionStatus struct { noSmithyDocumentSerde } +// The configuration for associating a package with a domain. +type PackageAssociationConfiguration struct { + + // The configuration parameters to enable accessing the key store required by the + // package. + KeyStoreAccessOption *KeyStoreAccessOption + + noSmithyDocumentSerde +} + +// The configuration parameters for a package. +type PackageConfiguration struct { + + // The configuration requirements for the package. + // + // This member is required. + ConfigurationRequirement RequirementLevel + + // The license requirements for the package. + // + // This member is required. + LicenseRequirement RequirementLevel + + // The relative file path for the license associated with the package. + LicenseFilepath *string + + // This indicates whether a B/G deployment is required for updating the + // configuration that the plugin is prerequisite for. + RequiresRestartForConfigurationUpdate *bool + + noSmithyDocumentSerde +} + // Basic information about a package. type PackageDetails struct { + // A list of users who are allowed to view and associate the package. This field + // is only visible to the owner of a package. + AllowListedUserList []string + + // This represents the available configuration parameters for the package. + AvailablePackageConfiguration *PackageConfiguration + // The package version. AvailablePackageVersion *string @@ -1973,12 +2036,19 @@ type PackageDetails struct { // User-specified description of the package. PackageDescription *string + // Package Encryption Options for a package. + PackageEncryptionOptions *PackageEncryptionOptions + // The unique identifier of the package. PackageID *string // The user-specified name of the package. PackageName *string + // The owner of the package who is allowed to create/update a package and add + // users to the package scope. + PackageOwner *string + // The current status of the package. The available options are AVAILABLE , COPYING // , COPY_FAILED , VALIDATNG , VALIDATION_FAILED , DELETING , and DELETE_FAILED . PackageStatus PackageStatus @@ -1986,6 +2056,41 @@ type PackageDetails struct { // The type of package. PackageType PackageType + // Package Vending Options for a package. + PackageVendingOptions *PackageVendingOptions + + noSmithyDocumentSerde +} + +// Details of a package that is associated with a domain. +type PackageDetailsForAssociation struct { + + // Internal ID of the package that you want to associate with a domain. + // + // This member is required. + PackageID *string + + // The configuration parameters for associating the package with a domain. + AssociationConfiguration *PackageAssociationConfiguration + + // List of package IDs that must be associated with the domain with or before the + // package can be associated. + PrerequisitePackageIDList []string + + noSmithyDocumentSerde +} + +// Encryption options for a package. +type PackageEncryptionOptions struct { + + // This indicates whether encryption is enabled for the package. + // + // This member is required. + EncryptionEnabled *bool + + // KMS key ID for encrypting the package. + KmsKeyIdentifier *string + noSmithyDocumentSerde } @@ -2001,6 +2106,19 @@ type PackageSource struct { noSmithyDocumentSerde } +// The vending options for a package to determine if the package can be used by +// other users. +type PackageVendingOptions struct { + + // This indicates whether vending is enabled for the package to determine if + // package can be used by other users. + // + // This member is required. + VendingEnabled *bool + + noSmithyDocumentSerde +} + // Details about a package version. type PackageVersionHistory struct { @@ -2010,6 +2128,9 @@ type PackageVersionHistory struct { // The date and time when the package was created. CreatedAt *time.Time + // The configuration details for a specific version of a package. + PackageConfiguration *PackageConfiguration + // The package version. PackageVersion *string diff --git a/service/opensearch/validators.go b/service/opensearch/validators.go index 14ffb5e0dc8..eb578522cde 100644 --- a/service/opensearch/validators.go +++ b/service/opensearch/validators.go @@ -90,6 +90,26 @@ func (m *validateOpAssociatePackage) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpAssociatePackages struct { +} + +func (*validateOpAssociatePackages) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssociatePackages) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssociatePackagesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssociatePackagesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpAuthorizeVpcEndpointAccess struct { } @@ -610,6 +630,26 @@ func (m *validateOpDissociatePackage) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpDissociatePackages struct { +} + +func (*validateOpDissociatePackages) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDissociatePackages) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DissociatePackagesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDissociatePackagesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetApplication struct { } @@ -1110,6 +1150,26 @@ func (m *validateOpUpdatePackage) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpUpdatePackageScope struct { +} + +func (*validateOpUpdatePackageScope) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdatePackageScope) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdatePackageScopeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdatePackageScopeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateScheduledAction struct { } @@ -1186,6 +1246,10 @@ func addOpAssociatePackageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociatePackage{}, middleware.After) } +func addOpAssociatePackagesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssociatePackages{}, middleware.After) +} + func addOpAuthorizeVpcEndpointAccessValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAuthorizeVpcEndpointAccess{}, middleware.After) } @@ -1290,6 +1354,10 @@ func addOpDissociatePackageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDissociatePackage{}, middleware.After) } +func addOpDissociatePackagesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDissociatePackages{}, middleware.After) +} + func addOpGetApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetApplication{}, middleware.After) } @@ -1390,6 +1458,10 @@ func addOpUpdatePackageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdatePackage{}, middleware.After) } +func addOpUpdatePackageScopeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdatePackageScope{}, middleware.After) +} + func addOpUpdateScheduledActionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateScheduledAction{}, middleware.After) } @@ -1483,6 +1555,21 @@ func validateDomainInformationContainer(v *types.DomainInformationContainer) err } } +func validateKeyStoreAccessOption(v *types.KeyStoreAccessOption) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "KeyStoreAccessOption"} + if v.KeyStoreAccessEnabled == nil { + invalidParams.Add(smithy.NewErrParamRequired("KeyStoreAccessEnabled")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOffPeakWindow(v *types.OffPeakWindow) error { if v == nil { return nil @@ -1517,6 +1604,108 @@ func validateOffPeakWindowOptions(v *types.OffPeakWindowOptions) error { } } +func validatePackageAssociationConfiguration(v *types.PackageAssociationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PackageAssociationConfiguration"} + if v.KeyStoreAccessOption != nil { + if err := validateKeyStoreAccessOption(v.KeyStoreAccessOption); err != nil { + invalidParams.AddNested("KeyStoreAccessOption", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePackageConfiguration(v *types.PackageConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PackageConfiguration"} + if len(v.LicenseRequirement) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("LicenseRequirement")) + } + if len(v.ConfigurationRequirement) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ConfigurationRequirement")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePackageDetailsForAssociation(v *types.PackageDetailsForAssociation) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PackageDetailsForAssociation"} + if v.PackageID == nil { + invalidParams.Add(smithy.NewErrParamRequired("PackageID")) + } + if v.AssociationConfiguration != nil { + if err := validatePackageAssociationConfiguration(v.AssociationConfiguration); err != nil { + invalidParams.AddNested("AssociationConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePackageDetailsForAssociationList(v []types.PackageDetailsForAssociation) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PackageDetailsForAssociationList"} + for i := range v { + if err := validatePackageDetailsForAssociation(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePackageEncryptionOptions(v *types.PackageEncryptionOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PackageEncryptionOptions"} + if v.EncryptionEnabled == nil { + invalidParams.Add(smithy.NewErrParamRequired("EncryptionEnabled")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePackageVendingOptions(v *types.PackageVendingOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PackageVendingOptions"} + if v.VendingEnabled == nil { + invalidParams.Add(smithy.NewErrParamRequired("VendingEnabled")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateSAMLIdp(v *types.SAMLIdp) error { if v == nil { return nil @@ -1668,6 +1857,33 @@ func validateOpAssociatePackageInput(v *AssociatePackageInput) error { if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } + if v.AssociationConfiguration != nil { + if err := validatePackageAssociationConfiguration(v.AssociationConfiguration); err != nil { + invalidParams.AddNested("AssociationConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAssociatePackagesInput(v *AssociatePackagesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssociatePackagesInput"} + if v.PackageList == nil { + invalidParams.Add(smithy.NewErrParamRequired("PackageList")) + } else if v.PackageList != nil { + if err := validatePackageDetailsForAssociationList(v.PackageList); err != nil { + invalidParams.AddNested("PackageList", err.(smithy.InvalidParamsError)) + } + } + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -1818,6 +2034,21 @@ func validateOpCreatePackageInput(v *CreatePackageInput) error { if v.PackageSource == nil { invalidParams.Add(smithy.NewErrParamRequired("PackageSource")) } + if v.PackageConfiguration != nil { + if err := validatePackageConfiguration(v.PackageConfiguration); err != nil { + invalidParams.AddNested("PackageConfiguration", err.(smithy.InvalidParamsError)) + } + } + if v.PackageVendingOptions != nil { + if err := validatePackageVendingOptions(v.PackageVendingOptions); err != nil { + invalidParams.AddNested("PackageVendingOptions", err.(smithy.InvalidParamsError)) + } + } + if v.PackageEncryptionOptions != nil { + if err := validatePackageEncryptionOptions(v.PackageEncryptionOptions); err != nil { + invalidParams.AddNested("PackageEncryptionOptions", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2122,6 +2353,24 @@ func validateOpDissociatePackageInput(v *DissociatePackageInput) error { } } +func validateOpDissociatePackagesInput(v *DissociatePackagesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DissociatePackagesInput"} + if v.PackageList == nil { + invalidParams.Add(smithy.NewErrParamRequired("PackageList")) + } + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetApplicationInput(v *GetApplicationInput) error { if v == nil { return nil @@ -2529,6 +2778,37 @@ func validateOpUpdatePackageInput(v *UpdatePackageInput) error { if v.PackageSource == nil { invalidParams.Add(smithy.NewErrParamRequired("PackageSource")) } + if v.PackageConfiguration != nil { + if err := validatePackageConfiguration(v.PackageConfiguration); err != nil { + invalidParams.AddNested("PackageConfiguration", err.(smithy.InvalidParamsError)) + } + } + if v.PackageEncryptionOptions != nil { + if err := validatePackageEncryptionOptions(v.PackageEncryptionOptions); err != nil { + invalidParams.AddNested("PackageEncryptionOptions", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdatePackageScopeInput(v *UpdatePackageScopeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdatePackageScopeInput"} + if v.PackageID == nil { + invalidParams.Add(smithy.NewErrParamRequired("PackageID")) + } + if len(v.Operation) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Operation")) + } + if v.PackageUserList == nil { + invalidParams.Add(smithy.NewErrParamRequired("PackageUserList")) + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/outposts/api_op_GetCapacityTask.go b/service/outposts/api_op_GetCapacityTask.go index c275adfc1a8..816bec330ff 100644 --- a/service/outposts/api_op_GetCapacityTask.go +++ b/service/outposts/api_op_GetCapacityTask.go @@ -74,6 +74,10 @@ type GetCapacityTaskOutput struct { // Reason why the capacity task failed. Failed *types.CapacityTaskFailure + // Instances that the user specified they cannot stop in order to free up the + // capacity needed to run the capacity task. + InstancesToExclude *types.InstancesToExclude + // The date the capacity task was last modified. LastModifiedDate *time.Time @@ -87,6 +91,15 @@ type GetCapacityTaskOutput struct { // List of instance pools requested in the capacity task. RequestedInstancePools []types.InstanceTypeCapacity + // User-specified option in case an instance is blocking the capacity task from + // running. Shows one of the following options: + // + // - WAIT_FOR_EVACUATION - Checks every 10 minutes over 48 hours to determine if + // instances have stopped and capacity is available to complete the task. + // + // - FAIL_TASK - The capacity task fails. + TaskActionOnBlockingInstances types.TaskActionOnBlockingInstances + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/outposts/api_op_GetOutpostSupportedInstanceTypes.go b/service/outposts/api_op_GetOutpostSupportedInstanceTypes.go index 1cd31684968..b588fa25d0a 100644 --- a/service/outposts/api_op_GetOutpostSupportedInstanceTypes.go +++ b/service/outposts/api_op_GetOutpostSupportedInstanceTypes.go @@ -31,11 +31,6 @@ func (c *Client) GetOutpostSupportedInstanceTypes(ctx context.Context, params *G type GetOutpostSupportedInstanceTypesInput struct { - // The ID for the Amazon Web Services Outposts order. - // - // This member is required. - OrderId *string - // The ID or ARN of the Outpost. // // This member is required. @@ -47,6 +42,9 @@ type GetOutpostSupportedInstanceTypesInput struct { // The pagination token. NextToken *string + // The ID for the Amazon Web Services Outposts order. + OrderId *string + noSmithyDocumentSerde } diff --git a/service/outposts/api_op_ListAssetInstances.go b/service/outposts/api_op_ListAssetInstances.go new file mode 100644 index 00000000000..fc2f0944694 --- /dev/null +++ b/service/outposts/api_op_ListAssetInstances.go @@ -0,0 +1,274 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package outposts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/outposts/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// A list of Amazon EC2 instances, belonging to all accounts, running on the +// specified Outpost. Does not include Amazon EBS or Amazon S3 instances. +func (c *Client) ListAssetInstances(ctx context.Context, params *ListAssetInstancesInput, optFns ...func(*Options)) (*ListAssetInstancesOutput, error) { + if params == nil { + params = &ListAssetInstancesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAssetInstances", params, optFns, c.addOperationListAssetInstancesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAssetInstancesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAssetInstancesInput struct { + + // The ID of the Outpost. + // + // This member is required. + OutpostIdentifier *string + + // Filters the results by account ID. + AccountIdFilter []string + + // Filters the results by asset ID. + AssetIdFilter []string + + // Filters the results by Amazon Web Services service. + AwsServiceFilter []types.AWSServiceName + + // Filters the results by instance ID. + InstanceTypeFilter []string + + // The maximum page size. + MaxResults *int32 + + // The pagination token. + NextToken *string + + noSmithyDocumentSerde +} + +type ListAssetInstancesOutput struct { + + // List of instances owned by all accounts on the Outpost. Does not include Amazon + // EBS or Amazon S3 instances. + AssetInstances []types.AssetInstance + + // The pagination token. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAssetInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListAssetInstances{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAssetInstances{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListAssetInstances"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListAssetInstancesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssetInstances(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListAssetInstancesPaginatorOptions is the paginator options for +// ListAssetInstances +type ListAssetInstancesPaginatorOptions struct { + // The maximum page size. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListAssetInstancesPaginator is a paginator for ListAssetInstances +type ListAssetInstancesPaginator struct { + options ListAssetInstancesPaginatorOptions + client ListAssetInstancesAPIClient + params *ListAssetInstancesInput + nextToken *string + firstPage bool +} + +// NewListAssetInstancesPaginator returns a new ListAssetInstancesPaginator +func NewListAssetInstancesPaginator(client ListAssetInstancesAPIClient, params *ListAssetInstancesInput, optFns ...func(*ListAssetInstancesPaginatorOptions)) *ListAssetInstancesPaginator { + if params == nil { + params = &ListAssetInstancesInput{} + } + + options := ListAssetInstancesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAssetInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssetInstancesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListAssetInstances page. +func (p *ListAssetInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssetInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListAssetInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// ListAssetInstancesAPIClient is a client that implements the ListAssetInstances +// operation. +type ListAssetInstancesAPIClient interface { + ListAssetInstances(context.Context, *ListAssetInstancesInput, ...func(*Options)) (*ListAssetInstancesOutput, error) +} + +var _ ListAssetInstancesAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListAssetInstances(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListAssetInstances", + } +} diff --git a/service/outposts/api_op_ListBlockingInstancesForCapacityTask.go b/service/outposts/api_op_ListBlockingInstancesForCapacityTask.go new file mode 100644 index 00000000000..1160e55c07e --- /dev/null +++ b/service/outposts/api_op_ListBlockingInstancesForCapacityTask.go @@ -0,0 +1,270 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package outposts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/outposts/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// A list of Amazon EC2 instances running on the Outpost and belonging to the +// account that initiated the capacity task. Use this list to specify the instances +// you cannot stop to free up capacity to run the capacity task. +func (c *Client) ListBlockingInstancesForCapacityTask(ctx context.Context, params *ListBlockingInstancesForCapacityTaskInput, optFns ...func(*Options)) (*ListBlockingInstancesForCapacityTaskOutput, error) { + if params == nil { + params = &ListBlockingInstancesForCapacityTaskInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListBlockingInstancesForCapacityTask", params, optFns, c.addOperationListBlockingInstancesForCapacityTaskMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListBlockingInstancesForCapacityTaskOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListBlockingInstancesForCapacityTaskInput struct { + + // The ID of the capacity task. + // + // This member is required. + CapacityTaskId *string + + // The ID or ARN of the Outpost associated with the specified capacity task. + // + // This member is required. + OutpostIdentifier *string + + // The maximum page size. + MaxResults *int32 + + // The pagination token. + NextToken *string + + noSmithyDocumentSerde +} + +type ListBlockingInstancesForCapacityTaskOutput struct { + + // A list of all running Amazon EC2 instances on the Outpost. Stopping one or more + // of these instances can free up the capacity needed to run the capacity task. + BlockingInstances []types.BlockingInstance + + // The pagination token. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListBlockingInstancesForCapacityTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListBlockingInstancesForCapacityTask{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListBlockingInstancesForCapacityTask{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListBlockingInstancesForCapacityTask"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListBlockingInstancesForCapacityTaskValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListBlockingInstancesForCapacityTask(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListBlockingInstancesForCapacityTaskPaginatorOptions is the paginator options +// for ListBlockingInstancesForCapacityTask +type ListBlockingInstancesForCapacityTaskPaginatorOptions struct { + // The maximum page size. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListBlockingInstancesForCapacityTaskPaginator is a paginator for +// ListBlockingInstancesForCapacityTask +type ListBlockingInstancesForCapacityTaskPaginator struct { + options ListBlockingInstancesForCapacityTaskPaginatorOptions + client ListBlockingInstancesForCapacityTaskAPIClient + params *ListBlockingInstancesForCapacityTaskInput + nextToken *string + firstPage bool +} + +// NewListBlockingInstancesForCapacityTaskPaginator returns a new +// ListBlockingInstancesForCapacityTaskPaginator +func NewListBlockingInstancesForCapacityTaskPaginator(client ListBlockingInstancesForCapacityTaskAPIClient, params *ListBlockingInstancesForCapacityTaskInput, optFns ...func(*ListBlockingInstancesForCapacityTaskPaginatorOptions)) *ListBlockingInstancesForCapacityTaskPaginator { + if params == nil { + params = &ListBlockingInstancesForCapacityTaskInput{} + } + + options := ListBlockingInstancesForCapacityTaskPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListBlockingInstancesForCapacityTaskPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBlockingInstancesForCapacityTaskPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListBlockingInstancesForCapacityTask page. +func (p *ListBlockingInstancesForCapacityTaskPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBlockingInstancesForCapacityTaskOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListBlockingInstancesForCapacityTask(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// ListBlockingInstancesForCapacityTaskAPIClient is a client that implements the +// ListBlockingInstancesForCapacityTask operation. +type ListBlockingInstancesForCapacityTaskAPIClient interface { + ListBlockingInstancesForCapacityTask(context.Context, *ListBlockingInstancesForCapacityTaskInput, ...func(*Options)) (*ListBlockingInstancesForCapacityTaskOutput, error) +} + +var _ ListBlockingInstancesForCapacityTaskAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListBlockingInstancesForCapacityTask(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListBlockingInstancesForCapacityTask", + } +} diff --git a/service/outposts/api_op_StartCapacityTask.go b/service/outposts/api_op_StartCapacityTask.go index c7e67f68f05..19065bec80a 100644 --- a/service/outposts/api_op_StartCapacityTask.go +++ b/service/outposts/api_op_StartCapacityTask.go @@ -12,8 +12,8 @@ import ( "time" ) -// Starts the specified capacity task. You can have one active capacity task for -// an order. +// Starts the specified capacity task. You can have one active capacity task per +// order or Outpost. func (c *Client) StartCapacityTask(ctx context.Context, params *StartCapacityTaskInput, optFns ...func(*Options)) (*StartCapacityTaskOutput, error) { if params == nil { params = &StartCapacityTaskInput{} @@ -36,12 +36,6 @@ type StartCapacityTaskInput struct { // This member is required. InstancePools []types.InstanceTypeCapacity - // The ID of the Amazon Web Services Outposts order associated with the specified - // capacity task. - // - // This member is required. - OrderId *string - // The ID or ARN of the Outposts associated with the specified capacity task. // // This member is required. @@ -52,6 +46,23 @@ type StartCapacityTaskInput struct { // not make any changes to your plan. DryRun bool + // List of user-specified running instances that must not be stopped in order to + // free up the capacity needed to run the capacity task. + InstancesToExclude *types.InstancesToExclude + + // The ID of the Amazon Web Services Outposts order associated with the specified + // capacity task. + OrderId *string + + // Specify one of the following options in case an instance is blocking the + // capacity task from running. + // + // - WAIT_FOR_EVACUATION - Checks every 10 minutes over 48 hours to determine if + // instances have stopped and capacity is available to complete the task. + // + // - FAIL_TASK - The capacity task fails. + TaskActionOnBlockingInstances types.TaskActionOnBlockingInstances + noSmithyDocumentSerde } @@ -76,6 +87,10 @@ type StartCapacityTaskOutput struct { // Reason that the specified capacity task failed. Failed *types.CapacityTaskFailure + // User-specified instances that must not be stopped in order to free up the + // capacity needed to run the capacity task. + InstancesToExclude *types.InstancesToExclude + // Date that the specified capacity task was last modified. LastModifiedDate *time.Time @@ -89,6 +104,15 @@ type StartCapacityTaskOutput struct { // List of the instance pools requested in the specified capacity task. RequestedInstancePools []types.InstanceTypeCapacity + // User-specified option in case an instance is blocking the capacity task from + // running. + // + // - WAIT_FOR_EVACUATION - Checks every 10 minutes over 48 hours to determine if + // instances have stopped and capacity is available to complete the task. + // + // - FAIL_TASK - The capacity task fails. + TaskActionOnBlockingInstances types.TaskActionOnBlockingInstances + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/outposts/deserializers.go b/service/outposts/deserializers.go index 00c8b686058..2965021fb75 100644 --- a/service/outposts/deserializers.go +++ b/service/outposts/deserializers.go @@ -1139,6 +1139,11 @@ func awsRestjson1_deserializeOpDocumentGetCapacityTaskOutput(v **GetCapacityTask return err } + case "InstancesToExclude": + if err := awsRestjson1_deserializeDocumentInstancesToExclude(&sv.InstancesToExclude, value); err != nil { + return err + } + case "LastModifiedDate": if value != nil { switch jtv := value.(type) { @@ -1178,6 +1183,15 @@ func awsRestjson1_deserializeOpDocumentGetCapacityTaskOutput(v **GetCapacityTask return err } + case "TaskActionOnBlockingInstances": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaskActionOnBlockingInstances to be of type string, got %T instead", value) + } + sv.TaskActionOnBlockingInstances = types.TaskActionOnBlockingInstances(jtv) + } + default: _, _ = key, value @@ -2532,14 +2546,14 @@ func awsRestjson1_deserializeOpDocumentGetSiteAddressOutput(v **GetSiteAddressOu return nil } -type awsRestjson1_deserializeOpListAssets struct { +type awsRestjson1_deserializeOpListAssetInstances struct { } -func (*awsRestjson1_deserializeOpListAssets) ID() string { +func (*awsRestjson1_deserializeOpListAssetInstances) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAssets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAssetInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2557,9 +2571,9 @@ func (m *awsRestjson1_deserializeOpListAssets) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAssets(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAssetInstances(response, &metadata) } - output := &ListAssetsOutput{} + output := &ListAssetInstancesOutput{} out.Result = output var buff [1024]byte @@ -2580,7 +2594,7 @@ func (m *awsRestjson1_deserializeOpListAssets) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAssetsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAssetInstancesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2594,7 +2608,7 @@ func (m *awsRestjson1_deserializeOpListAssets) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAssets(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAssetInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2657,7 +2671,7 @@ func awsRestjson1_deserializeOpErrorListAssets(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentListAssetsOutput(v **ListAssetsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAssetInstancesOutput(v **ListAssetInstancesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2670,17 +2684,17 @@ func awsRestjson1_deserializeOpDocumentListAssetsOutput(v **ListAssetsOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAssetsOutput + var sv *ListAssetInstancesOutput if *v == nil { - sv = &ListAssetsOutput{} + sv = &ListAssetInstancesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Assets": - if err := awsRestjson1_deserializeDocumentAssetListDefinition(&sv.Assets, value); err != nil { + case "AssetInstances": + if err := awsRestjson1_deserializeDocumentAssetInstanceList(&sv.AssetInstances, value); err != nil { return err } @@ -2702,14 +2716,14 @@ func awsRestjson1_deserializeOpDocumentListAssetsOutput(v **ListAssetsOutput, va return nil } -type awsRestjson1_deserializeOpListCapacityTasks struct { +type awsRestjson1_deserializeOpListAssets struct { } -func (*awsRestjson1_deserializeOpListCapacityTasks) ID() string { +func (*awsRestjson1_deserializeOpListAssets) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListCapacityTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAssets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2727,9 +2741,9 @@ func (m *awsRestjson1_deserializeOpListCapacityTasks) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListCapacityTasks(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAssets(response, &metadata) } - output := &ListCapacityTasksOutput{} + output := &ListAssetsOutput{} out.Result = output var buff [1024]byte @@ -2750,7 +2764,7 @@ func (m *awsRestjson1_deserializeOpListCapacityTasks) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListCapacityTasksOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAssetsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2764,7 +2778,7 @@ func (m *awsRestjson1_deserializeOpListCapacityTasks) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorListCapacityTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAssets(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2827,7 +2841,7 @@ func awsRestjson1_deserializeOpErrorListCapacityTasks(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentListCapacityTasksOutput(v **ListCapacityTasksOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAssetsOutput(v **ListAssetsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2840,17 +2854,17 @@ func awsRestjson1_deserializeOpDocumentListCapacityTasksOutput(v **ListCapacityT return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListCapacityTasksOutput + var sv *ListAssetsOutput if *v == nil { - sv = &ListCapacityTasksOutput{} + sv = &ListAssetsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "CapacityTasks": - if err := awsRestjson1_deserializeDocumentCapacityTaskList(&sv.CapacityTasks, value); err != nil { + case "Assets": + if err := awsRestjson1_deserializeDocumentAssetListDefinition(&sv.Assets, value); err != nil { return err } @@ -2872,14 +2886,14 @@ func awsRestjson1_deserializeOpDocumentListCapacityTasksOutput(v **ListCapacityT return nil } -type awsRestjson1_deserializeOpListCatalogItems struct { +type awsRestjson1_deserializeOpListBlockingInstancesForCapacityTask struct { } -func (*awsRestjson1_deserializeOpListCatalogItems) ID() string { +func (*awsRestjson1_deserializeOpListBlockingInstancesForCapacityTask) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListCatalogItems) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListBlockingInstancesForCapacityTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2897,9 +2911,9 @@ func (m *awsRestjson1_deserializeOpListCatalogItems) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListCatalogItems(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListBlockingInstancesForCapacityTask(response, &metadata) } - output := &ListCatalogItemsOutput{} + output := &ListBlockingInstancesForCapacityTaskOutput{} out.Result = output var buff [1024]byte @@ -2920,7 +2934,7 @@ func (m *awsRestjson1_deserializeOpListCatalogItems) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListCatalogItemsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListBlockingInstancesForCapacityTaskOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2934,7 +2948,7 @@ func (m *awsRestjson1_deserializeOpListCatalogItems) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorListCatalogItems(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListBlockingInstancesForCapacityTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2975,6 +2989,9 @@ func awsRestjson1_deserializeOpErrorListCatalogItems(response *smithyhttp.Respon } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -2994,7 +3011,7 @@ func awsRestjson1_deserializeOpErrorListCatalogItems(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentListCatalogItemsOutput(v **ListCatalogItemsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListBlockingInstancesForCapacityTaskOutput(v **ListBlockingInstancesForCapacityTaskOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3007,17 +3024,17 @@ func awsRestjson1_deserializeOpDocumentListCatalogItemsOutput(v **ListCatalogIte return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListCatalogItemsOutput + var sv *ListBlockingInstancesForCapacityTaskOutput if *v == nil { - sv = &ListCatalogItemsOutput{} + sv = &ListBlockingInstancesForCapacityTaskOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "CatalogItems": - if err := awsRestjson1_deserializeDocumentCatalogItemListDefinition(&sv.CatalogItems, value); err != nil { + case "BlockingInstances": + if err := awsRestjson1_deserializeDocumentBlockingInstancesList(&sv.BlockingInstances, value); err != nil { return err } @@ -3039,14 +3056,14 @@ func awsRestjson1_deserializeOpDocumentListCatalogItemsOutput(v **ListCatalogIte return nil } -type awsRestjson1_deserializeOpListOrders struct { +type awsRestjson1_deserializeOpListCapacityTasks struct { } -func (*awsRestjson1_deserializeOpListOrders) ID() string { +func (*awsRestjson1_deserializeOpListCapacityTasks) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListOrders) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListCapacityTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3064,9 +3081,9 @@ func (m *awsRestjson1_deserializeOpListOrders) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListOrders(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListCapacityTasks(response, &metadata) } - output := &ListOrdersOutput{} + output := &ListCapacityTasksOutput{} out.Result = output var buff [1024]byte @@ -3087,7 +3104,7 @@ func (m *awsRestjson1_deserializeOpListOrders) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListOrdersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListCapacityTasksOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3101,7 +3118,7 @@ func (m *awsRestjson1_deserializeOpListOrders) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListOrders(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListCapacityTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3164,7 +3181,7 @@ func awsRestjson1_deserializeOpErrorListOrders(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentListOrdersOutput(v **ListOrdersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListCapacityTasksOutput(v **ListCapacityTasksOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3177,15 +3194,20 @@ func awsRestjson1_deserializeOpDocumentListOrdersOutput(v **ListOrdersOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListOrdersOutput + var sv *ListCapacityTasksOutput if *v == nil { - sv = &ListOrdersOutput{} + sv = &ListCapacityTasksOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "CapacityTasks": + if err := awsRestjson1_deserializeDocumentCapacityTaskList(&sv.CapacityTasks, value); err != nil { + return err + } + case "NextToken": if value != nil { jtv, ok := value.(string) @@ -3195,11 +3217,6 @@ func awsRestjson1_deserializeOpDocumentListOrdersOutput(v **ListOrdersOutput, va sv.NextToken = ptr.String(jtv) } - case "Orders": - if err := awsRestjson1_deserializeDocumentOrderSummaryListDefinition(&sv.Orders, value); err != nil { - return err - } - default: _, _ = key, value @@ -3209,14 +3226,14 @@ func awsRestjson1_deserializeOpDocumentListOrdersOutput(v **ListOrdersOutput, va return nil } -type awsRestjson1_deserializeOpListOutposts struct { +type awsRestjson1_deserializeOpListCatalogItems struct { } -func (*awsRestjson1_deserializeOpListOutposts) ID() string { +func (*awsRestjson1_deserializeOpListCatalogItems) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListOutposts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListCatalogItems) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3234,9 +3251,9 @@ func (m *awsRestjson1_deserializeOpListOutposts) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListOutposts(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListCatalogItems(response, &metadata) } - output := &ListOutpostsOutput{} + output := &ListCatalogItemsOutput{} out.Result = output var buff [1024]byte @@ -3257,7 +3274,7 @@ func (m *awsRestjson1_deserializeOpListOutposts) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListOutpostsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListCatalogItemsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3271,7 +3288,7 @@ func (m *awsRestjson1_deserializeOpListOutposts) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorListOutposts(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListCatalogItems(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3312,12 +3329,12 @@ func awsRestjson1_deserializeOpErrorListOutposts(response *smithyhttp.Response, } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -3331,7 +3348,7 @@ func awsRestjson1_deserializeOpErrorListOutposts(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListOutpostsOutput(v **ListOutpostsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListCatalogItemsOutput(v **ListCatalogItemsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3344,15 +3361,20 @@ func awsRestjson1_deserializeOpDocumentListOutpostsOutput(v **ListOutpostsOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListOutpostsOutput + var sv *ListCatalogItemsOutput if *v == nil { - sv = &ListOutpostsOutput{} + sv = &ListCatalogItemsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "CatalogItems": + if err := awsRestjson1_deserializeDocumentCatalogItemListDefinition(&sv.CatalogItems, value); err != nil { + return err + } + case "NextToken": if value != nil { jtv, ok := value.(string) @@ -3362,11 +3384,6 @@ func awsRestjson1_deserializeOpDocumentListOutpostsOutput(v **ListOutpostsOutput sv.NextToken = ptr.String(jtv) } - case "Outposts": - if err := awsRestjson1_deserializeDocumentOutpostListDefinition(&sv.Outposts, value); err != nil { - return err - } - default: _, _ = key, value @@ -3376,14 +3393,14 @@ func awsRestjson1_deserializeOpDocumentListOutpostsOutput(v **ListOutpostsOutput return nil } -type awsRestjson1_deserializeOpListSites struct { +type awsRestjson1_deserializeOpListOrders struct { } -func (*awsRestjson1_deserializeOpListSites) ID() string { +func (*awsRestjson1_deserializeOpListOrders) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListSites) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListOrders) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3401,9 +3418,9 @@ func (m *awsRestjson1_deserializeOpListSites) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListSites(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListOrders(response, &metadata) } - output := &ListSitesOutput{} + output := &ListOrdersOutput{} out.Result = output var buff [1024]byte @@ -3424,7 +3441,7 @@ func (m *awsRestjson1_deserializeOpListSites) HandleDeserialize(ctx context.Cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListSitesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListOrdersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3438,7 +3455,7 @@ func (m *awsRestjson1_deserializeOpListSites) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorListSites(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListOrders(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3485,6 +3502,9 @@ func awsRestjson1_deserializeOpErrorListSites(response *smithyhttp.Response, met case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -3498,7 +3518,7 @@ func awsRestjson1_deserializeOpErrorListSites(response *smithyhttp.Response, met } } -func awsRestjson1_deserializeOpDocumentListSitesOutput(v **ListSitesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListOrdersOutput(v **ListOrdersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3511,9 +3531,9 @@ func awsRestjson1_deserializeOpDocumentListSitesOutput(v **ListSitesOutput, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListSitesOutput + var sv *ListOrdersOutput if *v == nil { - sv = &ListSitesOutput{} + sv = &ListOrdersOutput{} } else { sv = *v } @@ -3529,8 +3549,8 @@ func awsRestjson1_deserializeOpDocumentListSitesOutput(v **ListSitesOutput, valu sv.NextToken = ptr.String(jtv) } - case "Sites": - if err := awsRestjson1_deserializeDocumentSiteListDefinition(&sv.Sites, value); err != nil { + case "Orders": + if err := awsRestjson1_deserializeDocumentOrderSummaryListDefinition(&sv.Orders, value); err != nil { return err } @@ -3543,14 +3563,14 @@ func awsRestjson1_deserializeOpDocumentListSitesOutput(v **ListSitesOutput, valu return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpListOutposts struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpListOutposts) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListOutposts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3568,9 +3588,9 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListOutposts(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListOutpostsOutput{} out.Result = output var buff [1024]byte @@ -3591,7 +3611,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListOutpostsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3605,7 +3625,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListOutposts(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3646,12 +3666,12 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): - return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -3665,7 +3685,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListOutpostsOutput(v **ListOutpostsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3678,17 +3698,26 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *ListOutpostsOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &ListOutpostsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "Outposts": + if err := awsRestjson1_deserializeDocumentOutpostListDefinition(&sv.Outposts, value); err != nil { return err } @@ -3701,14 +3730,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpStartCapacityTask struct { +type awsRestjson1_deserializeOpListSites struct { } -func (*awsRestjson1_deserializeOpStartCapacityTask) ID() string { +func (*awsRestjson1_deserializeOpListSites) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpStartCapacityTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListSites) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3726,9 +3755,9 @@ func (m *awsRestjson1_deserializeOpStartCapacityTask) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStartCapacityTask(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListSites(response, &metadata) } - output := &StartCapacityTaskOutput{} + output := &ListSitesOutput{} out.Result = output var buff [1024]byte @@ -3749,7 +3778,7 @@ func (m *awsRestjson1_deserializeOpStartCapacityTask) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentStartCapacityTaskOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListSitesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3763,7 +3792,7 @@ func (m *awsRestjson1_deserializeOpStartCapacityTask) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorStartCapacityTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListSites(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3807,15 +3836,9 @@ func awsRestjson1_deserializeOpErrorStartCapacityTask(response *smithyhttp.Respo case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): - return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -3829,7 +3852,7 @@ func awsRestjson1_deserializeOpErrorStartCapacityTask(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentStartCapacityTaskOutput(v **StartCapacityTaskOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListSitesOutput(v **ListSitesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3842,48 +3865,379 @@ func awsRestjson1_deserializeOpDocumentStartCapacityTaskOutput(v **StartCapacity return fmt.Errorf("unexpected JSON type %v", value) } - var sv *StartCapacityTaskOutput + var sv *ListSitesOutput if *v == nil { - sv = &StartCapacityTaskOutput{} + sv = &ListSitesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "CapacityTaskId": + case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CapacityTaskId to be of type string, got %T instead", value) + return fmt.Errorf("expected Token to be of type string, got %T instead", value) } - sv.CapacityTaskId = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } - case "CapacityTaskStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CapacityTaskStatus to be of type string, got %T instead", value) - } - sv.CapacityTaskStatus = types.CapacityTaskStatus(jtv) + case "Sites": + if err := awsRestjson1_deserializeDocumentSiteListDefinition(&sv.Sites, value); err != nil { + return err } - case "CompletionDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CompletionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + default: + _, _ = key, value - default: - return fmt.Errorf("expected ISO8601Timestamp to be a JSON Number, got %T instead", value) + } + } + *v = sv + return nil +} - } - } +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpStartCapacityTask struct { +} + +func (*awsRestjson1_deserializeOpStartCapacityTask) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartCapacityTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorStartCapacityTask(response, &metadata) + } + output := &StartCapacityTaskOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentStartCapacityTaskOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorStartCapacityTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentStartCapacityTaskOutput(v **StartCapacityTaskOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartCapacityTaskOutput + if *v == nil { + sv = &StartCapacityTaskOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CapacityTaskId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CapacityTaskId to be of type string, got %T instead", value) + } + sv.CapacityTaskId = ptr.String(jtv) + } + + case "CapacityTaskStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CapacityTaskStatus to be of type string, got %T instead", value) + } + sv.CapacityTaskStatus = types.CapacityTaskStatus(jtv) + } + + case "CompletionDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CompletionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected ISO8601Timestamp to be a JSON Number, got %T instead", value) + + } + } case "CreationDate": if value != nil { @@ -3915,6 +4269,11 @@ func awsRestjson1_deserializeOpDocumentStartCapacityTaskOutput(v **StartCapacity return err } + case "InstancesToExclude": + if err := awsRestjson1_deserializeDocumentInstancesToExclude(&sv.InstancesToExclude, value); err != nil { + return err + } + case "LastModifiedDate": if value != nil { switch jtv := value.(type) { @@ -3954,6 +4313,15 @@ func awsRestjson1_deserializeOpDocumentStartCapacityTaskOutput(v **StartCapacity return err } + case "TaskActionOnBlockingInstances": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaskActionOnBlockingInstances to be of type string, got %T instead", value) + } + sv.TaskActionOnBlockingInstances = types.TaskActionOnBlockingInstances(jtv) + } + default: _, _ = key, value @@ -5246,6 +5614,42 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return nil } +func awsRestjson1_deserializeDocumentAccountIdList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentAddress(v **types.Address, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5367,16 +5771,228 @@ func awsRestjson1_deserializeDocumentAddress(v **types.Address, value interface{ sv.StateOrRegion = ptr.String(jtv) } - default: - _, _ = key, value + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAssetInfo(v **types.AssetInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AssetInfo + if *v == nil { + sv = &types.AssetInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AssetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssetId to be of type string, got %T instead", value) + } + sv.AssetId = ptr.String(jtv) + } + + case "AssetLocation": + if err := awsRestjson1_deserializeDocumentAssetLocation(&sv.AssetLocation, value); err != nil { + return err + } + + case "AssetType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssetType to be of type string, got %T instead", value) + } + sv.AssetType = types.AssetType(jtv) + } + + case "ComputeAttributes": + if err := awsRestjson1_deserializeDocumentComputeAttributes(&sv.ComputeAttributes, value); err != nil { + return err + } + + case "RackId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RackId to be of type string, got %T instead", value) + } + sv.RackId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAssetInstance(v **types.AssetInstance, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AssetInstance + if *v == nil { + sv = &types.AssetInstance{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AccountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "AssetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssetId to be of type string, got %T instead", value) + } + sv.AssetId = ptr.String(jtv) + } + + case "AwsServiceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AWSServiceName to be of type string, got %T instead", value) + } + sv.AwsServiceName = types.AWSServiceName(jtv) + } + + case "InstanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InstanceId to be of type string, got %T instead", value) + } + sv.InstanceId = ptr.String(jtv) + } + + case "InstanceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OutpostInstanceType to be of type string, got %T instead", value) + } + sv.InstanceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAssetInstanceCapacityList(v *[]types.AssetInstanceTypeCapacity, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.AssetInstanceTypeCapacity + if *v == nil { + cv = []types.AssetInstanceTypeCapacity{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AssetInstanceTypeCapacity + destAddr := &col + if err := awsRestjson1_deserializeDocumentAssetInstanceTypeCapacity(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAssetInstanceList(v *[]types.AssetInstance, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.AssetInstance + if *v == nil { + cv = []types.AssetInstance{} + } else { + cv = *v + } + for _, value := range shape { + var col types.AssetInstance + destAddr := &col + if err := awsRestjson1_deserializeDocumentAssetInstance(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentAssetInfo(v **types.AssetInfo, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetInstanceTypeCapacity(v **types.AssetInstanceTypeCapacity, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5389,50 +6005,35 @@ func awsRestjson1_deserializeDocumentAssetInfo(v **types.AssetInfo, value interf return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssetInfo + var sv *types.AssetInstanceTypeCapacity if *v == nil { - sv = &types.AssetInfo{} + sv = &types.AssetInstanceTypeCapacity{} } else { sv = *v } for key, value := range shape { switch key { - case "AssetId": + case "Count": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected AssetId to be of type string, got %T instead", value) + return fmt.Errorf("expected InstanceTypeCount to be json.Number, got %T instead", value) } - sv.AssetId = ptr.String(jtv) - } - - case "AssetLocation": - if err := awsRestjson1_deserializeDocumentAssetLocation(&sv.AssetLocation, value); err != nil { - return err - } - - case "AssetType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AssetType to be of type string, got %T instead", value) + i64, err := jtv.Int64() + if err != nil { + return err } - sv.AssetType = types.AssetType(jtv) - } - - case "ComputeAttributes": - if err := awsRestjson1_deserializeDocumentComputeAttributes(&sv.ComputeAttributes, value); err != nil { - return err + sv.Count = int32(i64) } - case "RackId": + case "InstanceType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected RackId to be of type string, got %T instead", value) + return fmt.Errorf("expected InstanceTypeName to be of type string, got %T instead", value) } - sv.RackId = ptr.String(jtv) + sv.InstanceType = ptr.String(jtv) } default: @@ -5543,6 +6144,134 @@ func awsRestjson1_deserializeDocumentAssetLocation(v **types.AssetLocation, valu return nil } +func awsRestjson1_deserializeDocumentAWSServiceNameList(v *[]types.AWSServiceName, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.AWSServiceName + if *v == nil { + cv = []types.AWSServiceName{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AWSServiceName + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AWSServiceName to be of type string, got %T instead", value) + } + col = types.AWSServiceName(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentBlockingInstance(v **types.BlockingInstance, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BlockingInstance + if *v == nil { + sv = &types.BlockingInstance{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AccountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "AwsServiceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AWSServiceName to be of type string, got %T instead", value) + } + sv.AwsServiceName = types.AWSServiceName(jtv) + } + + case "InstanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InstanceId to be of type string, got %T instead", value) + } + sv.InstanceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBlockingInstancesList(v *[]types.BlockingInstance, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.BlockingInstance + if *v == nil { + cv = []types.BlockingInstance{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BlockingInstance + destAddr := &col + if err := awsRestjson1_deserializeDocumentBlockingInstance(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentCapacityTaskFailure(v **types.CapacityTaskFailure, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5958,6 +6687,24 @@ func awsRestjson1_deserializeDocumentComputeAttributes(v **types.ComputeAttribut return err } + case "InstanceTypeCapacities": + if err := awsRestjson1_deserializeDocumentAssetInstanceCapacityList(&sv.InstanceTypeCapacities, value); err != nil { + return err + } + + case "MaxVcpus": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected VCPUCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxVcpus = ptr.Int32(int32(i64)) + } + case "State": if value != nil { jtv, ok := value.(string) @@ -6243,6 +6990,88 @@ func awsRestjson1_deserializeDocumentInstanceFamilies(v *[]string, value interfa return nil } +func awsRestjson1_deserializeDocumentInstanceIdList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InstanceId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentInstancesToExclude(v **types.InstancesToExclude, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InstancesToExclude + if *v == nil { + sv = &types.InstancesToExclude{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AccountIds": + if err := awsRestjson1_deserializeDocumentAccountIdList(&sv.AccountIds, value); err != nil { + return err + } + + case "Instances": + if err := awsRestjson1_deserializeDocumentInstanceIdList(&sv.Instances, value); err != nil { + return err + } + + case "Services": + if err := awsRestjson1_deserializeDocumentAWSServiceNameList(&sv.Services, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentInstanceTypeCapacity(v **types.InstanceTypeCapacity, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/outposts/generated.json b/service/outposts/generated.json index e1ce4bd4c12..1facb68c0f7 100644 --- a/service/outposts/generated.json +++ b/service/outposts/generated.json @@ -24,7 +24,9 @@ "api_op_GetOutpostSupportedInstanceTypes.go", "api_op_GetSite.go", "api_op_GetSiteAddress.go", + "api_op_ListAssetInstances.go", "api_op_ListAssets.go", + "api_op_ListBlockingInstancesForCapacityTask.go", "api_op_ListCapacityTasks.go", "api_op_ListCatalogItems.go", "api_op_ListOrders.go", diff --git a/service/outposts/serializers.go b/service/outposts/serializers.go index fdc4453b59d..dfc8452a555 100644 --- a/service/outposts/serializers.go +++ b/service/outposts/serializers.go @@ -1310,6 +1310,109 @@ func awsRestjson1_serializeOpHttpBindingsGetSiteAddressInput(v *GetSiteAddressIn return nil } +type awsRestjson1_serializeOpListAssetInstances struct { +} + +func (*awsRestjson1_serializeOpListAssetInstances) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListAssetInstances) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListAssetInstancesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/outposts/{OutpostIdentifier}/assetInstances") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListAssetInstancesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListAssetInstancesInput(v *ListAssetInstancesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccountIdFilter != nil { + for i := range v.AccountIdFilter { + encoder.AddQuery("AccountIdFilter").String(v.AccountIdFilter[i]) + } + } + + if v.AssetIdFilter != nil { + for i := range v.AssetIdFilter { + encoder.AddQuery("AssetIdFilter").String(v.AssetIdFilter[i]) + } + } + + if v.AwsServiceFilter != nil { + for i := range v.AwsServiceFilter { + encoder.AddQuery("AwsServiceFilter").String(string(v.AwsServiceFilter[i])) + } + } + + if v.InstanceTypeFilter != nil { + for i := range v.InstanceTypeFilter { + encoder.AddQuery("InstanceTypeFilter").String(v.InstanceTypeFilter[i]) + } + } + + if v.MaxResults != nil { + encoder.SetQuery("MaxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("NextToken").String(*v.NextToken) + } + + if v.OutpostIdentifier == nil || len(*v.OutpostIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member OutpostIdentifier must not be empty")} + } + if v.OutpostIdentifier != nil { + if err := encoder.SetURI("OutpostIdentifier").String(*v.OutpostIdentifier); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpListAssets struct { } @@ -1401,6 +1504,94 @@ func awsRestjson1_serializeOpHttpBindingsListAssetsInput(v *ListAssetsInput, enc return nil } +type awsRestjson1_serializeOpListBlockingInstancesForCapacityTask struct { +} + +func (*awsRestjson1_serializeOpListBlockingInstancesForCapacityTask) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListBlockingInstancesForCapacityTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListBlockingInstancesForCapacityTaskInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/outposts/{OutpostIdentifier}/capacity/{CapacityTaskId}/blockingInstances") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListBlockingInstancesForCapacityTaskInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListBlockingInstancesForCapacityTaskInput(v *ListBlockingInstancesForCapacityTaskInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.CapacityTaskId == nil || len(*v.CapacityTaskId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member CapacityTaskId must not be empty")} + } + if v.CapacityTaskId != nil { + if err := encoder.SetURI("CapacityTaskId").String(*v.CapacityTaskId); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("MaxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("NextToken").String(*v.NextToken) + } + + if v.OutpostIdentifier == nil || len(*v.OutpostIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member OutpostIdentifier must not be empty")} + } + if v.OutpostIdentifier != nil { + if err := encoder.SetURI("OutpostIdentifier").String(*v.OutpostIdentifier); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpListCapacityTasks struct { } @@ -1988,11 +2179,23 @@ func awsRestjson1_serializeOpDocumentStartCapacityTaskInput(v *StartCapacityTask } } + if v.InstancesToExclude != nil { + ok := object.Key("InstancesToExclude") + if err := awsRestjson1_serializeDocumentInstancesToExclude(v.InstancesToExclude, ok); err != nil { + return err + } + } + if v.OrderId != nil { ok := object.Key("OrderId") ok.String(*v.OrderId) } + if len(v.TaskActionOnBlockingInstances) > 0 { + ok := object.Key("TaskActionOnBlockingInstances") + ok.String(string(v.TaskActionOnBlockingInstances)) + } + return nil } @@ -2708,6 +2911,17 @@ func awsRestjson1_serializeOpDocumentUpdateSiteRackPhysicalPropertiesInput(v *Up return nil } +func awsRestjson1_serializeDocumentAccountIdList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsRestjson1_serializeDocumentAddress(v *types.Address, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2770,6 +2984,56 @@ func awsRestjson1_serializeDocumentAddress(v *types.Address, value smithyjson.Va return nil } +func awsRestjson1_serializeDocumentAWSServiceNameList(v []types.AWSServiceName, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentInstanceIdList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentInstancesToExclude(v *types.InstancesToExclude, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountIds != nil { + ok := object.Key("AccountIds") + if err := awsRestjson1_serializeDocumentAccountIdList(v.AccountIds, ok); err != nil { + return err + } + } + + if v.Instances != nil { + ok := object.Key("Instances") + if err := awsRestjson1_serializeDocumentInstanceIdList(v.Instances, ok); err != nil { + return err + } + } + + if v.Services != nil { + ok := object.Key("Services") + if err := awsRestjson1_serializeDocumentAWSServiceNameList(v.Services, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentInstanceTypeCapacity(v *types.InstanceTypeCapacity, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/outposts/snapshot/api_op_ListAssetInstances.go.snap b/service/outposts/snapshot/api_op_ListAssetInstances.go.snap new file mode 100644 index 00000000000..180d3ea8cd9 --- /dev/null +++ b/service/outposts/snapshot/api_op_ListAssetInstances.go.snap @@ -0,0 +1,41 @@ +ListAssetInstances + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/outposts/snapshot/api_op_ListBlockingInstancesForCapacityTask.go.snap b/service/outposts/snapshot/api_op_ListBlockingInstancesForCapacityTask.go.snap new file mode 100644 index 00000000000..5a1f325cc6e --- /dev/null +++ b/service/outposts/snapshot/api_op_ListBlockingInstancesForCapacityTask.go.snap @@ -0,0 +1,41 @@ +ListBlockingInstancesForCapacityTask + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/outposts/snapshot_test.go b/service/outposts/snapshot_test.go index 8f7d9412b9b..6d9971fb41a 100644 --- a/service/outposts/snapshot_test.go +++ b/service/outposts/snapshot_test.go @@ -254,6 +254,18 @@ func TestCheckSnapshot_GetSiteAddress(t *testing.T) { } } +func TestCheckSnapshot_ListAssetInstances(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListAssetInstances(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListAssetInstances") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListAssets(t *testing.T) { svc := New(Options{}) _, err := svc.ListAssets(context.Background(), nil, func(o *Options) { @@ -266,6 +278,18 @@ func TestCheckSnapshot_ListAssets(t *testing.T) { } } +func TestCheckSnapshot_ListBlockingInstancesForCapacityTask(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListBlockingInstancesForCapacityTask(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListBlockingInstancesForCapacityTask") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListCapacityTasks(t *testing.T) { svc := New(Options{}) _, err := svc.ListCapacityTasks(context.Background(), nil, func(o *Options) { @@ -625,6 +649,18 @@ func TestUpdateSnapshot_GetSiteAddress(t *testing.T) { } } +func TestUpdateSnapshot_ListAssetInstances(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListAssetInstances(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListAssetInstances") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListAssets(t *testing.T) { svc := New(Options{}) _, err := svc.ListAssets(context.Background(), nil, func(o *Options) { @@ -637,6 +673,18 @@ func TestUpdateSnapshot_ListAssets(t *testing.T) { } } +func TestUpdateSnapshot_ListBlockingInstancesForCapacityTask(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListBlockingInstancesForCapacityTask(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListBlockingInstancesForCapacityTask") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListCapacityTasks(t *testing.T) { svc := New(Options{}) _, err := svc.ListCapacityTasks(context.Background(), nil, func(o *Options) { diff --git a/service/outposts/types/enums.go b/service/outposts/types/enums.go index d1d87a661f7..b849e7837f0 100644 --- a/service/outposts/types/enums.go +++ b/service/outposts/types/enums.go @@ -59,11 +59,42 @@ func (AssetType) Values() []AssetType { } } +type AWSServiceName string + +// Enum values for AWSServiceName +const ( + AWSServiceNameAws AWSServiceName = "AWS" + AWSServiceNameEc2 AWSServiceName = "EC2" + AWSServiceNameElasticache AWSServiceName = "ELASTICACHE" + AWSServiceNameElb AWSServiceName = "ELB" + AWSServiceNameRds AWSServiceName = "RDS" + AWSServiceNameRoute53 AWSServiceName = "ROUTE53" +) + +// Values returns all known values for AWSServiceName. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (AWSServiceName) Values() []AWSServiceName { + return []AWSServiceName{ + "AWS", + "EC2", + "ELASTICACHE", + "ELB", + "RDS", + "ROUTE53", + } +} + type CapacityTaskFailureType string // Enum values for CapacityTaskFailureType const ( CapacityTaskFailureTypeUnsupportedCapacityConfiguration CapacityTaskFailureType = "UNSUPPORTED_CAPACITY_CONFIGURATION" + CapacityTaskFailureTypeUnexpectedAssetState CapacityTaskFailureType = "UNEXPECTED_ASSET_STATE" + CapacityTaskFailureTypeBlockingInstancesNotEvacuated CapacityTaskFailureType = "BLOCKING_INSTANCES_NOT_EVACUATED" + CapacityTaskFailureTypeInternalServerError CapacityTaskFailureType = "INTERNAL_SERVER_ERROR" + CapacityTaskFailureTypeResourceNotFound CapacityTaskFailureType = "RESOURCE_NOT_FOUND" ) // Values returns all known values for CapacityTaskFailureType. Note that this can @@ -73,6 +104,10 @@ const ( func (CapacityTaskFailureType) Values() []CapacityTaskFailureType { return []CapacityTaskFailureType{ "UNSUPPORTED_CAPACITY_CONFIGURATION", + "UNEXPECTED_ASSET_STATE", + "BLOCKING_INSTANCES_NOT_EVACUATED", + "INTERNAL_SERVER_ERROR", + "RESOURCE_NOT_FOUND", } } @@ -80,11 +115,13 @@ type CapacityTaskStatus string // Enum values for CapacityTaskStatus const ( - CapacityTaskStatusRequested CapacityTaskStatus = "REQUESTED" - CapacityTaskStatusInProgress CapacityTaskStatus = "IN_PROGRESS" - CapacityTaskStatusFailed CapacityTaskStatus = "FAILED" - CapacityTaskStatusCompleted CapacityTaskStatus = "COMPLETED" - CapacityTaskStatusCancelled CapacityTaskStatus = "CANCELLED" + CapacityTaskStatusRequested CapacityTaskStatus = "REQUESTED" + CapacityTaskStatusInProgress CapacityTaskStatus = "IN_PROGRESS" + CapacityTaskStatusFailed CapacityTaskStatus = "FAILED" + CapacityTaskStatusCompleted CapacityTaskStatus = "COMPLETED" + CapacityTaskStatusWaitingForEvacuation CapacityTaskStatus = "WAITING_FOR_EVACUATION" + CapacityTaskStatusCancellationInProgress CapacityTaskStatus = "CANCELLATION_IN_PROGRESS" + CapacityTaskStatusCancelled CapacityTaskStatus = "CANCELLED" ) // Values returns all known values for CapacityTaskStatus. Note that this can be @@ -97,6 +134,8 @@ func (CapacityTaskStatus) Values() []CapacityTaskStatus { "IN_PROGRESS", "FAILED", "COMPLETED", + "WAITING_FOR_EVACUATION", + "CANCELLATION_IN_PROGRESS", "CANCELLED", } } @@ -540,6 +579,26 @@ func (SupportedStorageEnum) Values() []SupportedStorageEnum { } } +type TaskActionOnBlockingInstances string + +// Enum values for TaskActionOnBlockingInstances +const ( + TaskActionOnBlockingInstancesWaitForEvacuation TaskActionOnBlockingInstances = "WAIT_FOR_EVACUATION" + TaskActionOnBlockingInstancesFailTask TaskActionOnBlockingInstances = "FAIL_TASK" +) + +// Values returns all known values for TaskActionOnBlockingInstances. Note that +// this can be expanded in the future, and so it is only as up to date as the +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (TaskActionOnBlockingInstances) Values() []TaskActionOnBlockingInstances { + return []TaskActionOnBlockingInstances{ + "WAIT_FOR_EVACUATION", + "FAIL_TASK", + } +} + type UplinkCount string // Enum values for UplinkCount diff --git a/service/outposts/types/types.go b/service/outposts/types/types.go index b22b1c298a3..06b7bd58dc3 100644 --- a/service/outposts/types/types.go +++ b/service/outposts/types/types.go @@ -77,6 +77,43 @@ type AssetInfo struct { noSmithyDocumentSerde } +// An Amazon EC2 instance. +type AssetInstance struct { + + // The ID of the Amazon Web Services account. + AccountId *string + + // The ID of the asset. + AssetId *string + + // The Amazon Web Services service name of the instance. + AwsServiceName AWSServiceName + + // The ID of the instance. + InstanceId *string + + // The type of instance. + InstanceType *string + + noSmithyDocumentSerde +} + +// The capacity for each instance type. +type AssetInstanceTypeCapacity struct { + + // The number of each instance type. + // + // This member is required. + Count int32 + + // The type of instance. + // + // This member is required. + InstanceType *string + + noSmithyDocumentSerde +} + // Information about the position of the asset in a rack. type AssetLocation struct { @@ -86,6 +123,22 @@ type AssetLocation struct { noSmithyDocumentSerde } +// A running Amazon EC2 instance that can be stopped to free up capacity needed to +// run the capacity task. +type BlockingInstance struct { + + // The ID of the Amazon Web Services account. + AccountId *string + + // The Amazon Web Services service name that owns the specified blocking instance. + AwsServiceName AWSServiceName + + // The ID of the blocking instance. + InstanceId *string + + noSmithyDocumentSerde +} + // The capacity tasks that failed. type CapacityTaskFailure struct { @@ -165,6 +218,13 @@ type ComputeAttributes struct { // given asset. InstanceFamilies []string + // The instance type capacities configured for this asset. This can be changed + // through a capacity task. + InstanceTypeCapacities []AssetInstanceTypeCapacity + + // The maximum number of vCPUs possible for the specified asset. + MaxVcpus *int32 + // The state. // // - ACTIVE - The asset is available and can provide capacity for new compute @@ -221,6 +281,24 @@ type EC2Capacity struct { noSmithyDocumentSerde } +// User-specified instances that must not be stopped. These instances will not +// appear in the list of instances that Amazon Web Services recommends to stop in +// order to free up capacity. +type InstancesToExclude struct { + + // IDs of the accounts that own each instance that must not be stopped. + AccountIds []string + + // List of user-specified instances that must not be stopped. + Instances []string + + // Names of the services that own each instance that must not be stopped in order + // to free up the capacity needed to run the capacity task. + Services []AWSServiceName + + noSmithyDocumentSerde +} + // The instance type that you specify determines the combination of CPU, memory, // storage, and networking capacity. type InstanceTypeCapacity struct { diff --git a/service/outposts/validators.go b/service/outposts/validators.go index 9c0fae3e228..617fddf619c 100644 --- a/service/outposts/validators.go +++ b/service/outposts/validators.go @@ -330,6 +330,26 @@ func (m *validateOpGetSite) HandleInitialize(ctx context.Context, in middleware. return next.HandleInitialize(ctx, in) } +type validateOpListAssetInstances struct { +} + +func (*validateOpListAssetInstances) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListAssetInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListAssetInstancesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListAssetInstancesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListAssets struct { } @@ -350,6 +370,26 @@ func (m *validateOpListAssets) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpListBlockingInstancesForCapacityTask struct { +} + +func (*validateOpListBlockingInstancesForCapacityTask) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListBlockingInstancesForCapacityTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListBlockingInstancesForCapacityTaskInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListBlockingInstancesForCapacityTaskInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -594,10 +634,18 @@ func addOpGetSiteValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetSite{}, middleware.After) } +func addOpListAssetInstancesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAssetInstances{}, middleware.After) +} + func addOpListAssetsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListAssets{}, middleware.After) } +func addOpListBlockingInstancesForCapacityTaskValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListBlockingInstancesForCapacityTask{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } @@ -921,9 +969,6 @@ func validateOpGetOutpostSupportedInstanceTypesInput(v *GetOutpostSupportedInsta if v.OutpostIdentifier == nil { invalidParams.Add(smithy.NewErrParamRequired("OutpostIdentifier")) } - if v.OrderId == nil { - invalidParams.Add(smithy.NewErrParamRequired("OrderId")) - } if invalidParams.Len() > 0 { return invalidParams } else { @@ -964,6 +1009,21 @@ func validateOpGetSiteInput(v *GetSiteInput) error { } } +func validateOpListAssetInstancesInput(v *ListAssetInstancesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListAssetInstancesInput"} + if v.OutpostIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("OutpostIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListAssetsInput(v *ListAssetsInput) error { if v == nil { return nil @@ -979,6 +1039,24 @@ func validateOpListAssetsInput(v *ListAssetsInput) error { } } +func validateOpListBlockingInstancesForCapacityTaskInput(v *ListBlockingInstancesForCapacityTaskInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListBlockingInstancesForCapacityTaskInput"} + if v.OutpostIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("OutpostIdentifier")) + } + if v.CapacityTaskId == nil { + invalidParams.Add(smithy.NewErrParamRequired("CapacityTaskId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil @@ -1002,9 +1080,6 @@ func validateOpStartCapacityTaskInput(v *StartCapacityTaskInput) error { if v.OutpostIdentifier == nil { invalidParams.Add(smithy.NewErrParamRequired("OutpostIdentifier")) } - if v.OrderId == nil { - invalidParams.Add(smithy.NewErrParamRequired("OrderId")) - } if v.InstancePools == nil { invalidParams.Add(smithy.NewErrParamRequired("InstancePools")) } else if v.InstancePools != nil {