diff --git a/.changelog/3c84f2792cce40abb60804186c0ab689.json b/.changelog/3c84f2792cce40abb60804186c0ab689.json new file mode 100644 index 00000000000..e1b4cf817e6 --- /dev/null +++ b/.changelog/3c84f2792cce40abb60804186c0ab689.json @@ -0,0 +1,8 @@ +{ + "id": "3c84f279-2cce-40ab-b608-04186c0ab689", + "type": "feature", + "description": "Updated ScheduleConfig to be an optional input to CreateDataIntegration to support event driven downloading of files from sources such as Amazon s3 using Amazon Connect AppIntegrations.", + "modules": [ + "service/appintegrations" + ] +} \ No newline at end of file diff --git a/.changelog/68f2beeb1d8c486185fd8400d62d3f1e.json b/.changelog/68f2beeb1d8c486185fd8400d62d3f1e.json new file mode 100644 index 00000000000..ecba0156ee2 --- /dev/null +++ b/.changelog/68f2beeb1d8c486185fd8400d62d3f1e.json @@ -0,0 +1,8 @@ +{ + "id": "68f2beeb-1d8c-4861-85fd-8400d62d3f1e", + "type": "feature", + "description": "This release adds support for updating phone number metadata, such as phone number description.", + "modules": [ + "service/connect" + ] +} \ No newline at end of file diff --git a/.changelog/6c4e825cc4834ce2957dcdb15391ec74.json b/.changelog/6c4e825cc4834ce2957dcdb15391ec74.json new file mode 100644 index 00000000000..34b77ea3222 --- /dev/null +++ b/.changelog/6c4e825cc4834ce2957dcdb15391ec74.json @@ -0,0 +1,8 @@ +{ + "id": "6c4e825c-c483-4ce2-957d-cdb15391ec74", + "type": "feature", + "description": "This release introduces three new APIs: StartBatchDeleteConfigurationTask, DescribeBatchDeleteConfigurationTask, and BatchDeleteAgents.", + "modules": [ + "service/applicationdiscoveryservice" + ] +} \ No newline at end of file diff --git a/.changelog/d006d5c63bee4a68aa7db4c52ce6b46c.json b/.changelog/d006d5c63bee4a68aa7db4c52ce6b46c.json new file mode 100644 index 00000000000..02e1c18061f --- /dev/null +++ b/.changelog/d006d5c63bee4a68aa7db4c52ce6b46c.json @@ -0,0 +1,8 @@ +{ + "id": "d006d5c6-3bee-4a68-aa7d-b4c52ce6b46c", + "type": "feature", + "description": "Update KmsKeyIdentifier constraints to support AWS KMS multi-Region keys.", + "modules": [ + "service/appconfig" + ] +} \ No newline at end of file diff --git a/.changelog/d3e913716c3c4ae5854930a92bc49879.json b/.changelog/d3e913716c3c4ae5854930a92bc49879.json new file mode 100644 index 00000000000..d3e47ce419f --- /dev/null +++ b/.changelog/d3e913716c3c4ae5854930a92bc49879.json @@ -0,0 +1,8 @@ +{ + "id": "d3e91371-6c3c-4ae5-8549-30a92bc49879", + "type": "documentation", + "description": "Updates on documentation links", + "modules": [ + "service/medicalimaging" + ] +} \ No newline at end of file diff --git a/.changelog/f5dc26db43304079a06e54c3b5d18b60.json b/.changelog/f5dc26db43304079a06e54c3b5d18b60.json new file mode 100644 index 00000000000..165ed1e9d94 --- /dev/null +++ b/.changelog/f5dc26db43304079a06e54c3b5d18b60.json @@ -0,0 +1,8 @@ +{ + "id": "f5dc26db-4330-4079-a06e-54c3b5d18b60", + "type": "feature", + "description": "This release introduces a new API: DeleteOpsItem. This allows deletion of an OpsItem.", + "modules": [ + "service/ssm" + ] +} \ No newline at end of file diff --git a/service/appconfig/endpoints.go b/service/appconfig/endpoints.go index 6652de5a3c6..13787f241a2 100644 --- a/service/appconfig/endpoints.go +++ b/service/appconfig/endpoints.go @@ -410,7 +410,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { if _Region == "us-gov-east-1" { uriString := "https://appconfig.us-gov-east-1.amazonaws.com" diff --git a/service/appintegrations/api_op_CreateDataIntegration.go b/service/appintegrations/api_op_CreateDataIntegration.go index 0a13867a140..2aa5ae087e0 100644 --- a/service/appintegrations/api_op_CreateDataIntegration.go +++ b/service/appintegrations/api_op_CreateDataIntegration.go @@ -47,11 +47,6 @@ type CreateDataIntegrationInput struct { // This member is required. Name *string - // The name of the data and how often it should be pulled from the source. - // - // This member is required. - ScheduleConfig *types.ScheduleConfiguration - // The URI of the data source. // // This member is required. @@ -73,6 +68,9 @@ type CreateDataIntegrationInput struct { // The configuration for what data should be pulled from the source. ObjectConfiguration map[string]map[string][]string + // The name of the data and how often it should be pulled from the source. + ScheduleConfig *types.ScheduleConfiguration + // The tags used to organize, track, or control access for this resource. For // example, { "tags": {"key1":"value1", "key2":"value2"} }. Tags map[string]string diff --git a/service/appintegrations/endpoints.go b/service/appintegrations/endpoints.go index 15f36e64583..982527d5432 100644 --- a/service/appintegrations/endpoints.go +++ b/service/appintegrations/endpoints.go @@ -410,7 +410,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://app-integrations-fips.") diff --git a/service/appintegrations/validators.go b/service/appintegrations/validators.go index ec1e89e6f91..6fb8e88a20e 100644 --- a/service/appintegrations/validators.go +++ b/service/appintegrations/validators.go @@ -587,9 +587,7 @@ func validateOpCreateDataIntegrationInput(v *CreateDataIntegrationInput) error { if v.SourceURI == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceURI")) } - if v.ScheduleConfig == nil { - invalidParams.Add(smithy.NewErrParamRequired("ScheduleConfig")) - } else if v.ScheduleConfig != nil { + if v.ScheduleConfig != nil { if err := validateScheduleConfiguration(v.ScheduleConfig); err != nil { invalidParams.AddNested("ScheduleConfig", err.(smithy.InvalidParamsError)) } diff --git a/service/applicationdiscoveryservice/api_op_BatchDeleteAgents.go b/service/applicationdiscoveryservice/api_op_BatchDeleteAgents.go new file mode 100644 index 00000000000..7b8033a5933 --- /dev/null +++ b/service/applicationdiscoveryservice/api_op_BatchDeleteAgents.go @@ -0,0 +1,264 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package applicationdiscoveryservice + +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/applicationdiscoveryservice/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes one or more agents or collectors as specified by ID. Deleting an agent +// or collector does not delete the previously discovered data. To delete the data +// collected, use StartBatchDeleteConfigurationTask . +func (c *Client) BatchDeleteAgents(ctx context.Context, params *BatchDeleteAgentsInput, optFns ...func(*Options)) (*BatchDeleteAgentsOutput, error) { + if params == nil { + params = &BatchDeleteAgentsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchDeleteAgents", params, optFns, c.addOperationBatchDeleteAgentsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchDeleteAgentsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchDeleteAgentsInput struct { + + // The list of agents to delete. + // + // This member is required. + DeleteAgents []types.DeleteAgent + + noSmithyDocumentSerde +} + +type BatchDeleteAgentsOutput struct { + + // A list of agent IDs that failed to delete during the deletion task, each paired + // with an error message. + Errors []types.BatchDeleteAgentError + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchDeleteAgentsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchDeleteAgents{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchDeleteAgents{}, 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 = addBatchDeleteAgentsResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpBatchDeleteAgentsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchDeleteAgents(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_opBatchDeleteAgents(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "discovery", + OperationName: "BatchDeleteAgents", + } +} + +type opBatchDeleteAgentsResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opBatchDeleteAgentsResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opBatchDeleteAgentsResolveEndpointMiddleware) 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 := "discovery" + 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 = "discovery" + } 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("discovery") + } + 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 addBatchDeleteAgentsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opBatchDeleteAgentsResolveEndpointMiddleware{ + 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/applicationdiscoveryservice/api_op_BatchDeleteImportData.go b/service/applicationdiscoveryservice/api_op_BatchDeleteImportData.go index 96d65aa197b..be61016ff0d 100644 --- a/service/applicationdiscoveryservice/api_op_BatchDeleteImportData.go +++ b/service/applicationdiscoveryservice/api_op_BatchDeleteImportData.go @@ -46,6 +46,9 @@ type BatchDeleteImportDataInput struct { // This member is required. ImportTaskIds []string + // Set to true to remove the deleted import task from DescribeImportTasks . + DeleteHistory bool + noSmithyDocumentSerde } diff --git a/service/applicationdiscoveryservice/api_op_DescribeAgents.go b/service/applicationdiscoveryservice/api_op_DescribeAgents.go index d6fd94127a0..5183694b0ff 100644 --- a/service/applicationdiscoveryservice/api_op_DescribeAgents.go +++ b/service/applicationdiscoveryservice/api_op_DescribeAgents.go @@ -154,6 +154,93 @@ func (c *Client) addOperationDescribeAgentsMiddlewares(stack *middleware.Stack, return nil } +// DescribeAgentsAPIClient is a client that implements the DescribeAgents +// operation. +type DescribeAgentsAPIClient interface { + DescribeAgents(context.Context, *DescribeAgentsInput, ...func(*Options)) (*DescribeAgentsOutput, error) +} + +var _ DescribeAgentsAPIClient = (*Client)(nil) + +// DescribeAgentsPaginatorOptions is the paginator options for DescribeAgents +type DescribeAgentsPaginatorOptions struct { + // The total number of agents/collectors to return in a single page of output. The + // maximum value is 100. + 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 +} + +// DescribeAgentsPaginator is a paginator for DescribeAgents +type DescribeAgentsPaginator struct { + options DescribeAgentsPaginatorOptions + client DescribeAgentsAPIClient + params *DescribeAgentsInput + nextToken *string + firstPage bool +} + +// NewDescribeAgentsPaginator returns a new DescribeAgentsPaginator +func NewDescribeAgentsPaginator(client DescribeAgentsAPIClient, params *DescribeAgentsInput, optFns ...func(*DescribeAgentsPaginatorOptions)) *DescribeAgentsPaginator { + if params == nil { + params = &DescribeAgentsInput{} + } + + options := DescribeAgentsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeAgentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAgentsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeAgents page. +func (p *DescribeAgentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAgentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.DescribeAgents(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_opDescribeAgents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationdiscoveryservice/api_op_DescribeBatchDeleteConfigurationTask.go b/service/applicationdiscoveryservice/api_op_DescribeBatchDeleteConfigurationTask.go new file mode 100644 index 00000000000..cd23cc275a1 --- /dev/null +++ b/service/applicationdiscoveryservice/api_op_DescribeBatchDeleteConfigurationTask.go @@ -0,0 +1,263 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package applicationdiscoveryservice + +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/applicationdiscoveryservice/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Takes a unique deletion task identifier as input and returns metadata about a +// configuration deletion task. +func (c *Client) DescribeBatchDeleteConfigurationTask(ctx context.Context, params *DescribeBatchDeleteConfigurationTaskInput, optFns ...func(*Options)) (*DescribeBatchDeleteConfigurationTaskOutput, error) { + if params == nil { + params = &DescribeBatchDeleteConfigurationTaskInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeBatchDeleteConfigurationTask", params, optFns, c.addOperationDescribeBatchDeleteConfigurationTaskMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeBatchDeleteConfigurationTaskOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeBatchDeleteConfigurationTaskInput struct { + + // The ID of the task to delete. + // + // This member is required. + TaskId *string + + noSmithyDocumentSerde +} + +type DescribeBatchDeleteConfigurationTaskOutput struct { + + // The BatchDeleteConfigurationTask that represents the deletion task being + // executed. + Task *types.BatchDeleteConfigurationTask + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeBatchDeleteConfigurationTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeBatchDeleteConfigurationTask{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeBatchDeleteConfigurationTask{}, 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 = addDescribeBatchDeleteConfigurationTaskResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDescribeBatchDeleteConfigurationTaskValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeBatchDeleteConfigurationTask(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_opDescribeBatchDeleteConfigurationTask(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "discovery", + OperationName: "DescribeBatchDeleteConfigurationTask", + } +} + +type opDescribeBatchDeleteConfigurationTaskResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDescribeBatchDeleteConfigurationTaskResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDescribeBatchDeleteConfigurationTaskResolveEndpointMiddleware) 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 := "discovery" + 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 = "discovery" + } 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("discovery") + } + 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 addDescribeBatchDeleteConfigurationTaskResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDescribeBatchDeleteConfigurationTaskResolveEndpointMiddleware{ + 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/applicationdiscoveryservice/api_op_DescribeExportConfigurations.go b/service/applicationdiscoveryservice/api_op_DescribeExportConfigurations.go index a478509b333..c822002051e 100644 --- a/service/applicationdiscoveryservice/api_op_DescribeExportConfigurations.go +++ b/service/applicationdiscoveryservice/api_op_DescribeExportConfigurations.go @@ -136,6 +136,96 @@ func (c *Client) addOperationDescribeExportConfigurationsMiddlewares(stack *midd return nil } +// DescribeExportConfigurationsAPIClient is a client that implements the +// DescribeExportConfigurations operation. +type DescribeExportConfigurationsAPIClient interface { + DescribeExportConfigurations(context.Context, *DescribeExportConfigurationsInput, ...func(*Options)) (*DescribeExportConfigurationsOutput, error) +} + +var _ DescribeExportConfigurationsAPIClient = (*Client)(nil) + +// DescribeExportConfigurationsPaginatorOptions is the paginator options for +// DescribeExportConfigurations +type DescribeExportConfigurationsPaginatorOptions struct { + // A number between 1 and 100 specifying the maximum number of continuous export + // descriptions returned. + 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 +} + +// DescribeExportConfigurationsPaginator is a paginator for +// DescribeExportConfigurations +type DescribeExportConfigurationsPaginator struct { + options DescribeExportConfigurationsPaginatorOptions + client DescribeExportConfigurationsAPIClient + params *DescribeExportConfigurationsInput + nextToken *string + firstPage bool +} + +// NewDescribeExportConfigurationsPaginator returns a new +// DescribeExportConfigurationsPaginator +func NewDescribeExportConfigurationsPaginator(client DescribeExportConfigurationsAPIClient, params *DescribeExportConfigurationsInput, optFns ...func(*DescribeExportConfigurationsPaginatorOptions)) *DescribeExportConfigurationsPaginator { + if params == nil { + params = &DescribeExportConfigurationsInput{} + } + + options := DescribeExportConfigurationsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeExportConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeExportConfigurationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeExportConfigurations page. +func (p *DescribeExportConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeExportConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.DescribeExportConfigurations(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_opDescribeExportConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationdiscoveryservice/api_op_DescribeExportTasks.go b/service/applicationdiscoveryservice/api_op_DescribeExportTasks.go index cb04eccdc89..8773ea786c7 100644 --- a/service/applicationdiscoveryservice/api_op_DescribeExportTasks.go +++ b/service/applicationdiscoveryservice/api_op_DescribeExportTasks.go @@ -151,6 +151,95 @@ func (c *Client) addOperationDescribeExportTasksMiddlewares(stack *middleware.St return nil } +// DescribeExportTasksAPIClient is a client that implements the +// DescribeExportTasks operation. +type DescribeExportTasksAPIClient interface { + DescribeExportTasks(context.Context, *DescribeExportTasksInput, ...func(*Options)) (*DescribeExportTasksOutput, error) +} + +var _ DescribeExportTasksAPIClient = (*Client)(nil) + +// DescribeExportTasksPaginatorOptions is the paginator options for +// DescribeExportTasks +type DescribeExportTasksPaginatorOptions struct { + // The maximum number of volume results returned by DescribeExportTasks in + // paginated output. When this parameter is used, DescribeExportTasks only returns + // maxResults results in a single page along with a nextToken response element. + 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 +} + +// DescribeExportTasksPaginator is a paginator for DescribeExportTasks +type DescribeExportTasksPaginator struct { + options DescribeExportTasksPaginatorOptions + client DescribeExportTasksAPIClient + params *DescribeExportTasksInput + nextToken *string + firstPage bool +} + +// NewDescribeExportTasksPaginator returns a new DescribeExportTasksPaginator +func NewDescribeExportTasksPaginator(client DescribeExportTasksAPIClient, params *DescribeExportTasksInput, optFns ...func(*DescribeExportTasksPaginatorOptions)) *DescribeExportTasksPaginator { + if params == nil { + params = &DescribeExportTasksInput{} + } + + options := DescribeExportTasksPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeExportTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeExportTasksPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeExportTasks page. +func (p *DescribeExportTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeExportTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.DescribeExportTasks(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_opDescribeExportTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationdiscoveryservice/api_op_DescribeTags.go b/service/applicationdiscoveryservice/api_op_DescribeTags.go index f096a8f6f4d..1d1434df9ed 100644 --- a/service/applicationdiscoveryservice/api_op_DescribeTags.go +++ b/service/applicationdiscoveryservice/api_op_DescribeTags.go @@ -147,6 +147,92 @@ func (c *Client) addOperationDescribeTagsMiddlewares(stack *middleware.Stack, op return nil } +// DescribeTagsAPIClient is a client that implements the DescribeTags operation. +type DescribeTagsAPIClient interface { + DescribeTags(context.Context, *DescribeTagsInput, ...func(*Options)) (*DescribeTagsOutput, error) +} + +var _ DescribeTagsAPIClient = (*Client)(nil) + +// DescribeTagsPaginatorOptions is the paginator options for DescribeTags +type DescribeTagsPaginatorOptions struct { + // The total number of items to return in a single page of output. The maximum + // value is 100. + 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 +} + +// DescribeTagsPaginator is a paginator for DescribeTags +type DescribeTagsPaginator struct { + options DescribeTagsPaginatorOptions + client DescribeTagsAPIClient + params *DescribeTagsInput + nextToken *string + firstPage bool +} + +// NewDescribeTagsPaginator returns a new DescribeTagsPaginator +func NewDescribeTagsPaginator(client DescribeTagsAPIClient, params *DescribeTagsInput, optFns ...func(*DescribeTagsPaginatorOptions)) *DescribeTagsPaginator { + if params == nil { + params = &DescribeTagsInput{} + } + + options := DescribeTagsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTagsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeTags page. +func (p *DescribeTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.DescribeTags(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_opDescribeTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationdiscoveryservice/api_op_ListConfigurations.go b/service/applicationdiscoveryservice/api_op_ListConfigurations.go index d7b8e2256e9..5694df89796 100644 --- a/service/applicationdiscoveryservice/api_op_ListConfigurations.go +++ b/service/applicationdiscoveryservice/api_op_ListConfigurations.go @@ -160,6 +160,93 @@ func (c *Client) addOperationListConfigurationsMiddlewares(stack *middleware.Sta return nil } +// ListConfigurationsAPIClient is a client that implements the ListConfigurations +// operation. +type ListConfigurationsAPIClient interface { + ListConfigurations(context.Context, *ListConfigurationsInput, ...func(*Options)) (*ListConfigurationsOutput, error) +} + +var _ ListConfigurationsAPIClient = (*Client)(nil) + +// ListConfigurationsPaginatorOptions is the paginator options for +// ListConfigurations +type ListConfigurationsPaginatorOptions struct { + // The total number of items to return. The maximum value is 100. + 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 +} + +// ListConfigurationsPaginator is a paginator for ListConfigurations +type ListConfigurationsPaginator struct { + options ListConfigurationsPaginatorOptions + client ListConfigurationsAPIClient + params *ListConfigurationsInput + nextToken *string + firstPage bool +} + +// NewListConfigurationsPaginator returns a new ListConfigurationsPaginator +func NewListConfigurationsPaginator(client ListConfigurationsAPIClient, params *ListConfigurationsInput, optFns ...func(*ListConfigurationsPaginatorOptions)) *ListConfigurationsPaginator { + if params == nil { + params = &ListConfigurationsInput{} + } + + options := ListConfigurationsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConfigurationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListConfigurations page. +func (p *ListConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListConfigurations(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_opListConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationdiscoveryservice/api_op_StartBatchDeleteConfigurationTask.go b/service/applicationdiscoveryservice/api_op_StartBatchDeleteConfigurationTask.go new file mode 100644 index 00000000000..5a10efa06e6 --- /dev/null +++ b/service/applicationdiscoveryservice/api_op_StartBatchDeleteConfigurationTask.go @@ -0,0 +1,268 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package applicationdiscoveryservice + +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/applicationdiscoveryservice/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Takes a list of configurationId as input and starts an asynchronous deletion +// task to remove the configurationItems. Returns a unique deletion task +// identifier. +func (c *Client) StartBatchDeleteConfigurationTask(ctx context.Context, params *StartBatchDeleteConfigurationTaskInput, optFns ...func(*Options)) (*StartBatchDeleteConfigurationTaskOutput, error) { + if params == nil { + params = &StartBatchDeleteConfigurationTaskInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartBatchDeleteConfigurationTask", params, optFns, c.addOperationStartBatchDeleteConfigurationTaskMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartBatchDeleteConfigurationTaskOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartBatchDeleteConfigurationTaskInput struct { + + // The list of configuration IDs that will be deleted by the task. + // + // This member is required. + ConfigurationIds []string + + // The type of configuration item to delete. Supported types are: SERVER. + // + // This member is required. + ConfigurationType types.DeletionConfigurationItemType + + noSmithyDocumentSerde +} + +type StartBatchDeleteConfigurationTaskOutput struct { + + // The unique identifier associated with the newly started deletion task. + TaskId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartBatchDeleteConfigurationTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartBatchDeleteConfigurationTask{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartBatchDeleteConfigurationTask{}, 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 = addStartBatchDeleteConfigurationTaskResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpStartBatchDeleteConfigurationTaskValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartBatchDeleteConfigurationTask(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_opStartBatchDeleteConfigurationTask(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "discovery", + OperationName: "StartBatchDeleteConfigurationTask", + } +} + +type opStartBatchDeleteConfigurationTaskResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opStartBatchDeleteConfigurationTaskResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opStartBatchDeleteConfigurationTaskResolveEndpointMiddleware) 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 := "discovery" + 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 = "discovery" + } 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("discovery") + } + 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 addStartBatchDeleteConfigurationTaskResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opStartBatchDeleteConfigurationTaskResolveEndpointMiddleware{ + 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/applicationdiscoveryservice/deserializers.go b/service/applicationdiscoveryservice/deserializers.go index ac15410c24a..b7d40f07a41 100644 --- a/service/applicationdiscoveryservice/deserializers.go +++ b/service/applicationdiscoveryservice/deserializers.go @@ -142,6 +142,126 @@ func awsAwsjson11_deserializeOpErrorAssociateConfigurationItemsToApplication(res } } +type awsAwsjson11_deserializeOpBatchDeleteAgents struct { +} + +func (*awsAwsjson11_deserializeOpBatchDeleteAgents) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpBatchDeleteAgents) 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_deserializeOpErrorBatchDeleteAgents(response, &metadata) + } + output := &BatchDeleteAgentsOutput{} + 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_deserializeOpDocumentBatchDeleteAgentsOutput(&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_deserializeOpErrorBatchDeleteAgents(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("AuthorizationErrorException", errorCode): + return awsAwsjson11_deserializeErrorAuthorizationErrorException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody) + + case strings.EqualFold("ServerInternalErrorException", errorCode): + return awsAwsjson11_deserializeErrorServerInternalErrorException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpBatchDeleteImportData struct { } @@ -886,6 +1006,126 @@ func awsAwsjson11_deserializeOpErrorDescribeAgents(response *smithyhttp.Response } } +type awsAwsjson11_deserializeOpDescribeBatchDeleteConfigurationTask struct { +} + +func (*awsAwsjson11_deserializeOpDescribeBatchDeleteConfigurationTask) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDescribeBatchDeleteConfigurationTask) 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_deserializeOpErrorDescribeBatchDeleteConfigurationTask(response, &metadata) + } + output := &DescribeBatchDeleteConfigurationTaskOutput{} + 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_deserializeOpDocumentDescribeBatchDeleteConfigurationTaskOutput(&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_deserializeOpErrorDescribeBatchDeleteConfigurationTask(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("AuthorizationErrorException", errorCode): + return awsAwsjson11_deserializeErrorAuthorizationErrorException(response, errorBody) + + case strings.EqualFold("HomeRegionNotSetException", errorCode): + return awsAwsjson11_deserializeErrorHomeRegionNotSetException(response, errorBody) + + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody) + + case strings.EqualFold("ServerInternalErrorException", errorCode): + return awsAwsjson11_deserializeErrorServerInternalErrorException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpDescribeConfigurations struct { } @@ -2257,14 +2497,14 @@ func awsAwsjson11_deserializeOpErrorListServerNeighbors(response *smithyhttp.Res } } -type awsAwsjson11_deserializeOpStartContinuousExport struct { +type awsAwsjson11_deserializeOpStartBatchDeleteConfigurationTask struct { } -func (*awsAwsjson11_deserializeOpStartContinuousExport) ID() string { +func (*awsAwsjson11_deserializeOpStartBatchDeleteConfigurationTask) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStartContinuousExport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpStartBatchDeleteConfigurationTask) 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) @@ -2278,9 +2518,9 @@ func (m *awsAwsjson11_deserializeOpStartContinuousExport) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStartContinuousExport(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorStartBatchDeleteConfigurationTask(response, &metadata) } - output := &StartContinuousExportOutput{} + output := &StartBatchDeleteConfigurationTaskOutput{} out.Result = output var buff [1024]byte @@ -2300,7 +2540,7 @@ func (m *awsAwsjson11_deserializeOpStartContinuousExport) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentStartContinuousExportOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentStartBatchDeleteConfigurationTaskOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2314,7 +2554,7 @@ func (m *awsAwsjson11_deserializeOpStartContinuousExport) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStartContinuousExport(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorStartBatchDeleteConfigurationTask(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)} @@ -2358,24 +2598,18 @@ func awsAwsjson11_deserializeOpErrorStartContinuousExport(response *smithyhttp.R case strings.EqualFold("AuthorizationErrorException", errorCode): return awsAwsjson11_deserializeErrorAuthorizationErrorException(response, errorBody) - case strings.EqualFold("ConflictErrorException", errorCode): - return awsAwsjson11_deserializeErrorConflictErrorException(response, errorBody) - case strings.EqualFold("HomeRegionNotSetException", errorCode): return awsAwsjson11_deserializeErrorHomeRegionNotSetException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("InvalidParameterValueException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) - case strings.EqualFold("ResourceInUseException", errorCode): - return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody) - case strings.EqualFold("ServerInternalErrorException", errorCode): return awsAwsjson11_deserializeErrorServerInternalErrorException(response, errorBody) @@ -2389,14 +2623,14 @@ func awsAwsjson11_deserializeOpErrorStartContinuousExport(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpStartDataCollectionByAgentIds struct { +type awsAwsjson11_deserializeOpStartContinuousExport struct { } -func (*awsAwsjson11_deserializeOpStartDataCollectionByAgentIds) ID() string { +func (*awsAwsjson11_deserializeOpStartContinuousExport) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStartDataCollectionByAgentIds) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpStartContinuousExport) 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) @@ -2410,9 +2644,9 @@ func (m *awsAwsjson11_deserializeOpStartDataCollectionByAgentIds) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStartDataCollectionByAgentIds(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorStartContinuousExport(response, &metadata) } - output := &StartDataCollectionByAgentIdsOutput{} + output := &StartContinuousExportOutput{} out.Result = output var buff [1024]byte @@ -2432,7 +2666,7 @@ func (m *awsAwsjson11_deserializeOpStartDataCollectionByAgentIds) HandleDeserial return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentStartDataCollectionByAgentIdsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentStartContinuousExportOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2446,7 +2680,139 @@ func (m *awsAwsjson11_deserializeOpStartDataCollectionByAgentIds) HandleDeserial return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStartDataCollectionByAgentIds(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorStartContinuousExport(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("AuthorizationErrorException", errorCode): + return awsAwsjson11_deserializeErrorAuthorizationErrorException(response, errorBody) + + case strings.EqualFold("ConflictErrorException", errorCode): + return awsAwsjson11_deserializeErrorConflictErrorException(response, errorBody) + + case strings.EqualFold("HomeRegionNotSetException", errorCode): + return awsAwsjson11_deserializeErrorHomeRegionNotSetException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody) + + case strings.EqualFold("OperationNotPermittedException", errorCode): + return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody) + + case strings.EqualFold("ServerInternalErrorException", errorCode): + return awsAwsjson11_deserializeErrorServerInternalErrorException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpStartDataCollectionByAgentIds struct { +} + +func (*awsAwsjson11_deserializeOpStartDataCollectionByAgentIds) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpStartDataCollectionByAgentIds) 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_deserializeOpErrorStartDataCollectionByAgentIds(response, &metadata) + } + output := &StartDataCollectionByAgentIdsOutput{} + 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_deserializeOpDocumentStartDataCollectionByAgentIdsOutput(&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_deserializeOpErrorStartDataCollectionByAgentIds(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)} @@ -3317,6 +3683,41 @@ func awsAwsjson11_deserializeErrorInvalidParameterValueException(response *smith return output } +func awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, 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 err + } + + output := &types.LimitExceededException{} + err := awsAwsjson11_deserializeDocumentLimitExceededException(&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 err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + func awsAwsjson11_deserializeErrorOperationNotPermittedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -3823,6 +4224,208 @@ func awsAwsjson11_deserializeDocumentAuthorizationErrorException(v **types.Autho return nil } +func awsAwsjson11_deserializeDocumentBatchDeleteAgentError(v **types.BatchDeleteAgentError, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BatchDeleteAgentError + if *v == nil { + sv = &types.BatchDeleteAgentError{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "agentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentId to be of type string, got %T instead", value) + } + sv.AgentId = ptr.String(jtv) + } + + case "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeleteAgentErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode = types.DeleteAgentErrorCode(jtv) + } + + case "errorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentBatchDeleteAgentErrors(v *[]types.BatchDeleteAgentError, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.BatchDeleteAgentError + if *v == nil { + cv = []types.BatchDeleteAgentError{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BatchDeleteAgentError + destAddr := &col + if err := awsAwsjson11_deserializeDocumentBatchDeleteAgentError(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentBatchDeleteConfigurationTask(v **types.BatchDeleteConfigurationTask, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BatchDeleteConfigurationTask + if *v == nil { + sv = &types.BatchDeleteConfigurationTask{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "configurationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeletionConfigurationItemType to be of type string, got %T instead", value) + } + sv.ConfigurationType = types.DeletionConfigurationItemType(jtv) + } + + case "deletedConfigurations": + if err := awsAwsjson11_deserializeDocumentConfigurationIdList(&sv.DeletedConfigurations, value); err != nil { + return err + } + + case "deletionWarnings": + if err := awsAwsjson11_deserializeDocumentDeletionWarningsList(&sv.DeletionWarnings, value); err != nil { + return err + } + + case "endTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected TimeStamp to be a JSON Number, got %T instead", value) + + } + } + + case "failedConfigurations": + if err := awsAwsjson11_deserializeDocumentFailedConfigurationList(&sv.FailedConfigurations, value); err != nil { + return err + } + + case "requestedConfigurations": + if err := awsAwsjson11_deserializeDocumentConfigurationIdList(&sv.RequestedConfigurations, value); err != nil { + return err + } + + case "startTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected TimeStamp to be a JSON Number, got %T instead", value) + + } + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BatchDeleteConfigurationTaskStatus to be of type string, got %T instead", value) + } + sv.Status = types.BatchDeleteConfigurationTaskStatus(jtv) + } + + case "taskId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UUID to be of type string, got %T instead", value) + } + sv.TaskId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentBatchDeleteImportDataError(v **types.BatchDeleteImportDataError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3951,6 +4554,42 @@ func awsAwsjson11_deserializeDocumentConfiguration(v *map[string]string, value i return nil } +func awsAwsjson11_deserializeDocumentConfigurationIdList(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 ConfigurationId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentConfigurations(v *[]map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4753,17 +5392,79 @@ func awsAwsjson11_deserializeDocumentCustomerMeCollectorInfo(v **types.CustomerM sv.UnhealthyMeCollectors = int32(i64) } - case "unknownMeCollectors": + case "unknownMeCollectors": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.UnknownMeCollectors = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDeletionWarning(v **types.DeletionWarning, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DeletionWarning + if *v == nil { + sv = &types.DeletionWarning{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "configurationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConfigurationId to be of type string, got %T instead", value) + } + sv.ConfigurationId = ptr.String(jtv) + } + + case "warningCode": 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 WarningCode to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.UnknownMeCollectors = int32(i64) + sv.WarningCode = int32(i64) + } + + case "warningText": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WarningText to be of type string, got %T instead", value) + } + sv.WarningText = ptr.String(jtv) } default: @@ -4775,6 +5476,40 @@ func awsAwsjson11_deserializeDocumentCustomerMeCollectorInfo(v **types.CustomerM return nil } +func awsAwsjson11_deserializeDocumentDeletionWarningsList(v *[]types.DeletionWarning, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.DeletionWarning + if *v == nil { + cv = []types.DeletionWarning{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DeletionWarning + destAddr := &col + if err := awsAwsjson11_deserializeDocumentDeletionWarning(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentDescribeConfigurationsAttribute(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5001,6 +5736,102 @@ func awsAwsjson11_deserializeDocumentExportsInfo(v *[]types.ExportInfo, value in return nil } +func awsAwsjson11_deserializeDocumentFailedConfiguration(v **types.FailedConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FailedConfiguration + if *v == nil { + sv = &types.FailedConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "configurationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConfigurationId to be of type string, got %T instead", value) + } + sv.ConfigurationId = ptr.String(jtv) + } + + case "errorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + case "errorStatusCode": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ErrorStatusCode to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ErrorStatusCode = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentFailedConfigurationList(v *[]types.FailedConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.FailedConfiguration + if *v == nil { + cv = []types.FailedConfiguration{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FailedConfiguration + destAddr := &col + if err := awsAwsjson11_deserializeDocumentFailedConfiguration(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentHomeRegionNotSetException(v **types.HomeRegionNotSetException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5340,6 +6171,46 @@ func awsAwsjson11_deserializeDocumentInvalidParameterValueException(v **types.In return nil } +func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LimitExceededException + if *v == nil { + sv = &types.LimitExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentNeighborConnectionDetail(v **types.NeighborConnectionDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5685,6 +6556,42 @@ func awsAwsjson11_deserializeOpDocumentAssociateConfigurationItemsToApplicationO return nil } +func awsAwsjson11_deserializeOpDocumentBatchDeleteAgentsOutput(v **BatchDeleteAgentsOutput, 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 *BatchDeleteAgentsOutput + if *v == nil { + sv = &BatchDeleteAgentsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errors": + if err := awsAwsjson11_deserializeDocumentBatchDeleteAgentErrors(&sv.Errors, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentBatchDeleteImportDataOutput(v **BatchDeleteImportDataOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5899,6 +6806,42 @@ func awsAwsjson11_deserializeOpDocumentDescribeAgentsOutput(v **DescribeAgentsOu return nil } +func awsAwsjson11_deserializeOpDocumentDescribeBatchDeleteConfigurationTaskOutput(v **DescribeBatchDeleteConfigurationTaskOutput, 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 *DescribeBatchDeleteConfigurationTaskOutput + if *v == nil { + sv = &DescribeBatchDeleteConfigurationTaskOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "task": + if err := awsAwsjson11_deserializeDocumentBatchDeleteConfigurationTask(&sv.Task, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDescribeConfigurationsOutput(v **DescribeConfigurationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6437,6 +7380,46 @@ func awsAwsjson11_deserializeOpDocumentListServerNeighborsOutput(v **ListServerN return nil } +func awsAwsjson11_deserializeOpDocumentStartBatchDeleteConfigurationTaskOutput(v **StartBatchDeleteConfigurationTaskOutput, 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 *StartBatchDeleteConfigurationTaskOutput + if *v == nil { + sv = &StartBatchDeleteConfigurationTaskOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "taskId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UUID to be of type string, got %T instead", value) + } + sv.TaskId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentStartContinuousExportOutput(v **StartContinuousExportOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/applicationdiscoveryservice/generated.json b/service/applicationdiscoveryservice/generated.json index adb3bab0bcf..b009d81aeb7 100644 --- a/service/applicationdiscoveryservice/generated.json +++ b/service/applicationdiscoveryservice/generated.json @@ -10,12 +10,14 @@ "api_client.go", "api_client_test.go", "api_op_AssociateConfigurationItemsToApplication.go", + "api_op_BatchDeleteAgents.go", "api_op_BatchDeleteImportData.go", "api_op_CreateApplication.go", "api_op_CreateTags.go", "api_op_DeleteApplications.go", "api_op_DeleteTags.go", "api_op_DescribeAgents.go", + "api_op_DescribeBatchDeleteConfigurationTask.go", "api_op_DescribeConfigurations.go", "api_op_DescribeContinuousExports.go", "api_op_DescribeExportConfigurations.go", @@ -27,6 +29,7 @@ "api_op_GetDiscoverySummary.go", "api_op_ListConfigurations.go", "api_op_ListServerNeighbors.go", + "api_op_StartBatchDeleteConfigurationTask.go", "api_op_StartContinuousExport.go", "api_op_StartDataCollectionByAgentIds.go", "api_op_StartExportTask.go", diff --git a/service/applicationdiscoveryservice/serializers.go b/service/applicationdiscoveryservice/serializers.go index ca089ebdb10..3faed168779 100644 --- a/service/applicationdiscoveryservice/serializers.go +++ b/service/applicationdiscoveryservice/serializers.go @@ -73,6 +73,61 @@ func (m *awsAwsjson11_serializeOpAssociateConfigurationItemsToApplication) Handl return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpBatchDeleteAgents struct { +} + +func (*awsAwsjson11_serializeOpBatchDeleteAgents) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpBatchDeleteAgents) 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.(*BatchDeleteAgentsInput) + _ = 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("AWSPoseidonService_V2015_11_01.BatchDeleteAgents") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentBatchDeleteAgentsInput(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_serializeOpBatchDeleteImportData struct { } @@ -403,6 +458,61 @@ func (m *awsAwsjson11_serializeOpDescribeAgents) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDescribeBatchDeleteConfigurationTask struct { +} + +func (*awsAwsjson11_serializeOpDescribeBatchDeleteConfigurationTask) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDescribeBatchDeleteConfigurationTask) 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.(*DescribeBatchDeleteConfigurationTaskInput) + _ = 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("AWSPoseidonService_V2015_11_01.DescribeBatchDeleteConfigurationTask") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribeBatchDeleteConfigurationTaskInput(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_serializeOpDescribeConfigurations struct { } @@ -1003,6 +1113,61 @@ func (m *awsAwsjson11_serializeOpListServerNeighbors) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpStartBatchDeleteConfigurationTask struct { +} + +func (*awsAwsjson11_serializeOpStartBatchDeleteConfigurationTask) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpStartBatchDeleteConfigurationTask) 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.(*StartBatchDeleteConfigurationTaskInput) + _ = 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("AWSPoseidonService_V2015_11_01.StartBatchDeleteConfigurationTask") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentStartBatchDeleteConfigurationTaskInput(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_serializeOpStartContinuousExport struct { } @@ -1431,6 +1596,36 @@ func awsAwsjson11_serializeDocumentContinuousExportIds(v []string, value smithyj return nil } +func awsAwsjson11_serializeDocumentDeleteAgent(v *types.DeleteAgent, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AgentId != nil { + ok := object.Key("agentId") + ok.String(*v.AgentId) + } + + if v.Force { + ok := object.Key("force") + ok.Boolean(v.Force) + } + + return nil +} + +func awsAwsjson11_serializeDocumentDeleteAgents(v []types.DeleteAgent, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentDeleteAgent(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeDocumentDescribeImportTasksFilterList(v []types.ImportTaskFilter, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -1834,10 +2029,29 @@ func awsAwsjson11_serializeOpDocumentAssociateConfigurationItemsToApplicationInp return nil } +func awsAwsjson11_serializeOpDocumentBatchDeleteAgentsInput(v *BatchDeleteAgentsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DeleteAgents != nil { + ok := object.Key("deleteAgents") + if err := awsAwsjson11_serializeDocumentDeleteAgents(v.DeleteAgents, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentBatchDeleteImportDataInput(v *BatchDeleteImportDataInput, value smithyjson.Value) error { object := value.Object() defer object.Close() + if v.DeleteHistory { + ok := object.Key("deleteHistory") + ok.Boolean(v.DeleteHistory) + } + if v.ImportTaskIds != nil { ok := object.Key("importTaskIds") if err := awsAwsjson11_serializeDocumentToDeleteIdentifierList(v.ImportTaskIds, ok); err != nil { @@ -1952,6 +2166,18 @@ func awsAwsjson11_serializeOpDocumentDescribeAgentsInput(v *DescribeAgentsInput, return nil } +func awsAwsjson11_serializeOpDocumentDescribeBatchDeleteConfigurationTaskInput(v *DescribeBatchDeleteConfigurationTaskInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TaskId != nil { + ok := object.Key("taskId") + ok.String(*v.TaskId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDescribeConfigurationsInput(v *DescribeConfigurationsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2189,6 +2415,25 @@ func awsAwsjson11_serializeOpDocumentListServerNeighborsInput(v *ListServerNeigh return nil } +func awsAwsjson11_serializeOpDocumentStartBatchDeleteConfigurationTaskInput(v *StartBatchDeleteConfigurationTaskInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ConfigurationIds != nil { + ok := object.Key("configurationIds") + if err := awsAwsjson11_serializeDocumentConfigurationIdList(v.ConfigurationIds, ok); err != nil { + return err + } + } + + if len(v.ConfigurationType) > 0 { + ok := object.Key("configurationType") + ok.String(string(v.ConfigurationType)) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentStartContinuousExportInput(v *StartContinuousExportInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/applicationdiscoveryservice/types/enums.go b/service/applicationdiscoveryservice/types/enums.go index 402e7af581b..583228aad56 100644 --- a/service/applicationdiscoveryservice/types/enums.go +++ b/service/applicationdiscoveryservice/types/enums.go @@ -28,6 +28,31 @@ func (AgentStatus) Values() []AgentStatus { } } +type BatchDeleteConfigurationTaskStatus string + +// Enum values for BatchDeleteConfigurationTaskStatus +const ( + BatchDeleteConfigurationTaskStatusInitializing BatchDeleteConfigurationTaskStatus = "INITIALIZING" + BatchDeleteConfigurationTaskStatusValidating BatchDeleteConfigurationTaskStatus = "VALIDATING" + BatchDeleteConfigurationTaskStatusDeleting BatchDeleteConfigurationTaskStatus = "DELETING" + BatchDeleteConfigurationTaskStatusCompleted BatchDeleteConfigurationTaskStatus = "COMPLETED" + BatchDeleteConfigurationTaskStatusFailed BatchDeleteConfigurationTaskStatus = "FAILED" +) + +// Values returns all known values for BatchDeleteConfigurationTaskStatus. Note +// that this can be expanded in the future, and so it is only as up to date as the +// client. The ordering of this slice is not guaranteed to be stable across +// updates. +func (BatchDeleteConfigurationTaskStatus) Values() []BatchDeleteConfigurationTaskStatus { + return []BatchDeleteConfigurationTaskStatus{ + "INITIALIZING", + "VALIDATING", + "DELETING", + "COMPLETED", + "FAILED", + } +} + type BatchDeleteImportDataErrorCode string // Enum values for BatchDeleteImportDataErrorCode @@ -115,6 +140,43 @@ func (DataSource) Values() []DataSource { } } +type DeleteAgentErrorCode string + +// Enum values for DeleteAgentErrorCode +const ( + DeleteAgentErrorCodeNotFound DeleteAgentErrorCode = "NOT_FOUND" + DeleteAgentErrorCodeInternalServerError DeleteAgentErrorCode = "INTERNAL_SERVER_ERROR" + DeleteAgentErrorCodeAgentInUse DeleteAgentErrorCode = "AGENT_IN_USE" +) + +// Values returns all known values for DeleteAgentErrorCode. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (DeleteAgentErrorCode) Values() []DeleteAgentErrorCode { + return []DeleteAgentErrorCode{ + "NOT_FOUND", + "INTERNAL_SERVER_ERROR", + "AGENT_IN_USE", + } +} + +type DeletionConfigurationItemType string + +// Enum values for DeletionConfigurationItemType +const ( + DeletionConfigurationItemTypeServer DeletionConfigurationItemType = "SERVER" +) + +// Values returns all known values for DeletionConfigurationItemType. Note that +// this can be expanded in the future, and so it is only as up to date as the +// client. The ordering of this slice is not guaranteed to be stable across +// updates. +func (DeletionConfigurationItemType) Values() []DeletionConfigurationItemType { + return []DeletionConfigurationItemType{ + "SERVER", + } +} + type ExportDataFormat string // Enum values for ExportDataFormat diff --git a/service/applicationdiscoveryservice/types/errors.go b/service/applicationdiscoveryservice/types/errors.go index 304264226fd..13b974a92ac 100644 --- a/service/applicationdiscoveryservice/types/errors.go +++ b/service/applicationdiscoveryservice/types/errors.go @@ -139,6 +139,32 @@ func (e *InvalidParameterValueException) ErrorCode() string { } func (e *InvalidParameterValueException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The limit of 200 configuration IDs per request has been exceeded. +type LimitExceededException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *LimitExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *LimitExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "LimitExceededException" + } + return *e.ErrorCodeOverride +} +func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // This operation is not permitted. type OperationNotPermittedException struct { Message *string diff --git a/service/applicationdiscoveryservice/types/types.go b/service/applicationdiscoveryservice/types/types.go index a0e2efee802..34747f9bd2e 100644 --- a/service/applicationdiscoveryservice/types/types.go +++ b/service/applicationdiscoveryservice/types/types.go @@ -78,6 +78,68 @@ type AgentNetworkInfo struct { noSmithyDocumentSerde } +// An object representing the agent or data collector that failed to delete, each +// containing agentId, errorMessage, and errorCode. +type BatchDeleteAgentError struct { + + // The ID of the agent or data collector to delete. + // + // This member is required. + AgentId *string + + // The type of error that occurred for the delete failed agent. Valid status are: + // AGENT_IN_USE | NOT_FOUND | INTERNAL_SERVER_ERROR. + // + // This member is required. + ErrorCode DeleteAgentErrorCode + + // The description of the error that occurred for the delete failed agent. + // + // This member is required. + ErrorMessage *string + + noSmithyDocumentSerde +} + +// A metadata object that represents the deletion task being executed. +type BatchDeleteConfigurationTask struct { + + // The type of configuration item to delete. Supported types are: SERVER. + ConfigurationType DeletionConfigurationItemType + + // The list of configuration IDs that were successfully deleted by the deletion + // task. + DeletedConfigurations []string + + // A list of configuration IDs that produced warnings regarding their deletion, + // paired with a warning message. + DeletionWarnings []DeletionWarning + + // An epoch seconds timestamp (UTC) of when the deletion task was completed or + // failed. + EndTime *time.Time + + // A list of configuration IDs that failed to delete during the deletion task, + // each paired with an error message. + FailedConfigurations []FailedConfiguration + + // The list of configuration IDs that were originally requested to be deleted by + // the deletion task. + RequestedConfigurations []string + + // An epoch seconds timestamp (UTC) of when the deletion task was started. + StartTime *time.Time + + // The current execution status of the deletion task. Valid status are: + // INITIALIZING | VALIDATING | DELETING | COMPLETED | FAILED. + Status BatchDeleteConfigurationTaskStatus + + // The deletion task's unique identifier. + TaskId *string + + noSmithyDocumentSerde +} + // Error messages returned for each import task that you deleted as a response for // this command. type BatchDeleteImportDataError struct { @@ -375,6 +437,39 @@ type CustomerMeCollectorInfo struct { noSmithyDocumentSerde } +// An object representing the agent or data collector to be deleted along with the +// optional configurations for error handling. +type DeleteAgent struct { + + // The ID of the agent or data collector to delete. + // + // This member is required. + AgentId *string + + // Optional flag used to force delete an agent or data collector. It is needed to + // delete any agent in HEALTHY/UNHEALTHY/RUNNING status. Note that deleting an + // agent that is actively reporting health causes it to be re-registered with a + // different agent ID after data collector re-connects with Amazon Web Services. + Force bool + + noSmithyDocumentSerde +} + +// A configuration ID paired with a warning message. +type DeletionWarning struct { + + // The unique identifier of the configuration that produced a warning. + ConfigurationId *string + + // The integer warning code associated with the warning message. + WarningCode int32 + + // A descriptive message of the warning the associated configuration ID produced. + WarningText *string + + noSmithyDocumentSerde +} + // Indicates that the exported data must include EC2 instance type matches for // on-premises servers that are discovered through Amazon Web Services Application // Discovery Service. @@ -502,6 +597,22 @@ type ExportPreferencesMemberEc2RecommendationsPreferences struct { func (*ExportPreferencesMemberEc2RecommendationsPreferences) isExportPreferences() {} +// A configuration ID paired with an error message. +type FailedConfiguration struct { + + // The unique identifier of the configuration the failed to delete. + ConfigurationId *string + + // A descriptive message indicating why the associated configuration failed to + // delete. + ErrorMessage *string + + // The integer error code associated with the error message. + ErrorStatusCode int32 + + noSmithyDocumentSerde +} + // A filter that can use conditional operators. For more information about // filters, see Querying Discovered Configuration Items (https://docs.aws.amazon.com/application-discovery/latest/userguide/discovery-api-queries.html) // in the Amazon Web Services Application Discovery Service User Guide. diff --git a/service/applicationdiscoveryservice/validators.go b/service/applicationdiscoveryservice/validators.go index 79a53cd0b90..4abaa2bf6dd 100644 --- a/service/applicationdiscoveryservice/validators.go +++ b/service/applicationdiscoveryservice/validators.go @@ -30,6 +30,26 @@ func (m *validateOpAssociateConfigurationItemsToApplication) HandleInitialize(ct return next.HandleInitialize(ctx, in) } +type validateOpBatchDeleteAgents struct { +} + +func (*validateOpBatchDeleteAgents) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchDeleteAgents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchDeleteAgentsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchDeleteAgentsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpBatchDeleteImportData struct { } @@ -150,6 +170,26 @@ func (m *validateOpDescribeAgents) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpDescribeBatchDeleteConfigurationTask struct { +} + +func (*validateOpDescribeBatchDeleteConfigurationTask) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeBatchDeleteConfigurationTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeBatchDeleteConfigurationTaskInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeBatchDeleteConfigurationTaskInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeConfigurations struct { } @@ -270,6 +310,26 @@ func (m *validateOpListServerNeighbors) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpStartBatchDeleteConfigurationTask struct { +} + +func (*validateOpStartBatchDeleteConfigurationTask) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartBatchDeleteConfigurationTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartBatchDeleteConfigurationTaskInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartBatchDeleteConfigurationTaskInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpStartDataCollectionByAgentIds struct { } @@ -394,6 +454,10 @@ func addOpAssociateConfigurationItemsToApplicationValidationMiddleware(stack *mi return stack.Initialize.Add(&validateOpAssociateConfigurationItemsToApplication{}, middleware.After) } +func addOpBatchDeleteAgentsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchDeleteAgents{}, middleware.After) +} + func addOpBatchDeleteImportDataValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpBatchDeleteImportData{}, middleware.After) } @@ -418,6 +482,10 @@ func addOpDescribeAgentsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeAgents{}, middleware.After) } +func addOpDescribeBatchDeleteConfigurationTaskValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeBatchDeleteConfigurationTask{}, middleware.After) +} + func addOpDescribeConfigurationsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeConfigurations{}, middleware.After) } @@ -442,6 +510,10 @@ func addOpListServerNeighborsValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpListServerNeighbors{}, middleware.After) } +func addOpStartBatchDeleteConfigurationTaskValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartBatchDeleteConfigurationTask{}, middleware.After) +} + func addOpStartDataCollectionByAgentIdsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartDataCollectionByAgentIds{}, middleware.After) } @@ -466,6 +538,38 @@ func addOpUpdateApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateApplication{}, middleware.After) } +func validateDeleteAgent(v *types.DeleteAgent) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAgent"} + if v.AgentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AgentId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateDeleteAgents(v []types.DeleteAgent) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAgents"} + for i := range v { + if err := validateDeleteAgent(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateEc2RecommendationsExportPreferences(v *types.Ec2RecommendationsExportPreferences) error { if v == nil { return nil @@ -719,6 +823,25 @@ func validateOpAssociateConfigurationItemsToApplicationInput(v *AssociateConfigu } } +func validateOpBatchDeleteAgentsInput(v *BatchDeleteAgentsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchDeleteAgentsInput"} + if v.DeleteAgents == nil { + invalidParams.Add(smithy.NewErrParamRequired("DeleteAgents")) + } else if v.DeleteAgents != nil { + if err := validateDeleteAgents(v.DeleteAgents); err != nil { + invalidParams.AddNested("DeleteAgents", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpBatchDeleteImportDataInput(v *BatchDeleteImportDataInput) error { if v == nil { return nil @@ -823,6 +946,21 @@ func validateOpDescribeAgentsInput(v *DescribeAgentsInput) error { } } +func validateOpDescribeBatchDeleteConfigurationTaskInput(v *DescribeBatchDeleteConfigurationTaskInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeBatchDeleteConfigurationTaskInput"} + if v.TaskId == nil { + invalidParams.Add(smithy.NewErrParamRequired("TaskId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeConfigurationsInput(v *DescribeConfigurationsInput) error { if v == nil { return nil @@ -930,6 +1068,24 @@ func validateOpListServerNeighborsInput(v *ListServerNeighborsInput) error { } } +func validateOpStartBatchDeleteConfigurationTaskInput(v *StartBatchDeleteConfigurationTaskInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartBatchDeleteConfigurationTaskInput"} + if len(v.ConfigurationType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ConfigurationType")) + } + if v.ConfigurationIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConfigurationIds")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpStartDataCollectionByAgentIdsInput(v *StartDataCollectionByAgentIdsInput) error { if v == nil { return nil diff --git a/service/connect/api_op_ActivateEvaluationForm.go b/service/connect/api_op_ActivateEvaluationForm.go index 8150548a233..894a4e336fb 100644 --- a/service/connect/api_op_ActivateEvaluationForm.go +++ b/service/connect/api_op_ActivateEvaluationForm.go @@ -44,7 +44,7 @@ type ActivateEvaluationFormInput struct { // provided, the latest version of the evaluation form is activated. // // This member is required. - EvaluationFormVersion *int32 + EvaluationFormVersion int32 // The identifier of the Amazon Connect instance. You can find the instance ID (https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html) // in the Amazon Resource Name (ARN) of the instance. @@ -70,7 +70,7 @@ type ActivateEvaluationFormOutput struct { // A version of the evaluation form. // // This member is required. - EvaluationFormVersion *int32 + EvaluationFormVersion int32 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/connect/api_op_CreateContactFlow.go b/service/connect/api_op_CreateContactFlow.go index 642d72ead81..996a946ba93 100644 --- a/service/connect/api_op_CreateContactFlow.go +++ b/service/connect/api_op_CreateContactFlow.go @@ -37,7 +37,7 @@ func (c *Client) CreateContactFlow(ctx context.Context, params *CreateContactFlo type CreateContactFlowInput struct { // The JSON string that represents the content of the flow. For an example, see - // Example contact flow in Amazon Connect Flow language (https://docs.aws.amazon.com/connect/latest/APIReference/flow-language-example.html) + // Example flow in Amazon Connect Flow language (https://docs.aws.amazon.com/connect/latest/APIReference/flow-language-example.html) // . Length Constraints: Minimum length of 1. Maximum length of 256000. // // This member is required. diff --git a/service/connect/api_op_CreateContactFlowModule.go b/service/connect/api_op_CreateContactFlowModule.go index 7599b59edbe..e37d2978021 100644 --- a/service/connect/api_op_CreateContactFlowModule.go +++ b/service/connect/api_op_CreateContactFlowModule.go @@ -33,7 +33,9 @@ func (c *Client) CreateContactFlowModule(ctx context.Context, params *CreateCont type CreateContactFlowModuleInput struct { - // The content of the flow module. + // The JSON string that represents the content of the flow. For an example, see + // Example flow in Amazon Connect Flow language (https://docs.aws.amazon.com/connect/latest/APIReference/flow-language-example.html) + // . // // This member is required. Content *string diff --git a/service/connect/api_op_CreateTrafficDistributionGroup.go b/service/connect/api_op_CreateTrafficDistributionGroup.go index e5b37b51393..b9a80c3abb0 100644 --- a/service/connect/api_op_CreateTrafficDistributionGroup.go +++ b/service/connect/api_op_CreateTrafficDistributionGroup.go @@ -16,8 +16,8 @@ import ( ) // Creates a traffic distribution group given an Amazon Connect instance that has -// been replicated. You can change the SignInConfig distribution only for a -// default TrafficDistributionGroup (see the IsDefault parameter in the +// been replicated. The SignInConfig distribution is available only on a default +// TrafficDistributionGroup (see the IsDefault parameter in the // TrafficDistributionGroup (https://docs.aws.amazon.com/connect/latest/APIReference/API_TrafficDistributionGroup.html) // data type). If you call UpdateTrafficDistribution with a modified SignInConfig // and a non-default TrafficDistributionGroup , an InvalidRequestException is diff --git a/service/connect/api_op_CreateUser.go b/service/connect/api_op_CreateUser.go index fe84179326c..f35c297f01c 100644 --- a/service/connect/api_op_CreateUser.go +++ b/service/connect/api_op_CreateUser.go @@ -16,9 +16,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a user account for the specified Amazon Connect instance. For -// information about how to create user accounts using the Amazon Connect console, -// see Add Users (https://docs.aws.amazon.com/connect/latest/adminguide/user-management.html) +// Creates a user account for the specified Amazon Connect instance. Certain +// UserIdentityInfo (https://docs.aws.amazon.com/connect/latest/APIReference/API_UserIdentityInfo.html) +// parameters are required in some situations. For example, Email is required if +// you are using SAML for identity management. FirstName and LastName are required +// if you are using Amazon Connect or SAML for identity management. For information +// about how to create user accounts using the Amazon Connect console, see Add +// Users (https://docs.aws.amazon.com/connect/latest/adminguide/user-management.html) // in the Amazon Connect Administrator Guide. func (c *Client) CreateUser(ctx context.Context, params *CreateUserInput, optFns ...func(*Options)) (*CreateUserOutput, error) { if params == nil { diff --git a/service/connect/api_op_DeactivateEvaluationForm.go b/service/connect/api_op_DeactivateEvaluationForm.go index b804ab0324d..656a8c024f1 100644 --- a/service/connect/api_op_DeactivateEvaluationForm.go +++ b/service/connect/api_op_DeactivateEvaluationForm.go @@ -44,7 +44,7 @@ type DeactivateEvaluationFormInput struct { // latest version of the evaluation form is deactivated. // // This member is required. - EvaluationFormVersion *int32 + EvaluationFormVersion int32 // The identifier of the Amazon Connect instance. You can find the instance ID (https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html) // in the Amazon Resource Name (ARN) of the instance. @@ -70,7 +70,7 @@ type DeactivateEvaluationFormOutput struct { // The version of the deactivated evaluation form resource. // // This member is required. - EvaluationFormVersion *int32 + EvaluationFormVersion int32 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/connect/api_op_GetFederationToken.go b/service/connect/api_op_GetFederationToken.go index e8a930eee8c..63a7a598ad9 100644 --- a/service/connect/api_op_GetFederationToken.go +++ b/service/connect/api_op_GetFederationToken.go @@ -16,10 +16,15 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves a token for federation. This API doesn't support root users. If you -// try to invoke GetFederationToken with root credentials, an error message similar -// to the following one appears: Provided identity: Principal: .... User: .... -// cannot be used for federation with Amazon Connect +// Supports SAML sign-in for Amazon Connect. Retrieves a token for federation. The +// token is for the Amazon Connect user which corresponds to the IAM credentials +// that were used to invoke this action. For more information about how SAML +// sign-in works in Amazon Connect, see Configure SAML with IAM for Amazon Connect +// in the Amazon Connect Administrator Guide. (https://docs.aws.amazon.com/connect/latest/adminguide/configure-saml.html) +// This API doesn't support root users. If you try to invoke GetFederationToken +// with root credentials, an error message similar to the following one appears: +// Provided identity: Principal: .... User: .... cannot be used for federation with +// Amazon Connect func (c *Client) GetFederationToken(ctx context.Context, params *GetFederationTokenInput, optFns ...func(*Options)) (*GetFederationTokenOutput, error) { if params == nil { params = &GetFederationTokenInput{} diff --git a/service/connect/api_op_GetMetricData.go b/service/connect/api_op_GetMetricData.go index bafa3b11271..a8694972067 100644 --- a/service/connect/api_op_GetMetricData.go +++ b/service/connect/api_op_GetMetricData.go @@ -19,7 +19,14 @@ import ( // Gets historical metric data from the specified Amazon Connect instance. For a // description of each historical metric, see Historical Metrics Definitions (https://docs.aws.amazon.com/connect/latest/adminguide/historical-metrics-definitions.html) -// in the Amazon Connect Administrator Guide. +// in the Amazon Connect Administrator Guide. We recommend using the +// GetMetricDataV2 (https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html) +// API. It provides more flexibility, features, and the ability to query longer +// time ranges than GetMetricData . Use it to retrieve historical agent and contact +// metrics for the last 3 months, at varying intervals. You can also use it to +// build custom dashboards to measure historical queue and agent performance. For +// example, you can track the number of incoming contacts for the last 7 days, with +// data split by day, to see how contact volume changed per day of the week. func (c *Client) GetMetricData(ctx context.Context, params *GetMetricDataInput, optFns ...func(*Options)) (*GetMetricDataOutput, error) { if params == nil { params = &GetMetricDataInput{} diff --git a/service/connect/api_op_GetTrafficDistribution.go b/service/connect/api_op_GetTrafficDistribution.go index 34978c433b8..1f828daf714 100644 --- a/service/connect/api_op_GetTrafficDistribution.go +++ b/service/connect/api_op_GetTrafficDistribution.go @@ -56,7 +56,8 @@ type GetTrafficDistributionOutput struct { // was created. The ARN must be provided if the call is from the replicated Region. Id *string - // The distribution of allowing signing in to the instance and its replica(s). + // The distribution that determines which Amazon Web Services Regions should be + // used to sign in agents in to both the instance and its replica(s). SignInConfig *types.SignInConfig // The distribution of traffic between the instance and its replicas. diff --git a/service/connect/api_op_SearchUsers.go b/service/connect/api_op_SearchUsers.go index 6c2d4c61b84..b663e051f06 100644 --- a/service/connect/api_op_SearchUsers.go +++ b/service/connect/api_op_SearchUsers.go @@ -36,7 +36,8 @@ func (c *Client) SearchUsers(ctx context.Context, params *SearchUsersInput, optF type SearchUsersInput struct { // The identifier of the Amazon Connect instance. You can find the instance ID (https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html) - // in the Amazon Resource Name (ARN) of the instance. + // in the Amazon Resource Name (ARN) of the instance. InstanceID is a required + // field. The "Required: No" below is incorrect. InstanceId *string // The maximum number of results to return per page. diff --git a/service/connect/api_op_StartTaskContact.go b/service/connect/api_op_StartTaskContact.go index 7d38f5be08d..ad3bae438b5 100644 --- a/service/connect/api_op_StartTaskContact.go +++ b/service/connect/api_op_StartTaskContact.go @@ -17,7 +17,33 @@ import ( "time" ) -// Initiates a flow to start a new task. +// Initiates a flow to start a new task contact. For more information about task +// contacts, see Concepts: Tasks in Amazon Connect (https://docs.aws.amazon.com/connect/latest/adminguide/tasks.html) +// in the Amazon Connect Administrator Guide. When using PreviousContactId and +// RelatedContactId input parameters, note the following: +// - PreviousContactId +// - Any updates to user-defined task contact attributes on any contact linked +// through the same PreviousContactId will affect every contact in the chain. +// - There can be a maximum of 12 linked task contacts in a chain. That is, 12 +// task contacts can be created that share the same PreviousContactId . +// - RelatedContactId +// - Copies contact attributes from the related task contact to the new contact. +// - Any update on attributes in a new task contact does not update attributes +// on previous contact. +// - There’s no limit on the number of task contacts that can be created that +// use the same RelatedContactId . +// +// In addition, when calling StartTaskContact include only one of these +// parameters: ContactFlowID , QuickConnectID , or TaskTemplateID . Only one +// parameter is required as long as the task template has a flow configured to run +// it. If more than one parameter is specified, or only the TaskTemplateID is +// specified but it does not have a flow configured, the request returns an error +// because Amazon Connect cannot identify the unique flow to run when the task is +// created. A ServiceQuotaExceededException occurs when the number of open tasks +// exceeds the active tasks quota or there are already 12 tasks referencing the +// same PreviousContactId . For more information about service quotas for task +// contacts, see Amazon Connect service quotas (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html) +// in the Amazon Connect Administrator Guide. func (c *Client) StartTaskContact(ctx context.Context, params *StartTaskContactInput, optFns ...func(*Options)) (*StartTaskContactOutput, error) { if params == nil { params = &StartTaskContactInput{} @@ -72,17 +98,31 @@ type StartTaskContactInput struct { // Panel (CCP). Description *string - // The identifier of the previous chat, voice, or task contact. + // The identifier of the previous chat, voice, or task contact. Any updates to + // user-defined attributes to task contacts linked using the same PreviousContactID + // will affect every contact in the chain. There can be a maximum of 12 linked task + // contacts in a chain. PreviousContactId *string - // The identifier for the quick connect. + // The identifier for the quick connect. Tasks that are created by using + // QuickConnectId will use the flow that is defined on agent or queue quick + // connect. For more information about quick connects, see Create quick connects (https://docs.aws.amazon.com/connect/latest/adminguide/quick-connects.html) + // . QuickConnectId *string // A formatted URL that is shown to an agent in the Contact Control Panel (CCP). + // Tasks can have the following reference types at the time of creation: URL | + // NUMBER | STRING | DATE | EMAIL . ATTACHMENT is not a supported reference type + // during task creation. References map[string]types.Reference // The contactId that is related (https://docs.aws.amazon.com/connect/latest/adminguide/tasks.html#linked-tasks) - // to this contact. + // to this contact. Linking tasks together by using RelatedContactID copies over + // contact attributes from the related task contact to the new task contact. All + // updates to user-defined attributes in the new task contact are limited to the + // individual contact ID, unlike what happens when tasks are linked by using + // PreviousContactID . There are no limits to the number of contacts that can be + // linked by using RelatedContactId . RelatedContactId *string // The timestamp, in Unix Epoch seconds format, at which to start running the @@ -90,7 +130,9 @@ type StartTaskContactInput struct { // 6 days in future. ScheduledTime *time.Time - // A unique identifier for the task template. + // A unique identifier for the task template. For more information about task + // templates, see Create task templates (https://docs.aws.amazon.com/connect/latest/adminguide/task-templates.html) + // in the Amazon Connect Administrator Guide. TaskTemplateId *string noSmithyDocumentSerde diff --git a/service/connect/api_op_UpdateContactFlowContent.go b/service/connect/api_op_UpdateContactFlowContent.go index b59f13c0203..644e35622e4 100644 --- a/service/connect/api_op_UpdateContactFlowContent.go +++ b/service/connect/api_op_UpdateContactFlowContent.go @@ -41,7 +41,7 @@ type UpdateContactFlowContentInput struct { ContactFlowId *string // The JSON string that represents the content of the flow. For an example, see - // Example contact flow in Amazon Connect Flow language (https://docs.aws.amazon.com/connect/latest/APIReference/flow-language-example.html) + // Example flow in Amazon Connect Flow language (https://docs.aws.amazon.com/connect/latest/APIReference/flow-language-example.html) // . Length Constraints: Minimum length of 1. Maximum length of 256000. // // This member is required. diff --git a/service/connect/api_op_UpdateContactFlowModuleContent.go b/service/connect/api_op_UpdateContactFlowModuleContent.go index 10494084915..038b42cb701 100644 --- a/service/connect/api_op_UpdateContactFlowModuleContent.go +++ b/service/connect/api_op_UpdateContactFlowModuleContent.go @@ -39,7 +39,7 @@ type UpdateContactFlowModuleContentInput struct { ContactFlowModuleId *string // The JSON string that represents the content of the flow. For an example, see - // Example contact flow in Amazon Connect Flow language (https://docs.aws.amazon.com/connect/latest/APIReference/flow-language-example.html) + // Example flow in Amazon Connect Flow language (https://docs.aws.amazon.com/connect/latest/APIReference/flow-language-example.html) // . // // This member is required. diff --git a/service/connect/api_op_UpdateEvaluationForm.go b/service/connect/api_op_UpdateEvaluationForm.go index cad231c5dcd..daa86b83d5f 100644 --- a/service/connect/api_op_UpdateEvaluationForm.go +++ b/service/connect/api_op_UpdateEvaluationForm.go @@ -45,7 +45,7 @@ type UpdateEvaluationFormInput struct { // A version of the evaluation form to update. // // This member is required. - EvaluationFormVersion *int32 + EvaluationFormVersion int32 // The identifier of the Amazon Connect instance. You can find the instance ID (https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html) // in the Amazon Resource Name (ARN) of the instance. @@ -98,7 +98,7 @@ type UpdateEvaluationFormOutput struct { // The version of the updated evaluation form resource. // // This member is required. - EvaluationFormVersion *int32 + EvaluationFormVersion int32 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/connect/api_op_UpdatePhoneNumberMetadata.go b/service/connect/api_op_UpdatePhoneNumberMetadata.go new file mode 100644 index 00000000000..f88a748e6c7 --- /dev/null +++ b/service/connect/api_op_UpdatePhoneNumberMetadata.go @@ -0,0 +1,304 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +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" +) + +// Updates a phone number’s metadata. To verify the status of a previous +// UpdatePhoneNumberMetadata operation, call the DescribePhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribePhoneNumber.html) +// API. +func (c *Client) UpdatePhoneNumberMetadata(ctx context.Context, params *UpdatePhoneNumberMetadataInput, optFns ...func(*Options)) (*UpdatePhoneNumberMetadataOutput, error) { + if params == nil { + params = &UpdatePhoneNumberMetadataInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdatePhoneNumberMetadata", params, optFns, c.addOperationUpdatePhoneNumberMetadataMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdatePhoneNumberMetadataOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdatePhoneNumberMetadataInput struct { + + // The Amazon Resource Name (ARN) or resource ID of the phone number. + // + // This member is required. + PhoneNumberId *string + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. If not provided, the Amazon Web Services SDK populates this + // field. For more information about idempotency, see Making retries safe with + // idempotent APIs (https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/) + // . + ClientToken *string + + // The description of the phone number. + PhoneNumberDescription *string + + noSmithyDocumentSerde +} + +type UpdatePhoneNumberMetadataOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdatePhoneNumberMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdatePhoneNumberMetadata{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdatePhoneNumberMetadata{}, 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 = addUpdatePhoneNumberMetadataResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opUpdatePhoneNumberMetadataMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdatePhoneNumberMetadataValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePhoneNumberMetadata(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 idempotencyToken_initializeOpUpdatePhoneNumberMetadata struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpUpdatePhoneNumberMetadata) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpUpdatePhoneNumberMetadata) 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.(*UpdatePhoneNumberMetadataInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdatePhoneNumberMetadataInput ") + } + + 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_opUpdatePhoneNumberMetadataMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpUpdatePhoneNumberMetadata{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opUpdatePhoneNumberMetadata(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "connect", + OperationName: "UpdatePhoneNumberMetadata", + } +} + +type opUpdatePhoneNumberMetadataResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opUpdatePhoneNumberMetadataResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opUpdatePhoneNumberMetadataResolveEndpointMiddleware) 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 := "connect" + 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 = "connect" + } 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("connect") + } + 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 addUpdatePhoneNumberMetadataResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opUpdatePhoneNumberMetadataResolveEndpointMiddleware{ + 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/connect/api_op_UpdateTrafficDistribution.go b/service/connect/api_op_UpdateTrafficDistribution.go index d437b8f53bc..85d0a2f0bcb 100644 --- a/service/connect/api_op_UpdateTrafficDistribution.go +++ b/service/connect/api_op_UpdateTrafficDistribution.go @@ -16,8 +16,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Updates the traffic distribution for a given traffic distribution group. You -// can change the SignInConfig distribution only for a default +// Updates the traffic distribution for a given traffic distribution group. The +// SignInConfig distribution is available only on a default // TrafficDistributionGroup (see the IsDefault parameter in the // TrafficDistributionGroup (https://docs.aws.amazon.com/connect/latest/APIReference/API_TrafficDistributionGroup.html) // data type). If you call UpdateTrafficDistribution with a modified SignInConfig @@ -52,7 +52,8 @@ type UpdateTrafficDistributionInput struct { // The distribution of agents between the instance and its replica(s). AgentConfig *types.AgentConfig - // The distribution of allowing signing in to the instance and its replica(s). + // The distribution that determines which Amazon Web Services Regions should be + // used to sign in agents in to both the instance and its replica(s). SignInConfig *types.SignInConfig // The distribution of traffic between the instance and its replica(s). diff --git a/service/connect/deserializers.go b/service/connect/deserializers.go index f9c23c06515..948b9fc61ed 100644 --- a/service/connect/deserializers.go +++ b/service/connect/deserializers.go @@ -194,7 +194,7 @@ func awsRestjson1_deserializeOpDocumentActivateEvaluationFormOutput(v **Activate if err != nil { return err } - sv.EvaluationFormVersion = ptr.Int32(int32(i64)) + sv.EvaluationFormVersion = int32(i64) } default: @@ -5702,7 +5702,7 @@ func awsRestjson1_deserializeOpDocumentDeactivateEvaluationFormOutput(v **Deacti if err != nil { return err } - sv.EvaluationFormVersion = ptr.Int32(int32(i64)) + sv.EvaluationFormVersion = int32(i64) } default: @@ -26384,7 +26384,7 @@ func awsRestjson1_deserializeOpDocumentUpdateEvaluationFormOutput(v **UpdateEval if err != nil { return err } - sv.EvaluationFormVersion = ptr.Int32(int32(i64)) + sv.EvaluationFormVersion = int32(i64) } default: @@ -26978,6 +26978,116 @@ func awsRestjson1_deserializeOpDocumentUpdatePhoneNumberOutput(v **UpdatePhoneNu return nil } +type awsRestjson1_deserializeOpUpdatePhoneNumberMetadata struct { +} + +func (*awsRestjson1_deserializeOpUpdatePhoneNumberMetadata) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdatePhoneNumberMetadata) 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, awsRestjson1_deserializeOpErrorUpdatePhoneNumberMetadata(response, &metadata) + } + output := &UpdatePhoneNumberMetadataOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdatePhoneNumberMetadata(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("IdempotencyException", errorCode): + return awsRestjson1_deserializeErrorIdempotencyException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpUpdatePrompt struct { } @@ -33887,7 +33997,7 @@ func awsRestjson1_deserializeDocumentEvaluationForm(v **types.EvaluationForm, va if err != nil { return err } - sv.EvaluationFormVersion = ptr.Int32(int32(i64)) + sv.EvaluationFormVersion = int32(i64) } case "Items": @@ -34025,7 +34135,7 @@ func awsRestjson1_deserializeDocumentEvaluationFormContent(v **types.EvaluationF if err != nil { return err } - sv.EvaluationFormVersion = ptr.Int32(int32(i64)) + sv.EvaluationFormVersion = int32(i64) } case "Items": @@ -35079,7 +35189,7 @@ func awsRestjson1_deserializeDocumentEvaluationFormSummary(v **types.EvaluationF if err != nil { return err } - sv.LatestVersion = ptr.Int32(int32(i64)) + sv.LatestVersion = int32(i64) } case "Title": @@ -35209,7 +35319,7 @@ func awsRestjson1_deserializeDocumentEvaluationFormVersionSummary(v **types.Eval if err != nil { return err } - sv.EvaluationFormVersion = ptr.Int32(int32(i64)) + sv.EvaluationFormVersion = int32(i64) } case "LastModifiedBy": diff --git a/service/connect/doc.go b/service/connect/doc.go index e65cb908942..8a737d7c98a 100644 --- a/service/connect/doc.go +++ b/service/connect/doc.go @@ -10,7 +10,7 @@ // efficiently by getting customers in touch with the appropriate agents. There are // limits to the number of Amazon Connect resources that you can create. There are // also limits to the number of requests that you can make per second. For more -// information, see Amazon Connect Service Quotas (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html) +// information, seeP98941055 Amazon Connect Service Quotas (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html) // in the Amazon Connect Administrator Guide. You can connect programmatically to // an Amazon Web Services service by using an endpoint. For a list of Amazon // Connect endpoints, see Amazon Connect Endpoints (https://docs.aws.amazon.com/general/latest/gr/connect_region.html) diff --git a/service/connect/endpoints.go b/service/connect/endpoints.go index 0944fccb710..4a973104443 100644 --- a/service/connect/endpoints.go +++ b/service/connect/endpoints.go @@ -410,8 +410,8 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { - if "aws-us-gov" == _PartitionResult.Name { + if _PartitionResult.SupportsFIPS == true { + if _PartitionResult.Name == "aws-us-gov" { uriString := func() string { var out strings.Builder out.WriteString("https://connect.") diff --git a/service/connect/generated.json b/service/connect/generated.json index 1e7eb3dd3d2..fa934398d27 100644 --- a/service/connect/generated.json +++ b/service/connect/generated.json @@ -193,6 +193,7 @@ "api_op_UpdateInstanceStorageConfig.go", "api_op_UpdateParticipantRoleConfig.go", "api_op_UpdatePhoneNumber.go", + "api_op_UpdatePhoneNumberMetadata.go", "api_op_UpdatePrompt.go", "api_op_UpdateQueueHoursOfOperation.go", "api_op_UpdateQueueMaxContacts.go", diff --git a/service/connect/serializers.go b/service/connect/serializers.go index 39289818761..fade9a4cb5d 100644 --- a/service/connect/serializers.go +++ b/service/connect/serializers.go @@ -105,9 +105,9 @@ func awsRestjson1_serializeOpDocumentActivateEvaluationFormInput(v *ActivateEval object := value.Object() defer object.Close() - if v.EvaluationFormVersion != nil { + { ok := object.Key("EvaluationFormVersion") - ok.Integer(*v.EvaluationFormVersion) + ok.Integer(v.EvaluationFormVersion) } return nil @@ -3787,9 +3787,9 @@ func awsRestjson1_serializeOpDocumentDeactivateEvaluationFormInput(v *Deactivate object := value.Object() defer object.Close() - if v.EvaluationFormVersion != nil { + { ok := object.Key("EvaluationFormVersion") - ok.Integer(*v.EvaluationFormVersion) + ok.Integer(v.EvaluationFormVersion) } return nil @@ -15708,9 +15708,9 @@ func awsRestjson1_serializeOpDocumentUpdateEvaluationFormInput(v *UpdateEvaluati ok.String(*v.Description) } - if v.EvaluationFormVersion != nil { + { ok := object.Key("EvaluationFormVersion") - ok.Integer(*v.EvaluationFormVersion) + ok.Integer(v.EvaluationFormVersion) } if v.Items != nil { @@ -16241,6 +16241,99 @@ func awsRestjson1_serializeOpDocumentUpdatePhoneNumberInput(v *UpdatePhoneNumber return nil } +type awsRestjson1_serializeOpUpdatePhoneNumberMetadata struct { +} + +func (*awsRestjson1_serializeOpUpdatePhoneNumberMetadata) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdatePhoneNumberMetadata) 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.(*UpdatePhoneNumberMetadataInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/phone-number/{PhoneNumberId}/metadata") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdatePhoneNumberMetadataInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdatePhoneNumberMetadataInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdatePhoneNumberMetadataInput(v *UpdatePhoneNumberMetadataInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.PhoneNumberId == nil || len(*v.PhoneNumberId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member PhoneNumberId must not be empty")} + } + if v.PhoneNumberId != nil { + if err := encoder.SetURI("PhoneNumberId").String(*v.PhoneNumberId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdatePhoneNumberMetadataInput(v *UpdatePhoneNumberMetadataInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.PhoneNumberDescription != nil { + ok := object.Key("PhoneNumberDescription") + ok.String(*v.PhoneNumberDescription) + } + + return nil +} + type awsRestjson1_serializeOpUpdatePrompt struct { } diff --git a/service/connect/types/types.go b/service/connect/types/types.go index cafcac8ea43..b84783970db 100644 --- a/service/connect/types/types.go +++ b/service/connect/types/types.go @@ -283,15 +283,16 @@ type ClaimedPhoneNumberSummary struct { PhoneNumberId *string // The status of the phone number. - // - CLAIMED means the previous ClaimedPhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_ClaimedPhoneNumber.html) + // - CLAIMED means the previous ClaimPhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_ClaimPhoneNumber.html) // or UpdatePhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdatePhoneNumber.html) // operation succeeded. - // - IN_PROGRESS means a ClaimedPhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_ClaimedPhoneNumber.html) - // or UpdatePhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdatePhoneNumber.html) + // - IN_PROGRESS means a ClaimPhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_ClaimPhoneNumber.html) + // , UpdatePhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdatePhoneNumber.html) + // , or UpdatePhoneNumberMetadata (https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdatePhoneNumberMetadata.html) // operation is still in progress and has not yet completed. You can call // DescribePhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribePhoneNumber.html) // at a later time to verify if the previous operation has completed. - // - FAILED indicates that the previous ClaimedPhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_ClaimedPhoneNumber.html) + // - FAILED indicates that the previous ClaimPhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_ClaimPhoneNumber.html) // or UpdatePhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdatePhoneNumber.html) // operation has failed. It will include a message indicating the failure reason. A // common reason for a failure may be that the TargetArn value you are claiming @@ -400,8 +401,8 @@ type ContactFlow struct { Arn *string // The JSON string that represents the content of the flow. For an example, see - // Example contact flow in Amazon Connect Flow language (https://docs.aws.amazon.com/connect/latest/APIReference/flow-language-example.html) - // . + // Example flow in Amazon Connect Flow language (https://docs.aws.amazon.com/connect/latest/APIReference/flow-language-example.html) + // . Length Constraints: Minimum length of 1. Maximum length of 256000. Content *string // The description of the flow. @@ -435,8 +436,8 @@ type ContactFlowModule struct { Arn *string // The JSON string that represents the content of the flow. For an example, see - // Example contact flow in Amazon Connect Flow language (https://docs.aws.amazon.com/connect/latest/APIReference/flow-language-example.html) - // . Length Constraints: Minimum length of 1. Maximum length of 256000. + // Example flow in Amazon Connect Flow language (https://docs.aws.amazon.com/connect/latest/APIReference/flow-language-example.html) + // . Content *string // The description of the flow module. @@ -845,7 +846,7 @@ type EvaluationForm struct { // A version of the evaluation form. // // This member is required. - EvaluationFormVersion *int32 + EvaluationFormVersion int32 // Items that are part of the evaluation form. The total number of sections and // questions must not exceed 100 each. Questions must be contained in a section. @@ -907,7 +908,7 @@ type EvaluationFormContent struct { // A version of the evaluation form. // // This member is required. - EvaluationFormVersion *int32 + EvaluationFormVersion int32 // Items that are part of the evaluation form. The total number of sections and // questions must not exceed 100 each. Questions must be contained in a section. @@ -1248,7 +1249,7 @@ type EvaluationFormSummary struct { // The version number of the latest evaluation form version. // // This member is required. - LatestVersion *int32 + LatestVersion int32 // A title of the evaluation form. // @@ -1294,7 +1295,7 @@ type EvaluationFormVersionSummary struct { // A version of the evaluation form. // // This member is required. - EvaluationFormVersion *int32 + EvaluationFormVersion int32 // The Amazon Resource Name (ARN) of the user who last updated the evaluation form. // @@ -2391,15 +2392,16 @@ type PhoneNumberQuickConnectConfig struct { } // The status of the phone number. -// - CLAIMED means the previous ClaimedPhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_ClaimedPhoneNumber.html) +// - CLAIMED means the previous ClaimPhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_ClaimPhoneNumber.html) // or UpdatePhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdatePhoneNumber.html) // operation succeeded. -// - IN_PROGRESS means a ClaimedPhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_ClaimedPhoneNumber.html) -// or UpdatePhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdatePhoneNumber.html) +// - IN_PROGRESS means a ClaimPhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_ClaimPhoneNumber.html) +// , UpdatePhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdatePhoneNumber.html) +// , or UpdatePhoneNumberMetadata (https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdatePhoneNumberMetadata.html) // operation is still in progress and has not yet completed. You can call // DescribePhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribePhoneNumber.html) // at a later time to verify if the previous operation has completed. -// - FAILED indicates that the previous ClaimedPhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_ClaimedPhoneNumber.html) +// - FAILED indicates that the previous ClaimPhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_ClaimPhoneNumber.html) // or UpdatePhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdatePhoneNumber.html) // operation has failed. It will include a message indicating the failure reason. A // common reason for a failure may be that the TargetArn value you are claiming @@ -3388,7 +3390,8 @@ type SendNotificationActionDefinition struct { noSmithyDocumentSerde } -// The distribution of allowing signing in to the instance and its replica(s). +// The distribution that determines which Amazon Web Services Regions should be +// used to sign in agents in to both the instance and its replica(s). type SignInConfig struct { // Information about traffic distributions. @@ -3688,12 +3691,10 @@ type TrafficDistributionGroup struct { // Whether this is the default traffic distribution group created during instance // replication. The default traffic distribution group cannot be deleted by the // DeleteTrafficDistributionGroup API. The default traffic distribution group is - // deleted as part of the process for deleting a replica. You can change the - // SignInConfig distribution only for a default TrafficDistributionGroup (see the - // IsDefault parameter in the TrafficDistributionGroup (https://docs.aws.amazon.com/connect/latest/APIReference/API_TrafficDistributionGroup.html) - // data type). If you call UpdateTrafficDistribution with a modified SignInConfig - // and a non-default TrafficDistributionGroup , an InvalidRequestException is - // returned. + // deleted as part of the process for deleting a replica. The SignInConfig + // distribution is available only on the default TrafficDistributionGroup . If you + // call UpdateTrafficDistribution with a modified SignInConfig and a non-default + // TrafficDistributionGroup , an InvalidRequestException is returned. IsDefault bool // The name of the traffic distribution group. @@ -3710,7 +3711,7 @@ type TrafficDistributionGroup struct { // operation is still in progress and has not yet completed. // - DELETION_FAILED means the previous DeleteTrafficDistributionGroup (https://docs.aws.amazon.com/connect/latest/APIReference/API_DeleteTrafficDistributionGroup.html) // operation has failed. - // - UPDATE_IN_PROGRESS means the previous UpdateTrafficDistributionGroup (https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdateTrafficDistributionGroup.html) + // - UPDATE_IN_PROGRESS means the previous UpdateTrafficDistribution (https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdateTrafficDistribution.html) // operation is still in progress and has not yet completed. Status TrafficDistributionGroupStatus diff --git a/service/connect/validators.go b/service/connect/validators.go index 6630033deb8..05ad7a10d25 100644 --- a/service/connect/validators.go +++ b/service/connect/validators.go @@ -3610,6 +3610,26 @@ func (m *validateOpUpdatePhoneNumber) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpUpdatePhoneNumberMetadata struct { +} + +func (*validateOpUpdatePhoneNumberMetadata) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdatePhoneNumberMetadata) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdatePhoneNumberMetadataInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdatePhoneNumberMetadataInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdatePrompt struct { } @@ -4850,6 +4870,10 @@ func addOpUpdatePhoneNumberValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdatePhoneNumber{}, middleware.After) } +func addOpUpdatePhoneNumberMetadataValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdatePhoneNumberMetadata{}, middleware.After) +} + func addOpUpdatePromptValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdatePrompt{}, middleware.After) } @@ -6243,9 +6267,6 @@ func validateOpActivateEvaluationFormInput(v *ActivateEvaluationFormInput) error if v.EvaluationFormId == nil { invalidParams.Add(smithy.NewErrParamRequired("EvaluationFormId")) } - if v.EvaluationFormVersion == nil { - invalidParams.Add(smithy.NewErrParamRequired("EvaluationFormVersion")) - } if invalidParams.Len() > 0 { return invalidParams } else { @@ -7034,9 +7055,6 @@ func validateOpDeactivateEvaluationFormInput(v *DeactivateEvaluationFormInput) e if v.EvaluationFormId == nil { invalidParams.Add(smithy.NewErrParamRequired("EvaluationFormId")) } - if v.EvaluationFormVersion == nil { - invalidParams.Add(smithy.NewErrParamRequired("EvaluationFormVersion")) - } if invalidParams.Len() > 0 { return invalidParams } else { @@ -9550,9 +9568,6 @@ func validateOpUpdateEvaluationFormInput(v *UpdateEvaluationFormInput) error { if v.EvaluationFormId == nil { invalidParams.Add(smithy.NewErrParamRequired("EvaluationFormId")) } - if v.EvaluationFormVersion == nil { - invalidParams.Add(smithy.NewErrParamRequired("EvaluationFormVersion")) - } if v.Title == nil { invalidParams.Add(smithy.NewErrParamRequired("Title")) } @@ -9690,6 +9705,21 @@ func validateOpUpdatePhoneNumberInput(v *UpdatePhoneNumberInput) error { } } +func validateOpUpdatePhoneNumberMetadataInput(v *UpdatePhoneNumberMetadataInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdatePhoneNumberMetadataInput"} + if v.PhoneNumberId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PhoneNumberId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdatePromptInput(v *UpdatePromptInput) error { if v == nil { return nil diff --git a/service/emr/internal/endpoints/endpoints.go b/service/emr/internal/endpoints/endpoints.go index c41691fd27e..23f14ff2a6c 100644 --- a/service/emr/internal/endpoints/endpoints.go +++ b/service/emr/internal/endpoints/endpoints.go @@ -280,6 +280,12 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "elasticmapreduce-fips.us-east-2.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "elasticmapreduce.us-east-2.api.aws", + }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, @@ -338,9 +344,21 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "cn-north-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "cn-north-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "elasticmapreduce.cn-north-1.api.amazonwebservices.com.cn", + }, endpoints.EndpointKey{ Region: "cn-northwest-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "elasticmapreduce.cn-northwest-1.api.amazonwebservices.com.cn", + }, }, }, { @@ -550,6 +568,12 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "elasticmapreduce.us-gov-east-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "elasticmapreduce.us-gov-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{ @@ -562,6 +586,13 @@ var defaultPartitions = endpoints.Partitions{ Hostname: "elasticmapreduce.us-gov-west-1.amazonaws.com", Protocols: []string{"https"}, }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "elasticmapreduce.us-gov-west-1.api.aws", + Protocols: []string{"https"}, + }, }, }, } diff --git a/service/emrcontainers/internal/endpoints/endpoints.go b/service/emrcontainers/internal/endpoints/endpoints.go index e150c0724b4..6a83d7a9920 100644 --- a/service/emrcontainers/internal/endpoints/endpoints.go +++ b/service/emrcontainers/internal/endpoints/endpoints.go @@ -151,6 +151,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, diff --git a/service/medicalimaging/api_op_CreateDatastore.go b/service/medicalimaging/api_op_CreateDatastore.go index d9dfd3432d5..846e4eab4b6 100644 --- a/service/medicalimaging/api_op_CreateDatastore.go +++ b/service/medicalimaging/api_op_CreateDatastore.go @@ -42,8 +42,8 @@ type CreateDatastoreInput struct { // The data store name. DatastoreName *string - // The Amazon Resource Name (ARN) assigned to the AWS Key Management Service (AWS - // KMS) key for accessing encrypted data. + // The Amazon Resource Name (ARN) assigned to the Key Management Service (KMS) key + // for accessing encrypted data. KmsKeyArn *string // The tags provided when creating a data store. diff --git a/service/medicalimaging/api_op_ListDICOMImportJobs.go b/service/medicalimaging/api_op_ListDICOMImportJobs.go index 06fbb3a6530..e64d520f2a2 100644 --- a/service/medicalimaging/api_op_ListDICOMImportJobs.go +++ b/service/medicalimaging/api_op_ListDICOMImportJobs.go @@ -16,7 +16,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// List import jobs created by this AWS account for a specific data store. +// List import jobs created for a specific data store. func (c *Client) ListDICOMImportJobs(ctx context.Context, params *ListDICOMImportJobsInput, optFns ...func(*Options)) (*ListDICOMImportJobsOutput, error) { if params == nil { params = &ListDICOMImportJobsInput{} diff --git a/service/medicalimaging/api_op_ListDatastores.go b/service/medicalimaging/api_op_ListDatastores.go index 8126a3f3e61..ae6669b8b71 100644 --- a/service/medicalimaging/api_op_ListDatastores.go +++ b/service/medicalimaging/api_op_ListDatastores.go @@ -16,7 +16,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// List data stores created by this AWS account. +// List data stores. func (c *Client) ListDatastores(ctx context.Context, params *ListDatastoresInput, optFns ...func(*Options)) (*ListDatastoresOutput, error) { if params == nil { params = &ListDatastoresInput{} diff --git a/service/medicalimaging/api_op_SearchImageSets.go b/service/medicalimaging/api_op_SearchImageSets.go index 400f522e09c..646b53f5a04 100644 --- a/service/medicalimaging/api_op_SearchImageSets.go +++ b/service/medicalimaging/api_op_SearchImageSets.go @@ -16,7 +16,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Search image sets based on defined input attributes. +// Search image sets based on defined input attributes. SearchImageSets accepts a +// single search query parameter and returns a paginated response of all image sets +// that have the matching criteria. All range queries must be input as +// (lowerBound, upperBound) . SearchImageSets uses the updatedAt field for sorting +// in decreasing order from latest to oldest. func (c *Client) SearchImageSets(ctx context.Context, params *SearchImageSetsInput, optFns ...func(*Options)) (*SearchImageSetsOutput, error) { if params == nil { params = &SearchImageSetsInput{} diff --git a/service/medicalimaging/doc.go b/service/medicalimaging/doc.go index 1cb2229035b..0cab91bcbf3 100644 --- a/service/medicalimaging/doc.go +++ b/service/medicalimaging/doc.go @@ -3,83 +3,85 @@ // Package medicalimaging provides the API client, operations, and parameter types // for AWS Health Imaging. // -// This is the AWS HealthImaging API Reference. AWS HealthImaging is an AWS -// service for storing, accessing, and analyzing medical images. For an -// introduction to the service, see the AWS HealthImaging Developer Guide (https://docs.aws.amazon.com/medical-imaging/latest/devguide) +// This is the AWS HealthImaging API Reference. AWS HealthImaging is a +// HIPAA-eligible service that helps health care providers and their medical +// imaging ISV partners store, transform, and apply machine learning to medical +// images. For an introduction to the service, see the AWS HealthImaging Developer +// Guide (https://docs.aws.amazon.com/healthimaging/latest/devguide/what-is.html) // . We recommend using one of the AWS Software Development Kits (SDKs) for your // programming language, as they take care of request authentication, // serialization, and connection management. For more information, see Tools to // build on AWS (http://aws.amazon.com/developer/tools) . For information about -// using AWS HealthImaging API actions in one of the language-specific AWS SDKs, -// refer to the See Also link at the end of each section that describes an API -// action or data type. The following sections list AWS HealthImaging API actions -// categorized according to functionality. Links are provided to actions within -// this Reference, along with links back to corresponding sections in the AWS -// HealthImaging Developer Guide so you can view console procedures and CLI/SDK -// code examples. Data store actions -// - CreateDatastore (https://docs.aws.amazon.com/medical-imaging/latest/APIReference/API_CreateDatastore.html) -// – See Creating a data store (https://docs.aws.amazon.com/medical-imaging/latest/devguide/create-data-store.html) +// using HealthImaging API actions in one of the language-specific AWS SDKs, refer +// to the See Also link at the end of each section that describes an API action or +// data type. The following sections list AWS HealthImaging API actions categorized +// according to functionality. Links are provided to actions within this Reference, +// along with links back to corresponding sections in the AWS HealthImaging +// Developer Guide where you can view console procedures and CLI/SDK code examples. +// Data store actions +// - CreateDatastore (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_CreateDatastore.html) +// – See Creating a data store (https://docs.aws.amazon.com/healthimaging/latest/devguide/create-data-store.html) // . -// - GetDatastore (https://docs.aws.amazon.com/medical-imaging/latest/APIReference/API_GetDatastore.html) -// – See Getting data store properties (https://docs.aws.amazon.com/medical-imaging/latest/devguide/get-data-store.html) +// - GetDatastore (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_GetDatastore.html) +// – See Getting data store properties (https://docs.aws.amazon.com/healthimaging/latest/devguide/get-data-store.html) // . -// - ListDatastores (https://docs.aws.amazon.com/medical-imaging/latest/APIReference/API_ListDatastores.html) -// – See Listing data stores (https://docs.aws.amazon.com/medical-imaging/latest/devguide/list-data-stores.html) +// - ListDatastores (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_ListDatastores.html) +// – See Listing data stores (https://docs.aws.amazon.com/healthimaging/latest/devguide/list-data-stores.html) // . -// - DeleteDatastore (https://docs.aws.amazon.com/medical-imaging/latest/APIReference/API_DeleteDatastore.html) -// – See Deleting a data store (https://docs.aws.amazon.com/medical-imaging/latest/devguide/delete-data-store.html) +// - DeleteDatastore (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_DeleteDatastore.html) +// – See Deleting a data store (https://docs.aws.amazon.com/healthimaging/latest/devguide/delete-data-store.html) // . // // Import job actions -// - StartDICOMImportJob (https://docs.aws.amazon.com/medical-imaging/latest/APIReference/API_StartDICOMImportJob.html) -// – See Starting an import job (https://docs.aws.amazon.com/medical-imaging/latest/devguide/start-dicom-import-job.html) +// - StartDICOMImportJob (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_StartDICOMImportJob.html) +// – See Starting an import job (https://docs.aws.amazon.com/healthimaging/latest/devguide/start-dicom-import-job.html) // . -// - GetDICOMImportJob (https://docs.aws.amazon.com/medical-imaging/latest/APIReference/API_GetDICOMImportJob.html) -// – See Getting import job properties (https://docs.aws.amazon.com/medical-imaging/latest/devguide/get-dicom-import-job.html) +// - GetDICOMImportJob (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_GetDICOMImportJob.html) +// – See Getting import job properties (https://docs.aws.amazon.com/healthimaging/latest/devguide/get-dicom-import-job.html) // . -// - ListDICOMImportJobs (https://docs.aws.amazon.com/medical-imaging/latest/APIReference/API_ListDICOMImportJobs.html) -// – See Listing import jobs (https://docs.aws.amazon.com/medical-imaging/latest/devguide/list-dicom-import-jobs.html) +// - ListDICOMImportJobs (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_ListDICOMImportJobs.html) +// – See Listing import jobs (https://docs.aws.amazon.com/healthimaging/latest/devguide/list-dicom-import-jobs.html) // . // // Image set access actions -// - SearchImageSets (https://docs.aws.amazon.com/medical-imaging/latest/APIReference/API_SearchImageSets.html) -// – See Searching image sets (https://docs.aws.amazon.com/medical-imaging/latest/devguide/search-image-sets.html) +// - SearchImageSets (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_SearchImageSets.html) +// – See Searching image sets (https://docs.aws.amazon.com/healthimaging/latest/devguide/search-image-sets.html) // . -// - GetImageSet (https://docs.aws.amazon.com/medical-imaging/latest/APIReference/API_GetImageSet.html) -// – See Getting image set properties (https://docs.aws.amazon.com/medical-imaging/latest/devguide/get-image-set-properties.html) +// - GetImageSet (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_GetImageSet.html) +// – See Getting image set properties (https://docs.aws.amazon.com/healthimaging/latest/devguide/get-image-set-properties.html) // . -// - GetImageSetMetadata (https://docs.aws.amazon.com/medical-imaging/latest/APIReference/API_GetImageSetMetadata.html) -// – See Getting image set metadata (https://docs.aws.amazon.com/medical-imaging/latest/devguide/get-image-set-metadata.html) +// - GetImageSetMetadata (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_GetImageSetMetadata.html) +// – See Getting image set metadata (https://docs.aws.amazon.com/healthimaging/latest/devguide/get-image-set-metadata.html) // . -// - GetImageFrame (https://docs.aws.amazon.com/medical-imaging/latest/APIReference/API_GetImageFrame.html) -// – See Getting image set pixel data (https://docs.aws.amazon.com/medical-imaging/latest/devguide/get-image-frame.html) +// - GetImageFrame (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_GetImageFrame.html) +// – See Getting image set pixel data (https://docs.aws.amazon.com/healthimaging/latest/devguide/get-image-frame.html) // . // // Image set modification actions -// - ListImageSetVersions (https://docs.aws.amazon.com/medical-imaging/latest/APIReference/API_ListImageSetVersions.html) -// – See Listing image set versions (https://docs.aws.amazon.com/medical-imaging/latest/devguide/list-image-set-versions.html) +// - ListImageSetVersions (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_ListImageSetVersions.html) +// – See Listing image set versions (https://docs.aws.amazon.com/healthimaging/latest/devguide/list-image-set-versions.html) // . -// - UpdateImageSetMetadata (https://docs.aws.amazon.com/medical-imaging/latest/APIReference/API_UpdateImageSetMetadata.html) -// – See Updating image set metadata (https://docs.aws.amazon.com/medical-imaging/latest/devguide/update-image-set-metadata.html) +// - UpdateImageSetMetadata (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_UpdateImageSetMetadata.html) +// – See Updating image set metadata (https://docs.aws.amazon.com/healthimaging/latest/devguide/update-image-set-metadata.html) // . -// - CopyImageSet (https://docs.aws.amazon.com/medical-imaging/latest/APIReference/API_CopyImageSet.html) -// – See Copying an image set (https://docs.aws.amazon.com/medical-imaging/latest/devguide/copy-image-set.html) +// - CopyImageSet (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_CopyImageSet.html) +// – See Copying an image set (https://docs.aws.amazon.com/healthimaging/latest/devguide/copy-image-set.html) // . -// - DeleteImageSet (https://docs.aws.amazon.com/medical-imaging/latest/APIReference/API_DeleteImageSet.html) -// – See Deleting an image set (https://docs.aws.amazon.com/medical-imaging/latest/devguide/delete-image-set.html) +// - DeleteImageSet (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_DeleteImageSet.html) +// – See Deleting an image set (https://docs.aws.amazon.com/healthimaging/latest/devguide/delete-image-set.html) // . // // Tagging actions -// - TagResource (https://docs.aws.amazon.com/medical-imaging/latest/APIReference/API_TagResource.html) -// – See Tagging a data store (https://docs.aws.amazon.com/medical-imaging/latest/devguide/tag-list-untag-data-store.html) -// and Tagging an image set (https://docs.aws.amazon.com/medical-imaging/latest/devguide/tag-list-untag-image-set.html) +// - TagResource (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_TagResource.html) +// – See Tagging a data store (https://docs.aws.amazon.com/healthimaging/latest/devguide/tag-list-untag-data-store.html) +// and Tagging an image set (https://docs.aws.amazon.com/healthimaging/latest/devguide/tag-list-untag-image-set.html) // . -// - ListTagsForResource (https://docs.aws.amazon.com/medical-imaging/latest/APIReference/API_ListTagsForResource.html) -// – See Tagging a data store (https://docs.aws.amazon.com/medical-imaging/latest/devguide/tag-list-untag-data-store.html) -// and Tagging an image set (https://docs.aws.amazon.com/medical-imaging/latest/devguide/tag-list-untag-image-set.html) +// - ListTagsForResource (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_ListTagsForResource.html) +// – See Tagging a data store (https://docs.aws.amazon.com/healthimaging/latest/devguide/tag-list-untag-data-store.html) +// and Tagging an image set (https://docs.aws.amazon.com/healthimaging/latest/devguide/tag-list-untag-image-set.html) // . -// - UntagResource (https://docs.aws.amazon.com/medical-imaging/latest/APIReference/API_UntagResource.html) -// – See Tagging a data store (https://docs.aws.amazon.com/medical-imaging/latest/devguide/tag-list-untag-data-store.html) -// and Tagging an image set (https://docs.aws.amazon.com/medical-imaging/latest/devguide/tag-list-untag-image-set.html) +// - UntagResource (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_UntagResource.html) +// – See Tagging a data store (https://docs.aws.amazon.com/healthimaging/latest/devguide/tag-list-untag-data-store.html) +// and Tagging an image set (https://docs.aws.amazon.com/healthimaging/latest/devguide/tag-list-untag-image-set.html) // . package medicalimaging diff --git a/service/medicalimaging/endpoints.go b/service/medicalimaging/endpoints.go index aad12849e9c..7992c8f2689 100644 --- a/service/medicalimaging/endpoints.go +++ b/service/medicalimaging/endpoints.go @@ -410,7 +410,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://medical-imaging-fips.") diff --git a/service/medicalimaging/types/errors.go b/service/medicalimaging/types/errors.go index c967150e900..f9309d1b25f 100644 --- a/service/medicalimaging/types/errors.go +++ b/service/medicalimaging/types/errors.go @@ -163,7 +163,7 @@ func (e *ThrottlingException) ErrorCode() string { } func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The input fails to satisfy the constraints specified by an AWS service. +// The input fails to satisfy the constraints set by the service. type ValidationException struct { Message *string diff --git a/service/medicalimaging/types/types.go b/service/medicalimaging/types/types.go index cf00f0a3d8f..835a5f9f986 100644 --- a/service/medicalimaging/types/types.go +++ b/service/medicalimaging/types/types.go @@ -134,8 +134,8 @@ type DatastoreProperties struct { // The Amazon Resource Name (ARN) for the data store. DatastoreArn *string - // The Amazon Resource Name (ARN) assigned to the AWS Key Management Service (AWS - // KMS) key for accessing encrypted data. + // The Amazon Resource Name (ARN) assigned to the Key Management Service (KMS) key + // for accessing encrypted data. KmsKeyArn *string // The timestamp when the data store was last updated. @@ -391,14 +391,14 @@ type ImageSetsMetadataSummary struct { // This member is required. ImageSetId *string - // The time an image set is created in AWS HealthImaging. Sample creation date is - // provided in 1985-04-12T23:20:50.52Z format. + // The time an image set is created. Sample creation date is provided in + // 1985-04-12T23:20:50.52Z format. CreatedAt *time.Time // The DICOM tags associated with the image set. DICOMTags *DICOMTags - // The time when an image was last updated in AWS HealthImaging. + // The time an image set was last updated. UpdatedAt *time.Time // The image set version. diff --git a/service/sagemaker/internal/endpoints/endpoints.go b/service/sagemaker/internal/endpoints/endpoints.go index e368ef77b24..1db45e73ef2 100644 --- a/service/sagemaker/internal/endpoints/endpoints.go +++ b/service/sagemaker/internal/endpoints/endpoints.go @@ -374,6 +374,11 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-isob-east-1", + }: endpoints.Endpoint{}, + }, }, { ID: "aws-iso-e", diff --git a/service/ssm/api_op_CreateOpsItem.go b/service/ssm/api_op_CreateOpsItem.go index 95160235be9..4f25a5d80e6 100644 --- a/service/ssm/api_op_CreateOpsItem.go +++ b/service/ssm/api_op_CreateOpsItem.go @@ -108,7 +108,7 @@ type CreateOpsItemInput struct { // OpsCenter. // - /aws/changerequest This type of OpsItem is used by Change Manager for // reviewing and approving or rejecting change requests. - // - /aws/insight This type of OpsItem is used by OpsCenter for aggregating and + // - /aws/insights This type of OpsItem is used by OpsCenter for aggregating and // reporting on duplicate OpsItems. OpsItemType *string diff --git a/service/ssm/api_op_DeleteOpsItem.go b/service/ssm/api_op_DeleteOpsItem.go new file mode 100644 index 00000000000..0e2398e0678 --- /dev/null +++ b/service/ssm/api_op_DeleteOpsItem.go @@ -0,0 +1,273 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +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" +) + +// Delete an OpsItem. You must have permission in Identity and Access Management +// (IAM) to delete an OpsItem. Note the following important information about this +// operation. +// - Deleting an OpsItem is irreversible. You can't restore a deleted OpsItem. +// - This operation uses an eventual consistency model, which means the system +// can take a few minutes to complete this operation. If you delete an OpsItem and +// immediately call, for example, GetOpsItem , the deleted OpsItem might still +// appear in the response. +// - This operation is idempotent. The system doesn't throw an exception if you +// repeatedly call this operation for the same OpsItem. If the first call is +// successful, all additional calls return the same successful response as the +// first call. +// - This operation doesn't support cross-account calls. A delegated +// administrator or management account can't delete OpsItems in other accounts, +// even if OpsCenter has been set up for cross-account administration. For more +// information about cross-account administration, see Setting up OpsCenter to +// centrally manage OpsItems across accounts (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-setting-up-cross-account.html) +// in the Systems Manager User Guide. +func (c *Client) DeleteOpsItem(ctx context.Context, params *DeleteOpsItemInput, optFns ...func(*Options)) (*DeleteOpsItemOutput, error) { + if params == nil { + params = &DeleteOpsItemInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteOpsItem", params, optFns, c.addOperationDeleteOpsItemMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteOpsItemOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteOpsItemInput struct { + + // The ID of the OpsItem that you want to delete. + // + // This member is required. + OpsItemId *string + + noSmithyDocumentSerde +} + +type DeleteOpsItemOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteOpsItemMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteOpsItem{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteOpsItem{}, 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 = addDeleteOpsItemResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteOpsItemValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteOpsItem(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_opDeleteOpsItem(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "ssm", + OperationName: "DeleteOpsItem", + } +} + +type opDeleteOpsItemResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDeleteOpsItemResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDeleteOpsItemResolveEndpointMiddleware) 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 := "ssm" + 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 = "ssm" + } 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("ssm") + } + 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 addDeleteOpsItemResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDeleteOpsItemResolveEndpointMiddleware{ + 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/ssm/deserializers.go b/service/ssm/deserializers.go index 431ffc87140..4f7fbe78a55 100644 --- a/service/ssm/deserializers.go +++ b/service/ssm/deserializers.go @@ -244,6 +244,9 @@ func awsAwsjson11_deserializeOpErrorAssociateOpsItemRelatedItem(response *smithy case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + case strings.EqualFold("OpsItemConflictException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemConflictException(response, errorBody) + case strings.EqualFold("OpsItemInvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody) @@ -2228,6 +2231,120 @@ func awsAwsjson11_deserializeOpErrorDeleteMaintenanceWindow(response *smithyhttp } } +type awsAwsjson11_deserializeOpDeleteOpsItem struct { +} + +func (*awsAwsjson11_deserializeOpDeleteOpsItem) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteOpsItem) 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_deserializeOpErrorDeleteOpsItem(response, &metadata) + } + output := &DeleteOpsItemOutput{} + 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_deserializeOpDocumentDeleteOpsItemOutput(&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_deserializeOpErrorDeleteOpsItem(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("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("OpsItemInvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpDeleteOpsMetadata struct { } @@ -7195,6 +7312,9 @@ func awsAwsjson11_deserializeOpErrorDisassociateOpsItemRelatedItem(response *smi case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + case strings.EqualFold("OpsItemConflictException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemConflictException(response, errorBody) + case strings.EqualFold("OpsItemInvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody) @@ -15970,6 +16090,9 @@ func awsAwsjson11_deserializeOpErrorUpdateOpsItem(response *smithyhttp.Response, case strings.EqualFold("OpsItemAlreadyExistsException", errorCode): return awsAwsjson11_deserializeErrorOpsItemAlreadyExistsException(response, errorBody) + case strings.EqualFold("OpsItemConflictException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemConflictException(response, errorBody) + case strings.EqualFold("OpsItemInvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody) @@ -19403,6 +19526,41 @@ func awsAwsjson11_deserializeErrorOpsItemAlreadyExistsException(response *smithy return output } +func awsAwsjson11_deserializeErrorOpsItemConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, 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 err + } + + output := &types.OpsItemConflictException{} + err := awsAwsjson11_deserializeDocumentOpsItemConflictException(&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 err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + func awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -33889,6 +34047,46 @@ func awsAwsjson11_deserializeDocumentOpsItemAlreadyExistsException(v **types.Ops return nil } +func awsAwsjson11_deserializeDocumentOpsItemConflictException(v **types.OpsItemConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.OpsItemConflictException + if *v == nil { + sv = &types.OpsItemConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentOpsItemDataValue(v **types.OpsItemDataValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -42012,6 +42210,37 @@ func awsAwsjson11_deserializeOpDocumentDeleteMaintenanceWindowOutput(v **DeleteM return nil } +func awsAwsjson11_deserializeOpDocumentDeleteOpsItemOutput(v **DeleteOpsItemOutput, 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 *DeleteOpsItemOutput + if *v == nil { + sv = &DeleteOpsItemOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDeleteOpsMetadataOutput(v **DeleteOpsMetadataOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/ssm/doc.go b/service/ssm/doc.go index e546b70849f..b2b6b2eeace 100644 --- a/service/ssm/doc.go +++ b/service/ssm/doc.go @@ -11,7 +11,7 @@ // . To get started, see Setting up Amazon Web Services Systems Manager (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-setting-up.html) // . Related resources // - For information about each of the capabilities that comprise Systems -// Manager, see Systems Manager capabilities (https://docs.aws.amazon.com/systems-manager/latest/userguide/what-is-systems-manager.html#systems-manager-capabilities) +// Manager, see Systems Manager capabilities (https://docs.aws.amazon.com/systems-manager-automation-runbooks/latest/userguide/systems-manager-capabilities.html) // in the Amazon Web Services Systems Manager User Guide. // - For details about predefined runbooks for Automation, a capability of // Amazon Web Services Systems Manager, see the Systems Manager Automation diff --git a/service/ssm/endpoints.go b/service/ssm/endpoints.go index 2f4cfebe297..1e8a8732a91 100644 --- a/service/ssm/endpoints.go +++ b/service/ssm/endpoints.go @@ -410,8 +410,8 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { - if "aws-us-gov" == _PartitionResult.Name { + if _PartitionResult.SupportsFIPS == true { + if _PartitionResult.Name == "aws-us-gov" { uriString := func() string { var out strings.Builder out.WriteString("https://ssm.") diff --git a/service/ssm/generated.json b/service/ssm/generated.json index 5e9c5487c27..a3aaad95247 100644 --- a/service/ssm/generated.json +++ b/service/ssm/generated.json @@ -28,6 +28,7 @@ "api_op_DeleteDocument.go", "api_op_DeleteInventory.go", "api_op_DeleteMaintenanceWindow.go", + "api_op_DeleteOpsItem.go", "api_op_DeleteOpsMetadata.go", "api_op_DeleteParameter.go", "api_op_DeleteParameters.go", diff --git a/service/ssm/serializers.go b/service/ssm/serializers.go index 3903bfa5fe5..fb7c3f338d9 100644 --- a/service/ssm/serializers.go +++ b/service/ssm/serializers.go @@ -1006,6 +1006,61 @@ func (m *awsAwsjson11_serializeOpDeleteMaintenanceWindow) HandleSerialize(ctx co return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDeleteOpsItem struct { +} + +func (*awsAwsjson11_serializeOpDeleteOpsItem) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteOpsItem) 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.(*DeleteOpsItemInput) + _ = 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("AmazonSSM.DeleteOpsItem") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteOpsItemInput(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_serializeOpDeleteOpsMetadata struct { } @@ -11320,6 +11375,18 @@ func awsAwsjson11_serializeOpDocumentDeleteMaintenanceWindowInput(v *DeleteMaint return nil } +func awsAwsjson11_serializeOpDocumentDeleteOpsItemInput(v *DeleteOpsItemInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.OpsItemId != nil { + ok := object.Key("OpsItemId") + ok.String(*v.OpsItemId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteOpsMetadataInput(v *DeleteOpsMetadataInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/ssm/types/errors.go b/service/ssm/types/errors.go index 045d5b8a0da..61ec235e228 100644 --- a/service/ssm/types/errors.go +++ b/service/ssm/types/errors.go @@ -2292,6 +2292,32 @@ func (e *OpsItemAlreadyExistsException) ErrorCode() string { } func (e *OpsItemAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The specified OpsItem is in the process of being deleted. +type OpsItemConflictException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *OpsItemConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *OpsItemConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *OpsItemConflictException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "OpsItemConflictException" + } + return *e.ErrorCodeOverride +} +func (e *OpsItemConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // A specified parameter argument isn't valid. Verify the available arguments and // try again. type OpsItemInvalidParameterException struct { diff --git a/service/ssm/types/types.go b/service/ssm/types/types.go index 518a7c235d3..e78c955d064 100644 --- a/service/ssm/types/types.go +++ b/service/ssm/types/types.go @@ -3431,7 +3431,7 @@ type OpsItem struct { // OpsCenter. // - /aws/changerequest This type of OpsItem is used by Change Manager for // reviewing and approving or rejecting change requests. - // - /aws/insight This type of OpsItem is used by OpsCenter for aggregating and + // - /aws/insights This type of OpsItem is used by OpsCenter for aggregating and // reporting on duplicate OpsItems. OpsItemType *string @@ -3671,7 +3671,7 @@ type OpsItemSummary struct { // OpsCenter. // - /aws/changerequest This type of OpsItem is used by Change Manager for // reviewing and approving or rejecting change requests. - // - /aws/insight This type of OpsItem is used by OpsCenter for aggregating and + // - /aws/insights This type of OpsItem is used by OpsCenter for aggregating and // reporting on duplicate OpsItems. OpsItemType *string diff --git a/service/ssm/validators.go b/service/ssm/validators.go index b37d00b9ecb..b9109b79914 100644 --- a/service/ssm/validators.go +++ b/service/ssm/validators.go @@ -350,6 +350,26 @@ func (m *validateOpDeleteMaintenanceWindow) HandleInitialize(ctx context.Context return next.HandleInitialize(ctx, in) } +type validateOpDeleteOpsItem struct { +} + +func (*validateOpDeleteOpsItem) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteOpsItem) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteOpsItemInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteOpsItemInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteOpsMetadata struct { } @@ -2538,6 +2558,10 @@ func addOpDeleteMaintenanceWindowValidationMiddleware(stack *middleware.Stack) e return stack.Initialize.Add(&validateOpDeleteMaintenanceWindow{}, middleware.After) } +func addOpDeleteOpsItemValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteOpsItem{}, middleware.After) +} + func addOpDeleteOpsMetadataValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteOpsMetadata{}, middleware.After) } @@ -4868,6 +4892,21 @@ func validateOpDeleteMaintenanceWindowInput(v *DeleteMaintenanceWindowInput) err } } +func validateOpDeleteOpsItemInput(v *DeleteOpsItemInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteOpsItemInput"} + if v.OpsItemId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OpsItemId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteOpsMetadataInput(v *DeleteOpsMetadataInput) error { if v == nil { return nil