diff --git a/.changelog/36bdf85553f94045b0dbfa76d01acacd.json b/.changelog/36bdf85553f94045b0dbfa76d01acacd.json new file mode 100644 index 00000000000..28c7662031d --- /dev/null +++ b/.changelog/36bdf85553f94045b0dbfa76d01acacd.json @@ -0,0 +1,8 @@ +{ + "id": "36bdf855-53f9-4045-b0db-fa76d01acacd", + "type": "feature", + "description": "Add ClientToken to QueryDefinition CFN Handler in CWL", + "modules": [ + "service/cloudwatchlogs" + ] +} \ No newline at end of file diff --git a/.changelog/974d4f6f1beb4704a44600db86266dca.json b/.changelog/974d4f6f1beb4704a44600db86266dca.json new file mode 100644 index 00000000000..92525634047 --- /dev/null +++ b/.changelog/974d4f6f1beb4704a44600db86266dca.json @@ -0,0 +1,8 @@ +{ + "id": "974d4f6f-1beb-4704-a446-00db86266dca", + "type": "feature", + "description": "Add support for the Swift package format.", + "modules": [ + "service/codeartifact" + ] +} \ No newline at end of file diff --git a/.changelog/a0ce97898834411e80f8920ec2b77dc6.json b/.changelog/a0ce97898834411e80f8920ec2b77dc6.json new file mode 100644 index 00000000000..8d6b3c21f1f --- /dev/null +++ b/.changelog/a0ce97898834411e80f8920ec2b77dc6.json @@ -0,0 +1,8 @@ +{ + "id": "a0ce9789-8834-411e-80f8-920ec2b77dc6", + "type": "feature", + "description": "Enabling boto3 paginators for list APIs and adding documentation around ServiceQuotaExceededException errors", + "modules": [ + "service/appconfig" + ] +} \ No newline at end of file diff --git a/.changelog/af5c2dda6cd84f029d87fee521fc459b.json b/.changelog/af5c2dda6cd84f029d87fee521fc459b.json new file mode 100644 index 00000000000..deaf50a2ed2 --- /dev/null +++ b/.changelog/af5c2dda6cd84f029d87fee521fc459b.json @@ -0,0 +1,8 @@ +{ + "id": "af5c2dda-6cd8-4f02-9d87-fee521fc459b", + "type": "feature", + "description": "Fix an issue where the SDK can fail to unmarshall response due to NumberFormatException", + "modules": [ + "service/s3" + ] +} \ No newline at end of file diff --git a/.changelog/c8ddd3eb62564e5aac2eda5b2452fc6c.json b/.changelog/c8ddd3eb62564e5aac2eda5b2452fc6c.json new file mode 100644 index 00000000000..2cabb3d203e --- /dev/null +++ b/.changelog/c8ddd3eb62564e5aac2eda5b2452fc6c.json @@ -0,0 +1,8 @@ +{ + "id": "c8ddd3eb-6256-4e5a-ac2e-da5b2452fc6c", + "type": "documentation", + "description": "Updated DescribeMediaStorageConfiguration, StartEdgeConfigurationUpdate, ImageGenerationConfiguration$SamplingInterval, and UpdateMediaStorageConfiguration to match AWS Docs.", + "modules": [ + "service/kinesisvideo" + ] +} \ No newline at end of file diff --git a/.changelog/cd25a3a4c2c144ec9ab538c514829d31.json b/.changelog/cd25a3a4c2c144ec9ab538c514829d31.json new file mode 100644 index 00000000000..556d56d0b26 --- /dev/null +++ b/.changelog/cd25a3a4c2c144ec9ab538c514829d31.json @@ -0,0 +1,8 @@ +{ + "id": "cd25a3a4-c2c1-44ec-9ab5-38c514829d31", + "type": "feature", + "description": "Adds a new DiscoverInstancesRevision API and also adds InstanceRevision field to the DiscoverInstances API response.", + "modules": [ + "service/servicediscovery" + ] +} \ No newline at end of file diff --git a/.changelog/e57ecbbf00404d0c986127983520b310.json b/.changelog/e57ecbbf00404d0c986127983520b310.json new file mode 100644 index 00000000000..d47c2c03a94 --- /dev/null +++ b/.changelog/e57ecbbf00404d0c986127983520b310.json @@ -0,0 +1,8 @@ +{ + "id": "e57ecbbf-0040-4d0c-9861-27983520b310", + "type": "feature", + "description": "This release adds improvements for managing App Runner auto scaling configuration resources. New APIs: UpdateDefaultAutoScalingConfiguration and ListServicesForAutoScalingConfiguration. Updated API: DeleteAutoScalingConfiguration.", + "modules": [ + "service/apprunner" + ] +} \ No newline at end of file diff --git a/.changelog/ff82d83fd0744c4581187a15371f8efa.json b/.changelog/ff82d83fd0744c4581187a15371f8efa.json new file mode 100644 index 00000000000..de44f80affc --- /dev/null +++ b/.changelog/ff82d83fd0744c4581187a15371f8efa.json @@ -0,0 +1,8 @@ +{ + "id": "ff82d83f-d074-4c45-8118-7a15371f8efa", + "type": "feature", + "description": "Update FIPS endpoints in aws-us-gov.", + "modules": [ + "service/ssooidc" + ] +} \ No newline at end of file diff --git a/service/appconfig/api_op_CreateConfigurationProfile.go b/service/appconfig/api_op_CreateConfigurationProfile.go index 58bffac4a73..45be929191b 100644 --- a/service/appconfig/api_op_CreateConfigurationProfile.go +++ b/service/appconfig/api_op_CreateConfigurationProfile.go @@ -66,8 +66,10 @@ type CreateConfigurationProfileInput struct { // hosted . // - For an Amazon Web Services Systems Manager Parameter Store parameter, // specify either the parameter name in the format ssm-parameter:// or the ARN. + // - For an Amazon Web Services CodePipeline pipeline, specify the URI in the + // following format: codepipeline ://. // - For an Secrets Manager secret, specify the URI in the following format: - // secrets-manager ://. + // secretsmanager ://. // - For an Amazon S3 object, specify the URI in the following format: s3:/// . // Here is an example: s3://my-bucket/my-app/us-east-1/my-config.json // - For an SSM document, specify either the document name in the format diff --git a/service/appconfig/api_op_CreateExtension.go b/service/appconfig/api_op_CreateExtension.go index 12534f4f33c..3d189c6a6c3 100644 --- a/service/appconfig/api_op_CreateExtension.go +++ b/service/appconfig/api_op_CreateExtension.go @@ -19,10 +19,20 @@ import ( // Creates an AppConfig extension. An extension augments your ability to inject // logic or behavior at different points during the AppConfig workflow of creating // or deploying a configuration. You can create your own extensions or use the -// Amazon Web Services authored extensions provided by AppConfig. For most use -// cases, to create your own extension, you must create an Lambda function to -// perform any computation and processing defined in the extension. For more -// information about extensions, see Working with AppConfig extensions (https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html) +// Amazon Web Services authored extensions provided by AppConfig. For an AppConfig +// extension that uses Lambda, you must create a Lambda function to perform any +// computation and processing defined in the extension. If you plan to create +// custom versions of the Amazon Web Services authored notification extensions, you +// only need to specify an Amazon Resource Name (ARN) in the Uri field for the new +// extension version. +// - For a custom EventBridge notification extension, enter the ARN of the +// EventBridge default events in the Uri field. +// - For a custom Amazon SNS notification extension, enter the ARN of an Amazon +// SNS topic in the Uri field. +// - For a custom Amazon SQS notification extension, enter the ARN of an Amazon +// SQS message queue in the Uri field. +// +// For more information about extensions, see Working with AppConfig extensions (https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html) // in the AppConfig User Guide. func (c *Client) CreateExtension(ctx context.Context, params *CreateExtensionInput, optFns ...func(*Options)) (*CreateExtensionOutput, error) { if params == nil { diff --git a/service/appconfig/api_op_GetDeployment.go b/service/appconfig/api_op_GetDeployment.go index 644991e27ff..01a0f4b01ed 100644 --- a/service/appconfig/api_op_GetDeployment.go +++ b/service/appconfig/api_op_GetDeployment.go @@ -127,6 +127,9 @@ type GetDeploymentOutput struct { // The state of the deployment. State types.DeploymentState + // A user-defined label for an AppConfig hosted configuration version. + VersionLabel *string + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/appconfig/api_op_StartDeployment.go b/service/appconfig/api_op_StartDeployment.go index 57904a74988..309a03f6d36 100644 --- a/service/appconfig/api_op_StartDeployment.go +++ b/service/appconfig/api_op_StartDeployment.go @@ -47,7 +47,7 @@ type StartDeploymentInput struct { // The configuration version to deploy. If deploying an AppConfig hosted // configuration version, you can specify either the version number or version - // label. + // label. For all other configurations, you must specify the version number. // // This member is required. ConfigurationVersion *string @@ -151,6 +151,9 @@ type StartDeploymentOutput struct { // The state of the deployment. State types.DeploymentState + // A user-defined label for an AppConfig hosted configuration version. + VersionLabel *string + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/appconfig/api_op_StopDeployment.go b/service/appconfig/api_op_StopDeployment.go index c342a8fa1c8..b3d96564b06 100644 --- a/service/appconfig/api_op_StopDeployment.go +++ b/service/appconfig/api_op_StopDeployment.go @@ -129,6 +129,9 @@ type StopDeploymentOutput struct { // The state of the deployment. State types.DeploymentState + // A user-defined label for an AppConfig hosted configuration version. + VersionLabel *string + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/appconfig/deserializers.go b/service/appconfig/deserializers.go index b293acec9ea..d951d864459 100644 --- a/service/appconfig/deserializers.go +++ b/service/appconfig/deserializers.go @@ -126,6 +126,9 @@ func awsRestjson1_deserializeOpErrorCreateApplication(response *smithyhttp.Respo case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -301,6 +304,9 @@ func awsRestjson1_deserializeOpErrorCreateConfigurationProfile(response *smithyh case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -514,6 +520,9 @@ func awsRestjson1_deserializeOpErrorCreateDeploymentStrategy(response *smithyhtt case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -767,6 +776,9 @@ func awsRestjson1_deserializeOpErrorCreateEnvironment(response *smithyhttp.Respo case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3034,6 +3046,15 @@ func awsRestjson1_deserializeOpDocumentGetDeploymentOutput(v **GetDeploymentOutp sv.State = types.DeploymentState(jtv) } + case "VersionLabel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VersionLabel to be of type string, got %T instead", value) + } + sv.VersionLabel = ptr.String(jtv) + } + default: _, _ = key, value @@ -5895,6 +5916,15 @@ func awsRestjson1_deserializeOpDocumentStartDeploymentOutput(v **StartDeployment sv.State = types.DeploymentState(jtv) } + case "VersionLabel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VersionLabel to be of type string, got %T instead", value) + } + sv.VersionLabel = ptr.String(jtv) + } + default: _, _ = key, value @@ -6294,6 +6324,15 @@ func awsRestjson1_deserializeOpDocumentStopDeploymentOutput(v **StopDeploymentOu sv.State = types.DeploymentState(jtv) } + case "VersionLabel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VersionLabel to be of type string, got %T instead", value) + } + sv.VersionLabel = ptr.String(jtv) + } + default: _, _ = key, value @@ -9266,6 +9305,15 @@ func awsRestjson1_deserializeDocumentDeploymentSummary(v **types.DeploymentSumma sv.State = types.DeploymentState(jtv) } + case "VersionLabel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VersionLabel to be of type string, got %T instead", value) + } + sv.VersionLabel = ptr.String(jtv) + } + default: _, _ = key, value diff --git a/service/appconfig/types/errors.go b/service/appconfig/types/errors.go index a3dcf568f20..8775198c82d 100644 --- a/service/appconfig/types/errors.go +++ b/service/appconfig/types/errors.go @@ -148,8 +148,14 @@ func (e *ResourceNotFoundException) ErrorCode() string { } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The number of hosted configuration versions exceeds the limit for the AppConfig -// hosted configuration store. Delete one or more versions and try again. +// The number of one more AppConfig resources exceeds the maximum allowed. Verify +// that your environment doesn't exceed the following service quotas: Applications: +// 100 max Deployment strategies: 20 max Configuration profiles: 100 max per +// application Environments: 20 max per application To resolve this issue, you can +// delete one or more resources and try again. Or, you can request a quota +// increase. For more information about quotas and to request an increase, see +// Service quotas for AppConfig (https://docs.aws.amazon.com/general/latest/gr/appconfig.html#limits_appconfig) +// in the Amazon Web Services General Reference. type ServiceQuotaExceededException struct { Message *string diff --git a/service/appconfig/types/types.go b/service/appconfig/types/types.go index ca6c5c15e89..178d3e105c4 100644 --- a/service/appconfig/types/types.go +++ b/service/appconfig/types/types.go @@ -159,9 +159,12 @@ type DeploymentEvent struct { ActionInvocations []ActionInvocation // A description of the deployment event. Descriptions include, but are not - // limited to, the user account or the Amazon CloudWatch alarm ARN that initiated a - // rollback, the percentage of hosts that received the deployment, or in the case - // of an internal error, a recommendation to attempt a new deployment. + // limited to, the following: + // - The Amazon Web Services account or the Amazon CloudWatch alarm ARN that + // initiated a rollback. + // - The percentage of hosts that received the deployment. + // - A recommendation to attempt a new deployment (in the case of an internal + // error). Description *string // The type of deployment event. Deployment event types include the start, stop, @@ -248,6 +251,9 @@ type DeploymentSummary struct { // The state of the deployment. State DeploymentState + // A user-defined label for an AppConfig hosted configuration version. + VersionLabel *string + noSmithyDocumentSerde } diff --git a/service/apprunner/api_op_CreateAutoScalingConfiguration.go b/service/apprunner/api_op_CreateAutoScalingConfiguration.go index 1d2a2fbbde8..dff11875e92 100644 --- a/service/apprunner/api_op_CreateAutoScalingConfiguration.go +++ b/service/apprunner/api_op_CreateAutoScalingConfiguration.go @@ -50,12 +50,20 @@ type CreateAutoScalingConfigurationInput struct { // A name for the auto scaling configuration. When you use it for the first time // in an Amazon Web Services Region, App Runner creates revision number 1 of this // name. When you use the same name in subsequent calls, App Runner creates - // incremental revisions of the configuration. The name DefaultConfiguration is - // reserved (it's the configuration that App Runner uses if you don't provide a - // custome one). You can't use it to create a new auto scaling configuration, and - // you can't create a revision of it. When you want to use your own auto scaling - // configuration for your App Runner service, create a configuration with a - // different name, and then provide it when you create or update your service. + // incremental revisions of the configuration. Prior to the release of Managing + // auto scaling (https://docs.aws.amazon.com/apprunner/latest/relnotes/release-yyyy-mm-dd-asc-improvements.html) + // , the name DefaultConfiguration was reserved. This restriction is no longer in + // place. You can now manage DefaultConfiguration the same way you manage your + // custom auto scaling configurations. This means you can do the following with the + // DefaultConfiguration that App Runner provides: + // - Create new revisions of the DefaultConfiguration . + // - Delete the revisions of the DefaultConfiguration . + // - Delete the auto scaling configuration for which the App Runner + // DefaultConfiguration was created. + // - If you delete the auto scaling configuration you can create another custom + // auto scaling configuration with the same DefaultConfiguration name. The + // original DefaultConfiguration resource provided by App Runner remains in your + // account unless you make changes to it. // // This member is required. AutoScalingConfigurationName *string diff --git a/service/apprunner/api_op_DeleteAutoScalingConfiguration.go b/service/apprunner/api_op_DeleteAutoScalingConfiguration.go index f7d18b3fc71..227ba5e5f17 100644 --- a/service/apprunner/api_op_DeleteAutoScalingConfiguration.go +++ b/service/apprunner/api_op_DeleteAutoScalingConfiguration.go @@ -17,8 +17,10 @@ import ( ) // Delete an App Runner automatic scaling configuration resource. You can delete a -// specific revision or the latest active revision. You can't delete a -// configuration that's used by one or more App Runner services. +// top level auto scaling configuration, a specific revision of one, or all +// revisions associated with the top level configuration. You can't delete the +// default auto scaling configuration or a configuration that's used by one or more +// App Runner services. func (c *Client) DeleteAutoScalingConfiguration(ctx context.Context, params *DeleteAutoScalingConfigurationInput, optFns ...func(*Options)) (*DeleteAutoScalingConfigurationOutput, error) { if params == nil { params = &DeleteAutoScalingConfigurationInput{} @@ -44,6 +46,12 @@ type DeleteAutoScalingConfigurationInput struct { // This member is required. AutoScalingConfigurationArn *string + // Set to true to delete all of the revisions associated with the + // AutoScalingConfigurationArn parameter value. When DeleteAllRevisions is set to + // true , the only valid value for the Amazon Resource Name (ARN) is a partial ARN + // ending with: .../name . + DeleteAllRevisions bool + noSmithyDocumentSerde } diff --git a/service/apprunner/api_op_ListServicesForAutoScalingConfiguration.go b/service/apprunner/api_op_ListServicesForAutoScalingConfiguration.go new file mode 100644 index 00000000000..8017e51fd62 --- /dev/null +++ b/service/apprunner/api_op_ListServicesForAutoScalingConfiguration.go @@ -0,0 +1,378 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package apprunner + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of the associated App Runner services using an auto scaling +// configuration. +func (c *Client) ListServicesForAutoScalingConfiguration(ctx context.Context, params *ListServicesForAutoScalingConfigurationInput, optFns ...func(*Options)) (*ListServicesForAutoScalingConfigurationOutput, error) { + if params == nil { + params = &ListServicesForAutoScalingConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListServicesForAutoScalingConfiguration", params, optFns, c.addOperationListServicesForAutoScalingConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListServicesForAutoScalingConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListServicesForAutoScalingConfigurationInput struct { + + // The Amazon Resource Name (ARN) of the App Runner auto scaling configuration + // that you want to list the services for. The ARN can be a full auto scaling + // configuration ARN, or a partial ARN ending with either .../name or + // .../name/revision . If a revision isn't specified, the latest active revision + // is used. + // + // This member is required. + AutoScalingConfigurationArn *string + + // The maximum number of results to include in each response (result page). It's + // used for a paginated request. If you don't specify MaxResults , the request + // retrieves all available results in a single response. + MaxResults *int32 + + // A token from a previous result page. It's used for a paginated request. The + // request retrieves the next result page. All other parameter values must be + // identical to the ones specified in the initial request. If you don't specify + // NextToken , the request retrieves the first result page. + NextToken *string + + noSmithyDocumentSerde +} + +type ListServicesForAutoScalingConfigurationOutput struct { + + // A list of service ARN records. In a paginated request, the request returns up + // to MaxResults records for each call. + // + // This member is required. + ServiceArnList []string + + // The token that you can pass in a subsequent request to get the next result + // page. It's returned in a paginated request. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListServicesForAutoScalingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListServicesForAutoScalingConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListServicesForAutoScalingConfiguration{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); 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 = addListServicesForAutoScalingConfigurationResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpListServicesForAutoScalingConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListServicesForAutoScalingConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListServicesForAutoScalingConfigurationAPIClient is a client that implements +// the ListServicesForAutoScalingConfiguration operation. +type ListServicesForAutoScalingConfigurationAPIClient interface { + ListServicesForAutoScalingConfiguration(context.Context, *ListServicesForAutoScalingConfigurationInput, ...func(*Options)) (*ListServicesForAutoScalingConfigurationOutput, error) +} + +var _ ListServicesForAutoScalingConfigurationAPIClient = (*Client)(nil) + +// ListServicesForAutoScalingConfigurationPaginatorOptions is the paginator +// options for ListServicesForAutoScalingConfiguration +type ListServicesForAutoScalingConfigurationPaginatorOptions struct { + // The maximum number of results to include in each response (result page). It's + // used for a paginated request. If you don't specify MaxResults , the request + // retrieves all available results in a single response. + 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 +} + +// ListServicesForAutoScalingConfigurationPaginator is a paginator for +// ListServicesForAutoScalingConfiguration +type ListServicesForAutoScalingConfigurationPaginator struct { + options ListServicesForAutoScalingConfigurationPaginatorOptions + client ListServicesForAutoScalingConfigurationAPIClient + params *ListServicesForAutoScalingConfigurationInput + nextToken *string + firstPage bool +} + +// NewListServicesForAutoScalingConfigurationPaginator returns a new +// ListServicesForAutoScalingConfigurationPaginator +func NewListServicesForAutoScalingConfigurationPaginator(client ListServicesForAutoScalingConfigurationAPIClient, params *ListServicesForAutoScalingConfigurationInput, optFns ...func(*ListServicesForAutoScalingConfigurationPaginatorOptions)) *ListServicesForAutoScalingConfigurationPaginator { + if params == nil { + params = &ListServicesForAutoScalingConfigurationInput{} + } + + options := ListServicesForAutoScalingConfigurationPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListServicesForAutoScalingConfigurationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServicesForAutoScalingConfigurationPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListServicesForAutoScalingConfiguration page. +func (p *ListServicesForAutoScalingConfigurationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServicesForAutoScalingConfigurationOutput, 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 + + result, err := p.client.ListServicesForAutoScalingConfiguration(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 +} + +func newServiceMetadataMiddleware_opListServicesForAutoScalingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "apprunner", + OperationName: "ListServicesForAutoScalingConfiguration", + } +} + +type opListServicesForAutoScalingConfigurationResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opListServicesForAutoScalingConfigurationResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opListServicesForAutoScalingConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "apprunner" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "apprunner" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("apprunner") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addListServicesForAutoScalingConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opListServicesForAutoScalingConfigurationResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/apprunner/api_op_UpdateDefaultAutoScalingConfiguration.go b/service/apprunner/api_op_UpdateDefaultAutoScalingConfiguration.go new file mode 100644 index 00000000000..9c6378e8a37 --- /dev/null +++ b/service/apprunner/api_op_UpdateDefaultAutoScalingConfiguration.go @@ -0,0 +1,269 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package apprunner + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/apprunner/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update an auto scaling configuration to be the default. The existing default +// auto scaling configuration will be set to non-default automatically. +func (c *Client) UpdateDefaultAutoScalingConfiguration(ctx context.Context, params *UpdateDefaultAutoScalingConfigurationInput, optFns ...func(*Options)) (*UpdateDefaultAutoScalingConfigurationOutput, error) { + if params == nil { + params = &UpdateDefaultAutoScalingConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateDefaultAutoScalingConfiguration", params, optFns, c.addOperationUpdateDefaultAutoScalingConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateDefaultAutoScalingConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateDefaultAutoScalingConfigurationInput struct { + + // The Amazon Resource Name (ARN) of the App Runner auto scaling configuration + // that you want to set as the default. The ARN can be a full auto scaling + // configuration ARN, or a partial ARN ending with either .../name or + // .../name/revision . If a revision isn't specified, the latest active revision + // is set as the default. + // + // This member is required. + AutoScalingConfigurationArn *string + + noSmithyDocumentSerde +} + +type UpdateDefaultAutoScalingConfigurationOutput struct { + + // A description of the App Runner auto scaling configuration that was set as + // default. + // + // This member is required. + AutoScalingConfiguration *types.AutoScalingConfiguration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateDefaultAutoScalingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateDefaultAutoScalingConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateDefaultAutoScalingConfiguration{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); 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 = addUpdateDefaultAutoScalingConfigurationResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdateDefaultAutoScalingConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDefaultAutoScalingConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateDefaultAutoScalingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "apprunner", + OperationName: "UpdateDefaultAutoScalingConfiguration", + } +} + +type opUpdateDefaultAutoScalingConfigurationResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opUpdateDefaultAutoScalingConfigurationResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opUpdateDefaultAutoScalingConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "apprunner" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "apprunner" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("apprunner") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addUpdateDefaultAutoScalingConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opUpdateDefaultAutoScalingConfigurationResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/apprunner/deserializers.go b/service/apprunner/deserializers.go index 7bf27ed433b..cc96ca9040f 100644 --- a/service/apprunner/deserializers.go +++ b/service/apprunner/deserializers.go @@ -2944,6 +2944,123 @@ func awsAwsjson10_deserializeOpErrorListServices(response *smithyhttp.Response, } } +type awsAwsjson10_deserializeOpListServicesForAutoScalingConfiguration struct { +} + +func (*awsAwsjson10_deserializeOpListServicesForAutoScalingConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListServicesForAutoScalingConfiguration) 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 + } + + 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, awsAwsjson10_deserializeOpErrorListServicesForAutoScalingConfiguration(response, &metadata) + } + output := &ListServicesForAutoScalingConfigurationOutput{} + 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 = awsAwsjson10_deserializeOpDocumentListServicesForAutoScalingConfigurationOutput(&output, shape) + 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorListServicesForAutoScalingConfiguration(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("InternalServiceErrorException", errorCode): + return awsAwsjson10_deserializeErrorInternalServiceErrorException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson10_deserializeOpListTagsForResource struct { } @@ -3889,6 +4006,123 @@ func awsAwsjson10_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } +type awsAwsjson10_deserializeOpUpdateDefaultAutoScalingConfiguration struct { +} + +func (*awsAwsjson10_deserializeOpUpdateDefaultAutoScalingConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateDefaultAutoScalingConfiguration) 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 + } + + 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, awsAwsjson10_deserializeOpErrorUpdateDefaultAutoScalingConfiguration(response, &metadata) + } + output := &UpdateDefaultAutoScalingConfigurationOutput{} + 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 = awsAwsjson10_deserializeOpDocumentUpdateDefaultAutoScalingConfigurationOutput(&output, shape) + 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorUpdateDefaultAutoScalingConfiguration(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("InternalServiceErrorException", errorCode): + return awsAwsjson10_deserializeErrorInternalServiceErrorException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson10_deserializeOpUpdateService struct { } @@ -4397,13 +4631,13 @@ func awsAwsjson10_deserializeDocumentAutoScalingConfiguration(v **types.AutoScal if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + return fmt.Errorf("expected AutoScalingConfigurationRevision to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.AutoScalingConfigurationRevision = int32(i64) + sv.AutoScalingConfigurationRevision = ptr.Int32(int32(i64)) } case "CreatedAt": @@ -4438,52 +4672,70 @@ func awsAwsjson10_deserializeDocumentAutoScalingConfiguration(v **types.AutoScal } } + case "HasAssociatedService": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected HasAssociatedService to be of type *bool, got %T instead", value) + } + sv.HasAssociatedService = ptr.Bool(jtv) + } + + case "IsDefault": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected IsDefault to be of type *bool, got %T instead", value) + } + sv.IsDefault = ptr.Bool(jtv) + } + case "Latest": if value != nil { jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected Latest to be of type *bool, got %T instead", value) } - sv.Latest = jtv + sv.Latest = ptr.Bool(jtv) } case "MaxConcurrency": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + return fmt.Errorf("expected MaxConcurrency to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.MaxConcurrency = int32(i64) + sv.MaxConcurrency = ptr.Int32(int32(i64)) } case "MaxSize": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + return fmt.Errorf("expected MaxSize to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.MaxSize = int32(i64) + sv.MaxSize = ptr.Int32(int32(i64)) } case "MinSize": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + return fmt.Errorf("expected MinSize to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.MinSize = int32(i64) + sv.MinSize = ptr.Int32(int32(i64)) } case "Status": @@ -4557,6 +4809,49 @@ func awsAwsjson10_deserializeDocumentAutoScalingConfigurationSummary(v **types.A sv.AutoScalingConfigurationRevision = int32(i64) } + 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 "HasAssociatedService": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected HasAssociatedService to be of type *bool, got %T instead", value) + } + sv.HasAssociatedService = ptr.Bool(jtv) + } + + case "IsDefault": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected IsDefault to be of type *bool, got %T instead", value) + } + sv.IsDefault = ptr.Bool(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AutoScalingConfigurationStatus to be of type string, got %T instead", value) + } + sv.Status = types.AutoScalingConfigurationStatus(jtv) + } + default: _, _ = key, value @@ -6414,6 +6709,42 @@ func awsAwsjson10_deserializeDocumentService(v **types.Service, value interface{ return nil } +func awsAwsjson10_deserializeDocumentServiceArnList(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 AppRunnerResourceArn to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson10_deserializeDocumentServiceObservabilityConfiguration(v **types.ServiceObservabilityConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8348,6 +8679,51 @@ func awsAwsjson10_deserializeOpDocumentListOperationsOutput(v **ListOperationsOu return nil } +func awsAwsjson10_deserializeOpDocumentListServicesForAutoScalingConfigurationOutput(v **ListServicesForAutoScalingConfigurationOutput, 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 *ListServicesForAutoScalingConfigurationOutput + if *v == nil { + sv = &ListServicesForAutoScalingConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "ServiceArnList": + if err := awsAwsjson10_deserializeDocumentServiceArnList(&sv.ServiceArnList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentListServicesOutput(v **ListServicesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8711,6 +9087,42 @@ func awsAwsjson10_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutp return nil } +func awsAwsjson10_deserializeOpDocumentUpdateDefaultAutoScalingConfigurationOutput(v **UpdateDefaultAutoScalingConfigurationOutput, 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 *UpdateDefaultAutoScalingConfigurationOutput + if *v == nil { + sv = &UpdateDefaultAutoScalingConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AutoScalingConfiguration": + if err := awsAwsjson10_deserializeDocumentAutoScalingConfiguration(&sv.AutoScalingConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentUpdateServiceOutput(v **UpdateServiceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/apprunner/generated.json b/service/apprunner/generated.json index fd16821222b..62c9fdf1a22 100644 --- a/service/apprunner/generated.json +++ b/service/apprunner/generated.json @@ -34,6 +34,7 @@ "api_op_ListObservabilityConfigurations.go", "api_op_ListOperations.go", "api_op_ListServices.go", + "api_op_ListServicesForAutoScalingConfiguration.go", "api_op_ListTagsForResource.go", "api_op_ListVpcConnectors.go", "api_op_ListVpcIngressConnections.go", @@ -42,6 +43,7 @@ "api_op_StartDeployment.go", "api_op_TagResource.go", "api_op_UntagResource.go", + "api_op_UpdateDefaultAutoScalingConfiguration.go", "api_op_UpdateService.go", "api_op_UpdateVpcIngressConnection.go", "deserializers.go", diff --git a/service/apprunner/serializers.go b/service/apprunner/serializers.go index 295dfe48b30..9b496bc45a8 100644 --- a/service/apprunner/serializers.go +++ b/service/apprunner/serializers.go @@ -1390,6 +1390,61 @@ func (m *awsAwsjson10_serializeOpListServices) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpListServicesForAutoScalingConfiguration struct { +} + +func (*awsAwsjson10_serializeOpListServicesForAutoScalingConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListServicesForAutoScalingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + 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.(*ListServicesForAutoScalingConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AppRunner.ListServicesForAutoScalingConfiguration") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListServicesForAutoScalingConfigurationInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpListTagsForResource struct { } @@ -1830,6 +1885,61 @@ func (m *awsAwsjson10_serializeOpUntagResource) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpUpdateDefaultAutoScalingConfiguration struct { +} + +func (*awsAwsjson10_serializeOpUpdateDefaultAutoScalingConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpUpdateDefaultAutoScalingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + 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.(*UpdateDefaultAutoScalingConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AppRunner.UpdateDefaultAutoScalingConfiguration") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentUpdateDefaultAutoScalingConfigurationInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpUpdateService struct { } @@ -2650,6 +2760,11 @@ func awsAwsjson10_serializeOpDocumentDeleteAutoScalingConfigurationInput(v *Dele ok.String(*v.AutoScalingConfigurationArn) } + if v.DeleteAllRevisions { + ok := object.Key("DeleteAllRevisions") + ok.Boolean(v.DeleteAllRevisions) + } + return nil } @@ -2910,6 +3025,28 @@ func awsAwsjson10_serializeOpDocumentListOperationsInput(v *ListOperationsInput, return nil } +func awsAwsjson10_serializeOpDocumentListServicesForAutoScalingConfigurationInput(v *ListServicesForAutoScalingConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AutoScalingConfigurationArn != nil { + ok := object.Key("AutoScalingConfigurationArn") + ok.String(*v.AutoScalingConfigurationArn) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentListServicesInput(v *ListServicesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3054,6 +3191,18 @@ func awsAwsjson10_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, v return nil } +func awsAwsjson10_serializeOpDocumentUpdateDefaultAutoScalingConfigurationInput(v *UpdateDefaultAutoScalingConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AutoScalingConfigurationArn != nil { + ok := object.Key("AutoScalingConfigurationArn") + ok.String(*v.AutoScalingConfigurationArn) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentUpdateServiceInput(v *UpdateServiceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/apprunner/types/types.go b/service/apprunner/types/types.go index c6d61e639e8..2551ed0920e 100644 --- a/service/apprunner/types/types.go +++ b/service/apprunner/types/types.go @@ -43,7 +43,7 @@ type AutoScalingConfiguration struct { // The revision of this auto scaling configuration. It's unique among all the // active configurations ( "Status": "ACTIVE" ) that share the same // AutoScalingConfigurationName . - AutoScalingConfigurationRevision int32 + AutoScalingConfigurationRevision *int32 // The time when the auto scaling configuration was created. It's in Unix time // stamp format. @@ -53,19 +53,31 @@ type AutoScalingConfiguration struct { // stamp format. DeletedAt *time.Time + // Indicates if this auto scaling configuration has an App Runner service + // associated with it. A value of true indicates one or more services are + // associated. A value of false indicates no services are associated. + HasAssociatedService *bool + + // Indicates if this auto scaling configuration should be used as the default for + // a new App Runner service that does not have an auto scaling configuration ARN + // specified during creation. Each account can have only one default + // AutoScalingConfiguration per region. The default AutoScalingConfiguration can + // be any revision under the same AutoScalingConfigurationName . + IsDefault *bool + // It's set to true for the configuration with the highest Revision among all // configurations that share the same AutoScalingConfigurationName . It's set to // false otherwise. - Latest bool + Latest *bool // The maximum number of concurrent requests that an instance processes. If the // number of concurrent requests exceeds this limit, App Runner scales the service // up. - MaxConcurrency int32 + MaxConcurrency *int32 // The maximum number of instances that a service scales up to. At most MaxSize // instances actively serve traffic for your service. - MaxSize int32 + MaxSize *int32 // The minimum number of instances that App Runner provisions for a service. The // service always has at least MinSize provisioned instances. Some of them @@ -75,7 +87,7 @@ type AutoScalingConfiguration struct { // for CPU usage of only the active subset. App Runner temporarily doubles the // number of provisioned instances during deployments, to maintain the same // capacity for both old and new code. - MinSize int32 + MinSize *int32 // The current state of the auto scaling configuration. If the status of a // configuration revision is INACTIVE , it was deleted and can't be used. Inactive @@ -107,6 +119,28 @@ type AutoScalingConfigurationSummary struct { // AutoScalingConfigurationName . AutoScalingConfigurationRevision int32 + // The time when the auto scaling configuration was created. It's in Unix time + // stamp format. + CreatedAt *time.Time + + // Indicates if this auto scaling configuration has an App Runner service + // associated with it. A value of true indicates one or more services are + // associated. A value of false indicates no services are associated. + HasAssociatedService *bool + + // Indicates if this auto scaling configuration should be used as the default for + // a new App Runner service that does not have an auto scaling configuration ARN + // specified during creation. Each account can have only one default + // AutoScalingConfiguration per region. The default AutoScalingConfiguration can + // be any revision under the same AutoScalingConfigurationName . + IsDefault *bool + + // The current state of the auto scaling configuration. If the status of a + // configuration revision is INACTIVE , it was deleted and can't be used. Inactive + // configuration revisions are permanently removed some time after they are + // deleted. + Status AutoScalingConfigurationStatus + noSmithyDocumentSerde } diff --git a/service/apprunner/validators.go b/service/apprunner/validators.go index c6a50eafc72..1de8634f5be 100644 --- a/service/apprunner/validators.go +++ b/service/apprunner/validators.go @@ -430,6 +430,26 @@ func (m *validateOpListOperations) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpListServicesForAutoScalingConfiguration struct { +} + +func (*validateOpListServicesForAutoScalingConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListServicesForAutoScalingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListServicesForAutoScalingConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListServicesForAutoScalingConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -550,6 +570,26 @@ func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpUpdateDefaultAutoScalingConfiguration struct { +} + +func (*validateOpUpdateDefaultAutoScalingConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateDefaultAutoScalingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateDefaultAutoScalingConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateDefaultAutoScalingConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateService struct { } @@ -674,6 +714,10 @@ func addOpListOperationsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListOperations{}, middleware.After) } +func addOpListServicesForAutoScalingConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListServicesForAutoScalingConfiguration{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } @@ -698,6 +742,10 @@ func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } +func addOpUpdateDefaultAutoScalingConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateDefaultAutoScalingConfiguration{}, middleware.After) +} + func addOpUpdateServiceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateService{}, middleware.After) } @@ -1223,6 +1271,21 @@ func validateOpListOperationsInput(v *ListOperationsInput) error { } } +func validateOpListServicesForAutoScalingConfigurationInput(v *ListServicesForAutoScalingConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListServicesForAutoScalingConfigurationInput"} + if v.AutoScalingConfigurationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AutoScalingConfigurationArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil @@ -1319,6 +1382,21 @@ func validateOpUntagResourceInput(v *UntagResourceInput) error { } } +func validateOpUpdateDefaultAutoScalingConfigurationInput(v *UpdateDefaultAutoScalingConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateDefaultAutoScalingConfigurationInput"} + if v.AutoScalingConfigurationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AutoScalingConfigurationArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateServiceInput(v *UpdateServiceInput) error { if v == nil { return nil diff --git a/service/cloudwatchlogs/api_client.go b/service/cloudwatchlogs/api_client.go index 4a38dc155a2..c5665a581c3 100644 --- a/service/cloudwatchlogs/api_client.go +++ b/service/cloudwatchlogs/api_client.go @@ -4,6 +4,7 @@ package cloudwatchlogs import ( "context" + cryptorand "crypto/rand" "fmt" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/defaults" @@ -16,6 +17,7 @@ import ( smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" + smithyrand "github.com/aws/smithy-go/rand" smithyhttp "github.com/aws/smithy-go/transport/http" "net" "net/http" @@ -47,6 +49,8 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveHTTPSignerV4(&options) + resolveIdempotencyTokenProvider(&options) + for _, fn := range optFns { fn(&options) } @@ -101,6 +105,10 @@ type Options struct { // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 + // Provides idempotency tokens values that will be automatically populated into + // idempotent API operations. + IdempotencyTokenProvider IdempotencyTokenProvider + // The logger writer interface to write logging messages to. Logger logging.Logger @@ -441,6 +449,13 @@ func newDefaultV4Signer(o Options) *v4.Signer { }) } +func resolveIdempotencyTokenProvider(o *Options) { + if o.IdempotencyTokenProvider != nil { + return + } + o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) +} + func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, @@ -479,6 +494,11 @@ func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { return nil } +// IdempotencyTokenProvider interface for providing idempotency token +type IdempotencyTokenProvider interface { + GetIdempotencyToken() (string, error) +} + func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } diff --git a/service/cloudwatchlogs/api_op_CreateLogGroup.go b/service/cloudwatchlogs/api_op_CreateLogGroup.go index df41d1fa9f4..8e6f7dbb87b 100644 --- a/service/cloudwatchlogs/api_op_CreateLogGroup.go +++ b/service/cloudwatchlogs/api_op_CreateLogGroup.go @@ -15,9 +15,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a log group with the specified name. You can create up to 20,000 log -// groups per account. You must use the following guidelines when naming a log -// group: +// Creates a log group with the specified name. You can create up to 1,000,000 log +// groups per Region per account. You must use the following guidelines when naming +// a log group: // - Log group names must be unique within a Region for an Amazon Web Services // account. // - Log group names can be between 1 and 512 characters long. diff --git a/service/cloudwatchlogs/api_op_PutMetricFilter.go b/service/cloudwatchlogs/api_op_PutMetricFilter.go index 1ad06201755..142aebdc01b 100644 --- a/service/cloudwatchlogs/api_op_PutMetricFilter.go +++ b/service/cloudwatchlogs/api_op_PutMetricFilter.go @@ -25,12 +25,11 @@ import ( // are charged as custom metrics. To prevent unexpected high charges, do not // specify high-cardinality fields such as IPAddress or requestID as dimensions. // Each different value found for a dimension is treated as a separate metric and -// accrues charges as a separate custom metric. CloudWatch Logs disables a metric -// filter if it generates 1,000 different name/value pairs for your specified -// dimensions within a certain amount of time. This helps to prevent accidental -// high charges. You can also set up a billing alarm to alert you if your charges -// are higher than expected. For more information, see Creating a Billing Alarm to -// Monitor Your Estimated Amazon Web Services Charges (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html) +// accrues charges as a separate custom metric. CloudWatch Logs might disable a +// metric filter if it generates 1,000 different name/value pairs for your +// specified dimensions within one hour. You can also set up a billing alarm to +// alert you if your charges are higher than expected. For more information, see +// Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services Charges (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html) // . func (c *Client) PutMetricFilter(ctx context.Context, params *PutMetricFilterInput, optFns ...func(*Options)) (*PutMetricFilterOutput, error) { if params == nil { diff --git a/service/cloudwatchlogs/api_op_PutQueryDefinition.go b/service/cloudwatchlogs/api_op_PutQueryDefinition.go index d7637b4dbc2..d55ca6e04b3 100644 --- a/service/cloudwatchlogs/api_op_PutQueryDefinition.go +++ b/service/cloudwatchlogs/api_op_PutQueryDefinition.go @@ -58,6 +58,10 @@ type PutQueryDefinitionInput struct { // This member is required. QueryString *string + // Used as an idempotency token, to avoid returning an exception if the service + // receives the same request twice because of a network error. + ClientToken *string + // Use this parameter to include specific log groups as part of your query // definition. If you are updating a query definition and you omit this parameter, // then the updated definition will contain no log groups. @@ -136,6 +140,9 @@ func (c *Client) addOperationPutQueryDefinitionMiddlewares(stack *middleware.Sta if err = addPutQueryDefinitionResolveEndpointMiddleware(stack, options); err != nil { return err } + if err = addIdempotencyToken_opPutQueryDefinitionMiddleware(stack, options); err != nil { + return err + } if err = addOpPutQueryDefinitionValidationMiddleware(stack); err != nil { return err } @@ -160,6 +167,39 @@ func (c *Client) addOperationPutQueryDefinitionMiddlewares(stack *middleware.Sta return nil } +type idempotencyToken_initializeOpPutQueryDefinition struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpPutQueryDefinition) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpPutQueryDefinition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*PutQueryDefinitionInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *PutQueryDefinitionInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opPutQueryDefinitionMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpPutQueryDefinition{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + func newServiceMetadataMiddleware_opPutQueryDefinition(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatchlogs/api_op_PutRetentionPolicy.go b/service/cloudwatchlogs/api_op_PutRetentionPolicy.go index 2ec4afa3edb..bbaf2f9c6f0 100644 --- a/service/cloudwatchlogs/api_op_PutRetentionPolicy.go +++ b/service/cloudwatchlogs/api_op_PutRetentionPolicy.go @@ -26,7 +26,12 @@ import ( // date is reached. To make sure that log data is deleted permanently, keep a log // group at its lower retention setting until 72 hours after the previous retention // period ends. Alternatively, wait to change the retention setting until you -// confirm that the earlier log events are deleted. +// confirm that the earlier log events are deleted. When log events reach their +// retention setting they are marked for deletion. After they are marked for +// deletion, they do not add to your archival storage costs anymore, even if they +// are not actually deleted until later. These log events marked for deletion are +// also not included when you use an API to retrieve the storedBytes value to see +// how many bytes a log group is storing. func (c *Client) PutRetentionPolicy(ctx context.Context, params *PutRetentionPolicyInput, optFns ...func(*Options)) (*PutRetentionPolicyOutput, error) { if params == nil { params = &PutRetentionPolicyInput{} diff --git a/service/cloudwatchlogs/serializers.go b/service/cloudwatchlogs/serializers.go index e81f65bc7f2..eb03ad071f4 100644 --- a/service/cloudwatchlogs/serializers.go +++ b/service/cloudwatchlogs/serializers.go @@ -3932,6 +3932,11 @@ func awsAwsjson11_serializeOpDocumentPutQueryDefinitionInput(v *PutQueryDefiniti object := value.Object() defer object.Close() + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + if v.LogGroupNames != nil { ok := object.Key("logGroupNames") if err := awsAwsjson11_serializeDocumentLogGroupNames(v.LogGroupNames, ok); err != nil { diff --git a/service/codeartifact/types/enums.go b/service/codeartifact/types/enums.go index b9970177ffd..192431de288 100644 --- a/service/codeartifact/types/enums.go +++ b/service/codeartifact/types/enums.go @@ -103,6 +103,7 @@ const ( PackageFormatMaven PackageFormat = "maven" PackageFormatNuget PackageFormat = "nuget" PackageFormatGeneric PackageFormat = "generic" + PackageFormatSwift PackageFormat = "swift" ) // Values returns all known values for PackageFormat. Note that this can be @@ -115,6 +116,7 @@ func (PackageFormat) Values() []PackageFormat { "maven", "nuget", "generic", + "swift", } } diff --git a/service/kinesisvideo/api_op_DescribeMediaStorageConfiguration.go b/service/kinesisvideo/api_op_DescribeMediaStorageConfiguration.go index a8394d953ec..3f7203c6a1d 100644 --- a/service/kinesisvideo/api_op_DescribeMediaStorageConfiguration.go +++ b/service/kinesisvideo/api_op_DescribeMediaStorageConfiguration.go @@ -16,8 +16,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns the most current information about the channel. Specify the ChannelName -// or ChannelARN in the input. +// This API is related to WebRTC Ingestion (https://docs.aws.amazon.com/kinesisvideostreams-webrtc-dg/latest/devguide/webrtc-ingestion.html) +// and is only available in the us-west-2 region. Returns the most current +// information about the channel. Specify the ChannelName or ChannelARN in the +// input. func (c *Client) DescribeMediaStorageConfiguration(ctx context.Context, params *DescribeMediaStorageConfigurationInput, optFns ...func(*Options)) (*DescribeMediaStorageConfigurationOutput, error) { if params == nil { params = &DescribeMediaStorageConfigurationInput{} diff --git a/service/kinesisvideo/api_op_StartEdgeConfigurationUpdate.go b/service/kinesisvideo/api_op_StartEdgeConfigurationUpdate.go index 35f296628f9..9e4d7b3f323 100644 --- a/service/kinesisvideo/api_op_StartEdgeConfigurationUpdate.go +++ b/service/kinesisvideo/api_op_StartEdgeConfigurationUpdate.go @@ -29,7 +29,10 @@ import ( // API again. If you invoke this API during the syncing process, a // ResourceInUseException will be thrown. The connectivity of the stream’s edge // configuration and the Edge Agent will be retried for 15 minutes. After 15 -// minutes, the status will transition into the SYNC_FAILED state. +// minutes, the status will transition into the SYNC_FAILED state. To move an edge +// configuration from one device to another, use DeleteEdgeConfiguration to delete +// the current edge configuration. You can then invoke StartEdgeConfigurationUpdate +// with an updated Hub Device ARN. func (c *Client) StartEdgeConfigurationUpdate(ctx context.Context, params *StartEdgeConfigurationUpdateInput, optFns ...func(*Options)) (*StartEdgeConfigurationUpdateOutput, error) { if params == nil { params = &StartEdgeConfigurationUpdateInput{} diff --git a/service/kinesisvideo/api_op_UpdateMediaStorageConfiguration.go b/service/kinesisvideo/api_op_UpdateMediaStorageConfiguration.go index 401db69a05c..1c7047d3dd7 100644 --- a/service/kinesisvideo/api_op_UpdateMediaStorageConfiguration.go +++ b/service/kinesisvideo/api_op_UpdateMediaStorageConfiguration.go @@ -16,8 +16,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Associates a SignalingChannel to a stream to store the media. There are two -// signaling modes that can specified : +// This API is related to WebRTC Ingestion (https://docs.aws.amazon.com/kinesisvideostreams-webrtc-dg/latest/devguide/webrtc-ingestion.html) +// and is only available in the us-west-2 region. Associates a SignalingChannel to +// a stream to store the media. There are two signaling modes that can specified : // - If the StorageStatus is disabled, no data will be stored, and the StreamARN // parameter will not be needed. // - If the StorageStatus is enabled, the data will be stored in the StreamARN diff --git a/service/kinesisvideo/types/types.go b/service/kinesisvideo/types/types.go index 4e64656f4fe..7a9475a5786 100644 --- a/service/kinesisvideo/types/types.go +++ b/service/kinesisvideo/types/types.go @@ -138,9 +138,8 @@ type ImageGenerationConfiguration struct { ImageSelectorType ImageSelectorType // The time interval in milliseconds (ms) at which the images need to be generated - // from the stream. The minimum value that can be provided is 33 ms, because a - // camera that generates content at 30 FPS would create a frame every 33.3 ms. If - // the timestamp range is less than the sampling interval, the Image from the + // from the stream. The minimum value that can be provided is 200 ms. If the + // timestamp range is less than the sampling interval, the Image from the // StartTimestamp will be returned if available. // // This member is required. diff --git a/service/pipes/internal/endpoints/endpoints.go b/service/pipes/internal/endpoints/endpoints.go index a3c1a2e9cf1..771b544c28d 100644 --- a/service/pipes/internal/endpoints/endpoints.go +++ b/service/pipes/internal/endpoints/endpoints.go @@ -157,6 +157,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, @@ -172,12 +175,18 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, diff --git a/service/s3/api_op_AbortMultipartUpload.go b/service/s3/api_op_AbortMultipartUpload.go index 35e16049380..5932f1f2ea3 100644 --- a/service/s3/api_op_AbortMultipartUpload.go +++ b/service/s3/api_op_AbortMultipartUpload.go @@ -87,9 +87,11 @@ type AbortMultipartUploadInput struct { ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_CompleteMultipartUpload.go b/service/s3/api_op_CompleteMultipartUpload.go index 72e267651b3..babfebcc6e2 100644 --- a/service/s3/api_op_CompleteMultipartUpload.go +++ b/service/s3/api_op_CompleteMultipartUpload.go @@ -156,9 +156,11 @@ type CompleteMultipartUploadInput struct { MultipartUpload *types.CompletedMultipartUpload // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_CopyObject.go b/service/s3/api_op_CopyObject.go index fb34d74bcd9..97516a258de 100644 --- a/service/s3/api_op_CopyObject.go +++ b/service/s3/api_op_CopyObject.go @@ -137,9 +137,12 @@ import ( // use the CopyObject action to change the storage class of an object that is // already stored in Amazon S3 by using the StorageClass parameter. For more // information, see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) -// in the Amazon S3 User Guide. If the source object's storage class is GLACIER, -// you must restore a copy of this object before you can use it as a source object -// for the copy operation. For more information, see RestoreObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html) +// in the Amazon S3 User Guide. If the source object's storage class is GLACIER or +// DEEP_ARCHIVE, or the object's storage class is INTELLIGENT_TIERING and it's S3 +// Intelligent-Tiering access tier (https://docs.aws.amazon.com/AmazonS3/latest/userguide/intelligent-tiering-overview.html#intel-tiering-tier-definition) +// is Archive Access or Deep Archive Access, you must restore a copy of this object +// before you can use it as a source object for the copy operation. For more +// information, see RestoreObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html) // . For more information, see Copying Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjectsExamples.html) // . Versioning By default, x-amz-copy-source header identifies the current // version of an object to copy. If the current version is a delete marker, Amazon @@ -332,9 +335,11 @@ type CopyObjectInput struct { ObjectLockRetainUntilDate *time.Time // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer @@ -359,11 +364,11 @@ type CopyObjectInput struct { // JSON with the encryption context key-value pairs. SSEKMSEncryptionContext *string - // Specifies the KMS key ID to use for object encryption. All GET and PUT requests - // for an object protected by KMS will fail if they're not made via SSL or using - // SigV4. For information about configuring any of the officially supported Amazon - // Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature - // Version in Request Authentication (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version) + // Specifies the KMS ID (Key ID, Key ARN, or Key Alias) to use for object + // encryption. All GET and PUT requests for an object protected by KMS will fail if + // they're not made via SSL or using SigV4. For information about configuring any + // of the officially supported Amazon Web Services SDKs and Amazon Web Services + // CLI, see Specifying the Signature Version in Request Authentication (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version) // in the Amazon S3 User Guide. SSEKMSKeyId *string @@ -371,11 +376,11 @@ type CopyObjectInput struct { // (for example, AES256 , aws:kms , aws:kms:dsse ). ServerSideEncryption types.ServerSideEncryption - // By default, Amazon S3 uses the STANDARD Storage Class to store newly created - // objects. The STANDARD storage class provides high durability and high - // availability. Depending on performance needs, you can specify a different - // Storage Class. Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. For - // more information, see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) + // If the x-amz-storage-class header is not used, the copied object will be stored + // in the STANDARD Storage Class by default. The STANDARD storage class provides + // high durability and high availability. Depending on performance needs, you can + // specify a different Storage Class. Amazon S3 on Outposts only uses the OUTPOSTS + // Storage Class. For more information, see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) // in the Amazon S3 User Guide. StorageClass types.StorageClass diff --git a/service/s3/api_op_CreateBucket.go b/service/s3/api_op_CreateBucket.go index 7f242b4e6c8..9da6f8b9c0b 100644 --- a/service/s3/api_op_CreateBucket.go +++ b/service/s3/api_op_CreateBucket.go @@ -26,11 +26,12 @@ import ( // information about bucket naming restrictions, see Bucket naming rules (https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html) // . If you want to create an Amazon S3 on Outposts bucket, see Create Bucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateBucket.html) // . By default, the bucket is created in the US East (N. Virginia) Region. You can -// optionally specify a Region in the request body. You might choose a Region to -// optimize latency, minimize costs, or address regulatory requirements. For -// example, if you reside in Europe, you will probably find it advantageous to -// create buckets in the Europe (Ireland) Region. For more information, see -// Accessing a bucket (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro) +// optionally specify a Region in the request body. To constrain the bucket +// creation to a specific Region, you can use LocationConstraint (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucketConfiguration.html) +// condition key. You might choose a Region to optimize latency, minimize costs, or +// address regulatory requirements. For example, if you reside in Europe, you will +// probably find it advantageous to create buckets in the Europe (Ireland) Region. +// For more information, see Accessing a bucket (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro) // . If you send your create bucket request to the s3.amazonaws.com endpoint, the // request goes to the us-east-1 Region. Accordingly, the signature calculations // in Signature Version 4 must use us-east-1 as the Region, even if the location diff --git a/service/s3/api_op_CreateMultipartUpload.go b/service/s3/api_op_CreateMultipartUpload.go index 740ac066a0b..2831c54c75f 100644 --- a/service/s3/api_op_CreateMultipartUpload.go +++ b/service/s3/api_op_CreateMultipartUpload.go @@ -290,9 +290,11 @@ type CreateMultipartUploadInput struct { ObjectLockRetainUntilDate *time.Time // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer @@ -317,11 +319,12 @@ type CreateMultipartUploadInput struct { // JSON with the encryption context key-value pairs. SSEKMSEncryptionContext *string - // Specifies the ID of the symmetric encryption customer managed key to use for - // object encryption. All GET and PUT requests for an object protected by KMS will - // fail if they're not made via SSL or using SigV4. For information about - // configuring any of the officially supported Amazon Web Services SDKs and Amazon - // Web Services CLI, see Specifying the Signature Version in Request Authentication (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version) + // Specifies the ID (Key ID, Key ARN, or Key Alias) of the symmetric encryption + // customer managed key to use for object encryption. All GET and PUT requests for + // an object protected by KMS will fail if they're not made via SSL or using SigV4. + // For information about configuring any of the officially supported Amazon Web + // Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version + // in Request Authentication (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version) // in the Amazon S3 User Guide. SSEKMSKeyId *string diff --git a/service/s3/api_op_DeleteObject.go b/service/s3/api_op_DeleteObject.go index 10d06dccac2..5b5cbf18739 100644 --- a/service/s3/api_op_DeleteObject.go +++ b/service/s3/api_op_DeleteObject.go @@ -95,9 +95,11 @@ type DeleteObjectInput struct { MFA *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer @@ -109,8 +111,10 @@ type DeleteObjectInput struct { type DeleteObjectOutput struct { - // Specifies whether the versioned object that was permanently deleted was (true) - // or was not (false) a delete marker. + // Indicates whether the specified object version that was permanently deleted was + // (true) or was not (false) a delete marker before deletion. In a simple DELETE, + // this header indicates whether (true) or not (false) the current version of the + // object is a delete marker. DeleteMarker bool // If present, indicates that the requester was successfully charged for the diff --git a/service/s3/api_op_DeleteObjects.go b/service/s3/api_op_DeleteObjects.go index befd40d4284..b494c18aede 100644 --- a/service/s3/api_op_DeleteObjects.go +++ b/service/s3/api_op_DeleteObjects.go @@ -119,9 +119,11 @@ type DeleteObjectsInput struct { MFA *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_GetBucketAccelerateConfiguration.go b/service/s3/api_op_GetBucketAccelerateConfiguration.go index c5d666ae204..f11b25aa335 100644 --- a/service/s3/api_op_GetBucketAccelerateConfiguration.go +++ b/service/s3/api_op_GetBucketAccelerateConfiguration.go @@ -65,9 +65,11 @@ type GetBucketAccelerateConfigurationInput struct { ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_GetObject.go b/service/s3/api_op_GetObject.go index c598abb6e5f..e84be49a979 100644 --- a/service/s3/api_op_GetObject.go +++ b/service/s3/api_op_GetObject.go @@ -191,9 +191,11 @@ type GetObjectInput struct { Range *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_GetObjectAcl.go b/service/s3/api_op_GetObjectAcl.go index e7cd7b6be01..b6ea63ea058 100644 --- a/service/s3/api_op_GetObjectAcl.go +++ b/service/s3/api_op_GetObjectAcl.go @@ -75,9 +75,11 @@ type GetObjectAclInput struct { ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_GetObjectAttributes.go b/service/s3/api_op_GetObjectAttributes.go index bc290eeca02..06b1ac2df25 100644 --- a/service/s3/api_op_GetObjectAttributes.go +++ b/service/s3/api_op_GetObjectAttributes.go @@ -139,9 +139,11 @@ type GetObjectAttributesInput struct { PartNumberMarker *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_GetObjectLegalHold.go b/service/s3/api_op_GetObjectLegalHold.go index a8c5132070c..c4344169726 100644 --- a/service/s3/api_op_GetObjectLegalHold.go +++ b/service/s3/api_op_GetObjectLegalHold.go @@ -63,9 +63,11 @@ type GetObjectLegalHoldInput struct { ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_GetObjectRetention.go b/service/s3/api_op_GetObjectRetention.go index 17f5d227936..278d13522cd 100644 --- a/service/s3/api_op_GetObjectRetention.go +++ b/service/s3/api_op_GetObjectRetention.go @@ -63,9 +63,11 @@ type GetObjectRetentionInput struct { ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_GetObjectTagging.go b/service/s3/api_op_GetObjectTagging.go index bad883bd9b8..14ebf1c4eb4 100644 --- a/service/s3/api_op_GetObjectTagging.go +++ b/service/s3/api_op_GetObjectTagging.go @@ -78,9 +78,11 @@ type GetObjectTaggingInput struct { ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_GetObjectTorrent.go b/service/s3/api_op_GetObjectTorrent.go index c8bcccfce3b..dd06c1bdeab 100644 --- a/service/s3/api_op_GetObjectTorrent.go +++ b/service/s3/api_op_GetObjectTorrent.go @@ -59,9 +59,11 @@ type GetObjectTorrentInput struct { ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_HeadObject.go b/service/s3/api_op_HeadObject.go index 96e204c194c..a121acb1632 100644 --- a/service/s3/api_op_HeadObject.go +++ b/service/s3/api_op_HeadObject.go @@ -155,9 +155,11 @@ type HeadObjectInput struct { Range *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_ListMultipartUploads.go b/service/s3/api_op_ListMultipartUploads.go index 721bbca18f3..4749ad10b56 100644 --- a/service/s3/api_op_ListMultipartUploads.go +++ b/service/s3/api_op_ListMultipartUploads.go @@ -119,9 +119,11 @@ type ListMultipartUploadsInput struct { Prefix *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_ListObjectVersions.go b/service/s3/api_op_ListObjectVersions.go index d4a6bf13485..00ef2e9eecd 100644 --- a/service/s3/api_op_ListObjectVersions.go +++ b/service/s3/api_op_ListObjectVersions.go @@ -95,9 +95,11 @@ type ListObjectVersionsInput struct { Prefix *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_ListParts.go b/service/s3/api_op_ListParts.go index 2db5f0ac845..14ef6f91f92 100644 --- a/service/s3/api_op_ListParts.go +++ b/service/s3/api_op_ListParts.go @@ -100,9 +100,11 @@ type ListPartsInput struct { PartNumberMarker *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_PutBucketEncryption.go b/service/s3/api_op_PutBucketEncryption.go index 696fbe2d64a..ef10919611d 100644 --- a/service/s3/api_op_PutBucketEncryption.go +++ b/service/s3/api_op_PutBucketEncryption.go @@ -24,16 +24,14 @@ import ( // default encryption configuration that uses server-side encryption with Amazon S3 // managed keys (SSE-S3). You can optionally configure default encryption for a // bucket by using server-side encryption with Key Management Service (KMS) keys -// (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys -// (DSSE-KMS), or server-side encryption with customer-provided keys (SSE-C). If -// you specify default encryption by using SSE-KMS, you can also configure Amazon -// S3 Bucket Keys. For information about bucket default encryption, see Amazon S3 -// bucket default encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) -// in the Amazon S3 User Guide. For more information about S3 Bucket Keys, see -// Amazon S3 Bucket Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) -// in the Amazon S3 User Guide. This action requires Amazon Web Services Signature -// Version 4. For more information, see Authenticating Requests (Amazon Web -// Services Signature Version 4) (https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html) +// (SSE-KMS) or dual-layer server-side encryption with Amazon Web Services KMS keys +// (DSSE-KMS). If you specify default encryption by using SSE-KMS, you can also +// configure Amazon S3 Bucket Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) +// . If you use PutBucketEncryption to set your default bucket encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) +// to SSE-KMS, you should verify that your KMS key ID is correct. Amazon S3 does +// not validate the KMS key ID provided in PutBucketEncryption requests. This +// action requires Amazon Web Services Signature Version 4. For more information, +// see Authenticating Requests (Amazon Web Services Signature Version 4) (https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html) // . To use this operation, you must have permission to perform the // s3:PutEncryptionConfiguration action. The bucket owner has this permission by // default. The bucket owner can grant this permission to others. For more diff --git a/service/s3/api_op_PutBucketReplication.go b/service/s3/api_op_PutBucketReplication.go index bfb5250db24..d44e96bc8ae 100644 --- a/service/s3/api_op_PutBucketReplication.go +++ b/service/s3/api_op_PutBucketReplication.go @@ -25,17 +25,19 @@ import ( // request body. In the replication configuration, you provide the name of the // destination bucket or buckets where you want Amazon S3 to replicate objects, the // IAM role that Amazon S3 can assume to replicate objects on your behalf, and -// other relevant information. A replication configuration must include at least -// one rule, and can contain a maximum of 1,000. Each rule identifies a subset of -// objects to replicate by filtering the objects in the source bucket. To choose -// additional subsets of objects to replicate, add a rule for each subset. To -// specify a subset of the objects in the source bucket to apply a replication rule -// to, add the Filter element as a child of the Rule element. You can filter -// objects based on an object key prefix, one or more object tags, or both. When -// you add the Filter element in the configuration, you must also add the following -// elements: DeleteMarkerReplication , Status , and Priority . If you are using an -// earlier version of the replication configuration, Amazon S3 handles replication -// of delete markers differently. For more information, see Backward Compatibility (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations) +// other relevant information. You can invoke this request for a specific Amazon +// Web Services Region by using the aws:RequestedRegion (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-requestedregion) +// condition key. A replication configuration must include at least one rule, and +// can contain a maximum of 1,000. Each rule identifies a subset of objects to +// replicate by filtering the objects in the source bucket. To choose additional +// subsets of objects to replicate, add a rule for each subset. To specify a subset +// of the objects in the source bucket to apply a replication rule to, add the +// Filter element as a child of the Rule element. You can filter objects based on +// an object key prefix, one or more object tags, or both. When you add the Filter +// element in the configuration, you must also add the following elements: +// DeleteMarkerReplication , Status , and Priority . If you are using an earlier +// version of the replication configuration, Amazon S3 handles replication of +// delete markers differently. For more information, see Backward Compatibility (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations) // . For information about enabling versioning on a bucket, see Using Versioning (https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html) // . Handling Replication of Encrypted Objects By default, Amazon S3 doesn't // replicate objects that are stored at rest using server-side encryption with KMS diff --git a/service/s3/api_op_PutBucketTagging.go b/service/s3/api_op_PutBucketTagging.go index 0c2bd3896c7..9792ad38e46 100644 --- a/service/s3/api_op_PutBucketTagging.go +++ b/service/s3/api_op_PutBucketTagging.go @@ -27,7 +27,7 @@ import ( // specific application name, and then organize your billing information to see the // total cost of that application across several services. For more information, // see Cost Allocation and Tagging (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) -// and Using Cost Allocation in Amazon S3 Bucket Tags (https://docs.aws.amazon.com/AmazonS3/latest/dev/CostAllocTagging.html) +// and Using Cost Allocation in Amazon S3 Bucket Tags (https://docs.aws.amazon.com/AmazonS3/latest/userguide/CostAllocTagging.html) // . When this operation sets the tags for a bucket, it will overwrite any current // tags the bucket already has. You cannot use this operation to add tags to an // existing list of tags. To use this operation, you must have permissions to @@ -35,20 +35,17 @@ import ( // default and can grant this permission to others. For more information about // permissions, see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) // and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// . PutBucketTagging has the following special errors: -// - Error code: InvalidTagError -// - Description: The tag provided was not a valid tag. This error can occur if -// the tag did not pass input validation. For information about tag restrictions, -// see User-Defined Tag Restrictions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html) -// and Amazon Web Services-Generated Cost Allocation Tag Restrictions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/aws-tag-restrictions.html) +// . PutBucketTagging has the following special errors. For more Amazon S3 errors +// see, Error Responses (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html) +// . +// - InvalidTag - The tag provided was not a valid tag. This error can occur if +// the tag did not pass input validation. For more information, see Using Cost +// Allocation in Amazon S3 Bucket Tags (https://docs.aws.amazon.com/AmazonS3/latest/userguide/CostAllocTagging.html) // . -// - Error code: MalformedXMLError -// - Description: The XML provided does not match the schema. -// - Error code: OperationAbortedError -// - Description: A conflicting conditional action is currently in progress +// - MalformedXML - The XML provided does not match the schema. +// - OperationAborted - A conflicting conditional action is currently in progress // against this resource. Please try again. -// - Error code: InternalError -// - Description: The service was unable to apply the provided tag to the +// - InternalError - The service was unable to apply the provided tag to the // bucket. // // The following operations are related to PutBucketTagging : diff --git a/service/s3/api_op_PutBucketWebsite.go b/service/s3/api_op_PutBucketWebsite.go index 06086353540..e21b4c171a4 100644 --- a/service/s3/api_op_PutBucketWebsite.go +++ b/service/s3/api_op_PutBucketWebsite.go @@ -61,7 +61,7 @@ import ( // Amazon S3 has a limitation of 50 routing rules per website configuration. If // you require more than 50 routing rules, you can use object redirect. For more // information, see Configuring an Object Redirect (https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html) -// in the Amazon S3 User Guide. +// in the Amazon S3 User Guide. The maximum request length is limited to 128 KB. func (c *Client) PutBucketWebsite(ctx context.Context, params *PutBucketWebsiteInput, optFns ...func(*Options)) (*PutBucketWebsiteOutput, error) { if params == nil { params = &PutBucketWebsiteInput{} diff --git a/service/s3/api_op_PutObject.go b/service/s3/api_op_PutObject.go index 2b61fcb8b2f..51c2f1fd4d6 100644 --- a/service/s3/api_op_PutObject.go +++ b/service/s3/api_op_PutObject.go @@ -264,9 +264,11 @@ type PutObjectInput struct { ObjectLockRetainUntilDate *time.Time // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer @@ -294,9 +296,9 @@ type PutObjectInput struct { SSEKMSEncryptionContext *string // If x-amz-server-side-encryption has a valid value of aws:kms or aws:kms:dsse , - // this header specifies the ID of the Key Management Service (KMS) symmetric - // encryption customer managed key that was used for the object. If you specify - // x-amz-server-side-encryption:aws:kms or + // this header specifies the ID (Key ID, Key ARN, or Key Alias) of the Key + // Management Service (KMS) symmetric encryption customer managed key that was used + // for the object. If you specify x-amz-server-side-encryption:aws:kms or // x-amz-server-side-encryption:aws:kms:dsse , but do not provide // x-amz-server-side-encryption-aws-kms-key-id , Amazon S3 uses the Amazon Web // Services managed key ( aws/s3 ) to protect the data. If the KMS key does not diff --git a/service/s3/api_op_PutObjectAcl.go b/service/s3/api_op_PutObjectAcl.go index 480f15cfb86..22a0dcc22f3 100644 --- a/service/s3/api_op_PutObjectAcl.go +++ b/service/s3/api_op_PutObjectAcl.go @@ -199,9 +199,11 @@ type PutObjectAclInput struct { GrantWriteACP *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_PutObjectLegalHold.go b/service/s3/api_op_PutObjectLegalHold.go index 0245a045f65..d4d371df71b 100644 --- a/service/s3/api_op_PutObjectLegalHold.go +++ b/service/s3/api_op_PutObjectLegalHold.go @@ -81,9 +81,11 @@ type PutObjectLegalHoldInput struct { LegalHold *types.ObjectLockLegalHold // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_PutObjectLockConfiguration.go b/service/s3/api_op_PutObjectLockConfiguration.go index b05c857ee74..5b4a897e53c 100644 --- a/service/s3/api_op_PutObjectLockConfiguration.go +++ b/service/s3/api_op_PutObjectLockConfiguration.go @@ -74,9 +74,11 @@ type PutObjectLockConfigurationInput struct { ObjectLockConfiguration *types.ObjectLockConfiguration // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_PutObjectRetention.go b/service/s3/api_op_PutObjectRetention.go index 8715b20dae8..95176ea6998 100644 --- a/service/s3/api_op_PutObjectRetention.go +++ b/service/s3/api_op_PutObjectRetention.go @@ -84,9 +84,11 @@ type PutObjectRetentionInput struct { ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_PutObjectTagging.go b/service/s3/api_op_PutObjectTagging.go index d8d773e219c..e9785b934c2 100644 --- a/service/s3/api_op_PutObjectTagging.go +++ b/service/s3/api_op_PutObjectTagging.go @@ -20,10 +20,10 @@ import ( ) // Sets the supplied tag-set to an object that already exists in a bucket. A tag -// is a key-value pair. You can associate tags with an object by sending a PUT -// request against the tagging subresource that is associated with the object. You -// can retrieve tags by sending a GET request. For more information, see -// GetObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html) +// is a key-value pair. For more information, see Object Tagging (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-tagging.html) +// . You can associate tags with an object by sending a PUT request against the +// tagging subresource that is associated with the object. You can retrieve tags by +// sending a GET request. For more information, see GetObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html) // . For tagging-related restrictions related to characters and encodings, see Tag // Restrictions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html) // . Note that Amazon S3 limits the maximum number of tags to 10 tags per object. @@ -31,20 +31,18 @@ import ( // s3:PutObjectTagging action. By default, the bucket owner has this permission and // can grant this permission to others. To put tags of any other version, use the // versionId query parameter. You also need permission for the -// s3:PutObjectVersionTagging action. For information about the Amazon S3 object -// tagging feature, see Object Tagging (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html) -// . PutObjectTagging has the following special errors: -// - Code: InvalidTagError -// - Cause: The tag provided was not a valid tag. This error can occur if the -// tag did not pass input validation. For more information, see Object Tagging (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html) +// s3:PutObjectVersionTagging action. PutObjectTagging has the following special +// errors. For more Amazon S3 errors see, Error Responses (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html) +// . +// - InvalidTag - The tag provided was not a valid tag. This error can occur if +// the tag did not pass input validation. For more information, see Object +// Tagging (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-tagging.html) // . -// - Code: MalformedXMLError -// - Cause: The XML provided does not match the schema. -// - Code: OperationAbortedError -// - Cause: A conflicting conditional action is currently in progress against -// this resource. Please try again. -// - Code: InternalError -// - Cause: The service was unable to apply the provided tag to the object. +// - MalformedXML - The XML provided does not match the schema. +// - OperationAborted - A conflicting conditional action is currently in progress +// against this resource. Please try again. +// - InternalError - The service was unable to apply the provided tag to the +// object. // // The following operations are related to PutObjectTagging : // - GetObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html) @@ -116,9 +114,11 @@ type PutObjectTaggingInput struct { ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_PutPublicAccessBlock.go b/service/s3/api_op_PutPublicAccessBlock.go index 02f57c74c77..8aa349c746d 100644 --- a/service/s3/api_op_PutPublicAccessBlock.go +++ b/service/s3/api_op_PutPublicAccessBlock.go @@ -27,7 +27,7 @@ import ( // an object, it checks the PublicAccessBlock configuration for both the bucket // (or the bucket that contains the object) and the bucket owner's account. If the // PublicAccessBlock configurations are different between the bucket and the -// account, Amazon S3 uses the most restrictive combination of the bucket-level and +// account, S3 uses the most restrictive combination of the bucket-level and // account-level settings. For more information about when Amazon S3 considers a // bucket or an object public, see The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status) // . The following operations are related to PutPublicAccessBlock : diff --git a/service/s3/api_op_RestoreObject.go b/service/s3/api_op_RestoreObject.go index 1173c318f22..0ccf96b3f32 100644 --- a/service/s3/api_op_RestoreObject.go +++ b/service/s3/api_op_RestoreObject.go @@ -224,9 +224,11 @@ type RestoreObjectInput struct { ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_UploadPart.go b/service/s3/api_op_UploadPart.go index 461f48488be..a3e1a7db4ea 100644 --- a/service/s3/api_op_UploadPart.go +++ b/service/s3/api_op_UploadPart.go @@ -202,9 +202,11 @@ type UploadPartInput struct { ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_UploadPartCopy.go b/service/s3/api_op_UploadPartCopy.go index 31a61ead930..ce9a179a7de 100644 --- a/service/s3/api_op_UploadPartCopy.go +++ b/service/s3/api_op_UploadPartCopy.go @@ -215,9 +215,11 @@ type UploadPartCopyInput struct { ExpectedSourceBucketOwner *string // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Bucket owners need not specify this parameter in their requests. If either the + // source or destination Amazon S3 bucket has Requester Pays enabled, the requester + // will pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see Downloading Objects in + // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 User Guide. RequestPayer types.RequestPayer diff --git a/service/s3/api_op_WriteGetObjectResponse.go b/service/s3/api_op_WriteGetObjectResponse.go index e01ad934d2f..751f646dce5 100644 --- a/service/s3/api_op_WriteGetObjectResponse.go +++ b/service/s3/api_op_WriteGetObjectResponse.go @@ -242,9 +242,9 @@ type WriteGetObjectResponseInput struct { // . SSECustomerKeyMD5 *string - // If present, specifies the ID of the Amazon Web Services Key Management Service - // (Amazon Web Services KMS) symmetric encryption customer managed key that was - // used for stored in Amazon S3 object. + // If present, specifies the ID (Key ID, Key ARN, or Key Alias) of the Amazon Web + // Services Key Management Service (Amazon Web Services KMS) symmetric encryption + // customer managed key that was used for stored in Amazon S3 object. SSEKMSKeyId *string // The server-side encryption algorithm used when storing requested object in diff --git a/service/s3/types/types.go b/service/s3/types/types.go index 1b8a31174fb..3ddea0a2450 100644 --- a/service/s3/types/types.go +++ b/service/s3/types/types.go @@ -594,9 +594,10 @@ type Delete struct { // Information about the deleted object. type DeletedObject struct { - // Specifies whether the versioned object that was permanently deleted was (true) - // or was not (false) a delete marker. In a simple DELETE, this header indicates - // whether (true) or not (false) a delete marker was created. + // Indicates whether the specified object version that was permanently deleted was + // (true) or was not (false) a delete marker before deletion. In a simple DELETE, + // this header indicates whether (true) or not (false) the current version of the + // object is a delete marker. DeleteMarker bool // The version ID of the delete marker created as a result of the DELETE @@ -2997,17 +2998,17 @@ type ServerSideEncryptionByDefault struct { // Amazon Web Services Key Management Service (KMS) customer Amazon Web Services // KMS key ID to use for the default encryption. This parameter is allowed if and - // only if SSEAlgorithm is set to aws:kms . You can specify the key ID or the - // Amazon Resource Name (ARN) of the KMS key. If you use a key ID, you can run into - // a LogDestination undeliverable error when creating a VPC flow log. If you are - // using encryption with cross-account or Amazon Web Services service operations - // you must use a fully qualified KMS key ARN. For more information, see Using - // encryption for cross-account operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html#bucket-encryption-update-bucket-policy) - // . + // only if SSEAlgorithm is set to aws:kms . You can specify the key ID, key alias, + // or the Amazon Resource Name (ARN) of the KMS key. // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // Amazon S3 only supports symmetric encryption KMS keys. For more information, + // - Key Alias: alias/alias-name + // If you use a key ID, you can run into a LogDestination undeliverable error when + // creating a VPC flow log. If you are using encryption with cross-account or + // Amazon Web Services service operations you must use a fully qualified KMS key + // ARN. For more information, see Using encryption for cross-account operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html#bucket-encryption-update-bucket-policy) + // . Amazon S3 only supports symmetric encryption KMS keys. For more information, // see Asymmetric keys in Amazon Web Services KMS (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) // in the Amazon Web Services Key Management Service Developer Guide. KMSMasterKeyID *string diff --git a/service/servicediscovery/api_op_DiscoverInstances.go b/service/servicediscovery/api_op_DiscoverInstances.go index 2416a9ec2cd..d10b42feaef 100644 --- a/service/servicediscovery/api_op_DiscoverInstances.go +++ b/service/servicediscovery/api_op_DiscoverInstances.go @@ -17,9 +17,10 @@ import ( ) // Discovers registered instances for a specified namespace and service. You can -// use DiscoverInstances to discover instances for any type of namespace. For -// public and private DNS namespaces, you can also use DNS queries to discover -// instances. +// use DiscoverInstances to discover instances for any type of namespace. +// DiscoverInstances returns a randomized list of instances allowing customers to +// distribute traffic evenly across instances. For public and private DNS +// namespaces, you can also use DNS queries to discover instances. func (c *Client) DiscoverInstances(ctx context.Context, params *DiscoverInstancesInput, optFns ...func(*Options)) (*DiscoverInstancesOutput, error) { if params == nil { params = &DiscoverInstancesInput{} @@ -82,6 +83,11 @@ type DiscoverInstancesOutput struct { // instance. Instances []types.HttpInstanceSummary + // The increasing revision associated to the response Instances list. If a new + // instance is registered or deregistered, the InstancesRevision updates. The + // health status updates don't update InstancesRevision . + InstancesRevision *int64 + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/servicediscovery/api_op_DiscoverInstancesRevision.go b/service/servicediscovery/api_op_DiscoverInstancesRevision.go new file mode 100644 index 00000000000..f81712c7cec --- /dev/null +++ b/service/servicediscovery/api_op_DiscoverInstancesRevision.go @@ -0,0 +1,298 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package servicediscovery + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Discovers the increasing revision associated with an instance. +func (c *Client) DiscoverInstancesRevision(ctx context.Context, params *DiscoverInstancesRevisionInput, optFns ...func(*Options)) (*DiscoverInstancesRevisionOutput, error) { + if params == nil { + params = &DiscoverInstancesRevisionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DiscoverInstancesRevision", params, optFns, c.addOperationDiscoverInstancesRevisionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DiscoverInstancesRevisionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DiscoverInstancesRevisionInput struct { + + // The HttpName name of the namespace. It's found in the HttpProperties member of + // the Properties member of the namespace. + // + // This member is required. + NamespaceName *string + + // The name of the service that you specified when you registered the instance. + // + // This member is required. + ServiceName *string + + noSmithyDocumentSerde +} + +type DiscoverInstancesRevisionOutput struct { + + // The increasing revision associated to the response Instances list. If a new + // instance is registered or deregistered, the InstancesRevision updates. The + // health status updates don't update InstancesRevision . + InstancesRevision *int64 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDiscoverInstancesRevisionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDiscoverInstancesRevision{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDiscoverInstancesRevision{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); 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 = addEndpointPrefix_opDiscoverInstancesRevisionMiddleware(stack); err != nil { + return err + } + if err = addDiscoverInstancesRevisionResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDiscoverInstancesRevisionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDiscoverInstancesRevision(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type endpointPrefix_opDiscoverInstancesRevisionMiddleware struct { +} + +func (*endpointPrefix_opDiscoverInstancesRevisionMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDiscoverInstancesRevisionMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + req.URL.Host = "data-" + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opDiscoverInstancesRevisionMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opDiscoverInstancesRevisionMiddleware{}, `OperationSerializer`, middleware.After) +} + +func newServiceMetadataMiddleware_opDiscoverInstancesRevision(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "servicediscovery", + OperationName: "DiscoverInstancesRevision", + } +} + +type opDiscoverInstancesRevisionResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDiscoverInstancesRevisionResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDiscoverInstancesRevisionResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "servicediscovery" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "servicediscovery" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("servicediscovery") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDiscoverInstancesRevisionResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDiscoverInstancesRevisionResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/servicediscovery/api_op_GetOperation.go b/service/servicediscovery/api_op_GetOperation.go index b9c87ce6b4d..43821a8de8d 100644 --- a/service/servicediscovery/api_op_GetOperation.go +++ b/service/servicediscovery/api_op_GetOperation.go @@ -17,8 +17,8 @@ import ( ) // Gets information about any operation that returns an operation ID in the -// response, such as a CreateService request. To get a list of operations that -// match specified criteria, see ListOperations (https://docs.aws.amazon.com/cloud-map/latest/api/API_ListOperations.html) +// response, such as a CreateHttpNamespace request. To get a list of operations +// that match specified criteria, see ListOperations (https://docs.aws.amazon.com/cloud-map/latest/api/API_ListOperations.html) // . func (c *Client) GetOperation(ctx context.Context, params *GetOperationInput, optFns ...func(*Options)) (*GetOperationOutput, error) { if params == nil { diff --git a/service/servicediscovery/api_op_RegisterInstance.go b/service/servicediscovery/api_op_RegisterInstance.go index 82011b64c5a..d60bcd772fc 100644 --- a/service/servicediscovery/api_op_RegisterInstance.go +++ b/service/servicediscovery/api_op_RegisterInstance.go @@ -74,7 +74,7 @@ type RegisterInstanceInput struct { // - If the service that's specified by ServiceId includes HealthCheckConfig // settings, Cloud Map will create the Route 53 health check, but it doesn't // associate the health check with the alias record. - // - Auto naming currently doesn't support creating alias records that route + // - Cloud Map currently doesn't support creating alias records that route // traffic to Amazon Web Services resources other than Elastic Load Balancing load // balancers. // - If you specify a value for AWS_ALIAS_DNS_NAME , don't specify values for any diff --git a/service/servicediscovery/deserializers.go b/service/servicediscovery/deserializers.go index 9bfc53c54d0..f05111f0845 100644 --- a/service/servicediscovery/deserializers.go +++ b/service/servicediscovery/deserializers.go @@ -992,6 +992,126 @@ func awsAwsjson11_deserializeOpErrorDiscoverInstances(response *smithyhttp.Respo } } +type awsAwsjson11_deserializeOpDiscoverInstancesRevision struct { +} + +func (*awsAwsjson11_deserializeOpDiscoverInstancesRevision) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDiscoverInstancesRevision) 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 + } + + 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, awsAwsjson11_deserializeOpErrorDiscoverInstancesRevision(response, &metadata) + } + output := &DiscoverInstancesRevisionOutput{} + 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 = awsAwsjson11_deserializeOpDocumentDiscoverInstancesRevisionOutput(&output, shape) + 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDiscoverInstancesRevision(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("InvalidInput", errorCode): + return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) + + case strings.EqualFold("NamespaceNotFound", errorCode): + return awsAwsjson11_deserializeErrorNamespaceNotFound(response, errorBody) + + case strings.EqualFold("RequestLimitExceeded", errorCode): + return awsAwsjson11_deserializeErrorRequestLimitExceeded(response, errorBody) + + case strings.EqualFold("ServiceNotFound", errorCode): + return awsAwsjson11_deserializeErrorServiceNotFound(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpGetInstance struct { } @@ -6054,6 +6174,63 @@ func awsAwsjson11_deserializeOpDocumentDiscoverInstancesOutput(v **DiscoverInsta return err } + case "InstancesRevision": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Revision to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.InstancesRevision = ptr.Int64(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDiscoverInstancesRevisionOutput(v **DiscoverInstancesRevisionOutput, 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 *DiscoverInstancesRevisionOutput + if *v == nil { + sv = &DiscoverInstancesRevisionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "InstancesRevision": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Revision to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.InstancesRevision = ptr.Int64(i64) + } + default: _, _ = key, value diff --git a/service/servicediscovery/generated.json b/service/servicediscovery/generated.json index 4a07dc7503a..1585669d7e2 100644 --- a/service/servicediscovery/generated.json +++ b/service/servicediscovery/generated.json @@ -17,6 +17,7 @@ "api_op_DeleteService.go", "api_op_DeregisterInstance.go", "api_op_DiscoverInstances.go", + "api_op_DiscoverInstancesRevision.go", "api_op_GetInstance.go", "api_op_GetInstancesHealthStatus.go", "api_op_GetNamespace.go", diff --git a/service/servicediscovery/serializers.go b/service/servicediscovery/serializers.go index 666db84ddcf..f78db5091b4 100644 --- a/service/servicediscovery/serializers.go +++ b/service/servicediscovery/serializers.go @@ -455,6 +455,61 @@ func (m *awsAwsjson11_serializeOpDiscoverInstances) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDiscoverInstancesRevision struct { +} + +func (*awsAwsjson11_serializeOpDiscoverInstancesRevision) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDiscoverInstancesRevision) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + 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.(*DiscoverInstancesRevisionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Route53AutoNaming_v20170314.DiscoverInstancesRevision") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDiscoverInstancesRevisionInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpGetInstance struct { } @@ -2191,6 +2246,23 @@ func awsAwsjson11_serializeOpDocumentDiscoverInstancesInput(v *DiscoverInstances return nil } +func awsAwsjson11_serializeOpDocumentDiscoverInstancesRevisionInput(v *DiscoverInstancesRevisionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NamespaceName != nil { + ok := object.Key("NamespaceName") + ok.String(*v.NamespaceName) + } + + if v.ServiceName != nil { + ok := object.Key("ServiceName") + ok.String(*v.ServiceName) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentGetInstanceInput(v *GetInstanceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/servicediscovery/validators.go b/service/servicediscovery/validators.go index 4610ad087fa..6b774a073d9 100644 --- a/service/servicediscovery/validators.go +++ b/service/servicediscovery/validators.go @@ -170,6 +170,26 @@ func (m *validateOpDiscoverInstances) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpDiscoverInstancesRevision struct { +} + +func (*validateOpDiscoverInstancesRevision) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDiscoverInstancesRevision) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DiscoverInstancesRevisionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDiscoverInstancesRevisionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetInstance struct { } @@ -562,6 +582,10 @@ func addOpDiscoverInstancesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDiscoverInstances{}, middleware.After) } +func addOpDiscoverInstancesRevisionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDiscoverInstancesRevision{}, middleware.After) +} + func addOpGetInstanceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetInstance{}, middleware.After) } @@ -1284,6 +1308,24 @@ func validateOpDiscoverInstancesInput(v *DiscoverInstancesInput) error { } } +func validateOpDiscoverInstancesRevisionInput(v *DiscoverInstancesRevisionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DiscoverInstancesRevisionInput"} + if v.NamespaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("NamespaceName")) + } + if v.ServiceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetInstanceInput(v *GetInstanceInput) error { if v == nil { return nil diff --git a/service/ssoadmin/internal/endpoints/endpoints.go b/service/ssoadmin/internal/endpoints/endpoints.go index b0cc07b5ead..3743ccd4589 100644 --- a/service/ssoadmin/internal/endpoints/endpoints.go +++ b/service/ssoadmin/internal/endpoints/endpoints.go @@ -247,6 +247,14 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "cn-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + }: endpoints.Endpoint{}, + }, }, { ID: "aws-iso", diff --git a/service/ssooidc/endpoints.go b/service/ssooidc/endpoints.go index 53dd2d5ae09..e8d190e48a4 100644 --- a/service/ssooidc/endpoints.go +++ b/service/ssooidc/endpoints.go @@ -411,6 +411,25 @@ func (r *resolver) ResolveEndpoint( } if _UseFIPS == true { if true == _PartitionResult.SupportsFIPS { + if "aws-us-gov" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://oidc.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } uriString := func() string { var out strings.Builder out.WriteString("https://oidc-fips.") diff --git a/service/ssooidc/endpoints_test.go b/service/ssooidc/endpoints_test.go index 570b2670bd4..7c527d2760a 100644 --- a/service/ssooidc/endpoints_test.go +++ b/service/ssooidc/endpoints_test.go @@ -1161,7 +1161,7 @@ func TestEndpointCase29(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://oidc-fips.us-gov-east-1.amazonaws.com") + uri, _ := url.Parse("https://oidc.us-gov-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri,