repo_name
stringlengths
1
52
repo_creator
stringclasses
6 values
programming_language
stringclasses
4 values
code
stringlengths
0
9.68M
num_lines
int64
1
234k
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Initialize Application Migration Service. func (c *Client) InitializeService(ctx context.Context, params *InitializeServiceInput, optFns ...func(*Options)) (*InitializeServiceOutput, error) { if params == nil { params = &InitializeServiceInput{} } result, metadata, err := c.invokeOperation(ctx, "InitializeService", params, optFns, c.addOperationInitializeServiceMiddlewares) if err != nil { return nil, err } out := result.(*InitializeServiceOutput) out.ResultMetadata = metadata return out, nil } type InitializeServiceInput struct { noSmithyDocumentSerde } type InitializeServiceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationInitializeServiceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpInitializeService{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpInitializeService{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opInitializeService(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 } return nil } func newServiceMetadataMiddleware_opInitializeService(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "InitializeService", } }
111
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves all applications or multiple applications by ID. func (c *Client) ListApplications(ctx context.Context, params *ListApplicationsInput, optFns ...func(*Options)) (*ListApplicationsOutput, error) { if params == nil { params = &ListApplicationsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListApplications", params, optFns, c.addOperationListApplicationsMiddlewares) if err != nil { return nil, err } out := result.(*ListApplicationsOutput) out.ResultMetadata = metadata return out, nil } type ListApplicationsInput struct { // Applications list filters. Filters *types.ListApplicationsRequestFilters // Maximum results to return when listing applications. MaxResults int32 // Request next token. NextToken *string noSmithyDocumentSerde } type ListApplicationsOutput struct { // Applications list. Items []types.Application // Response next token. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListApplicationsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListApplications{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListApplications{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListApplications(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 } return nil } // ListApplicationsAPIClient is a client that implements the ListApplications // operation. type ListApplicationsAPIClient interface { ListApplications(context.Context, *ListApplicationsInput, ...func(*Options)) (*ListApplicationsOutput, error) } var _ ListApplicationsAPIClient = (*Client)(nil) // ListApplicationsPaginatorOptions is the paginator options for ListApplications type ListApplicationsPaginatorOptions struct { // Maximum results to return when listing applications. 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 } // ListApplicationsPaginator is a paginator for ListApplications type ListApplicationsPaginator struct { options ListApplicationsPaginatorOptions client ListApplicationsAPIClient params *ListApplicationsInput nextToken *string firstPage bool } // NewListApplicationsPaginator returns a new ListApplicationsPaginator func NewListApplicationsPaginator(client ListApplicationsAPIClient, params *ListApplicationsInput, optFns ...func(*ListApplicationsPaginatorOptions)) *ListApplicationsPaginator { if params == nil { params = &ListApplicationsInput{} } options := ListApplicationsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListApplicationsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListApplicationsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListApplications page. func (p *ListApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationsOutput, 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.ListApplications(ctx, &params, 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_opListApplications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "ListApplications", } }
216
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // List export errors. func (c *Client) ListExportErrors(ctx context.Context, params *ListExportErrorsInput, optFns ...func(*Options)) (*ListExportErrorsOutput, error) { if params == nil { params = &ListExportErrorsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListExportErrors", params, optFns, c.addOperationListExportErrorsMiddlewares) if err != nil { return nil, err } out := result.(*ListExportErrorsOutput) out.ResultMetadata = metadata return out, nil } // List export errors request. type ListExportErrorsInput struct { // List export errors request export id. // // This member is required. ExportID *string // List export errors request max results. MaxResults int32 // List export errors request next token. NextToken *string noSmithyDocumentSerde } // List export errors response. type ListExportErrorsOutput struct { // List export errors response items. Items []types.ExportTaskError // List export errors response next token. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListExportErrorsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListExportErrors{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListExportErrors{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListExportErrorsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListExportErrors(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 } return nil } // ListExportErrorsAPIClient is a client that implements the ListExportErrors // operation. type ListExportErrorsAPIClient interface { ListExportErrors(context.Context, *ListExportErrorsInput, ...func(*Options)) (*ListExportErrorsOutput, error) } var _ ListExportErrorsAPIClient = (*Client)(nil) // ListExportErrorsPaginatorOptions is the paginator options for ListExportErrors type ListExportErrorsPaginatorOptions struct { // List export errors request max results. 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 } // ListExportErrorsPaginator is a paginator for ListExportErrors type ListExportErrorsPaginator struct { options ListExportErrorsPaginatorOptions client ListExportErrorsAPIClient params *ListExportErrorsInput nextToken *string firstPage bool } // NewListExportErrorsPaginator returns a new ListExportErrorsPaginator func NewListExportErrorsPaginator(client ListExportErrorsAPIClient, params *ListExportErrorsInput, optFns ...func(*ListExportErrorsPaginatorOptions)) *ListExportErrorsPaginator { if params == nil { params = &ListExportErrorsInput{} } options := ListExportErrorsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListExportErrorsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListExportErrorsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListExportErrors page. func (p *ListExportErrorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListExportErrorsOutput, 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.ListExportErrors(ctx, &params, 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_opListExportErrors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "ListExportErrors", } }
223
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // List exports. func (c *Client) ListExports(ctx context.Context, params *ListExportsInput, optFns ...func(*Options)) (*ListExportsOutput, error) { if params == nil { params = &ListExportsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListExports", params, optFns, c.addOperationListExportsMiddlewares) if err != nil { return nil, err } out := result.(*ListExportsOutput) out.ResultMetadata = metadata return out, nil } // List export request. type ListExportsInput struct { // List exports request filters. Filters *types.ListExportsRequestFilters // List export request max results. MaxResults int32 // List export request next token. NextToken *string noSmithyDocumentSerde } // List export response. type ListExportsOutput struct { // List export response items. Items []types.ExportTask // List export response next token. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListExportsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListExports{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListExports{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListExports(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 } return nil } // ListExportsAPIClient is a client that implements the ListExports operation. type ListExportsAPIClient interface { ListExports(context.Context, *ListExportsInput, ...func(*Options)) (*ListExportsOutput, error) } var _ ListExportsAPIClient = (*Client)(nil) // ListExportsPaginatorOptions is the paginator options for ListExports type ListExportsPaginatorOptions struct { // List export request max results. 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 } // ListExportsPaginator is a paginator for ListExports type ListExportsPaginator struct { options ListExportsPaginatorOptions client ListExportsAPIClient params *ListExportsInput nextToken *string firstPage bool } // NewListExportsPaginator returns a new ListExportsPaginator func NewListExportsPaginator(client ListExportsAPIClient, params *ListExportsInput, optFns ...func(*ListExportsPaginatorOptions)) *ListExportsPaginator { if params == nil { params = &ListExportsInput{} } options := ListExportsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListExportsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListExportsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListExports page. func (p *ListExportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListExportsOutput, 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.ListExports(ctx, &params, 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_opListExports(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "ListExports", } }
217
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // List import errors. func (c *Client) ListImportErrors(ctx context.Context, params *ListImportErrorsInput, optFns ...func(*Options)) (*ListImportErrorsOutput, error) { if params == nil { params = &ListImportErrorsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListImportErrors", params, optFns, c.addOperationListImportErrorsMiddlewares) if err != nil { return nil, err } out := result.(*ListImportErrorsOutput) out.ResultMetadata = metadata return out, nil } // List import errors request. type ListImportErrorsInput struct { // List import errors request import id. // // This member is required. ImportID *string // List import errors request max results. MaxResults int32 // List import errors request next token. NextToken *string noSmithyDocumentSerde } // List imports errors response. type ListImportErrorsOutput struct { // List imports errors response items. Items []types.ImportTaskError // List imports errors response next token. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListImportErrorsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListImportErrors{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListImportErrors{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListImportErrorsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListImportErrors(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 } return nil } // ListImportErrorsAPIClient is a client that implements the ListImportErrors // operation. type ListImportErrorsAPIClient interface { ListImportErrors(context.Context, *ListImportErrorsInput, ...func(*Options)) (*ListImportErrorsOutput, error) } var _ ListImportErrorsAPIClient = (*Client)(nil) // ListImportErrorsPaginatorOptions is the paginator options for ListImportErrors type ListImportErrorsPaginatorOptions struct { // List import errors request max results. 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 } // ListImportErrorsPaginator is a paginator for ListImportErrors type ListImportErrorsPaginator struct { options ListImportErrorsPaginatorOptions client ListImportErrorsAPIClient params *ListImportErrorsInput nextToken *string firstPage bool } // NewListImportErrorsPaginator returns a new ListImportErrorsPaginator func NewListImportErrorsPaginator(client ListImportErrorsAPIClient, params *ListImportErrorsInput, optFns ...func(*ListImportErrorsPaginatorOptions)) *ListImportErrorsPaginator { if params == nil { params = &ListImportErrorsInput{} } options := ListImportErrorsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListImportErrorsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListImportErrorsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListImportErrors page. func (p *ListImportErrorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImportErrorsOutput, 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.ListImportErrors(ctx, &params, 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_opListImportErrors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "ListImportErrors", } }
223
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // List imports. func (c *Client) ListImports(ctx context.Context, params *ListImportsInput, optFns ...func(*Options)) (*ListImportsOutput, error) { if params == nil { params = &ListImportsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListImports", params, optFns, c.addOperationListImportsMiddlewares) if err != nil { return nil, err } out := result.(*ListImportsOutput) out.ResultMetadata = metadata return out, nil } // List imports request. type ListImportsInput struct { // List imports request filters. Filters *types.ListImportsRequestFilters // List imports request max results. MaxResults int32 // List imports request next token. NextToken *string noSmithyDocumentSerde } // List import response. type ListImportsOutput struct { // List import response items. Items []types.ImportTask // List import response next token. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListImportsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListImports{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListImports{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListImports(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 } return nil } // ListImportsAPIClient is a client that implements the ListImports operation. type ListImportsAPIClient interface { ListImports(context.Context, *ListImportsInput, ...func(*Options)) (*ListImportsOutput, error) } var _ ListImportsAPIClient = (*Client)(nil) // ListImportsPaginatorOptions is the paginator options for ListImports type ListImportsPaginatorOptions struct { // List imports request max results. 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 } // ListImportsPaginator is a paginator for ListImports type ListImportsPaginator struct { options ListImportsPaginatorOptions client ListImportsAPIClient params *ListImportsInput nextToken *string firstPage bool } // NewListImportsPaginator returns a new ListImportsPaginator func NewListImportsPaginator(client ListImportsAPIClient, params *ListImportsInput, optFns ...func(*ListImportsPaginatorOptions)) *ListImportsPaginator { if params == nil { params = &ListImportsInput{} } options := ListImportsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListImportsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListImportsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListImports page. func (p *ListImportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImportsOutput, 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.ListImports(ctx, &params, 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_opListImports(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "ListImports", } }
217
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // List source server post migration custom actions. func (c *Client) ListSourceServerActions(ctx context.Context, params *ListSourceServerActionsInput, optFns ...func(*Options)) (*ListSourceServerActionsOutput, error) { if params == nil { params = &ListSourceServerActionsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListSourceServerActions", params, optFns, c.addOperationListSourceServerActionsMiddlewares) if err != nil { return nil, err } out := result.(*ListSourceServerActionsOutput) out.ResultMetadata = metadata return out, nil } type ListSourceServerActionsInput struct { // Source server ID. // // This member is required. SourceServerID *string // Filters to apply when listing source server post migration custom actions. Filters *types.SourceServerActionsRequestFilters // Maximum amount of items to return when listing source server post migration // custom actions. MaxResults int32 // Next token to use when listing source server post migration custom actions. NextToken *string noSmithyDocumentSerde } type ListSourceServerActionsOutput struct { // List of source server post migration custom actions. Items []types.SourceServerActionDocument // Next token returned when listing source server post migration custom actions. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListSourceServerActionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListSourceServerActions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSourceServerActions{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListSourceServerActionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSourceServerActions(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 } return nil } // ListSourceServerActionsAPIClient is a client that implements the // ListSourceServerActions operation. type ListSourceServerActionsAPIClient interface { ListSourceServerActions(context.Context, *ListSourceServerActionsInput, ...func(*Options)) (*ListSourceServerActionsOutput, error) } var _ ListSourceServerActionsAPIClient = (*Client)(nil) // ListSourceServerActionsPaginatorOptions is the paginator options for // ListSourceServerActions type ListSourceServerActionsPaginatorOptions struct { // Maximum amount of items to return when listing source server post migration // custom actions. 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 } // ListSourceServerActionsPaginator is a paginator for ListSourceServerActions type ListSourceServerActionsPaginator struct { options ListSourceServerActionsPaginatorOptions client ListSourceServerActionsAPIClient params *ListSourceServerActionsInput nextToken *string firstPage bool } // NewListSourceServerActionsPaginator returns a new // ListSourceServerActionsPaginator func NewListSourceServerActionsPaginator(client ListSourceServerActionsAPIClient, params *ListSourceServerActionsInput, optFns ...func(*ListSourceServerActionsPaginatorOptions)) *ListSourceServerActionsPaginator { if params == nil { params = &ListSourceServerActionsInput{} } options := ListSourceServerActionsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListSourceServerActionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListSourceServerActionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListSourceServerActions page. func (p *ListSourceServerActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSourceServerActionsOutput, 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.ListSourceServerActions(ctx, &params, 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_opListSourceServerActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "ListSourceServerActions", } }
228
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // List all tags for your Application Migration Service resources. func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { params = &ListTagsForResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) if err != nil { return nil, err } out := result.(*ListTagsForResourceOutput) out.ResultMetadata = metadata return out, nil } type ListTagsForResourceInput struct { // List tags for resource request by ARN. // // This member is required. ResourceArn *string noSmithyDocumentSerde } type ListTagsForResourceOutput struct { // List tags for resource response. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(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 } return nil } func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "ListTagsForResource", } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // List template post migration custom actions. func (c *Client) ListTemplateActions(ctx context.Context, params *ListTemplateActionsInput, optFns ...func(*Options)) (*ListTemplateActionsOutput, error) { if params == nil { params = &ListTemplateActionsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListTemplateActions", params, optFns, c.addOperationListTemplateActionsMiddlewares) if err != nil { return nil, err } out := result.(*ListTemplateActionsOutput) out.ResultMetadata = metadata return out, nil } type ListTemplateActionsInput struct { // Launch configuration template ID. // // This member is required. LaunchConfigurationTemplateID *string // Filters to apply when listing template post migration custom actions. Filters *types.TemplateActionsRequestFilters // Maximum amount of items to return when listing template post migration custom // actions. MaxResults int32 // Next token to use when listing template post migration custom actions. NextToken *string noSmithyDocumentSerde } type ListTemplateActionsOutput struct { // List of template post migration custom actions. Items []types.TemplateActionDocument // Next token returned when listing template post migration custom actions. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListTemplateActionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListTemplateActions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTemplateActions{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListTemplateActionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTemplateActions(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 } return nil } // ListTemplateActionsAPIClient is a client that implements the // ListTemplateActions operation. type ListTemplateActionsAPIClient interface { ListTemplateActions(context.Context, *ListTemplateActionsInput, ...func(*Options)) (*ListTemplateActionsOutput, error) } var _ ListTemplateActionsAPIClient = (*Client)(nil) // ListTemplateActionsPaginatorOptions is the paginator options for // ListTemplateActions type ListTemplateActionsPaginatorOptions struct { // Maximum amount of items to return when listing template post migration custom // actions. 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 } // ListTemplateActionsPaginator is a paginator for ListTemplateActions type ListTemplateActionsPaginator struct { options ListTemplateActionsPaginatorOptions client ListTemplateActionsAPIClient params *ListTemplateActionsInput nextToken *string firstPage bool } // NewListTemplateActionsPaginator returns a new ListTemplateActionsPaginator func NewListTemplateActionsPaginator(client ListTemplateActionsAPIClient, params *ListTemplateActionsInput, optFns ...func(*ListTemplateActionsPaginatorOptions)) *ListTemplateActionsPaginator { if params == nil { params = &ListTemplateActionsInput{} } options := ListTemplateActionsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListTemplateActionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListTemplateActionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListTemplateActions page. func (p *ListTemplateActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTemplateActionsOutput, 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.ListTemplateActions(ctx, &params, 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_opListTemplateActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "ListTemplateActions", } }
227
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves all waves or multiple waves by ID. func (c *Client) ListWaves(ctx context.Context, params *ListWavesInput, optFns ...func(*Options)) (*ListWavesOutput, error) { if params == nil { params = &ListWavesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListWaves", params, optFns, c.addOperationListWavesMiddlewares) if err != nil { return nil, err } out := result.(*ListWavesOutput) out.ResultMetadata = metadata return out, nil } type ListWavesInput struct { // Waves list filters. Filters *types.ListWavesRequestFilters // Maximum results to return when listing waves. MaxResults int32 // Request next token. NextToken *string noSmithyDocumentSerde } type ListWavesOutput struct { // Waves list. Items []types.Wave // Response next token. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListWavesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListWaves{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListWaves{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListWaves(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 } return nil } // ListWavesAPIClient is a client that implements the ListWaves operation. type ListWavesAPIClient interface { ListWaves(context.Context, *ListWavesInput, ...func(*Options)) (*ListWavesOutput, error) } var _ ListWavesAPIClient = (*Client)(nil) // ListWavesPaginatorOptions is the paginator options for ListWaves type ListWavesPaginatorOptions struct { // Maximum results to return when listing waves. 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 } // ListWavesPaginator is a paginator for ListWaves type ListWavesPaginator struct { options ListWavesPaginatorOptions client ListWavesAPIClient params *ListWavesInput nextToken *string firstPage bool } // NewListWavesPaginator returns a new ListWavesPaginator func NewListWavesPaginator(client ListWavesAPIClient, params *ListWavesInput, optFns ...func(*ListWavesPaginatorOptions)) *ListWavesPaginator { if params == nil { params = &ListWavesInput{} } options := ListWavesPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListWavesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListWavesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListWaves page. func (p *ListWavesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWavesOutput, 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.ListWaves(ctx, &params, 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_opListWaves(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "ListWaves", } }
215
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Archives specific Source Servers by setting the SourceServer.isArchived // property to true for specified SourceServers by ID. This command only works for // SourceServers with a lifecycle. state which equals DISCONNECTED or CUTOVER. func (c *Client) MarkAsArchived(ctx context.Context, params *MarkAsArchivedInput, optFns ...func(*Options)) (*MarkAsArchivedOutput, error) { if params == nil { params = &MarkAsArchivedInput{} } result, metadata, err := c.invokeOperation(ctx, "MarkAsArchived", params, optFns, c.addOperationMarkAsArchivedMiddlewares) if err != nil { return nil, err } out := result.(*MarkAsArchivedOutput) out.ResultMetadata = metadata return out, nil } type MarkAsArchivedInput struct { // Mark as archived by Source Server ID. // // This member is required. SourceServerID *string noSmithyDocumentSerde } type MarkAsArchivedOutput struct { // Source server application ID. ApplicationID *string // Source server ARN. Arn *string // Source server data replication info. DataReplicationInfo *types.DataReplicationInfo // Source server fqdn for action framework. FqdnForActionFramework *string // Source server archived status. IsArchived *bool // Source server launched instance. LaunchedInstance *types.LaunchedInstance // Source server lifecycle state. LifeCycle *types.LifeCycle // Source server replication type. ReplicationType types.ReplicationType // Source server properties. SourceProperties *types.SourceProperties // Source server ID. SourceServerID *string // Source server Tags. Tags map[string]string // Source server user provided ID. UserProvidedID *string // Source server vCenter client id. VcenterClientID *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationMarkAsArchivedMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpMarkAsArchived{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpMarkAsArchived{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpMarkAsArchivedValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opMarkAsArchived(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 } return nil } func newServiceMetadataMiddleware_opMarkAsArchived(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "MarkAsArchived", } }
163
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Put source server post migration custom action. func (c *Client) PutSourceServerAction(ctx context.Context, params *PutSourceServerActionInput, optFns ...func(*Options)) (*PutSourceServerActionOutput, error) { if params == nil { params = &PutSourceServerActionInput{} } result, metadata, err := c.invokeOperation(ctx, "PutSourceServerAction", params, optFns, c.addOperationPutSourceServerActionMiddlewares) if err != nil { return nil, err } out := result.(*PutSourceServerActionOutput) out.ResultMetadata = metadata return out, nil } type PutSourceServerActionInput struct { // Source server post migration custom action ID. // // This member is required. ActionID *string // Source server post migration custom action name. // // This member is required. ActionName *string // Source server post migration custom action document identifier. // // This member is required. DocumentIdentifier *string // Source server post migration custom action order. // // This member is required. Order int32 // Source server ID. // // This member is required. SourceServerID *string // Source server post migration custom action active status. Active *bool // Source server post migration custom action category. Category types.ActionCategory // Source server post migration custom action description. Description *string // Source server post migration custom action document version. DocumentVersion *string // Source server post migration custom action external parameters. ExternalParameters map[string]types.SsmExternalParameter // Source server post migration custom action must succeed for cutover. MustSucceedForCutover *bool // Source server post migration custom action parameters. Parameters map[string][]types.SsmParameterStoreParameter // Source server post migration custom action timeout in seconds. TimeoutSeconds int32 noSmithyDocumentSerde } type PutSourceServerActionOutput struct { // Source server post migration custom action ID. ActionID *string // Source server post migration custom action name. ActionName *string // Source server post migration custom action active status. Active *bool // Source server post migration custom action category. Category types.ActionCategory // Source server post migration custom action description. Description *string // Source server post migration custom action document identifier. DocumentIdentifier *string // Source server post migration custom action document version. DocumentVersion *string // Source server post migration custom action external parameters. ExternalParameters map[string]types.SsmExternalParameter // Source server post migration custom action must succeed for cutover. MustSucceedForCutover *bool // Source server post migration custom action order. Order int32 // Source server post migration custom action parameters. Parameters map[string][]types.SsmParameterStoreParameter // Source server post migration custom action timeout in seconds. TimeoutSeconds int32 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationPutSourceServerActionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpPutSourceServerAction{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutSourceServerAction{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpPutSourceServerActionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutSourceServerAction(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 } return nil } func newServiceMetadataMiddleware_opPutSourceServerAction(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "PutSourceServerAction", } }
202
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Put template post migration custom action. func (c *Client) PutTemplateAction(ctx context.Context, params *PutTemplateActionInput, optFns ...func(*Options)) (*PutTemplateActionOutput, error) { if params == nil { params = &PutTemplateActionInput{} } result, metadata, err := c.invokeOperation(ctx, "PutTemplateAction", params, optFns, c.addOperationPutTemplateActionMiddlewares) if err != nil { return nil, err } out := result.(*PutTemplateActionOutput) out.ResultMetadata = metadata return out, nil } type PutTemplateActionInput struct { // Template post migration custom action ID. // // This member is required. ActionID *string // Template post migration custom action name. // // This member is required. ActionName *string // Template post migration custom action document identifier. // // This member is required. DocumentIdentifier *string // Launch configuration template ID. // // This member is required. LaunchConfigurationTemplateID *string // Template post migration custom action order. // // This member is required. Order int32 // Template post migration custom action active status. Active *bool // Template post migration custom action category. Category types.ActionCategory // Template post migration custom action description. Description *string // Template post migration custom action document version. DocumentVersion *string // Template post migration custom action external parameters. ExternalParameters map[string]types.SsmExternalParameter // Template post migration custom action must succeed for cutover. MustSucceedForCutover *bool // Operating system eligible for this template post migration custom action. OperatingSystem *string // Template post migration custom action parameters. Parameters map[string][]types.SsmParameterStoreParameter // Template post migration custom action timeout in seconds. TimeoutSeconds int32 noSmithyDocumentSerde } type PutTemplateActionOutput struct { // Template post migration custom action ID. ActionID *string // Template post migration custom action name. ActionName *string // Template post migration custom action active status. Active *bool // Template post migration custom action category. Category types.ActionCategory // Template post migration custom action description. Description *string // Template post migration custom action document identifier. DocumentIdentifier *string // Template post migration custom action document version. DocumentVersion *string // Template post migration custom action external parameters. ExternalParameters map[string]types.SsmExternalParameter // Template post migration custom action must succeed for cutover. MustSucceedForCutover *bool // Operating system eligible for this template post migration custom action. OperatingSystem *string // Template post migration custom action order. Order int32 // Template post migration custom action parameters. Parameters map[string][]types.SsmParameterStoreParameter // Template post migration custom action timeout in seconds. TimeoutSeconds int32 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationPutTemplateActionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpPutTemplateAction{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutTemplateAction{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpPutTemplateActionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutTemplateAction(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 } return nil } func newServiceMetadataMiddleware_opPutTemplateAction(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "PutTemplateAction", } }
208
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Remove source server post migration custom action. func (c *Client) RemoveSourceServerAction(ctx context.Context, params *RemoveSourceServerActionInput, optFns ...func(*Options)) (*RemoveSourceServerActionOutput, error) { if params == nil { params = &RemoveSourceServerActionInput{} } result, metadata, err := c.invokeOperation(ctx, "RemoveSourceServerAction", params, optFns, c.addOperationRemoveSourceServerActionMiddlewares) if err != nil { return nil, err } out := result.(*RemoveSourceServerActionOutput) out.ResultMetadata = metadata return out, nil } type RemoveSourceServerActionInput struct { // Source server post migration custom action ID to remove. // // This member is required. ActionID *string // Source server ID of the post migration custom action to remove. // // This member is required. SourceServerID *string noSmithyDocumentSerde } type RemoveSourceServerActionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRemoveSourceServerActionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpRemoveSourceServerAction{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRemoveSourceServerAction{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpRemoveSourceServerActionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveSourceServerAction(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 } return nil } func newServiceMetadataMiddleware_opRemoveSourceServerAction(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "RemoveSourceServerAction", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Remove template post migration custom action. func (c *Client) RemoveTemplateAction(ctx context.Context, params *RemoveTemplateActionInput, optFns ...func(*Options)) (*RemoveTemplateActionOutput, error) { if params == nil { params = &RemoveTemplateActionInput{} } result, metadata, err := c.invokeOperation(ctx, "RemoveTemplateAction", params, optFns, c.addOperationRemoveTemplateActionMiddlewares) if err != nil { return nil, err } out := result.(*RemoveTemplateActionOutput) out.ResultMetadata = metadata return out, nil } type RemoveTemplateActionInput struct { // Template post migration custom action ID to remove. // // This member is required. ActionID *string // Launch configuration template ID of the post migration custom action to remove. // // This member is required. LaunchConfigurationTemplateID *string noSmithyDocumentSerde } type RemoveTemplateActionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRemoveTemplateActionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpRemoveTemplateAction{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRemoveTemplateAction{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpRemoveTemplateActionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveTemplateAction(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 } return nil } func newServiceMetadataMiddleware_opRemoveTemplateAction(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "RemoveTemplateAction", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Causes the data replication initiation sequence to begin immediately upon next // Handshake for specified SourceServer IDs, regardless of when the previous // initiation started. This command will not work if the SourceServer is not // stalled or is in a DISCONNECTED or STOPPED state. func (c *Client) RetryDataReplication(ctx context.Context, params *RetryDataReplicationInput, optFns ...func(*Options)) (*RetryDataReplicationOutput, error) { if params == nil { params = &RetryDataReplicationInput{} } result, metadata, err := c.invokeOperation(ctx, "RetryDataReplication", params, optFns, c.addOperationRetryDataReplicationMiddlewares) if err != nil { return nil, err } out := result.(*RetryDataReplicationOutput) out.ResultMetadata = metadata return out, nil } type RetryDataReplicationInput struct { // Retry data replication for Source Server ID. // // This member is required. SourceServerID *string noSmithyDocumentSerde } type RetryDataReplicationOutput struct { // Source server application ID. ApplicationID *string // Source server ARN. Arn *string // Source server data replication info. DataReplicationInfo *types.DataReplicationInfo // Source server fqdn for action framework. FqdnForActionFramework *string // Source server archived status. IsArchived *bool // Source server launched instance. LaunchedInstance *types.LaunchedInstance // Source server lifecycle state. LifeCycle *types.LifeCycle // Source server replication type. ReplicationType types.ReplicationType // Source server properties. SourceProperties *types.SourceProperties // Source server ID. SourceServerID *string // Source server Tags. Tags map[string]string // Source server user provided ID. UserProvidedID *string // Source server vCenter client id. VcenterClientID *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRetryDataReplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpRetryDataReplication{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRetryDataReplication{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpRetryDataReplicationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRetryDataReplication(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 } return nil } func newServiceMetadataMiddleware_opRetryDataReplication(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "RetryDataReplication", } }
164
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Launches a Cutover Instance for specific Source Servers. This command starts a // LAUNCH job whose initiatedBy property is StartCutover and changes the // SourceServer.lifeCycle.state property to CUTTING_OVER. func (c *Client) StartCutover(ctx context.Context, params *StartCutoverInput, optFns ...func(*Options)) (*StartCutoverOutput, error) { if params == nil { params = &StartCutoverInput{} } result, metadata, err := c.invokeOperation(ctx, "StartCutover", params, optFns, c.addOperationStartCutoverMiddlewares) if err != nil { return nil, err } out := result.(*StartCutoverOutput) out.ResultMetadata = metadata return out, nil } type StartCutoverInput struct { // Start Cutover by Source Server IDs. // // This member is required. SourceServerIDs []string // Start Cutover by Tags. Tags map[string]string noSmithyDocumentSerde } type StartCutoverOutput struct { // Start Cutover Job response. Job *types.Job // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartCutoverMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpStartCutover{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartCutover{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStartCutoverValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartCutover(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 } return nil } func newServiceMetadataMiddleware_opStartCutover(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "StartCutover", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Start export. func (c *Client) StartExport(ctx context.Context, params *StartExportInput, optFns ...func(*Options)) (*StartExportOutput, error) { if params == nil { params = &StartExportInput{} } result, metadata, err := c.invokeOperation(ctx, "StartExport", params, optFns, c.addOperationStartExportMiddlewares) if err != nil { return nil, err } out := result.(*StartExportOutput) out.ResultMetadata = metadata return out, nil } // Start export request. type StartExportInput struct { // Start export request s3 bucket. // // This member is required. S3Bucket *string // Start export request s3key. // // This member is required. S3Key *string // Start export request s3 bucket owner. S3BucketOwner *string noSmithyDocumentSerde } // Start export response. type StartExportOutput struct { // Start export response export task. ExportTask *types.ExportTask // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartExportMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpStartExport{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartExport{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStartExportValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartExport(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 } return nil } func newServiceMetadataMiddleware_opStartExport(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "StartExport", } }
135
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Start import. func (c *Client) StartImport(ctx context.Context, params *StartImportInput, optFns ...func(*Options)) (*StartImportOutput, error) { if params == nil { params = &StartImportInput{} } result, metadata, err := c.invokeOperation(ctx, "StartImport", params, optFns, c.addOperationStartImportMiddlewares) if err != nil { return nil, err } out := result.(*StartImportOutput) out.ResultMetadata = metadata return out, nil } // Start import request. type StartImportInput struct { // Start import request s3 bucket source. // // This member is required. S3BucketSource *types.S3BucketSource // Start import request client token. ClientToken *string noSmithyDocumentSerde } // Start import response. type StartImportOutput struct { // Start import response import task. ImportTask *types.ImportTask // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartImportMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpStartImport{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartImport{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addIdempotencyToken_opStartImportMiddleware(stack, options); err != nil { return err } if err = addOpStartImportValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartImport(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 } return nil } type idempotencyToken_initializeOpStartImport struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpStartImport) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpStartImport) 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.(*StartImportInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *StartImportInput ") } 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_opStartImportMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpStartImport{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opStartImport(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "StartImport", } }
167
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Starts replication for SNAPSHOT_SHIPPING agents. func (c *Client) StartReplication(ctx context.Context, params *StartReplicationInput, optFns ...func(*Options)) (*StartReplicationOutput, error) { if params == nil { params = &StartReplicationInput{} } result, metadata, err := c.invokeOperation(ctx, "StartReplication", params, optFns, c.addOperationStartReplicationMiddlewares) if err != nil { return nil, err } out := result.(*StartReplicationOutput) out.ResultMetadata = metadata return out, nil } type StartReplicationInput struct { // ID of source server on which to start replication. // // This member is required. SourceServerID *string noSmithyDocumentSerde } type StartReplicationOutput struct { // Source server application ID. ApplicationID *string // Source server ARN. Arn *string // Source server data replication info. DataReplicationInfo *types.DataReplicationInfo // Source server fqdn for action framework. FqdnForActionFramework *string // Source server archived status. IsArchived *bool // Source server launched instance. LaunchedInstance *types.LaunchedInstance // Source server lifecycle state. LifeCycle *types.LifeCycle // Source server replication type. ReplicationType types.ReplicationType // Source server properties. SourceProperties *types.SourceProperties // Source server ID. SourceServerID *string // Source server Tags. Tags map[string]string // Source server user provided ID. UserProvidedID *string // Source server vCenter client id. VcenterClientID *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartReplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpStartReplication{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartReplication{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStartReplicationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartReplication(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 } return nil } func newServiceMetadataMiddleware_opStartReplication(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "StartReplication", } }
161
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Launches a Test Instance for specific Source Servers. This command starts a // LAUNCH job whose initiatedBy property is StartTest and changes the // SourceServer.lifeCycle.state property to TESTING. func (c *Client) StartTest(ctx context.Context, params *StartTestInput, optFns ...func(*Options)) (*StartTestOutput, error) { if params == nil { params = &StartTestInput{} } result, metadata, err := c.invokeOperation(ctx, "StartTest", params, optFns, c.addOperationStartTestMiddlewares) if err != nil { return nil, err } out := result.(*StartTestOutput) out.ResultMetadata = metadata return out, nil } type StartTestInput struct { // Start Test for Source Server IDs. // // This member is required. SourceServerIDs []string // Start Test by Tags. Tags map[string]string noSmithyDocumentSerde } type StartTestOutput struct { // Start Test Job response. Job *types.Job // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartTestMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpStartTest{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartTest{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStartTestValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartTest(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 } return nil } func newServiceMetadataMiddleware_opStartTest(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "StartTest", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Adds or overwrites only the specified tags for the specified Application // Migration Service resource or resources. When you specify an existing tag key, // the value is overwritten with the new value. Each resource can have a maximum of // 50 tags. Each tag consists of a key and optional value. func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { params = &TagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) if err != nil { return nil, err } out := result.(*TagResourceOutput) out.ResultMetadata = metadata return out, nil } type TagResourceInput struct { // Tag resource by ARN. // // This member is required. ResourceArn *string // Tag resource by Tags. // // This member is required. Tags map[string]string noSmithyDocumentSerde } type TagResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpTagResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(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 } return nil } func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "TagResource", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Starts a job that terminates specific launched EC2 Test and Cutover instances. // This command will not work for any Source Server with a lifecycle.state of // TESTING, CUTTING_OVER, or CUTOVER. func (c *Client) TerminateTargetInstances(ctx context.Context, params *TerminateTargetInstancesInput, optFns ...func(*Options)) (*TerminateTargetInstancesOutput, error) { if params == nil { params = &TerminateTargetInstancesInput{} } result, metadata, err := c.invokeOperation(ctx, "TerminateTargetInstances", params, optFns, c.addOperationTerminateTargetInstancesMiddlewares) if err != nil { return nil, err } out := result.(*TerminateTargetInstancesOutput) out.ResultMetadata = metadata return out, nil } type TerminateTargetInstancesInput struct { // Terminate Target instance by Source Server IDs. // // This member is required. SourceServerIDs []string // Terminate Target instance by Tags. Tags map[string]string noSmithyDocumentSerde } type TerminateTargetInstancesOutput struct { // Terminate Target instance Job response. Job *types.Job // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationTerminateTargetInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpTerminateTargetInstances{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTerminateTargetInstances{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpTerminateTargetInstancesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTerminateTargetInstances(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 } return nil } func newServiceMetadataMiddleware_opTerminateTargetInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "TerminateTargetInstances", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Unarchive application. func (c *Client) UnarchiveApplication(ctx context.Context, params *UnarchiveApplicationInput, optFns ...func(*Options)) (*UnarchiveApplicationOutput, error) { if params == nil { params = &UnarchiveApplicationInput{} } result, metadata, err := c.invokeOperation(ctx, "UnarchiveApplication", params, optFns, c.addOperationUnarchiveApplicationMiddlewares) if err != nil { return nil, err } out := result.(*UnarchiveApplicationOutput) out.ResultMetadata = metadata return out, nil } type UnarchiveApplicationInput struct { // Application ID. // // This member is required. ApplicationID *string noSmithyDocumentSerde } type UnarchiveApplicationOutput struct { // Application aggregated status. ApplicationAggregatedStatus *types.ApplicationAggregatedStatus // Application ID. ApplicationID *string // Application ARN. Arn *string // Application creation dateTime. CreationDateTime *string // Application description. Description *string // Application archival status. IsArchived *bool // Application last modified dateTime. LastModifiedDateTime *string // Application name. Name *string // Application tags. Tags map[string]string // Application wave ID. WaveID *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUnarchiveApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUnarchiveApplication{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUnarchiveApplication{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUnarchiveApplicationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUnarchiveApplication(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 } return nil } func newServiceMetadataMiddleware_opUnarchiveApplication(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "UnarchiveApplication", } }
152
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Unarchive wave. func (c *Client) UnarchiveWave(ctx context.Context, params *UnarchiveWaveInput, optFns ...func(*Options)) (*UnarchiveWaveOutput, error) { if params == nil { params = &UnarchiveWaveInput{} } result, metadata, err := c.invokeOperation(ctx, "UnarchiveWave", params, optFns, c.addOperationUnarchiveWaveMiddlewares) if err != nil { return nil, err } out := result.(*UnarchiveWaveOutput) out.ResultMetadata = metadata return out, nil } type UnarchiveWaveInput struct { // Wave ID. // // This member is required. WaveID *string noSmithyDocumentSerde } type UnarchiveWaveOutput struct { // Wave ARN. Arn *string // Wave creation dateTime. CreationDateTime *string // Wave description. Description *string // Wave archival status. IsArchived *bool // Wave last modified dateTime. LastModifiedDateTime *string // Wave name. Name *string // Wave tags. Tags map[string]string // Wave aggregated status. WaveAggregatedStatus *types.WaveAggregatedStatus // Wave ID. WaveID *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUnarchiveWaveMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUnarchiveWave{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUnarchiveWave{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUnarchiveWaveValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUnarchiveWave(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 } return nil } func newServiceMetadataMiddleware_opUnarchiveWave(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "UnarchiveWave", } }
149
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes the specified set of tags from the specified set of Application // Migration Service resources. func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { params = &UntagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) if err != nil { return nil, err } out := result.(*UntagResourceOutput) out.ResultMetadata = metadata return out, nil } type UntagResourceInput struct { // Untag resource by ARN. // // This member is required. ResourceArn *string // Untag resource by Keys. // // This member is required. TagKeys []string noSmithyDocumentSerde } type UntagResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUntagResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(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 } return nil } func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "UntagResource", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Update application. func (c *Client) UpdateApplication(ctx context.Context, params *UpdateApplicationInput, optFns ...func(*Options)) (*UpdateApplicationOutput, error) { if params == nil { params = &UpdateApplicationInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateApplication", params, optFns, c.addOperationUpdateApplicationMiddlewares) if err != nil { return nil, err } out := result.(*UpdateApplicationOutput) out.ResultMetadata = metadata return out, nil } type UpdateApplicationInput struct { // Application ID. // // This member is required. ApplicationID *string // Application description. Description *string // Application name. Name *string noSmithyDocumentSerde } type UpdateApplicationOutput struct { // Application aggregated status. ApplicationAggregatedStatus *types.ApplicationAggregatedStatus // Application ID. ApplicationID *string // Application ARN. Arn *string // Application creation dateTime. CreationDateTime *string // Application description. Description *string // Application archival status. IsArchived *bool // Application last modified dateTime. LastModifiedDateTime *string // Application name. Name *string // Application tags. Tags map[string]string // Application wave ID. WaveID *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateApplication{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateApplication{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateApplicationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateApplication(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 } return nil } func newServiceMetadataMiddleware_opUpdateApplication(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "UpdateApplication", } }
158
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates multiple LaunchConfigurations by Source Server ID. func (c *Client) UpdateLaunchConfiguration(ctx context.Context, params *UpdateLaunchConfigurationInput, optFns ...func(*Options)) (*UpdateLaunchConfigurationOutput, error) { if params == nil { params = &UpdateLaunchConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateLaunchConfiguration", params, optFns, c.addOperationUpdateLaunchConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*UpdateLaunchConfigurationOutput) out.ResultMetadata = metadata return out, nil } type UpdateLaunchConfigurationInput struct { // Update Launch configuration by Source Server ID request. // // This member is required. SourceServerID *string // Update Launch configuration boot mode request. BootMode types.BootMode // Update Launch configuration copy Private IP request. CopyPrivateIp *bool // Update Launch configuration copy Tags request. CopyTags *bool // Enable map auto tagging. EnableMapAutoTagging *bool // Update Launch configuration launch disposition request. LaunchDisposition types.LaunchDisposition // Update Launch configuration licensing request. Licensing *types.Licensing // Launch configuration map auto tagging MPE ID. MapAutoTaggingMpeID *string // Update Launch configuration name request. Name *string // Post Launch Actions to executed on the Test or Cutover instance. PostLaunchActions *types.PostLaunchActions // Update Launch configuration Target instance right sizing request. TargetInstanceTypeRightSizingMethod types.TargetInstanceTypeRightSizingMethod noSmithyDocumentSerde } type UpdateLaunchConfigurationOutput struct { // Launch configuration boot mode. BootMode types.BootMode // Copy Private IP during Launch Configuration. CopyPrivateIp *bool // Copy Tags during Launch Configuration. CopyTags *bool // Launch configuration EC2 Launch template ID. Ec2LaunchTemplateID *string // Enable map auto tagging. EnableMapAutoTagging *bool // Launch disposition for launch configuration. LaunchDisposition types.LaunchDisposition // Launch configuration OS licensing. Licensing *types.Licensing // Map auto tagging MPE ID. MapAutoTaggingMpeID *string // Launch configuration name. Name *string // Post Launch Actions to executed on the Test or Cutover instance. PostLaunchActions *types.PostLaunchActions // Launch configuration Source Server ID. SourceServerID *string // Launch configuration Target instance type right sizing method. TargetInstanceTypeRightSizingMethod types.TargetInstanceTypeRightSizingMethod // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateLaunchConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateLaunchConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateLaunchConfiguration{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateLaunchConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateLaunchConfiguration(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 } return nil } func newServiceMetadataMiddleware_opUpdateLaunchConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "UpdateLaunchConfiguration", } }
188
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates an existing Launch Configuration Template by ID. func (c *Client) UpdateLaunchConfigurationTemplate(ctx context.Context, params *UpdateLaunchConfigurationTemplateInput, optFns ...func(*Options)) (*UpdateLaunchConfigurationTemplateOutput, error) { if params == nil { params = &UpdateLaunchConfigurationTemplateInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateLaunchConfigurationTemplate", params, optFns, c.addOperationUpdateLaunchConfigurationTemplateMiddlewares) if err != nil { return nil, err } out := result.(*UpdateLaunchConfigurationTemplateOutput) out.ResultMetadata = metadata return out, nil } type UpdateLaunchConfigurationTemplateInput struct { // Launch Configuration Template ID. // // This member is required. LaunchConfigurationTemplateID *string // Associate public Ip address. AssociatePublicIpAddress *bool // Launch configuration template boot mode. BootMode types.BootMode // Copy private Ip. CopyPrivateIp *bool // Copy tags. CopyTags *bool // Enable map auto tagging. EnableMapAutoTagging *bool // Large volume config. LargeVolumeConf *types.LaunchTemplateDiskConf // Launch disposition. LaunchDisposition types.LaunchDisposition // Configure Licensing. Licensing *types.Licensing // Launch configuration template map auto tagging MPE ID. MapAutoTaggingMpeID *string // Post Launch Action to execute on the Test or Cutover instance. PostLaunchActions *types.PostLaunchActions // Small volume config. SmallVolumeConf *types.LaunchTemplateDiskConf // Small volume maximum size. SmallVolumeMaxSize int64 // Target instance type right-sizing method. TargetInstanceTypeRightSizingMethod types.TargetInstanceTypeRightSizingMethod noSmithyDocumentSerde } type UpdateLaunchConfigurationTemplateOutput struct { // ID of the Launch Configuration Template. // // This member is required. LaunchConfigurationTemplateID *string // ARN of the Launch Configuration Template. Arn *string // Associate public Ip address. AssociatePublicIpAddress *bool // Launch configuration template boot mode. BootMode types.BootMode // Copy private Ip. CopyPrivateIp *bool // Copy tags. CopyTags *bool // EC2 launch template ID. Ec2LaunchTemplateID *string // Enable map auto tagging. EnableMapAutoTagging *bool // Large volume config. LargeVolumeConf *types.LaunchTemplateDiskConf // Launch disposition. LaunchDisposition types.LaunchDisposition // Configure Licensing. Licensing *types.Licensing // Launch configuration template map auto tagging MPE ID. MapAutoTaggingMpeID *string // Post Launch Actions of the Launch Configuration Template. PostLaunchActions *types.PostLaunchActions // Small volume config. SmallVolumeConf *types.LaunchTemplateDiskConf // Small volume maximum size. SmallVolumeMaxSize int64 // Tags of the Launch Configuration Template. Tags map[string]string // Target instance type right-sizing method. TargetInstanceTypeRightSizingMethod types.TargetInstanceTypeRightSizingMethod // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateLaunchConfigurationTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateLaunchConfigurationTemplate{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateLaunchConfigurationTemplate{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateLaunchConfigurationTemplateValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateLaunchConfigurationTemplate(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 } return nil } func newServiceMetadataMiddleware_opUpdateLaunchConfigurationTemplate(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "UpdateLaunchConfigurationTemplate", } }
214
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Allows you to update multiple ReplicationConfigurations by Source Server ID. func (c *Client) UpdateReplicationConfiguration(ctx context.Context, params *UpdateReplicationConfigurationInput, optFns ...func(*Options)) (*UpdateReplicationConfigurationOutput, error) { if params == nil { params = &UpdateReplicationConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateReplicationConfiguration", params, optFns, c.addOperationUpdateReplicationConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*UpdateReplicationConfigurationOutput) out.ResultMetadata = metadata return out, nil } type UpdateReplicationConfigurationInput struct { // Update replication configuration Source Server ID request. // // This member is required. SourceServerID *string // Update replication configuration associate default Application Migration // Service Security group request. AssociateDefaultSecurityGroup *bool // Update replication configuration bandwidth throttling request. BandwidthThrottling int64 // Update replication configuration create Public IP request. CreatePublicIP *bool // Update replication configuration data plane routing request. DataPlaneRouting types.ReplicationConfigurationDataPlaneRouting // Update replication configuration use default large Staging Disk type request. DefaultLargeStagingDiskType types.ReplicationConfigurationDefaultLargeStagingDiskType // Update replication configuration EBS encryption request. EbsEncryption types.ReplicationConfigurationEbsEncryption // Update replication configuration EBS encryption key ARN request. EbsEncryptionKeyArn *string // Update replication configuration name request. Name *string // Update replication configuration replicated disks request. ReplicatedDisks []types.ReplicationConfigurationReplicatedDisk // Update replication configuration Replication Server instance type request. ReplicationServerInstanceType *string // Update replication configuration Replication Server Security Groups IDs request. ReplicationServersSecurityGroupsIDs []string // Update replication configuration Staging Area subnet request. StagingAreaSubnetId *string // Update replication configuration Staging Area Tags request. StagingAreaTags map[string]string // Update replication configuration use dedicated Replication Server request. UseDedicatedReplicationServer *bool noSmithyDocumentSerde } type UpdateReplicationConfigurationOutput struct { // Replication Configuration associate default Application Migration Service // Security Group. AssociateDefaultSecurityGroup *bool // Replication Configuration set bandwidth throttling. BandwidthThrottling int64 // Replication Configuration create Public IP. CreatePublicIP *bool // Replication Configuration data plane routing. DataPlaneRouting types.ReplicationConfigurationDataPlaneRouting // Replication Configuration use default large Staging Disks. DefaultLargeStagingDiskType types.ReplicationConfigurationDefaultLargeStagingDiskType // Replication Configuration EBS encryption. EbsEncryption types.ReplicationConfigurationEbsEncryption // Replication Configuration EBS encryption key ARN. EbsEncryptionKeyArn *string // Replication Configuration name. Name *string // Replication Configuration replicated disks. ReplicatedDisks []types.ReplicationConfigurationReplicatedDisk // Replication Configuration Replication Server instance type. ReplicationServerInstanceType *string // Replication Configuration Replication Server Security Group IDs. ReplicationServersSecurityGroupsIDs []string // Replication Configuration Source Server ID. SourceServerID *string // Replication Configuration Staging Area subnet ID. StagingAreaSubnetId *string // Replication Configuration Staging Area tags. StagingAreaTags map[string]string // Replication Configuration use Dedicated Replication Server. UseDedicatedReplicationServer *bool // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateReplicationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateReplicationConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateReplicationConfiguration{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateReplicationConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateReplicationConfiguration(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 } return nil } func newServiceMetadataMiddleware_opUpdateReplicationConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "UpdateReplicationConfiguration", } }
211
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates multiple ReplicationConfigurationTemplates by ID. func (c *Client) UpdateReplicationConfigurationTemplate(ctx context.Context, params *UpdateReplicationConfigurationTemplateInput, optFns ...func(*Options)) (*UpdateReplicationConfigurationTemplateOutput, error) { if params == nil { params = &UpdateReplicationConfigurationTemplateInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateReplicationConfigurationTemplate", params, optFns, c.addOperationUpdateReplicationConfigurationTemplateMiddlewares) if err != nil { return nil, err } out := result.(*UpdateReplicationConfigurationTemplateOutput) out.ResultMetadata = metadata return out, nil } type UpdateReplicationConfigurationTemplateInput struct { // Update replication configuration template template ID request. // // This member is required. ReplicationConfigurationTemplateID *string // Update replication configuration template ARN request. Arn *string // Update replication configuration template associate default Application // Migration Service Security group request. AssociateDefaultSecurityGroup *bool // Update replication configuration template bandwidth throttling request. BandwidthThrottling int64 // Update replication configuration template create Public IP request. CreatePublicIP *bool // Update replication configuration template data plane routing request. DataPlaneRouting types.ReplicationConfigurationDataPlaneRouting // Update replication configuration template use default large Staging Disk type // request. DefaultLargeStagingDiskType types.ReplicationConfigurationDefaultLargeStagingDiskType // Update replication configuration template EBS encryption request. EbsEncryption types.ReplicationConfigurationEbsEncryption // Update replication configuration template EBS encryption key ARN request. EbsEncryptionKeyArn *string // Update replication configuration template Replication Server instance type // request. ReplicationServerInstanceType *string // Update replication configuration template Replication Server Security groups // IDs request. ReplicationServersSecurityGroupsIDs []string // Update replication configuration template Staging Area subnet ID request. StagingAreaSubnetId *string // Update replication configuration template Staging Area Tags request. StagingAreaTags map[string]string // Update replication configuration template use dedicated Replication Server // request. UseDedicatedReplicationServer *bool noSmithyDocumentSerde } type UpdateReplicationConfigurationTemplateOutput struct { // Replication Configuration template ID. // // This member is required. ReplicationConfigurationTemplateID *string // Replication Configuration template ARN. Arn *string // Replication Configuration template associate default Application Migration // Service Security group. AssociateDefaultSecurityGroup *bool // Replication Configuration template bandwidth throttling. BandwidthThrottling int64 // Replication Configuration template create Public IP. CreatePublicIP *bool // Replication Configuration template data plane routing. DataPlaneRouting types.ReplicationConfigurationDataPlaneRouting // Replication Configuration template use default large Staging Disk type. DefaultLargeStagingDiskType types.ReplicationConfigurationDefaultLargeStagingDiskType // Replication Configuration template EBS encryption. EbsEncryption types.ReplicationConfigurationEbsEncryption // Replication Configuration template EBS encryption key ARN. EbsEncryptionKeyArn *string // Replication Configuration template server instance type. ReplicationServerInstanceType *string // Replication Configuration template server Security Groups IDs. ReplicationServersSecurityGroupsIDs []string // Replication Configuration template Staging Area subnet ID. StagingAreaSubnetId *string // Replication Configuration template Staging Area Tags. StagingAreaTags map[string]string // Replication Configuration template Tags. Tags map[string]string // Replication Configuration template use Dedicated Replication Server. UseDedicatedReplicationServer *bool // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateReplicationConfigurationTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateReplicationConfigurationTemplate{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateReplicationConfigurationTemplate{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateReplicationConfigurationTemplateValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateReplicationConfigurationTemplate(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 } return nil } func newServiceMetadataMiddleware_opUpdateReplicationConfigurationTemplate(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "UpdateReplicationConfigurationTemplate", } }
214
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Allows you to change between the AGENT_BASED replication type and the // SNAPSHOT_SHIPPING replication type. func (c *Client) UpdateSourceServerReplicationType(ctx context.Context, params *UpdateSourceServerReplicationTypeInput, optFns ...func(*Options)) (*UpdateSourceServerReplicationTypeOutput, error) { if params == nil { params = &UpdateSourceServerReplicationTypeInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateSourceServerReplicationType", params, optFns, c.addOperationUpdateSourceServerReplicationTypeMiddlewares) if err != nil { return nil, err } out := result.(*UpdateSourceServerReplicationTypeOutput) out.ResultMetadata = metadata return out, nil } type UpdateSourceServerReplicationTypeInput struct { // Replication type to which to update source server. // // This member is required. ReplicationType types.ReplicationType // ID of source server on which to update replication type. // // This member is required. SourceServerID *string noSmithyDocumentSerde } type UpdateSourceServerReplicationTypeOutput struct { // Source server application ID. ApplicationID *string // Source server ARN. Arn *string // Source server data replication info. DataReplicationInfo *types.DataReplicationInfo // Source server fqdn for action framework. FqdnForActionFramework *string // Source server archived status. IsArchived *bool // Source server launched instance. LaunchedInstance *types.LaunchedInstance // Source server lifecycle state. LifeCycle *types.LifeCycle // Source server replication type. ReplicationType types.ReplicationType // Source server properties. SourceProperties *types.SourceProperties // Source server ID. SourceServerID *string // Source server Tags. Tags map[string]string // Source server user provided ID. UserProvidedID *string // Source server vCenter client id. VcenterClientID *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateSourceServerReplicationTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSourceServerReplicationType{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSourceServerReplicationType{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateSourceServerReplicationTypeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSourceServerReplicationType(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 } return nil } func newServiceMetadataMiddleware_opUpdateSourceServerReplicationType(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "UpdateSourceServerReplicationType", } }
167
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mgn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Update wave. func (c *Client) UpdateWave(ctx context.Context, params *UpdateWaveInput, optFns ...func(*Options)) (*UpdateWaveOutput, error) { if params == nil { params = &UpdateWaveInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateWave", params, optFns, c.addOperationUpdateWaveMiddlewares) if err != nil { return nil, err } out := result.(*UpdateWaveOutput) out.ResultMetadata = metadata return out, nil } type UpdateWaveInput struct { // Wave ID. // // This member is required. WaveID *string // Wave description. Description *string // Wave name. Name *string noSmithyDocumentSerde } type UpdateWaveOutput struct { // Wave ARN. Arn *string // Wave creation dateTime. CreationDateTime *string // Wave description. Description *string // Wave archival status. IsArchived *bool // Wave last modified dateTime. LastModifiedDateTime *string // Wave name. Name *string // Wave tags. Tags map[string]string // Wave aggregated status. WaveAggregatedStatus *types.WaveAggregatedStatus // Wave ID. WaveID *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateWaveMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateWave{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateWave{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateWaveValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateWave(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 } return nil } func newServiceMetadataMiddleware_opUpdateWave(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgn", OperationName: "UpdateWave", } }
155
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/mgn/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "io/ioutil" "math" "strconv" "strings" ) type awsRestjson1_deserializeOpArchiveApplication struct { } func (*awsRestjson1_deserializeOpArchiveApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpArchiveApplication) 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_deserializeOpErrorArchiveApplication(response, &metadata) } output := &ArchiveApplicationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentArchiveApplicationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorArchiveApplication(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentArchiveApplicationOutput(v **ArchiveApplicationOutput, 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 *ArchiveApplicationOutput if *v == nil { sv = &ArchiveApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationAggregatedStatus": if err := awsRestjson1_deserializeDocumentApplicationAggregatedStatus(&sv.ApplicationAggregatedStatus, value); err != nil { return err } case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "lastModifiedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastModifiedDateTime = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpArchiveWave struct { } func (*awsRestjson1_deserializeOpArchiveWave) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpArchiveWave) 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_deserializeOpErrorArchiveWave(response, &metadata) } output := &ArchiveWaveOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentArchiveWaveOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorArchiveWave(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentArchiveWaveOutput(v **ArchiveWaveOutput, 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 *ArchiveWaveOutput if *v == nil { sv = &ArchiveWaveOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "lastModifiedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastModifiedDateTime = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "waveAggregatedStatus": if err := awsRestjson1_deserializeDocumentWaveAggregatedStatus(&sv.WaveAggregatedStatus, value); err != nil { return err } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpAssociateApplications struct { } func (*awsRestjson1_deserializeOpAssociateApplications) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpAssociateApplications) 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_deserializeOpErrorAssociateApplications(response, &metadata) } output := &AssociateApplicationsOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorAssociateApplications(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpAssociateSourceServers struct { } func (*awsRestjson1_deserializeOpAssociateSourceServers) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpAssociateSourceServers) 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_deserializeOpErrorAssociateSourceServers(response, &metadata) } output := &AssociateSourceServersOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorAssociateSourceServers(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpChangeServerLifeCycleState struct { } func (*awsRestjson1_deserializeOpChangeServerLifeCycleState) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpChangeServerLifeCycleState) 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_deserializeOpErrorChangeServerLifeCycleState(response, &metadata) } output := &ChangeServerLifeCycleStateOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentChangeServerLifeCycleStateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorChangeServerLifeCycleState(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentChangeServerLifeCycleStateOutput(v **ChangeServerLifeCycleStateOutput, 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 *ChangeServerLifeCycleStateOutput if *v == nil { sv = &ChangeServerLifeCycleStateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "dataReplicationInfo": if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { return err } case "fqdnForActionFramework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FqdnForActionFramework = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "launchedInstance": if err := awsRestjson1_deserializeDocumentLaunchedInstance(&sv.LaunchedInstance, value); err != nil { return err } case "lifeCycle": if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { return err } case "replicationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationType to be of type string, got %T instead", value) } sv.ReplicationType = types.ReplicationType(jtv) } case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "userProvidedID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.UserProvidedID = ptr.String(jtv) } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateApplication struct { } func (*awsRestjson1_deserializeOpCreateApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateApplication) 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_deserializeOpErrorCreateApplication(response, &metadata) } output := &CreateApplicationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentCreateApplicationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateApplication(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateApplicationOutput(v **CreateApplicationOutput, 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 *CreateApplicationOutput if *v == nil { sv = &CreateApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationAggregatedStatus": if err := awsRestjson1_deserializeDocumentApplicationAggregatedStatus(&sv.ApplicationAggregatedStatus, value); err != nil { return err } case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "lastModifiedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastModifiedDateTime = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateLaunchConfigurationTemplate struct { } func (*awsRestjson1_deserializeOpCreateLaunchConfigurationTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateLaunchConfigurationTemplate) 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_deserializeOpErrorCreateLaunchConfigurationTemplate(response, &metadata) } output := &CreateLaunchConfigurationTemplateOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentCreateLaunchConfigurationTemplateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateLaunchConfigurationTemplate(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateLaunchConfigurationTemplateOutput(v **CreateLaunchConfigurationTemplateOutput, 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 *CreateLaunchConfigurationTemplateOutput if *v == nil { sv = &CreateLaunchConfigurationTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "associatePublicIpAddress": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssociatePublicIpAddress = ptr.Bool(jtv) } case "bootMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BootMode to be of type string, got %T instead", value) } sv.BootMode = types.BootMode(jtv) } case "copyPrivateIp": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyPrivateIp = ptr.Bool(jtv) } case "copyTags": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyTags = ptr.Bool(jtv) } case "ec2LaunchTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2LaunchConfigurationTemplateID to be of type string, got %T instead", value) } sv.Ec2LaunchTemplateID = ptr.String(jtv) } case "enableMapAutoTagging": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnableMapAutoTagging = ptr.Bool(jtv) } case "largeVolumeConf": if err := awsRestjson1_deserializeDocumentLaunchTemplateDiskConf(&sv.LargeVolumeConf, value); err != nil { return err } case "launchConfigurationTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchConfigurationTemplateID to be of type string, got %T instead", value) } sv.LaunchConfigurationTemplateID = ptr.String(jtv) } case "launchDisposition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchDisposition to be of type string, got %T instead", value) } sv.LaunchDisposition = types.LaunchDisposition(jtv) } case "licensing": if err := awsRestjson1_deserializeDocumentLicensing(&sv.Licensing, value); err != nil { return err } case "mapAutoTaggingMpeID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } sv.MapAutoTaggingMpeID = ptr.String(jtv) } case "postLaunchActions": if err := awsRestjson1_deserializeDocumentPostLaunchActions(&sv.PostLaunchActions, value); err != nil { return err } case "smallVolumeConf": if err := awsRestjson1_deserializeDocumentLaunchTemplateDiskConf(&sv.SmallVolumeConf, value); err != nil { return err } case "smallVolumeMaxSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SmallVolumeMaxSize = i64 } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "targetInstanceTypeRightSizingMethod": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TargetInstanceTypeRightSizingMethod to be of type string, got %T instead", value) } sv.TargetInstanceTypeRightSizingMethod = types.TargetInstanceTypeRightSizingMethod(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateReplicationConfigurationTemplate struct { } func (*awsRestjson1_deserializeOpCreateReplicationConfigurationTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateReplicationConfigurationTemplate) 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_deserializeOpErrorCreateReplicationConfigurationTemplate(response, &metadata) } output := &CreateReplicationConfigurationTemplateOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentCreateReplicationConfigurationTemplateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateReplicationConfigurationTemplate(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateReplicationConfigurationTemplateOutput(v **CreateReplicationConfigurationTemplateOutput, 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 *CreateReplicationConfigurationTemplateOutput if *v == nil { sv = &CreateReplicationConfigurationTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "associateDefaultSecurityGroup": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssociateDefaultSecurityGroup = ptr.Bool(jtv) } case "bandwidthThrottling": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BandwidthThrottling = i64 } case "createPublicIP": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CreatePublicIP = ptr.Bool(jtv) } case "dataPlaneRouting": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationDataPlaneRouting to be of type string, got %T instead", value) } sv.DataPlaneRouting = types.ReplicationConfigurationDataPlaneRouting(jtv) } case "defaultLargeStagingDiskType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationDefaultLargeStagingDiskType to be of type string, got %T instead", value) } sv.DefaultLargeStagingDiskType = types.ReplicationConfigurationDefaultLargeStagingDiskType(jtv) } case "ebsEncryption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationEbsEncryption to be of type string, got %T instead", value) } sv.EbsEncryption = types.ReplicationConfigurationEbsEncryption(jtv) } case "ebsEncryptionKeyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.EbsEncryptionKeyArn = ptr.String(jtv) } case "replicationConfigurationTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationTemplateID to be of type string, got %T instead", value) } sv.ReplicationConfigurationTemplateID = ptr.String(jtv) } case "replicationServerInstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceType to be of type string, got %T instead", value) } sv.ReplicationServerInstanceType = ptr.String(jtv) } case "replicationServersSecurityGroupsIDs": if err := awsRestjson1_deserializeDocumentReplicationServersSecurityGroupsIDs(&sv.ReplicationServersSecurityGroupsIDs, value); err != nil { return err } case "stagingAreaSubnetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SubnetID to be of type string, got %T instead", value) } sv.StagingAreaSubnetId = ptr.String(jtv) } case "stagingAreaTags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.StagingAreaTags, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "useDedicatedReplicationServer": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseDedicatedReplicationServer = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateWave struct { } func (*awsRestjson1_deserializeOpCreateWave) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateWave) 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_deserializeOpErrorCreateWave(response, &metadata) } output := &CreateWaveOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentCreateWaveOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateWave(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateWaveOutput(v **CreateWaveOutput, 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 *CreateWaveOutput if *v == nil { sv = &CreateWaveOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "lastModifiedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastModifiedDateTime = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "waveAggregatedStatus": if err := awsRestjson1_deserializeDocumentWaveAggregatedStatus(&sv.WaveAggregatedStatus, value); err != nil { return err } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteApplication struct { } func (*awsRestjson1_deserializeOpDeleteApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteApplication) 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_deserializeOpErrorDeleteApplication(response, &metadata) } output := &DeleteApplicationOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteApplication(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteJob struct { } func (*awsRestjson1_deserializeOpDeleteJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteJob) 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_deserializeOpErrorDeleteJob(response, &metadata) } output := &DeleteJobOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteJob(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteLaunchConfigurationTemplate struct { } func (*awsRestjson1_deserializeOpDeleteLaunchConfigurationTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteLaunchConfigurationTemplate) 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_deserializeOpErrorDeleteLaunchConfigurationTemplate(response, &metadata) } output := &DeleteLaunchConfigurationTemplateOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteLaunchConfigurationTemplate(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteReplicationConfigurationTemplate struct { } func (*awsRestjson1_deserializeOpDeleteReplicationConfigurationTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteReplicationConfigurationTemplate) 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_deserializeOpErrorDeleteReplicationConfigurationTemplate(response, &metadata) } output := &DeleteReplicationConfigurationTemplateOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteReplicationConfigurationTemplate(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteSourceServer struct { } func (*awsRestjson1_deserializeOpDeleteSourceServer) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteSourceServer) 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_deserializeOpErrorDeleteSourceServer(response, &metadata) } output := &DeleteSourceServerOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteSourceServer(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteVcenterClient struct { } func (*awsRestjson1_deserializeOpDeleteVcenterClient) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteVcenterClient) 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_deserializeOpErrorDeleteVcenterClient(response, &metadata) } output := &DeleteVcenterClientOutput{} 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_deserializeOpErrorDeleteVcenterClient(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteWave struct { } func (*awsRestjson1_deserializeOpDeleteWave) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteWave) 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_deserializeOpErrorDeleteWave(response, &metadata) } output := &DeleteWaveOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteWave(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDescribeJobLogItems struct { } func (*awsRestjson1_deserializeOpDescribeJobLogItems) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeJobLogItems) 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_deserializeOpErrorDescribeJobLogItems(response, &metadata) } output := &DescribeJobLogItemsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentDescribeJobLogItemsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDescribeJobLogItems(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeJobLogItemsOutput(v **DescribeJobLogItemsOutput, 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 *DescribeJobLogItemsOutput if *v == nil { sv = &DescribeJobLogItemsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentJobLogs(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeJobs struct { } func (*awsRestjson1_deserializeOpDescribeJobs) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeJobs) 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_deserializeOpErrorDescribeJobs(response, &metadata) } output := &DescribeJobsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentDescribeJobsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDescribeJobs(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeJobsOutput(v **DescribeJobsOutput, 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 *DescribeJobsOutput if *v == nil { sv = &DescribeJobsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentJobsList(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeLaunchConfigurationTemplates struct { } func (*awsRestjson1_deserializeOpDescribeLaunchConfigurationTemplates) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeLaunchConfigurationTemplates) 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_deserializeOpErrorDescribeLaunchConfigurationTemplates(response, &metadata) } output := &DescribeLaunchConfigurationTemplatesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentDescribeLaunchConfigurationTemplatesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDescribeLaunchConfigurationTemplates(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeLaunchConfigurationTemplatesOutput(v **DescribeLaunchConfigurationTemplatesOutput, 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 *DescribeLaunchConfigurationTemplatesOutput if *v == nil { sv = &DescribeLaunchConfigurationTemplatesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentLaunchConfigurationTemplates(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeReplicationConfigurationTemplates struct { } func (*awsRestjson1_deserializeOpDescribeReplicationConfigurationTemplates) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeReplicationConfigurationTemplates) 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_deserializeOpErrorDescribeReplicationConfigurationTemplates(response, &metadata) } output := &DescribeReplicationConfigurationTemplatesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentDescribeReplicationConfigurationTemplatesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDescribeReplicationConfigurationTemplates(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeReplicationConfigurationTemplatesOutput(v **DescribeReplicationConfigurationTemplatesOutput, 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 *DescribeReplicationConfigurationTemplatesOutput if *v == nil { sv = &DescribeReplicationConfigurationTemplatesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentReplicationConfigurationTemplates(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeSourceServers struct { } func (*awsRestjson1_deserializeOpDescribeSourceServers) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeSourceServers) 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_deserializeOpErrorDescribeSourceServers(response, &metadata) } output := &DescribeSourceServersOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentDescribeSourceServersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDescribeSourceServers(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeSourceServersOutput(v **DescribeSourceServersOutput, 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 *DescribeSourceServersOutput if *v == nil { sv = &DescribeSourceServersOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentSourceServersList(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeVcenterClients struct { } func (*awsRestjson1_deserializeOpDescribeVcenterClients) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeVcenterClients) 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_deserializeOpErrorDescribeVcenterClients(response, &metadata) } output := &DescribeVcenterClientsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentDescribeVcenterClientsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDescribeVcenterClients(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeVcenterClientsOutput(v **DescribeVcenterClientsOutput, 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 *DescribeVcenterClientsOutput if *v == nil { sv = &DescribeVcenterClientsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentVcenterClientList(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDisassociateApplications struct { } func (*awsRestjson1_deserializeOpDisassociateApplications) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDisassociateApplications) 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_deserializeOpErrorDisassociateApplications(response, &metadata) } output := &DisassociateApplicationsOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDisassociateApplications(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDisassociateSourceServers struct { } func (*awsRestjson1_deserializeOpDisassociateSourceServers) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDisassociateSourceServers) 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_deserializeOpErrorDisassociateSourceServers(response, &metadata) } output := &DisassociateSourceServersOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDisassociateSourceServers(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDisconnectFromService struct { } func (*awsRestjson1_deserializeOpDisconnectFromService) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDisconnectFromService) 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_deserializeOpErrorDisconnectFromService(response, &metadata) } output := &DisconnectFromServiceOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentDisconnectFromServiceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDisconnectFromService(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDisconnectFromServiceOutput(v **DisconnectFromServiceOutput, 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 *DisconnectFromServiceOutput if *v == nil { sv = &DisconnectFromServiceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "dataReplicationInfo": if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { return err } case "fqdnForActionFramework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FqdnForActionFramework = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "launchedInstance": if err := awsRestjson1_deserializeDocumentLaunchedInstance(&sv.LaunchedInstance, value); err != nil { return err } case "lifeCycle": if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { return err } case "replicationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationType to be of type string, got %T instead", value) } sv.ReplicationType = types.ReplicationType(jtv) } case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "userProvidedID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.UserProvidedID = ptr.String(jtv) } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpFinalizeCutover struct { } func (*awsRestjson1_deserializeOpFinalizeCutover) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpFinalizeCutover) 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_deserializeOpErrorFinalizeCutover(response, &metadata) } output := &FinalizeCutoverOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentFinalizeCutoverOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorFinalizeCutover(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentFinalizeCutoverOutput(v **FinalizeCutoverOutput, 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 *FinalizeCutoverOutput if *v == nil { sv = &FinalizeCutoverOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "dataReplicationInfo": if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { return err } case "fqdnForActionFramework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FqdnForActionFramework = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "launchedInstance": if err := awsRestjson1_deserializeDocumentLaunchedInstance(&sv.LaunchedInstance, value); err != nil { return err } case "lifeCycle": if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { return err } case "replicationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationType to be of type string, got %T instead", value) } sv.ReplicationType = types.ReplicationType(jtv) } case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "userProvidedID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.UserProvidedID = ptr.String(jtv) } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetLaunchConfiguration struct { } func (*awsRestjson1_deserializeOpGetLaunchConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetLaunchConfiguration) 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_deserializeOpErrorGetLaunchConfiguration(response, &metadata) } output := &GetLaunchConfigurationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentGetLaunchConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetLaunchConfiguration(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetLaunchConfigurationOutput(v **GetLaunchConfigurationOutput, 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 *GetLaunchConfigurationOutput if *v == nil { sv = &GetLaunchConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "bootMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BootMode to be of type string, got %T instead", value) } sv.BootMode = types.BootMode(jtv) } case "copyPrivateIp": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyPrivateIp = ptr.Bool(jtv) } case "copyTags": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyTags = ptr.Bool(jtv) } case "ec2LaunchTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.Ec2LaunchTemplateID = ptr.String(jtv) } case "enableMapAutoTagging": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnableMapAutoTagging = ptr.Bool(jtv) } case "launchDisposition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchDisposition to be of type string, got %T instead", value) } sv.LaunchDisposition = types.LaunchDisposition(jtv) } case "licensing": if err := awsRestjson1_deserializeDocumentLicensing(&sv.Licensing, value); err != nil { return err } case "mapAutoTaggingMpeID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } sv.MapAutoTaggingMpeID = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SmallBoundedString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "postLaunchActions": if err := awsRestjson1_deserializeDocumentPostLaunchActions(&sv.PostLaunchActions, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "targetInstanceTypeRightSizingMethod": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TargetInstanceTypeRightSizingMethod to be of type string, got %T instead", value) } sv.TargetInstanceTypeRightSizingMethod = types.TargetInstanceTypeRightSizingMethod(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetReplicationConfiguration struct { } func (*awsRestjson1_deserializeOpGetReplicationConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetReplicationConfiguration) 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_deserializeOpErrorGetReplicationConfiguration(response, &metadata) } output := &GetReplicationConfigurationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentGetReplicationConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetReplicationConfiguration(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetReplicationConfigurationOutput(v **GetReplicationConfigurationOutput, 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 *GetReplicationConfigurationOutput if *v == nil { sv = &GetReplicationConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "associateDefaultSecurityGroup": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssociateDefaultSecurityGroup = ptr.Bool(jtv) } case "bandwidthThrottling": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BandwidthThrottling = i64 } case "createPublicIP": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CreatePublicIP = ptr.Bool(jtv) } case "dataPlaneRouting": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationDataPlaneRouting to be of type string, got %T instead", value) } sv.DataPlaneRouting = types.ReplicationConfigurationDataPlaneRouting(jtv) } case "defaultLargeStagingDiskType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationDefaultLargeStagingDiskType to be of type string, got %T instead", value) } sv.DefaultLargeStagingDiskType = types.ReplicationConfigurationDefaultLargeStagingDiskType(jtv) } case "ebsEncryption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationEbsEncryption to be of type string, got %T instead", value) } sv.EbsEncryption = types.ReplicationConfigurationEbsEncryption(jtv) } case "ebsEncryptionKeyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.EbsEncryptionKeyArn = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SmallBoundedString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "replicatedDisks": if err := awsRestjson1_deserializeDocumentReplicationConfigurationReplicatedDisks(&sv.ReplicatedDisks, value); err != nil { return err } case "replicationServerInstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceType to be of type string, got %T instead", value) } sv.ReplicationServerInstanceType = ptr.String(jtv) } case "replicationServersSecurityGroupsIDs": if err := awsRestjson1_deserializeDocumentReplicationServersSecurityGroupsIDs(&sv.ReplicationServersSecurityGroupsIDs, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "stagingAreaSubnetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SubnetID to be of type string, got %T instead", value) } sv.StagingAreaSubnetId = ptr.String(jtv) } case "stagingAreaTags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.StagingAreaTags, value); err != nil { return err } case "useDedicatedReplicationServer": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseDedicatedReplicationServer = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpInitializeService struct { } func (*awsRestjson1_deserializeOpInitializeService) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpInitializeService) 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_deserializeOpErrorInitializeService(response, &metadata) } output := &InitializeServiceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorInitializeService(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("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpListApplications struct { } func (*awsRestjson1_deserializeOpListApplications) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListApplications) 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_deserializeOpErrorListApplications(response, &metadata) } output := &ListApplicationsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListApplicationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListApplications(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListApplicationsOutput(v **ListApplicationsOutput, 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 *ListApplicationsOutput if *v == nil { sv = &ListApplicationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentApplicationsList(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListExportErrors struct { } func (*awsRestjson1_deserializeOpListExportErrors) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListExportErrors) 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_deserializeOpErrorListExportErrors(response, &metadata) } output := &ListExportErrorsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListExportErrorsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListExportErrors(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListExportErrorsOutput(v **ListExportErrorsOutput, 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 *ListExportErrorsOutput if *v == nil { sv = &ListExportErrorsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentExportErrors(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListExports struct { } func (*awsRestjson1_deserializeOpListExports) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListExports) 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_deserializeOpErrorListExports(response, &metadata) } output := &ListExportsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListExportsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListExports(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListExportsOutput(v **ListExportsOutput, 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 *ListExportsOutput if *v == nil { sv = &ListExportsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentExportsList(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListImportErrors struct { } func (*awsRestjson1_deserializeOpListImportErrors) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListImportErrors) 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_deserializeOpErrorListImportErrors(response, &metadata) } output := &ListImportErrorsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListImportErrorsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListImportErrors(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListImportErrorsOutput(v **ListImportErrorsOutput, 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 *ListImportErrorsOutput if *v == nil { sv = &ListImportErrorsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentImportErrors(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListImports struct { } func (*awsRestjson1_deserializeOpListImports) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListImports) 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_deserializeOpErrorListImports(response, &metadata) } output := &ListImportsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListImportsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListImports(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListImportsOutput(v **ListImportsOutput, 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 *ListImportsOutput if *v == nil { sv = &ListImportsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentImportList(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListSourceServerActions struct { } func (*awsRestjson1_deserializeOpListSourceServerActions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListSourceServerActions) 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_deserializeOpErrorListSourceServerActions(response, &metadata) } output := &ListSourceServerActionsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListSourceServerActionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListSourceServerActions(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListSourceServerActionsOutput(v **ListSourceServerActionsOutput, 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 *ListSourceServerActionsOutput if *v == nil { sv = &ListSourceServerActionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentSourceServerActionDocuments(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTagsForResource struct { } func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTagsForResourceOutput if *v == nil { sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTemplateActions struct { } func (*awsRestjson1_deserializeOpListTemplateActions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTemplateActions) 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_deserializeOpErrorListTemplateActions(response, &metadata) } output := &ListTemplateActionsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListTemplateActionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListTemplateActions(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListTemplateActionsOutput(v **ListTemplateActionsOutput, 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 *ListTemplateActionsOutput if *v == nil { sv = &ListTemplateActionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentTemplateActionDocuments(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListWaves struct { } func (*awsRestjson1_deserializeOpListWaves) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListWaves) 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_deserializeOpErrorListWaves(response, &metadata) } output := &ListWavesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListWavesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListWaves(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListWavesOutput(v **ListWavesOutput, 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 *ListWavesOutput if *v == nil { sv = &ListWavesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentWavesList(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpMarkAsArchived struct { } func (*awsRestjson1_deserializeOpMarkAsArchived) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpMarkAsArchived) 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_deserializeOpErrorMarkAsArchived(response, &metadata) } output := &MarkAsArchivedOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentMarkAsArchivedOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorMarkAsArchived(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentMarkAsArchivedOutput(v **MarkAsArchivedOutput, 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 *MarkAsArchivedOutput if *v == nil { sv = &MarkAsArchivedOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "dataReplicationInfo": if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { return err } case "fqdnForActionFramework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FqdnForActionFramework = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "launchedInstance": if err := awsRestjson1_deserializeDocumentLaunchedInstance(&sv.LaunchedInstance, value); err != nil { return err } case "lifeCycle": if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { return err } case "replicationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationType to be of type string, got %T instead", value) } sv.ReplicationType = types.ReplicationType(jtv) } case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "userProvidedID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.UserProvidedID = ptr.String(jtv) } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpPutSourceServerAction struct { } func (*awsRestjson1_deserializeOpPutSourceServerAction) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpPutSourceServerAction) 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_deserializeOpErrorPutSourceServerAction(response, &metadata) } output := &PutSourceServerActionOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentPutSourceServerActionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorPutSourceServerAction(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentPutSourceServerActionOutput(v **PutSourceServerActionOutput, 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 *PutSourceServerActionOutput if *v == nil { sv = &PutSourceServerActionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "actionID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionID to be of type string, got %T instead", value) } sv.ActionID = ptr.String(jtv) } case "actionName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionName to be of type string, got %T instead", value) } sv.ActionName = ptr.String(jtv) } case "active": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Active = ptr.Bool(jtv) } case "category": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionCategory to be of type string, got %T instead", value) } sv.Category = types.ActionCategory(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "documentIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.DocumentIdentifier = ptr.String(jtv) } case "documentVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DocumentVersion to be of type string, got %T instead", value) } sv.DocumentVersion = ptr.String(jtv) } case "externalParameters": if err := awsRestjson1_deserializeDocumentSsmDocumentExternalParameters(&sv.ExternalParameters, value); err != nil { return err } case "mustSucceedForCutover": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.MustSucceedForCutover = ptr.Bool(jtv) } case "order": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected OrderType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Order = int32(i64) } case "parameters": if err := awsRestjson1_deserializeDocumentSsmDocumentParameters(&sv.Parameters, value); err != nil { return err } case "timeoutSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StrictlyPositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TimeoutSeconds = int32(i64) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpPutTemplateAction struct { } func (*awsRestjson1_deserializeOpPutTemplateAction) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpPutTemplateAction) 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_deserializeOpErrorPutTemplateAction(response, &metadata) } output := &PutTemplateActionOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentPutTemplateActionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorPutTemplateAction(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentPutTemplateActionOutput(v **PutTemplateActionOutput, 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 *PutTemplateActionOutput if *v == nil { sv = &PutTemplateActionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "actionID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionID to be of type string, got %T instead", value) } sv.ActionID = ptr.String(jtv) } case "actionName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.ActionName = ptr.String(jtv) } case "active": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Active = ptr.Bool(jtv) } case "category": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionCategory to be of type string, got %T instead", value) } sv.Category = types.ActionCategory(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "documentIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.DocumentIdentifier = ptr.String(jtv) } case "documentVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DocumentVersion to be of type string, got %T instead", value) } sv.DocumentVersion = ptr.String(jtv) } case "externalParameters": if err := awsRestjson1_deserializeDocumentSsmDocumentExternalParameters(&sv.ExternalParameters, value); err != nil { return err } case "mustSucceedForCutover": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.MustSucceedForCutover = ptr.Bool(jtv) } case "operatingSystem": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperatingSystemString to be of type string, got %T instead", value) } sv.OperatingSystem = ptr.String(jtv) } case "order": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected OrderType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Order = int32(i64) } case "parameters": if err := awsRestjson1_deserializeDocumentSsmDocumentParameters(&sv.Parameters, value); err != nil { return err } case "timeoutSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StrictlyPositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TimeoutSeconds = int32(i64) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpRemoveSourceServerAction struct { } func (*awsRestjson1_deserializeOpRemoveSourceServerAction) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpRemoveSourceServerAction) 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_deserializeOpErrorRemoveSourceServerAction(response, &metadata) } output := &RemoveSourceServerActionOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorRemoveSourceServerAction(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpRemoveTemplateAction struct { } func (*awsRestjson1_deserializeOpRemoveTemplateAction) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpRemoveTemplateAction) 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_deserializeOpErrorRemoveTemplateAction(response, &metadata) } output := &RemoveTemplateActionOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorRemoveTemplateAction(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpRetryDataReplication struct { } func (*awsRestjson1_deserializeOpRetryDataReplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpRetryDataReplication) 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_deserializeOpErrorRetryDataReplication(response, &metadata) } output := &RetryDataReplicationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentRetryDataReplicationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorRetryDataReplication(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentRetryDataReplicationOutput(v **RetryDataReplicationOutput, 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 *RetryDataReplicationOutput if *v == nil { sv = &RetryDataReplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "dataReplicationInfo": if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { return err } case "fqdnForActionFramework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FqdnForActionFramework = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "launchedInstance": if err := awsRestjson1_deserializeDocumentLaunchedInstance(&sv.LaunchedInstance, value); err != nil { return err } case "lifeCycle": if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { return err } case "replicationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationType to be of type string, got %T instead", value) } sv.ReplicationType = types.ReplicationType(jtv) } case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "userProvidedID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.UserProvidedID = ptr.String(jtv) } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStartCutover struct { } func (*awsRestjson1_deserializeOpStartCutover) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartCutover) 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_deserializeOpErrorStartCutover(response, &metadata) } output := &StartCutoverOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentStartCutoverOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorStartCutover(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentStartCutoverOutput(v **StartCutoverOutput, 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 *StartCutoverOutput if *v == nil { sv = &StartCutoverOutput{} } else { sv = *v } for key, value := range shape { switch key { case "job": if err := awsRestjson1_deserializeDocumentJob(&sv.Job, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStartExport struct { } func (*awsRestjson1_deserializeOpStartExport) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartExport) 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_deserializeOpErrorStartExport(response, &metadata) } output := &StartExportOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentStartExportOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorStartExport(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("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentStartExportOutput(v **StartExportOutput, 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 *StartExportOutput if *v == nil { sv = &StartExportOutput{} } else { sv = *v } for key, value := range shape { switch key { case "exportTask": if err := awsRestjson1_deserializeDocumentExportTask(&sv.ExportTask, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStartImport struct { } func (*awsRestjson1_deserializeOpStartImport) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartImport) 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_deserializeOpErrorStartImport(response, &metadata) } output := &StartImportOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentStartImportOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorStartImport(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentStartImportOutput(v **StartImportOutput, 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 *StartImportOutput if *v == nil { sv = &StartImportOutput{} } else { sv = *v } for key, value := range shape { switch key { case "importTask": if err := awsRestjson1_deserializeDocumentImportTask(&sv.ImportTask, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStartReplication struct { } func (*awsRestjson1_deserializeOpStartReplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartReplication) 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_deserializeOpErrorStartReplication(response, &metadata) } output := &StartReplicationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentStartReplicationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorStartReplication(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentStartReplicationOutput(v **StartReplicationOutput, 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 *StartReplicationOutput if *v == nil { sv = &StartReplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "dataReplicationInfo": if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { return err } case "fqdnForActionFramework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FqdnForActionFramework = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "launchedInstance": if err := awsRestjson1_deserializeDocumentLaunchedInstance(&sv.LaunchedInstance, value); err != nil { return err } case "lifeCycle": if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { return err } case "replicationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationType to be of type string, got %T instead", value) } sv.ReplicationType = types.ReplicationType(jtv) } case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "userProvidedID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.UserProvidedID = ptr.String(jtv) } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStartTest struct { } func (*awsRestjson1_deserializeOpStartTest) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartTest) 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_deserializeOpErrorStartTest(response, &metadata) } output := &StartTestOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentStartTestOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorStartTest(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentStartTestOutput(v **StartTestOutput, 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 *StartTestOutput if *v == nil { sv = &StartTestOutput{} } else { sv = *v } for key, value := range shape { switch key { case "job": if err := awsRestjson1_deserializeDocumentJob(&sv.Job, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpTagResource struct { } func (*awsRestjson1_deserializeOpTagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpTagResource) 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_deserializeOpErrorTagResource(response, &metadata) } output := &TagResourceOutput{} 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_deserializeOpErrorTagResource(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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpTerminateTargetInstances struct { } func (*awsRestjson1_deserializeOpTerminateTargetInstances) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpTerminateTargetInstances) 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_deserializeOpErrorTerminateTargetInstances(response, &metadata) } output := &TerminateTargetInstancesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentTerminateTargetInstancesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorTerminateTargetInstances(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentTerminateTargetInstancesOutput(v **TerminateTargetInstancesOutput, 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 *TerminateTargetInstancesOutput if *v == nil { sv = &TerminateTargetInstancesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "job": if err := awsRestjson1_deserializeDocumentJob(&sv.Job, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUnarchiveApplication struct { } func (*awsRestjson1_deserializeOpUnarchiveApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUnarchiveApplication) 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_deserializeOpErrorUnarchiveApplication(response, &metadata) } output := &UnarchiveApplicationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentUnarchiveApplicationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorUnarchiveApplication(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUnarchiveApplicationOutput(v **UnarchiveApplicationOutput, 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 *UnarchiveApplicationOutput if *v == nil { sv = &UnarchiveApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationAggregatedStatus": if err := awsRestjson1_deserializeDocumentApplicationAggregatedStatus(&sv.ApplicationAggregatedStatus, value); err != nil { return err } case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "lastModifiedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastModifiedDateTime = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUnarchiveWave struct { } func (*awsRestjson1_deserializeOpUnarchiveWave) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUnarchiveWave) 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_deserializeOpErrorUnarchiveWave(response, &metadata) } output := &UnarchiveWaveOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentUnarchiveWaveOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorUnarchiveWave(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUnarchiveWaveOutput(v **UnarchiveWaveOutput, 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 *UnarchiveWaveOutput if *v == nil { sv = &UnarchiveWaveOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "lastModifiedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastModifiedDateTime = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "waveAggregatedStatus": if err := awsRestjson1_deserializeDocumentWaveAggregatedStatus(&sv.WaveAggregatedStatus, value); err != nil { return err } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUntagResource struct { } func (*awsRestjson1_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUntagResource) 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_deserializeOpErrorUntagResource(response, &metadata) } output := &UntagResourceOutput{} 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_deserializeOpErrorUntagResource(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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUpdateApplication struct { } func (*awsRestjson1_deserializeOpUpdateApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateApplication) 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_deserializeOpErrorUpdateApplication(response, &metadata) } output := &UpdateApplicationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentUpdateApplicationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateApplication(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateApplicationOutput(v **UpdateApplicationOutput, 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 *UpdateApplicationOutput if *v == nil { sv = &UpdateApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationAggregatedStatus": if err := awsRestjson1_deserializeDocumentApplicationAggregatedStatus(&sv.ApplicationAggregatedStatus, value); err != nil { return err } case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "lastModifiedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastModifiedDateTime = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateLaunchConfiguration struct { } func (*awsRestjson1_deserializeOpUpdateLaunchConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateLaunchConfiguration) 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_deserializeOpErrorUpdateLaunchConfiguration(response, &metadata) } output := &UpdateLaunchConfigurationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentUpdateLaunchConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateLaunchConfiguration(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateLaunchConfigurationOutput(v **UpdateLaunchConfigurationOutput, 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 *UpdateLaunchConfigurationOutput if *v == nil { sv = &UpdateLaunchConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "bootMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BootMode to be of type string, got %T instead", value) } sv.BootMode = types.BootMode(jtv) } case "copyPrivateIp": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyPrivateIp = ptr.Bool(jtv) } case "copyTags": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyTags = ptr.Bool(jtv) } case "ec2LaunchTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.Ec2LaunchTemplateID = ptr.String(jtv) } case "enableMapAutoTagging": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnableMapAutoTagging = ptr.Bool(jtv) } case "launchDisposition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchDisposition to be of type string, got %T instead", value) } sv.LaunchDisposition = types.LaunchDisposition(jtv) } case "licensing": if err := awsRestjson1_deserializeDocumentLicensing(&sv.Licensing, value); err != nil { return err } case "mapAutoTaggingMpeID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } sv.MapAutoTaggingMpeID = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SmallBoundedString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "postLaunchActions": if err := awsRestjson1_deserializeDocumentPostLaunchActions(&sv.PostLaunchActions, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "targetInstanceTypeRightSizingMethod": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TargetInstanceTypeRightSizingMethod to be of type string, got %T instead", value) } sv.TargetInstanceTypeRightSizingMethod = types.TargetInstanceTypeRightSizingMethod(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateLaunchConfigurationTemplate struct { } func (*awsRestjson1_deserializeOpUpdateLaunchConfigurationTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateLaunchConfigurationTemplate) 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_deserializeOpErrorUpdateLaunchConfigurationTemplate(response, &metadata) } output := &UpdateLaunchConfigurationTemplateOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentUpdateLaunchConfigurationTemplateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateLaunchConfigurationTemplate(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateLaunchConfigurationTemplateOutput(v **UpdateLaunchConfigurationTemplateOutput, 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 *UpdateLaunchConfigurationTemplateOutput if *v == nil { sv = &UpdateLaunchConfigurationTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "associatePublicIpAddress": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssociatePublicIpAddress = ptr.Bool(jtv) } case "bootMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BootMode to be of type string, got %T instead", value) } sv.BootMode = types.BootMode(jtv) } case "copyPrivateIp": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyPrivateIp = ptr.Bool(jtv) } case "copyTags": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyTags = ptr.Bool(jtv) } case "ec2LaunchTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2LaunchConfigurationTemplateID to be of type string, got %T instead", value) } sv.Ec2LaunchTemplateID = ptr.String(jtv) } case "enableMapAutoTagging": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnableMapAutoTagging = ptr.Bool(jtv) } case "largeVolumeConf": if err := awsRestjson1_deserializeDocumentLaunchTemplateDiskConf(&sv.LargeVolumeConf, value); err != nil { return err } case "launchConfigurationTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchConfigurationTemplateID to be of type string, got %T instead", value) } sv.LaunchConfigurationTemplateID = ptr.String(jtv) } case "launchDisposition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchDisposition to be of type string, got %T instead", value) } sv.LaunchDisposition = types.LaunchDisposition(jtv) } case "licensing": if err := awsRestjson1_deserializeDocumentLicensing(&sv.Licensing, value); err != nil { return err } case "mapAutoTaggingMpeID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } sv.MapAutoTaggingMpeID = ptr.String(jtv) } case "postLaunchActions": if err := awsRestjson1_deserializeDocumentPostLaunchActions(&sv.PostLaunchActions, value); err != nil { return err } case "smallVolumeConf": if err := awsRestjson1_deserializeDocumentLaunchTemplateDiskConf(&sv.SmallVolumeConf, value); err != nil { return err } case "smallVolumeMaxSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SmallVolumeMaxSize = i64 } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "targetInstanceTypeRightSizingMethod": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TargetInstanceTypeRightSizingMethod to be of type string, got %T instead", value) } sv.TargetInstanceTypeRightSizingMethod = types.TargetInstanceTypeRightSizingMethod(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateReplicationConfiguration struct { } func (*awsRestjson1_deserializeOpUpdateReplicationConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateReplicationConfiguration) 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_deserializeOpErrorUpdateReplicationConfiguration(response, &metadata) } output := &UpdateReplicationConfigurationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentUpdateReplicationConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateReplicationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateReplicationConfigurationOutput(v **UpdateReplicationConfigurationOutput, 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 *UpdateReplicationConfigurationOutput if *v == nil { sv = &UpdateReplicationConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "associateDefaultSecurityGroup": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssociateDefaultSecurityGroup = ptr.Bool(jtv) } case "bandwidthThrottling": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BandwidthThrottling = i64 } case "createPublicIP": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CreatePublicIP = ptr.Bool(jtv) } case "dataPlaneRouting": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationDataPlaneRouting to be of type string, got %T instead", value) } sv.DataPlaneRouting = types.ReplicationConfigurationDataPlaneRouting(jtv) } case "defaultLargeStagingDiskType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationDefaultLargeStagingDiskType to be of type string, got %T instead", value) } sv.DefaultLargeStagingDiskType = types.ReplicationConfigurationDefaultLargeStagingDiskType(jtv) } case "ebsEncryption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationEbsEncryption to be of type string, got %T instead", value) } sv.EbsEncryption = types.ReplicationConfigurationEbsEncryption(jtv) } case "ebsEncryptionKeyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.EbsEncryptionKeyArn = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SmallBoundedString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "replicatedDisks": if err := awsRestjson1_deserializeDocumentReplicationConfigurationReplicatedDisks(&sv.ReplicatedDisks, value); err != nil { return err } case "replicationServerInstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceType to be of type string, got %T instead", value) } sv.ReplicationServerInstanceType = ptr.String(jtv) } case "replicationServersSecurityGroupsIDs": if err := awsRestjson1_deserializeDocumentReplicationServersSecurityGroupsIDs(&sv.ReplicationServersSecurityGroupsIDs, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "stagingAreaSubnetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SubnetID to be of type string, got %T instead", value) } sv.StagingAreaSubnetId = ptr.String(jtv) } case "stagingAreaTags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.StagingAreaTags, value); err != nil { return err } case "useDedicatedReplicationServer": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseDedicatedReplicationServer = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateReplicationConfigurationTemplate struct { } func (*awsRestjson1_deserializeOpUpdateReplicationConfigurationTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateReplicationConfigurationTemplate) 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_deserializeOpErrorUpdateReplicationConfigurationTemplate(response, &metadata) } output := &UpdateReplicationConfigurationTemplateOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentUpdateReplicationConfigurationTemplateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateReplicationConfigurationTemplate(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateReplicationConfigurationTemplateOutput(v **UpdateReplicationConfigurationTemplateOutput, 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 *UpdateReplicationConfigurationTemplateOutput if *v == nil { sv = &UpdateReplicationConfigurationTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "associateDefaultSecurityGroup": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssociateDefaultSecurityGroup = ptr.Bool(jtv) } case "bandwidthThrottling": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BandwidthThrottling = i64 } case "createPublicIP": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CreatePublicIP = ptr.Bool(jtv) } case "dataPlaneRouting": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationDataPlaneRouting to be of type string, got %T instead", value) } sv.DataPlaneRouting = types.ReplicationConfigurationDataPlaneRouting(jtv) } case "defaultLargeStagingDiskType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationDefaultLargeStagingDiskType to be of type string, got %T instead", value) } sv.DefaultLargeStagingDiskType = types.ReplicationConfigurationDefaultLargeStagingDiskType(jtv) } case "ebsEncryption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationEbsEncryption to be of type string, got %T instead", value) } sv.EbsEncryption = types.ReplicationConfigurationEbsEncryption(jtv) } case "ebsEncryptionKeyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.EbsEncryptionKeyArn = ptr.String(jtv) } case "replicationConfigurationTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationTemplateID to be of type string, got %T instead", value) } sv.ReplicationConfigurationTemplateID = ptr.String(jtv) } case "replicationServerInstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceType to be of type string, got %T instead", value) } sv.ReplicationServerInstanceType = ptr.String(jtv) } case "replicationServersSecurityGroupsIDs": if err := awsRestjson1_deserializeDocumentReplicationServersSecurityGroupsIDs(&sv.ReplicationServersSecurityGroupsIDs, value); err != nil { return err } case "stagingAreaSubnetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SubnetID to be of type string, got %T instead", value) } sv.StagingAreaSubnetId = ptr.String(jtv) } case "stagingAreaTags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.StagingAreaTags, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "useDedicatedReplicationServer": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseDedicatedReplicationServer = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateSourceServerReplicationType struct { } func (*awsRestjson1_deserializeOpUpdateSourceServerReplicationType) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateSourceServerReplicationType) 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_deserializeOpErrorUpdateSourceServerReplicationType(response, &metadata) } output := &UpdateSourceServerReplicationTypeOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentUpdateSourceServerReplicationTypeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateSourceServerReplicationType(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateSourceServerReplicationTypeOutput(v **UpdateSourceServerReplicationTypeOutput, 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 *UpdateSourceServerReplicationTypeOutput if *v == nil { sv = &UpdateSourceServerReplicationTypeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "dataReplicationInfo": if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { return err } case "fqdnForActionFramework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FqdnForActionFramework = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "launchedInstance": if err := awsRestjson1_deserializeDocumentLaunchedInstance(&sv.LaunchedInstance, value); err != nil { return err } case "lifeCycle": if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { return err } case "replicationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationType to be of type string, got %T instead", value) } sv.ReplicationType = types.ReplicationType(jtv) } case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "userProvidedID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.UserProvidedID = ptr.String(jtv) } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateWave struct { } func (*awsRestjson1_deserializeOpUpdateWave) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateWave) 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_deserializeOpErrorUpdateWave(response, &metadata) } output := &UpdateWaveOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentUpdateWaveOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateWave(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateWaveOutput(v **UpdateWaveOutput, 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 *UpdateWaveOutput if *v == nil { sv = &UpdateWaveOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "lastModifiedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastModifiedDateTime = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "waveAggregatedStatus": if err := awsRestjson1_deserializeDocumentWaveAggregatedStatus(&sv.WaveAggregatedStatus, value); err != nil { return err } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeOpHttpBindingsInternalServerException(v *types.InternalServerException, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { headerValues[0] = strings.TrimSpace(headerValues[0]) vv, err := strconv.ParseInt(headerValues[0], 0, 64) if err != nil { return err } v.RetryAfterSeconds = vv } return nil } func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { headerValues[0] = strings.TrimSpace(headerValues[0]) v.RetryAfterSeconds = ptr.String(headerValues[0]) } return nil } func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.AccessDeniedException{} 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 } err := awsRestjson1_deserializeDocumentAccessDeniedException(&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 awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ConflictException{} 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 } err := awsRestjson1_deserializeDocumentConflictException(&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 awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalServerException{} 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 } err := awsRestjson1_deserializeDocumentInternalServerException(&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) if err := awsRestjson1_deserializeOpHttpBindingsInternalServerException(output, response); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} } return output } func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceNotFoundException{} 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 } err := awsRestjson1_deserializeDocumentResourceNotFoundException(&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 awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ServiceQuotaExceededException{} 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 } err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&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 awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ThrottlingException{} 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 } err := awsRestjson1_deserializeDocumentThrottlingException(&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) if err := awsRestjson1_deserializeOpHttpBindingsThrottlingException(output, response); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} } return output } func awsRestjson1_deserializeErrorUninitializedAccountException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.UninitializedAccountException{} 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 } err := awsRestjson1_deserializeDocumentUninitializedAccountException(&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 awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ValidationException{} 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 } err := awsRestjson1_deserializeDocumentValidationException(&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 awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, 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.AccessDeniedException if *v == nil { sv = &types.AccessDeniedException{} } else { sv = *v } for key, value := range shape { switch key { case "code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentApplication(v **types.Application, 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.Application if *v == nil { sv = &types.Application{} } else { sv = *v } for key, value := range shape { switch key { case "applicationAggregatedStatus": if err := awsRestjson1_deserializeDocumentApplicationAggregatedStatus(&sv.ApplicationAggregatedStatus, value); err != nil { return err } case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "lastModifiedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastModifiedDateTime = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentApplicationAggregatedStatus(v **types.ApplicationAggregatedStatus, 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.ApplicationAggregatedStatus if *v == nil { sv = &types.ApplicationAggregatedStatus{} } else { sv = *v } for key, value := range shape { switch key { case "healthStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationHealthStatus to be of type string, got %T instead", value) } sv.HealthStatus = types.ApplicationHealthStatus(jtv) } case "lastUpdateDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastUpdateDateTime = ptr.String(jtv) } case "progressStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationProgressStatus to be of type string, got %T instead", value) } sv.ProgressStatus = types.ApplicationProgressStatus(jtv) } case "totalSourceServers": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalSourceServers = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentApplicationsList(v *[]types.Application, 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.Application if *v == nil { cv = []types.Application{} } else { cv = *v } for _, value := range shape { var col types.Application destAddr := &col if err := awsRestjson1_deserializeDocumentApplication(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, 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.ConflictException if *v == nil { sv = &types.ConflictException{} } else { sv = *v } for key, value := range shape { switch key { case "code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "errors": if err := awsRestjson1_deserializeDocumentConflictExceptionErrors(&sv.Errors, value); err != nil { return err } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "resourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConflictExceptionErrors(v *[]types.ErrorDetails, 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.ErrorDetails if *v == nil { cv = []types.ErrorDetails{} } else { cv = *v } for _, value := range shape { var col types.ErrorDetails destAddr := &col if err := awsRestjson1_deserializeDocumentErrorDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCPU(v **types.CPU, 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.CPU if *v == nil { sv = &types.CPU{} } else { sv = *v } for key, value := range shape { switch key { case "cores": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Cores = i64 } case "modelName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.ModelName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCpus(v *[]types.CPU, 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.CPU if *v == nil { cv = []types.CPU{} } else { cv = *v } for _, value := range shape { var col types.CPU destAddr := &col if err := awsRestjson1_deserializeDocumentCPU(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDataReplicationError(v **types.DataReplicationError, 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.DataReplicationError if *v == nil { sv = &types.DataReplicationError{} } else { sv = *v } for key, value := range shape { switch key { case "error": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataReplicationErrorString to be of type string, got %T instead", value) } sv.Error = types.DataReplicationErrorString(jtv) } case "rawError": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.RawError = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataReplicationInfo(v **types.DataReplicationInfo, 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.DataReplicationInfo if *v == nil { sv = &types.DataReplicationInfo{} } else { sv = *v } for key, value := range shape { switch key { case "dataReplicationError": if err := awsRestjson1_deserializeDocumentDataReplicationError(&sv.DataReplicationError, value); err != nil { return err } case "dataReplicationInitiation": if err := awsRestjson1_deserializeDocumentDataReplicationInitiation(&sv.DataReplicationInitiation, value); err != nil { return err } case "dataReplicationState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataReplicationState to be of type string, got %T instead", value) } sv.DataReplicationState = types.DataReplicationState(jtv) } case "etaDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.EtaDateTime = ptr.String(jtv) } case "lagDuration": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DurationString to be of type string, got %T instead", value) } sv.LagDuration = ptr.String(jtv) } case "lastSnapshotDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastSnapshotDateTime = ptr.String(jtv) } case "replicatedDisks": if err := awsRestjson1_deserializeDocumentDataReplicationInfoReplicatedDisks(&sv.ReplicatedDisks, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataReplicationInfoReplicatedDisk(v **types.DataReplicationInfoReplicatedDisk, 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.DataReplicationInfoReplicatedDisk if *v == nil { sv = &types.DataReplicationInfoReplicatedDisk{} } else { sv = *v } for key, value := range shape { switch key { case "backloggedStorageBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BackloggedStorageBytes = i64 } case "deviceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.DeviceName = ptr.String(jtv) } case "replicatedStorageBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ReplicatedStorageBytes = i64 } case "rescannedStorageBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RescannedStorageBytes = i64 } case "totalStorageBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalStorageBytes = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataReplicationInfoReplicatedDisks(v *[]types.DataReplicationInfoReplicatedDisk, 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.DataReplicationInfoReplicatedDisk if *v == nil { cv = []types.DataReplicationInfoReplicatedDisk{} } else { cv = *v } for _, value := range shape { var col types.DataReplicationInfoReplicatedDisk destAddr := &col if err := awsRestjson1_deserializeDocumentDataReplicationInfoReplicatedDisk(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDataReplicationInitiation(v **types.DataReplicationInitiation, 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.DataReplicationInitiation if *v == nil { sv = &types.DataReplicationInitiation{} } else { sv = *v } for key, value := range shape { switch key { case "nextAttemptDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.NextAttemptDateTime = ptr.String(jtv) } case "startDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.StartDateTime = ptr.String(jtv) } case "steps": if err := awsRestjson1_deserializeDocumentDataReplicationInitiationSteps(&sv.Steps, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataReplicationInitiationStep(v **types.DataReplicationInitiationStep, 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.DataReplicationInitiationStep if *v == nil { sv = &types.DataReplicationInitiationStep{} } else { sv = *v } for key, value := range shape { switch key { case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataReplicationInitiationStepName to be of type string, got %T instead", value) } sv.Name = types.DataReplicationInitiationStepName(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataReplicationInitiationStepStatus to be of type string, got %T instead", value) } sv.Status = types.DataReplicationInitiationStepStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataReplicationInitiationSteps(v *[]types.DataReplicationInitiationStep, 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.DataReplicationInitiationStep if *v == nil { cv = []types.DataReplicationInitiationStep{} } else { cv = *v } for _, value := range shape { var col types.DataReplicationInitiationStep destAddr := &col if err := awsRestjson1_deserializeDocumentDataReplicationInitiationStep(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDisk(v **types.Disk, 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.Disk if *v == nil { sv = &types.Disk{} } else { sv = *v } for key, value := range shape { switch key { case "bytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Bytes = i64 } case "deviceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.DeviceName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDisks(v *[]types.Disk, 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.Disk if *v == nil { cv = []types.Disk{} } else { cv = *v } for _, value := range shape { var col types.Disk destAddr := &col if err := awsRestjson1_deserializeDocumentDisk(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentErrorDetails(v **types.ErrorDetails, 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.ErrorDetails if *v == nil { sv = &types.ErrorDetails{} } else { sv = *v } for key, value := range shape { switch key { case "code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "resourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentExportErrorData(v **types.ExportErrorData, 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.ExportErrorData if *v == nil { sv = &types.ExportErrorData{} } else { sv = *v } for key, value := range shape { switch key { case "rawError": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.RawError = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentExportErrors(v *[]types.ExportTaskError, 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.ExportTaskError if *v == nil { cv = []types.ExportTaskError{} } else { cv = *v } for _, value := range shape { var col types.ExportTaskError destAddr := &col if err := awsRestjson1_deserializeDocumentExportTaskError(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentExportsList(v *[]types.ExportTask, 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.ExportTask if *v == nil { cv = []types.ExportTask{} } else { cv = *v } for _, value := range shape { var col types.ExportTask destAddr := &col if err := awsRestjson1_deserializeDocumentExportTask(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentExportTask(v **types.ExportTask, 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.ExportTask if *v == nil { sv = &types.ExportTask{} } else { sv = *v } for key, value := range shape { switch key { case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "endDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.EndDateTime = ptr.String(jtv) } case "exportID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExportID to be of type string, got %T instead", value) } sv.ExportID = ptr.String(jtv) } case "progressPercentage": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.ProgressPercentage = ptr.Float32(float32(f64)) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.ProgressPercentage = ptr.Float32(float32(f64)) default: return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) } } case "s3Bucket": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3BucketName to be of type string, got %T instead", value) } sv.S3Bucket = ptr.String(jtv) } case "s3BucketOwner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountID to be of type string, got %T instead", value) } sv.S3BucketOwner = ptr.String(jtv) } case "s3Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Key to be of type string, got %T instead", value) } sv.S3Key = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExportStatus to be of type string, got %T instead", value) } sv.Status = types.ExportStatus(jtv) } case "summary": if err := awsRestjson1_deserializeDocumentExportTaskSummary(&sv.Summary, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentExportTaskError(v **types.ExportTaskError, 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.ExportTaskError if *v == nil { sv = &types.ExportTaskError{} } else { sv = *v } for key, value := range shape { switch key { case "errorData": if err := awsRestjson1_deserializeDocumentExportErrorData(&sv.ErrorData, value); err != nil { return err } case "errorDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.ErrorDateTime = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentExportTaskSummary(v **types.ExportTaskSummary, 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.ExportTaskSummary if *v == nil { sv = &types.ExportTaskSummary{} } else { sv = *v } for key, value := range shape { switch key { case "applicationsCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ApplicationsCount = i64 } case "serversCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ServersCount = i64 } case "wavesCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.WavesCount = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIdentificationHints(v **types.IdentificationHints, 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.IdentificationHints if *v == nil { sv = &types.IdentificationHints{} } else { sv = *v } for key, value := range shape { switch key { case "awsInstanceID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceID to be of type string, got %T instead", value) } sv.AwsInstanceID = ptr.String(jtv) } case "fqdn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.Fqdn = ptr.String(jtv) } case "hostname": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.Hostname = ptr.String(jtv) } case "vmPath": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.VmPath = ptr.String(jtv) } case "vmWareUuid": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.VmWareUuid = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImportErrorData(v **types.ImportErrorData, 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.ImportErrorData if *v == nil { sv = &types.ImportErrorData{} } else { sv = *v } for key, value := range shape { switch key { case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } case "ec2LaunchTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.Ec2LaunchTemplateID = ptr.String(jtv) } case "rawError": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.RawError = ptr.String(jtv) } case "rowNumber": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RowNumber = i64 } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImportErrors(v *[]types.ImportTaskError, 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.ImportTaskError if *v == nil { cv = []types.ImportTaskError{} } else { cv = *v } for _, value := range shape { var col types.ImportTaskError destAddr := &col if err := awsRestjson1_deserializeDocumentImportTaskError(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentImportList(v *[]types.ImportTask, 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.ImportTask if *v == nil { cv = []types.ImportTask{} } else { cv = *v } for _, value := range shape { var col types.ImportTask destAddr := &col if err := awsRestjson1_deserializeDocumentImportTask(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentImportTask(v **types.ImportTask, 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.ImportTask if *v == nil { sv = &types.ImportTask{} } else { sv = *v } for key, value := range shape { switch key { case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "endDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.EndDateTime = ptr.String(jtv) } case "importID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImportID to be of type string, got %T instead", value) } sv.ImportID = ptr.String(jtv) } case "progressPercentage": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.ProgressPercentage = ptr.Float32(float32(f64)) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.ProgressPercentage = ptr.Float32(float32(f64)) default: return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) } } case "s3BucketSource": if err := awsRestjson1_deserializeDocumentS3BucketSource(&sv.S3BucketSource, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImportStatus to be of type string, got %T instead", value) } sv.Status = types.ImportStatus(jtv) } case "summary": if err := awsRestjson1_deserializeDocumentImportTaskSummary(&sv.Summary, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImportTaskError(v **types.ImportTaskError, 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.ImportTaskError if *v == nil { sv = &types.ImportTaskError{} } else { sv = *v } for key, value := range shape { switch key { case "errorData": if err := awsRestjson1_deserializeDocumentImportErrorData(&sv.ErrorData, value); err != nil { return err } case "errorDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.ErrorDateTime = ptr.String(jtv) } case "errorType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImportErrorType to be of type string, got %T instead", value) } sv.ErrorType = types.ImportErrorType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImportTaskSummary(v **types.ImportTaskSummary, 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.ImportTaskSummary if *v == nil { sv = &types.ImportTaskSummary{} } else { sv = *v } for key, value := range shape { switch key { case "applications": if err := awsRestjson1_deserializeDocumentImportTaskSummaryApplications(&sv.Applications, value); err != nil { return err } case "servers": if err := awsRestjson1_deserializeDocumentImportTaskSummaryServers(&sv.Servers, value); err != nil { return err } case "waves": if err := awsRestjson1_deserializeDocumentImportTaskSummaryWaves(&sv.Waves, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImportTaskSummaryApplications(v **types.ImportTaskSummaryApplications, 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.ImportTaskSummaryApplications if *v == nil { sv = &types.ImportTaskSummaryApplications{} } else { sv = *v } for key, value := range shape { switch key { case "createdCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.CreatedCount = i64 } case "modifiedCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ModifiedCount = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImportTaskSummaryServers(v **types.ImportTaskSummaryServers, 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.ImportTaskSummaryServers if *v == nil { sv = &types.ImportTaskSummaryServers{} } else { sv = *v } for key, value := range shape { switch key { case "createdCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.CreatedCount = i64 } case "modifiedCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ModifiedCount = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImportTaskSummaryWaves(v **types.ImportTaskSummaryWaves, 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.ImportTaskSummaryWaves if *v == nil { sv = &types.ImportTaskSummaryWaves{} } else { sv = *v } for key, value := range shape { switch key { case "createdCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.CreatedCount = i64 } case "modifiedCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ModifiedCount = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, 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.InternalServerException if *v == nil { sv = &types.InternalServerException{} } 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 LargeBoundedString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "retryAfterSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RetryAfterSeconds = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIPsList(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 BoundedString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentJob(v **types.Job, 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.Job if *v == nil { sv = &types.Job{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "endDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.EndDateTime = ptr.String(jtv) } case "initiatedBy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected InitiatedBy to be of type string, got %T instead", value) } sv.InitiatedBy = types.InitiatedBy(jtv) } case "jobID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobID to be of type string, got %T instead", value) } sv.JobID = ptr.String(jtv) } case "participatingServers": if err := awsRestjson1_deserializeDocumentParticipatingServers(&sv.ParticipatingServers, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) } sv.Status = types.JobStatus(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobType to be of type string, got %T instead", value) } sv.Type = types.JobType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentJobLog(v **types.JobLog, 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.JobLog if *v == nil { sv = &types.JobLog{} } else { sv = *v } for key, value := range shape { switch key { case "event": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobLogEvent to be of type string, got %T instead", value) } sv.Event = types.JobLogEvent(jtv) } case "eventData": if err := awsRestjson1_deserializeDocumentJobLogEventData(&sv.EventData, value); err != nil { return err } case "logDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LogDateTime = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentJobLogEventData(v **types.JobLogEventData, 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.JobLogEventData if *v == nil { sv = &types.JobLogEventData{} } else { sv = *v } for key, value := range shape { switch key { case "conversionServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceID to be of type string, got %T instead", value) } sv.ConversionServerID = ptr.String(jtv) } case "rawError": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.RawError = ptr.String(jtv) } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "targetInstanceID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceID to be of type string, got %T instead", value) } sv.TargetInstanceID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentJobLogs(v *[]types.JobLog, 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.JobLog if *v == nil { cv = []types.JobLog{} } else { cv = *v } for _, value := range shape { var col types.JobLog destAddr := &col if err := awsRestjson1_deserializeDocumentJobLog(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentJobPostLaunchActionsLaunchStatus(v **types.JobPostLaunchActionsLaunchStatus, 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.JobPostLaunchActionsLaunchStatus if *v == nil { sv = &types.JobPostLaunchActionsLaunchStatus{} } else { sv = *v } for key, value := range shape { switch key { case "executionID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.ExecutionID = ptr.String(jtv) } case "executionStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PostLaunchActionExecutionStatus to be of type string, got %T instead", value) } sv.ExecutionStatus = types.PostLaunchActionExecutionStatus(jtv) } case "failureReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FailureReason = ptr.String(jtv) } case "ssmDocument": if err := awsRestjson1_deserializeDocumentSsmDocument(&sv.SsmDocument, value); err != nil { return err } case "ssmDocumentType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SsmDocumentType to be of type string, got %T instead", value) } sv.SsmDocumentType = types.SsmDocumentType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentJobsList(v *[]types.Job, 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.Job if *v == nil { cv = []types.Job{} } else { cv = *v } for _, value := range shape { var col types.Job destAddr := &col if err := awsRestjson1_deserializeDocumentJob(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentLaunchConfigurationTemplate(v **types.LaunchConfigurationTemplate, 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.LaunchConfigurationTemplate if *v == nil { sv = &types.LaunchConfigurationTemplate{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "associatePublicIpAddress": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssociatePublicIpAddress = ptr.Bool(jtv) } case "bootMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BootMode to be of type string, got %T instead", value) } sv.BootMode = types.BootMode(jtv) } case "copyPrivateIp": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyPrivateIp = ptr.Bool(jtv) } case "copyTags": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyTags = ptr.Bool(jtv) } case "ec2LaunchTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2LaunchConfigurationTemplateID to be of type string, got %T instead", value) } sv.Ec2LaunchTemplateID = ptr.String(jtv) } case "enableMapAutoTagging": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnableMapAutoTagging = ptr.Bool(jtv) } case "largeVolumeConf": if err := awsRestjson1_deserializeDocumentLaunchTemplateDiskConf(&sv.LargeVolumeConf, value); err != nil { return err } case "launchConfigurationTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchConfigurationTemplateID to be of type string, got %T instead", value) } sv.LaunchConfigurationTemplateID = ptr.String(jtv) } case "launchDisposition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchDisposition to be of type string, got %T instead", value) } sv.LaunchDisposition = types.LaunchDisposition(jtv) } case "licensing": if err := awsRestjson1_deserializeDocumentLicensing(&sv.Licensing, value); err != nil { return err } case "mapAutoTaggingMpeID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } sv.MapAutoTaggingMpeID = ptr.String(jtv) } case "postLaunchActions": if err := awsRestjson1_deserializeDocumentPostLaunchActions(&sv.PostLaunchActions, value); err != nil { return err } case "smallVolumeConf": if err := awsRestjson1_deserializeDocumentLaunchTemplateDiskConf(&sv.SmallVolumeConf, value); err != nil { return err } case "smallVolumeMaxSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SmallVolumeMaxSize = i64 } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "targetInstanceTypeRightSizingMethod": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TargetInstanceTypeRightSizingMethod to be of type string, got %T instead", value) } sv.TargetInstanceTypeRightSizingMethod = types.TargetInstanceTypeRightSizingMethod(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLaunchConfigurationTemplates(v *[]types.LaunchConfigurationTemplate, 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.LaunchConfigurationTemplate if *v == nil { cv = []types.LaunchConfigurationTemplate{} } else { cv = *v } for _, value := range shape { var col types.LaunchConfigurationTemplate destAddr := &col if err := awsRestjson1_deserializeDocumentLaunchConfigurationTemplate(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentLaunchedInstance(v **types.LaunchedInstance, 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.LaunchedInstance if *v == nil { sv = &types.LaunchedInstance{} } else { sv = *v } for key, value := range shape { switch key { case "ec2InstanceID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceID to be of type string, got %T instead", value) } sv.Ec2InstanceID = ptr.String(jtv) } case "firstBoot": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FirstBoot to be of type string, got %T instead", value) } sv.FirstBoot = types.FirstBoot(jtv) } case "jobID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobID to be of type string, got %T instead", value) } sv.JobID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLaunchTemplateDiskConf(v **types.LaunchTemplateDiskConf, 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.LaunchTemplateDiskConf if *v == nil { sv = &types.LaunchTemplateDiskConf{} } else { sv = *v } for key, value := range shape { switch key { case "iops": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Iops = i64 } case "throughput": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Throughput = i64 } case "volumeType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VolumeType to be of type string, got %T instead", value) } sv.VolumeType = types.VolumeType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLicensing(v **types.Licensing, 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.Licensing if *v == nil { sv = &types.Licensing{} } else { sv = *v } for key, value := range shape { switch key { case "osByol": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.OsByol = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLifeCycle(v **types.LifeCycle, 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.LifeCycle if *v == nil { sv = &types.LifeCycle{} } else { sv = *v } for key, value := range shape { switch key { case "addedToServiceDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.AddedToServiceDateTime = ptr.String(jtv) } case "elapsedReplicationDuration": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DurationString to be of type string, got %T instead", value) } sv.ElapsedReplicationDuration = ptr.String(jtv) } case "firstByteDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.FirstByteDateTime = ptr.String(jtv) } case "lastCutover": if err := awsRestjson1_deserializeDocumentLifeCycleLastCutover(&sv.LastCutover, value); err != nil { return err } case "lastSeenByServiceDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastSeenByServiceDateTime = ptr.String(jtv) } case "lastTest": if err := awsRestjson1_deserializeDocumentLifeCycleLastTest(&sv.LastTest, value); err != nil { return err } case "state": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LifeCycleState to be of type string, got %T instead", value) } sv.State = types.LifeCycleState(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLifeCycleLastCutover(v **types.LifeCycleLastCutover, 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.LifeCycleLastCutover if *v == nil { sv = &types.LifeCycleLastCutover{} } else { sv = *v } for key, value := range shape { switch key { case "finalized": if err := awsRestjson1_deserializeDocumentLifeCycleLastCutoverFinalized(&sv.Finalized, value); err != nil { return err } case "initiated": if err := awsRestjson1_deserializeDocumentLifeCycleLastCutoverInitiated(&sv.Initiated, value); err != nil { return err } case "reverted": if err := awsRestjson1_deserializeDocumentLifeCycleLastCutoverReverted(&sv.Reverted, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLifeCycleLastCutoverFinalized(v **types.LifeCycleLastCutoverFinalized, 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.LifeCycleLastCutoverFinalized if *v == nil { sv = &types.LifeCycleLastCutoverFinalized{} } else { sv = *v } for key, value := range shape { switch key { case "apiCallDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.ApiCallDateTime = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLifeCycleLastCutoverInitiated(v **types.LifeCycleLastCutoverInitiated, 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.LifeCycleLastCutoverInitiated if *v == nil { sv = &types.LifeCycleLastCutoverInitiated{} } else { sv = *v } for key, value := range shape { switch key { case "apiCallDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.ApiCallDateTime = ptr.String(jtv) } case "jobID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobID to be of type string, got %T instead", value) } sv.JobID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLifeCycleLastCutoverReverted(v **types.LifeCycleLastCutoverReverted, 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.LifeCycleLastCutoverReverted if *v == nil { sv = &types.LifeCycleLastCutoverReverted{} } else { sv = *v } for key, value := range shape { switch key { case "apiCallDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.ApiCallDateTime = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLifeCycleLastTest(v **types.LifeCycleLastTest, 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.LifeCycleLastTest if *v == nil { sv = &types.LifeCycleLastTest{} } else { sv = *v } for key, value := range shape { switch key { case "finalized": if err := awsRestjson1_deserializeDocumentLifeCycleLastTestFinalized(&sv.Finalized, value); err != nil { return err } case "initiated": if err := awsRestjson1_deserializeDocumentLifeCycleLastTestInitiated(&sv.Initiated, value); err != nil { return err } case "reverted": if err := awsRestjson1_deserializeDocumentLifeCycleLastTestReverted(&sv.Reverted, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLifeCycleLastTestFinalized(v **types.LifeCycleLastTestFinalized, 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.LifeCycleLastTestFinalized if *v == nil { sv = &types.LifeCycleLastTestFinalized{} } else { sv = *v } for key, value := range shape { switch key { case "apiCallDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.ApiCallDateTime = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLifeCycleLastTestInitiated(v **types.LifeCycleLastTestInitiated, 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.LifeCycleLastTestInitiated if *v == nil { sv = &types.LifeCycleLastTestInitiated{} } else { sv = *v } for key, value := range shape { switch key { case "apiCallDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.ApiCallDateTime = ptr.String(jtv) } case "jobID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobID to be of type string, got %T instead", value) } sv.JobID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLifeCycleLastTestReverted(v **types.LifeCycleLastTestReverted, 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.LifeCycleLastTestReverted if *v == nil { sv = &types.LifeCycleLastTestReverted{} } else { sv = *v } for key, value := range shape { switch key { case "apiCallDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.ApiCallDateTime = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNetworkInterface(v **types.NetworkInterface, 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.NetworkInterface if *v == nil { sv = &types.NetworkInterface{} } else { sv = *v } for key, value := range shape { switch key { case "ips": if err := awsRestjson1_deserializeDocumentIPsList(&sv.Ips, value); err != nil { return err } case "isPrimary": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsPrimary = ptr.Bool(jtv) } case "macAddress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.MacAddress = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNetworkInterfaces(v *[]types.NetworkInterface, 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.NetworkInterface if *v == nil { cv = []types.NetworkInterface{} } else { cv = *v } for _, value := range shape { var col types.NetworkInterface destAddr := &col if err := awsRestjson1_deserializeDocumentNetworkInterface(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentOS(v **types.OS, 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.OS if *v == nil { sv = &types.OS{} } else { sv = *v } for key, value := range shape { switch key { case "fullString": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FullString = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentParticipatingServer(v **types.ParticipatingServer, 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.ParticipatingServer if *v == nil { sv = &types.ParticipatingServer{} } else { sv = *v } for key, value := range shape { switch key { case "launchedEc2InstanceID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceID to be of type string, got %T instead", value) } sv.LaunchedEc2InstanceID = ptr.String(jtv) } case "launchStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchStatus to be of type string, got %T instead", value) } sv.LaunchStatus = types.LaunchStatus(jtv) } case "postLaunchActionsStatus": if err := awsRestjson1_deserializeDocumentPostLaunchActionsStatus(&sv.PostLaunchActionsStatus, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentParticipatingServers(v *[]types.ParticipatingServer, 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.ParticipatingServer if *v == nil { cv = []types.ParticipatingServer{} } else { cv = *v } for _, value := range shape { var col types.ParticipatingServer destAddr := &col if err := awsRestjson1_deserializeDocumentParticipatingServer(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPostLaunchActions(v **types.PostLaunchActions, 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.PostLaunchActions if *v == nil { sv = &types.PostLaunchActions{} } else { sv = *v } for key, value := range shape { switch key { case "cloudWatchLogGroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CloudWatchLogGroupName to be of type string, got %T instead", value) } sv.CloudWatchLogGroupName = ptr.String(jtv) } case "deployment": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PostLaunchActionsDeploymentType to be of type string, got %T instead", value) } sv.Deployment = types.PostLaunchActionsDeploymentType(jtv) } case "s3LogBucket": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3LogBucketName to be of type string, got %T instead", value) } sv.S3LogBucket = ptr.String(jtv) } case "s3OutputKeyPrefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.S3OutputKeyPrefix = ptr.String(jtv) } case "ssmDocuments": if err := awsRestjson1_deserializeDocumentSsmDocuments(&sv.SsmDocuments, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPostLaunchActionsLaunchStatusList(v *[]types.JobPostLaunchActionsLaunchStatus, 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.JobPostLaunchActionsLaunchStatus if *v == nil { cv = []types.JobPostLaunchActionsLaunchStatus{} } else { cv = *v } for _, value := range shape { var col types.JobPostLaunchActionsLaunchStatus destAddr := &col if err := awsRestjson1_deserializeDocumentJobPostLaunchActionsLaunchStatus(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPostLaunchActionsStatus(v **types.PostLaunchActionsStatus, 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.PostLaunchActionsStatus if *v == nil { sv = &types.PostLaunchActionsStatus{} } else { sv = *v } for key, value := range shape { switch key { case "postLaunchActionsLaunchStatusList": if err := awsRestjson1_deserializeDocumentPostLaunchActionsLaunchStatusList(&sv.PostLaunchActionsLaunchStatusList, value); err != nil { return err } case "ssmAgentDiscoveryDatetime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.SsmAgentDiscoveryDatetime = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentReplicationConfigurationReplicatedDisk(v **types.ReplicationConfigurationReplicatedDisk, 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.ReplicationConfigurationReplicatedDisk if *v == nil { sv = &types.ReplicationConfigurationReplicatedDisk{} } else { sv = *v } for key, value := range shape { switch key { case "deviceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.DeviceName = ptr.String(jtv) } case "iops": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Iops = i64 } case "isBootDisk": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsBootDisk = ptr.Bool(jtv) } case "stagingDiskType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationReplicatedDiskStagingDiskType to be of type string, got %T instead", value) } sv.StagingDiskType = types.ReplicationConfigurationReplicatedDiskStagingDiskType(jtv) } case "throughput": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Throughput = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentReplicationConfigurationReplicatedDisks(v *[]types.ReplicationConfigurationReplicatedDisk, 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.ReplicationConfigurationReplicatedDisk if *v == nil { cv = []types.ReplicationConfigurationReplicatedDisk{} } else { cv = *v } for _, value := range shape { var col types.ReplicationConfigurationReplicatedDisk destAddr := &col if err := awsRestjson1_deserializeDocumentReplicationConfigurationReplicatedDisk(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentReplicationConfigurationTemplate(v **types.ReplicationConfigurationTemplate, 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.ReplicationConfigurationTemplate if *v == nil { sv = &types.ReplicationConfigurationTemplate{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "associateDefaultSecurityGroup": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssociateDefaultSecurityGroup = ptr.Bool(jtv) } case "bandwidthThrottling": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BandwidthThrottling = i64 } case "createPublicIP": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CreatePublicIP = ptr.Bool(jtv) } case "dataPlaneRouting": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationDataPlaneRouting to be of type string, got %T instead", value) } sv.DataPlaneRouting = types.ReplicationConfigurationDataPlaneRouting(jtv) } case "defaultLargeStagingDiskType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationDefaultLargeStagingDiskType to be of type string, got %T instead", value) } sv.DefaultLargeStagingDiskType = types.ReplicationConfigurationDefaultLargeStagingDiskType(jtv) } case "ebsEncryption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationEbsEncryption to be of type string, got %T instead", value) } sv.EbsEncryption = types.ReplicationConfigurationEbsEncryption(jtv) } case "ebsEncryptionKeyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.EbsEncryptionKeyArn = ptr.String(jtv) } case "replicationConfigurationTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationTemplateID to be of type string, got %T instead", value) } sv.ReplicationConfigurationTemplateID = ptr.String(jtv) } case "replicationServerInstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceType to be of type string, got %T instead", value) } sv.ReplicationServerInstanceType = ptr.String(jtv) } case "replicationServersSecurityGroupsIDs": if err := awsRestjson1_deserializeDocumentReplicationServersSecurityGroupsIDs(&sv.ReplicationServersSecurityGroupsIDs, value); err != nil { return err } case "stagingAreaSubnetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SubnetID to be of type string, got %T instead", value) } sv.StagingAreaSubnetId = ptr.String(jtv) } case "stagingAreaTags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.StagingAreaTags, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "useDedicatedReplicationServer": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseDedicatedReplicationServer = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentReplicationConfigurationTemplates(v *[]types.ReplicationConfigurationTemplate, 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.ReplicationConfigurationTemplate if *v == nil { cv = []types.ReplicationConfigurationTemplate{} } else { cv = *v } for _, value := range shape { var col types.ReplicationConfigurationTemplate destAddr := &col if err := awsRestjson1_deserializeDocumentReplicationConfigurationTemplate(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentReplicationServersSecurityGroupsIDs(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 SecurityGroupID to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, 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.ResourceNotFoundException if *v == nil { sv = &types.ResourceNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "resourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentS3BucketSource(v **types.S3BucketSource, 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.S3BucketSource if *v == nil { sv = &types.S3BucketSource{} } else { sv = *v } for key, value := range shape { switch key { case "s3Bucket": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3BucketName to be of type string, got %T instead", value) } sv.S3Bucket = ptr.String(jtv) } case "s3BucketOwner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountID to be of type string, got %T instead", value) } sv.S3BucketOwner = ptr.String(jtv) } case "s3Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Key to be of type string, got %T instead", value) } sv.S3Key = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, 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.ServiceQuotaExceededException if *v == nil { sv = &types.ServiceQuotaExceededException{} } else { sv = *v } for key, value := range shape { switch key { case "code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "quotaCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.QuotaCode = ptr.String(jtv) } case "quotaValue": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StrictlyPositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.QuotaValue = int32(i64) } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "resourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } case "serviceCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.ServiceCode = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSourceProperties(v **types.SourceProperties, 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.SourceProperties if *v == nil { sv = &types.SourceProperties{} } else { sv = *v } for key, value := range shape { switch key { case "cpus": if err := awsRestjson1_deserializeDocumentCpus(&sv.Cpus, value); err != nil { return err } case "disks": if err := awsRestjson1_deserializeDocumentDisks(&sv.Disks, value); err != nil { return err } case "identificationHints": if err := awsRestjson1_deserializeDocumentIdentificationHints(&sv.IdentificationHints, value); err != nil { return err } case "lastUpdatedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastUpdatedDateTime = ptr.String(jtv) } case "networkInterfaces": if err := awsRestjson1_deserializeDocumentNetworkInterfaces(&sv.NetworkInterfaces, value); err != nil { return err } case "os": if err := awsRestjson1_deserializeDocumentOS(&sv.Os, value); err != nil { return err } case "ramBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RamBytes = i64 } case "recommendedInstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceType to be of type string, got %T instead", value) } sv.RecommendedInstanceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSourceServer(v **types.SourceServer, 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.SourceServer if *v == nil { sv = &types.SourceServer{} } else { sv = *v } for key, value := range shape { switch key { case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "dataReplicationInfo": if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { return err } case "fqdnForActionFramework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FqdnForActionFramework = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "launchedInstance": if err := awsRestjson1_deserializeDocumentLaunchedInstance(&sv.LaunchedInstance, value); err != nil { return err } case "lifeCycle": if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { return err } case "replicationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationType to be of type string, got %T instead", value) } sv.ReplicationType = types.ReplicationType(jtv) } case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "userProvidedID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.UserProvidedID = ptr.String(jtv) } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSourceServerActionDocument(v **types.SourceServerActionDocument, 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.SourceServerActionDocument if *v == nil { sv = &types.SourceServerActionDocument{} } else { sv = *v } for key, value := range shape { switch key { case "actionID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionID to be of type string, got %T instead", value) } sv.ActionID = ptr.String(jtv) } case "actionName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionName to be of type string, got %T instead", value) } sv.ActionName = ptr.String(jtv) } case "active": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Active = ptr.Bool(jtv) } case "category": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionCategory to be of type string, got %T instead", value) } sv.Category = types.ActionCategory(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "documentIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.DocumentIdentifier = ptr.String(jtv) } case "documentVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DocumentVersion to be of type string, got %T instead", value) } sv.DocumentVersion = ptr.String(jtv) } case "externalParameters": if err := awsRestjson1_deserializeDocumentSsmDocumentExternalParameters(&sv.ExternalParameters, value); err != nil { return err } case "mustSucceedForCutover": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.MustSucceedForCutover = ptr.Bool(jtv) } case "order": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected OrderType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Order = int32(i64) } case "parameters": if err := awsRestjson1_deserializeDocumentSsmDocumentParameters(&sv.Parameters, value); err != nil { return err } case "timeoutSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StrictlyPositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TimeoutSeconds = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSourceServerActionDocuments(v *[]types.SourceServerActionDocument, 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.SourceServerActionDocument if *v == nil { cv = []types.SourceServerActionDocument{} } else { cv = *v } for _, value := range shape { var col types.SourceServerActionDocument destAddr := &col if err := awsRestjson1_deserializeDocumentSourceServerActionDocument(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSourceServersList(v *[]types.SourceServer, 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.SourceServer if *v == nil { cv = []types.SourceServer{} } else { cv = *v } for _, value := range shape { var col types.SourceServer destAddr := &col if err := awsRestjson1_deserializeDocumentSourceServer(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSsmDocument(v **types.SsmDocument, 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.SsmDocument if *v == nil { sv = &types.SsmDocument{} } else { sv = *v } for key, value := range shape { switch key { case "actionName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.ActionName = ptr.String(jtv) } case "externalParameters": if err := awsRestjson1_deserializeDocumentSsmDocumentExternalParameters(&sv.ExternalParameters, value); err != nil { return err } case "mustSucceedForCutover": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.MustSucceedForCutover = ptr.Bool(jtv) } case "parameters": if err := awsRestjson1_deserializeDocumentSsmDocumentParameters(&sv.Parameters, value); err != nil { return err } case "ssmDocumentName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SsmDocumentName to be of type string, got %T instead", value) } sv.SsmDocumentName = ptr.String(jtv) } case "timeoutSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StrictlyPositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TimeoutSeconds = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSsmDocumentExternalParameters(v *map[string]types.SsmExternalParameter, 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 mv map[string]types.SsmExternalParameter if *v == nil { mv = map[string]types.SsmExternalParameter{} } else { mv = *v } for key, value := range shape { var parsedVal types.SsmExternalParameter mapVar := parsedVal if err := awsRestjson1_deserializeDocumentSsmExternalParameter(&mapVar, value); err != nil { return err } parsedVal = mapVar mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentSsmDocumentParameters(v *map[string][]types.SsmParameterStoreParameter, 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 mv map[string][]types.SsmParameterStoreParameter if *v == nil { mv = map[string][]types.SsmParameterStoreParameter{} } else { mv = *v } for key, value := range shape { var parsedVal []types.SsmParameterStoreParameter mapVar := parsedVal if err := awsRestjson1_deserializeDocumentSsmParameterStoreParameters(&mapVar, value); err != nil { return err } parsedVal = mapVar mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentSsmDocuments(v *[]types.SsmDocument, 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.SsmDocument if *v == nil { cv = []types.SsmDocument{} } else { cv = *v } for _, value := range shape { var col types.SsmDocument destAddr := &col if err := awsRestjson1_deserializeDocumentSsmDocument(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSsmExternalParameter(v *types.SsmExternalParameter, 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 uv types.SsmExternalParameter loop: for key, value := range shape { if value == nil { continue } switch key { case "dynamicPath": var mv string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JmesPathString to be of type string, got %T instead", value) } mv = jtv } uv = &types.SsmExternalParameterMemberDynamicPath{Value: mv} break loop default: uv = &types.UnknownUnionMember{Tag: key} break loop } } *v = uv return nil } func awsRestjson1_deserializeDocumentSsmParameterStoreParameter(v **types.SsmParameterStoreParameter, 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.SsmParameterStoreParameter if *v == nil { sv = &types.SsmParameterStoreParameter{} } else { sv = *v } for key, value := range shape { switch key { case "parameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SsmParameterStoreParameterName to be of type string, got %T instead", value) } sv.ParameterName = ptr.String(jtv) } case "parameterType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SsmParameterStoreParameterType to be of type string, got %T instead", value) } sv.ParameterType = types.SsmParameterStoreParameterType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSsmParameterStoreParameters(v *[]types.SsmParameterStoreParameter, 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.SsmParameterStoreParameter if *v == nil { cv = []types.SsmParameterStoreParameter{} } else { cv = *v } for _, value := range shape { var col types.SsmParameterStoreParameter destAddr := &col if err := awsRestjson1_deserializeDocumentSsmParameterStoreParameter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTagsMap(v *map[string]string, 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 mv map[string]string if *v == nil { mv = map[string]string{} } else { mv = *v } for key, value := range shape { var parsedVal string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentTemplateActionDocument(v **types.TemplateActionDocument, 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.TemplateActionDocument if *v == nil { sv = &types.TemplateActionDocument{} } else { sv = *v } for key, value := range shape { switch key { case "actionID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionID to be of type string, got %T instead", value) } sv.ActionID = ptr.String(jtv) } case "actionName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.ActionName = ptr.String(jtv) } case "active": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Active = ptr.Bool(jtv) } case "category": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionCategory to be of type string, got %T instead", value) } sv.Category = types.ActionCategory(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "documentIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.DocumentIdentifier = ptr.String(jtv) } case "documentVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DocumentVersion to be of type string, got %T instead", value) } sv.DocumentVersion = ptr.String(jtv) } case "externalParameters": if err := awsRestjson1_deserializeDocumentSsmDocumentExternalParameters(&sv.ExternalParameters, value); err != nil { return err } case "mustSucceedForCutover": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.MustSucceedForCutover = ptr.Bool(jtv) } case "operatingSystem": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperatingSystemString to be of type string, got %T instead", value) } sv.OperatingSystem = ptr.String(jtv) } case "order": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected OrderType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Order = int32(i64) } case "parameters": if err := awsRestjson1_deserializeDocumentSsmDocumentParameters(&sv.Parameters, value); err != nil { return err } case "timeoutSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StrictlyPositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TimeoutSeconds = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTemplateActionDocuments(v *[]types.TemplateActionDocument, 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.TemplateActionDocument if *v == nil { cv = []types.TemplateActionDocument{} } else { cv = *v } for _, value := range shape { var col types.TemplateActionDocument destAddr := &col if err := awsRestjson1_deserializeDocumentTemplateActionDocument(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, 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.ThrottlingException if *v == nil { sv = &types.ThrottlingException{} } 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 LargeBoundedString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "quotaCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.QuotaCode = ptr.String(jtv) } case "retryAfterSeconds": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.RetryAfterSeconds = ptr.String(jtv) } case "serviceCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.ServiceCode = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUninitializedAccountException(v **types.UninitializedAccountException, 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.UninitializedAccountException if *v == nil { sv = &types.UninitializedAccountException{} } else { sv = *v } for key, value := range shape { switch key { case "code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, 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.ValidationException if *v == nil { sv = &types.ValidationException{} } else { sv = *v } for key, value := range shape { switch key { case "code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "fieldList": if err := awsRestjson1_deserializeDocumentValidationExceptionFieldList(&sv.FieldList, value); err != nil { return err } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value) } sv.Reason = types.ValidationExceptionReason(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, 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.ValidationExceptionField if *v == nil { sv = &types.ValidationExceptionField{} } 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 LargeBoundedString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, 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.ValidationExceptionField if *v == nil { cv = []types.ValidationExceptionField{} } else { cv = *v } for _, value := range shape { var col types.ValidationExceptionField destAddr := &col if err := awsRestjson1_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentVcenterClient(v **types.VcenterClient, 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.VcenterClient if *v == nil { sv = &types.VcenterClient{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "datacenterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.DatacenterName = ptr.String(jtv) } case "hostname": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.Hostname = ptr.String(jtv) } case "lastSeenDatetime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastSeenDatetime = ptr.String(jtv) } case "sourceServerTags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.SourceServerTags, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = ptr.String(jtv) } case "vcenterUUID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.VcenterUUID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVcenterClientList(v *[]types.VcenterClient, 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.VcenterClient if *v == nil { cv = []types.VcenterClient{} } else { cv = *v } for _, value := range shape { var col types.VcenterClient destAddr := &col if err := awsRestjson1_deserializeDocumentVcenterClient(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentWave(v **types.Wave, 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.Wave if *v == nil { sv = &types.Wave{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "lastModifiedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastModifiedDateTime = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "waveAggregatedStatus": if err := awsRestjson1_deserializeDocumentWaveAggregatedStatus(&sv.WaveAggregatedStatus, value); err != nil { return err } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWaveAggregatedStatus(v **types.WaveAggregatedStatus, 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.WaveAggregatedStatus if *v == nil { sv = &types.WaveAggregatedStatus{} } else { sv = *v } for key, value := range shape { switch key { case "healthStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveHealthStatus to be of type string, got %T instead", value) } sv.HealthStatus = types.WaveHealthStatus(jtv) } case "lastUpdateDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastUpdateDateTime = ptr.String(jtv) } case "progressStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveProgressStatus to be of type string, got %T instead", value) } sv.ProgressStatus = types.WaveProgressStatus(jtv) } case "replicationStartedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.ReplicationStartedDateTime = ptr.String(jtv) } case "totalApplications": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalApplications = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWavesList(v *[]types.Wave, 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.Wave if *v == nil { cv = []types.Wave{} } else { cv = *v } for _, value := range shape { var col types.Wave destAddr := &col if err := awsRestjson1_deserializeDocumentWave(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil }
16,939
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package mgn provides the API client, operations, and parameter types for // Application Migration Service. // // The Application Migration Service service. package mgn
8
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" "errors" "fmt" "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" internalendpoints "github.com/aws/aws-sdk-go-v2/service/mgn/internal/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "net/url" "strings" ) // EndpointResolverOptions is the service endpoint resolver options type EndpointResolverOptions = internalendpoints.Options // EndpointResolver interface for resolving service endpoints. type EndpointResolver interface { ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) } var _ EndpointResolver = &internalendpoints.Resolver{} // NewDefaultEndpointResolver constructs a new service endpoint resolver func NewDefaultEndpointResolver() *internalendpoints.Resolver { return internalendpoints.New() } // EndpointResolverFunc is a helper utility that wraps a function so it satisfies // the EndpointResolver interface. This is useful when you want to add additional // endpoint resolving logic, or stub out specific endpoints with custom values. type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { return fn(region, options) } func resolveDefaultEndpointConfiguration(o *Options) { if o.EndpointResolver != nil { return } o.EndpointResolver = NewDefaultEndpointResolver() } // EndpointResolverFromURL returns an EndpointResolver configured using the // provided endpoint url. By default, the resolved endpoint resolver uses the // client region as signing region, and the endpoint source is set to // EndpointSourceCustom.You can provide functional options to configure endpoint // values for the resolved endpoint. func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} for _, fn := range optFns { fn(&e) } return EndpointResolverFunc( func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { if len(e.SigningRegion) == 0 { e.SigningRegion = region } return e, nil }, ) } type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions } func (*ResolveEndpoint) ID() string { return "ResolveEndpoint" } func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } if m.Resolver == nil { return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") } eo := m.Options eo.Logger = middleware.GetLogger(ctx) var endpoint aws.Endpoint endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) if err != nil { return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) } req.URL, err = url.Parse(endpoint.URL) if err != nil { return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) } if len(awsmiddleware.GetSigningName(ctx)) == 0 { signingName := endpoint.SigningName if len(signingName) == 0 { signingName = "mgn" } ctx = awsmiddleware.SetSigningName(ctx, signingName) } ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { return stack.Serialize.Insert(&ResolveEndpoint{ Resolver: o.EndpointResolver, Options: o.EndpointOptions, }, "OperationSerializer", middleware.Before) } func removeResolveEndpointMiddleware(stack *middleware.Stack) error { _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) return err } type wrappedEndpointResolver struct { awsResolver aws.EndpointResolverWithOptions resolver EndpointResolver } func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { if w.awsResolver == nil { goto fallback } endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) if err == nil { return endpoint, nil } if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { return endpoint, err } fallback: if w.resolver == nil { return endpoint, fmt.Errorf("default endpoint resolver provided was nil") } return w.resolver.ResolveEndpoint(region, options) } type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { return a(service, region) } var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) // withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver. // If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided // fallbackResolver for resolution. // // fallbackResolver must not be nil func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { var resolver aws.EndpointResolverWithOptions if awsResolverWithOptions != nil { resolver = awsResolverWithOptions } else if awsResolver != nil { resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) } return &wrappedEndpointResolver{ awsResolver: resolver, resolver: fallbackResolver, } } func finalizeClientEndpointResolverOptions(options *Options) { options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() if len(options.EndpointOptions.ResolvedRegion) == 0 { const fipsInfix = "-fips-" const fipsPrefix = "fips-" const fipsSuffix = "-fips" if strings.Contains(options.Region, fipsInfix) || strings.Contains(options.Region, fipsPrefix) || strings.Contains(options.Region, fipsSuffix) { options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled } } }
201
aws-sdk-go-v2
aws
Go
// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. package mgn // goModuleVersion is the tagged release for this module const goModuleVersion = "1.18.9"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/mgn/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) type awsRestjson1_serializeOpArchiveApplication struct { } func (*awsRestjson1_serializeOpArchiveApplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpArchiveApplication) 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.(*ArchiveApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/ArchiveApplication") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentArchiveApplicationInput(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_serializeOpHttpBindingsArchiveApplicationInput(v *ArchiveApplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentArchiveApplicationInput(v *ArchiveApplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ApplicationID != nil { ok := object.Key("applicationID") ok.String(*v.ApplicationID) } return nil } type awsRestjson1_serializeOpArchiveWave struct { } func (*awsRestjson1_serializeOpArchiveWave) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpArchiveWave) 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.(*ArchiveWaveInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/ArchiveWave") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentArchiveWaveInput(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_serializeOpHttpBindingsArchiveWaveInput(v *ArchiveWaveInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentArchiveWaveInput(v *ArchiveWaveInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.WaveID != nil { ok := object.Key("waveID") ok.String(*v.WaveID) } return nil } type awsRestjson1_serializeOpAssociateApplications struct { } func (*awsRestjson1_serializeOpAssociateApplications) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpAssociateApplications) 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.(*AssociateApplicationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/AssociateApplications") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentAssociateApplicationsInput(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_serializeOpHttpBindingsAssociateApplicationsInput(v *AssociateApplicationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentAssociateApplicationsInput(v *AssociateApplicationsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ApplicationIDs != nil { ok := object.Key("applicationIDs") if err := awsRestjson1_serializeDocumentApplicationIDs(v.ApplicationIDs, ok); err != nil { return err } } if v.WaveID != nil { ok := object.Key("waveID") ok.String(*v.WaveID) } return nil } type awsRestjson1_serializeOpAssociateSourceServers struct { } func (*awsRestjson1_serializeOpAssociateSourceServers) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpAssociateSourceServers) 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.(*AssociateSourceServersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/AssociateSourceServers") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentAssociateSourceServersInput(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_serializeOpHttpBindingsAssociateSourceServersInput(v *AssociateSourceServersInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentAssociateSourceServersInput(v *AssociateSourceServersInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ApplicationID != nil { ok := object.Key("applicationID") ok.String(*v.ApplicationID) } if v.SourceServerIDs != nil { ok := object.Key("sourceServerIDs") if err := awsRestjson1_serializeDocumentAssociateSourceServersRequestSourceServerIDs(v.SourceServerIDs, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpChangeServerLifeCycleState struct { } func (*awsRestjson1_serializeOpChangeServerLifeCycleState) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpChangeServerLifeCycleState) 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.(*ChangeServerLifeCycleStateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/ChangeServerLifeCycleState") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentChangeServerLifeCycleStateInput(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_serializeOpHttpBindingsChangeServerLifeCycleStateInput(v *ChangeServerLifeCycleStateInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentChangeServerLifeCycleStateInput(v *ChangeServerLifeCycleStateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.LifeCycle != nil { ok := object.Key("lifeCycle") if err := awsRestjson1_serializeDocumentChangeServerLifeCycleStateSourceServerLifecycle(v.LifeCycle, ok); err != nil { return err } } if v.SourceServerID != nil { ok := object.Key("sourceServerID") ok.String(*v.SourceServerID) } return nil } type awsRestjson1_serializeOpCreateApplication struct { } func (*awsRestjson1_serializeOpCreateApplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateApplication) 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.(*CreateApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/CreateApplication") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateApplicationInput(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_serializeOpHttpBindingsCreateApplicationInput(v *CreateApplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateApplicationInput(v *CreateApplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateLaunchConfigurationTemplate struct { } func (*awsRestjson1_serializeOpCreateLaunchConfigurationTemplate) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateLaunchConfigurationTemplate) 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.(*CreateLaunchConfigurationTemplateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/CreateLaunchConfigurationTemplate") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateLaunchConfigurationTemplateInput(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_serializeOpHttpBindingsCreateLaunchConfigurationTemplateInput(v *CreateLaunchConfigurationTemplateInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateLaunchConfigurationTemplateInput(v *CreateLaunchConfigurationTemplateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssociatePublicIpAddress != nil { ok := object.Key("associatePublicIpAddress") ok.Boolean(*v.AssociatePublicIpAddress) } if len(v.BootMode) > 0 { ok := object.Key("bootMode") ok.String(string(v.BootMode)) } if v.CopyPrivateIp != nil { ok := object.Key("copyPrivateIp") ok.Boolean(*v.CopyPrivateIp) } if v.CopyTags != nil { ok := object.Key("copyTags") ok.Boolean(*v.CopyTags) } if v.EnableMapAutoTagging != nil { ok := object.Key("enableMapAutoTagging") ok.Boolean(*v.EnableMapAutoTagging) } if v.LargeVolumeConf != nil { ok := object.Key("largeVolumeConf") if err := awsRestjson1_serializeDocumentLaunchTemplateDiskConf(v.LargeVolumeConf, ok); err != nil { return err } } if len(v.LaunchDisposition) > 0 { ok := object.Key("launchDisposition") ok.String(string(v.LaunchDisposition)) } if v.Licensing != nil { ok := object.Key("licensing") if err := awsRestjson1_serializeDocumentLicensing(v.Licensing, ok); err != nil { return err } } if v.MapAutoTaggingMpeID != nil { ok := object.Key("mapAutoTaggingMpeID") ok.String(*v.MapAutoTaggingMpeID) } if v.PostLaunchActions != nil { ok := object.Key("postLaunchActions") if err := awsRestjson1_serializeDocumentPostLaunchActions(v.PostLaunchActions, ok); err != nil { return err } } if v.SmallVolumeConf != nil { ok := object.Key("smallVolumeConf") if err := awsRestjson1_serializeDocumentLaunchTemplateDiskConf(v.SmallVolumeConf, ok); err != nil { return err } } if v.SmallVolumeMaxSize != 0 { ok := object.Key("smallVolumeMaxSize") ok.Long(v.SmallVolumeMaxSize) } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { return err } } if len(v.TargetInstanceTypeRightSizingMethod) > 0 { ok := object.Key("targetInstanceTypeRightSizingMethod") ok.String(string(v.TargetInstanceTypeRightSizingMethod)) } return nil } type awsRestjson1_serializeOpCreateReplicationConfigurationTemplate struct { } func (*awsRestjson1_serializeOpCreateReplicationConfigurationTemplate) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateReplicationConfigurationTemplate) 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.(*CreateReplicationConfigurationTemplateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/CreateReplicationConfigurationTemplate") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateReplicationConfigurationTemplateInput(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_serializeOpHttpBindingsCreateReplicationConfigurationTemplateInput(v *CreateReplicationConfigurationTemplateInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateReplicationConfigurationTemplateInput(v *CreateReplicationConfigurationTemplateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssociateDefaultSecurityGroup != nil { ok := object.Key("associateDefaultSecurityGroup") ok.Boolean(*v.AssociateDefaultSecurityGroup) } { ok := object.Key("bandwidthThrottling") ok.Long(v.BandwidthThrottling) } if v.CreatePublicIP != nil { ok := object.Key("createPublicIP") ok.Boolean(*v.CreatePublicIP) } if len(v.DataPlaneRouting) > 0 { ok := object.Key("dataPlaneRouting") ok.String(string(v.DataPlaneRouting)) } if len(v.DefaultLargeStagingDiskType) > 0 { ok := object.Key("defaultLargeStagingDiskType") ok.String(string(v.DefaultLargeStagingDiskType)) } if len(v.EbsEncryption) > 0 { ok := object.Key("ebsEncryption") ok.String(string(v.EbsEncryption)) } if v.EbsEncryptionKeyArn != nil { ok := object.Key("ebsEncryptionKeyArn") ok.String(*v.EbsEncryptionKeyArn) } if v.ReplicationServerInstanceType != nil { ok := object.Key("replicationServerInstanceType") ok.String(*v.ReplicationServerInstanceType) } if v.ReplicationServersSecurityGroupsIDs != nil { ok := object.Key("replicationServersSecurityGroupsIDs") if err := awsRestjson1_serializeDocumentReplicationServersSecurityGroupsIDs(v.ReplicationServersSecurityGroupsIDs, ok); err != nil { return err } } if v.StagingAreaSubnetId != nil { ok := object.Key("stagingAreaSubnetId") ok.String(*v.StagingAreaSubnetId) } if v.StagingAreaTags != nil { ok := object.Key("stagingAreaTags") if err := awsRestjson1_serializeDocumentTagsMap(v.StagingAreaTags, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { return err } } if v.UseDedicatedReplicationServer != nil { ok := object.Key("useDedicatedReplicationServer") ok.Boolean(*v.UseDedicatedReplicationServer) } return nil } type awsRestjson1_serializeOpCreateWave struct { } func (*awsRestjson1_serializeOpCreateWave) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateWave) 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.(*CreateWaveInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/CreateWave") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateWaveInput(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_serializeOpHttpBindingsCreateWaveInput(v *CreateWaveInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateWaveInput(v *CreateWaveInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteApplication struct { } func (*awsRestjson1_serializeOpDeleteApplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteApplication) 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.(*DeleteApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/DeleteApplication") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDeleteApplicationInput(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_serializeOpHttpBindingsDeleteApplicationInput(v *DeleteApplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDeleteApplicationInput(v *DeleteApplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ApplicationID != nil { ok := object.Key("applicationID") ok.String(*v.ApplicationID) } return nil } type awsRestjson1_serializeOpDeleteJob struct { } func (*awsRestjson1_serializeOpDeleteJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteJob) 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.(*DeleteJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/DeleteJob") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDeleteJobInput(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_serializeOpHttpBindingsDeleteJobInput(v *DeleteJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDeleteJobInput(v *DeleteJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.JobID != nil { ok := object.Key("jobID") ok.String(*v.JobID) } return nil } type awsRestjson1_serializeOpDeleteLaunchConfigurationTemplate struct { } func (*awsRestjson1_serializeOpDeleteLaunchConfigurationTemplate) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteLaunchConfigurationTemplate) 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.(*DeleteLaunchConfigurationTemplateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/DeleteLaunchConfigurationTemplate") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDeleteLaunchConfigurationTemplateInput(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_serializeOpHttpBindingsDeleteLaunchConfigurationTemplateInput(v *DeleteLaunchConfigurationTemplateInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDeleteLaunchConfigurationTemplateInput(v *DeleteLaunchConfigurationTemplateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.LaunchConfigurationTemplateID != nil { ok := object.Key("launchConfigurationTemplateID") ok.String(*v.LaunchConfigurationTemplateID) } return nil } type awsRestjson1_serializeOpDeleteReplicationConfigurationTemplate struct { } func (*awsRestjson1_serializeOpDeleteReplicationConfigurationTemplate) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteReplicationConfigurationTemplate) 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.(*DeleteReplicationConfigurationTemplateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/DeleteReplicationConfigurationTemplate") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDeleteReplicationConfigurationTemplateInput(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_serializeOpHttpBindingsDeleteReplicationConfigurationTemplateInput(v *DeleteReplicationConfigurationTemplateInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDeleteReplicationConfigurationTemplateInput(v *DeleteReplicationConfigurationTemplateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ReplicationConfigurationTemplateID != nil { ok := object.Key("replicationConfigurationTemplateID") ok.String(*v.ReplicationConfigurationTemplateID) } return nil } type awsRestjson1_serializeOpDeleteSourceServer struct { } func (*awsRestjson1_serializeOpDeleteSourceServer) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteSourceServer) 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.(*DeleteSourceServerInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/DeleteSourceServer") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDeleteSourceServerInput(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_serializeOpHttpBindingsDeleteSourceServerInput(v *DeleteSourceServerInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDeleteSourceServerInput(v *DeleteSourceServerInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SourceServerID != nil { ok := object.Key("sourceServerID") ok.String(*v.SourceServerID) } return nil } type awsRestjson1_serializeOpDeleteVcenterClient struct { } func (*awsRestjson1_serializeOpDeleteVcenterClient) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteVcenterClient) 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.(*DeleteVcenterClientInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/DeleteVcenterClient") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDeleteVcenterClientInput(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_serializeOpHttpBindingsDeleteVcenterClientInput(v *DeleteVcenterClientInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDeleteVcenterClientInput(v *DeleteVcenterClientInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.VcenterClientID != nil { ok := object.Key("vcenterClientID") ok.String(*v.VcenterClientID) } return nil } type awsRestjson1_serializeOpDeleteWave struct { } func (*awsRestjson1_serializeOpDeleteWave) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteWave) 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.(*DeleteWaveInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/DeleteWave") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDeleteWaveInput(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_serializeOpHttpBindingsDeleteWaveInput(v *DeleteWaveInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDeleteWaveInput(v *DeleteWaveInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.WaveID != nil { ok := object.Key("waveID") ok.String(*v.WaveID) } return nil } type awsRestjson1_serializeOpDescribeJobLogItems struct { } func (*awsRestjson1_serializeOpDescribeJobLogItems) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeJobLogItems) 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.(*DescribeJobLogItemsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/DescribeJobLogItems") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDescribeJobLogItemsInput(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_serializeOpHttpBindingsDescribeJobLogItemsInput(v *DescribeJobLogItemsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeJobLogItemsInput(v *DescribeJobLogItemsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.JobID != nil { ok := object.Key("jobID") ok.String(*v.JobID) } if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } return nil } type awsRestjson1_serializeOpDescribeJobs struct { } func (*awsRestjson1_serializeOpDescribeJobs) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeJobs) 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.(*DescribeJobsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/DescribeJobs") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDescribeJobsInput(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_serializeOpHttpBindingsDescribeJobsInput(v *DescribeJobsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeJobsInput(v *DescribeJobsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("filters") if err := awsRestjson1_serializeDocumentDescribeJobsRequestFilters(v.Filters, ok); err != nil { return err } } if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } return nil } type awsRestjson1_serializeOpDescribeLaunchConfigurationTemplates struct { } func (*awsRestjson1_serializeOpDescribeLaunchConfigurationTemplates) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeLaunchConfigurationTemplates) 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.(*DescribeLaunchConfigurationTemplatesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/DescribeLaunchConfigurationTemplates") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDescribeLaunchConfigurationTemplatesInput(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_serializeOpHttpBindingsDescribeLaunchConfigurationTemplatesInput(v *DescribeLaunchConfigurationTemplatesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeLaunchConfigurationTemplatesInput(v *DescribeLaunchConfigurationTemplatesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.LaunchConfigurationTemplateIDs != nil { ok := object.Key("launchConfigurationTemplateIDs") if err := awsRestjson1_serializeDocumentLaunchConfigurationTemplateIDs(v.LaunchConfigurationTemplateIDs, ok); err != nil { return err } } if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } return nil } type awsRestjson1_serializeOpDescribeReplicationConfigurationTemplates struct { } func (*awsRestjson1_serializeOpDescribeReplicationConfigurationTemplates) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeReplicationConfigurationTemplates) 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.(*DescribeReplicationConfigurationTemplatesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/DescribeReplicationConfigurationTemplates") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDescribeReplicationConfigurationTemplatesInput(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_serializeOpHttpBindingsDescribeReplicationConfigurationTemplatesInput(v *DescribeReplicationConfigurationTemplatesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeReplicationConfigurationTemplatesInput(v *DescribeReplicationConfigurationTemplatesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if v.ReplicationConfigurationTemplateIDs != nil { ok := object.Key("replicationConfigurationTemplateIDs") if err := awsRestjson1_serializeDocumentReplicationConfigurationTemplateIDs(v.ReplicationConfigurationTemplateIDs, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeSourceServers struct { } func (*awsRestjson1_serializeOpDescribeSourceServers) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeSourceServers) 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.(*DescribeSourceServersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/DescribeSourceServers") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDescribeSourceServersInput(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_serializeOpHttpBindingsDescribeSourceServersInput(v *DescribeSourceServersInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeSourceServersInput(v *DescribeSourceServersInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("filters") if err := awsRestjson1_serializeDocumentDescribeSourceServersRequestFilters(v.Filters, ok); err != nil { return err } } if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } return nil } type awsRestjson1_serializeOpDescribeVcenterClients struct { } func (*awsRestjson1_serializeOpDescribeVcenterClients) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeVcenterClients) 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.(*DescribeVcenterClientsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/DescribeVcenterClients") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDescribeVcenterClientsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDescribeVcenterClientsInput(v *DescribeVcenterClientsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpDisassociateApplications struct { } func (*awsRestjson1_serializeOpDisassociateApplications) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDisassociateApplications) 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.(*DisassociateApplicationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/DisassociateApplications") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDisassociateApplicationsInput(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_serializeOpHttpBindingsDisassociateApplicationsInput(v *DisassociateApplicationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDisassociateApplicationsInput(v *DisassociateApplicationsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ApplicationIDs != nil { ok := object.Key("applicationIDs") if err := awsRestjson1_serializeDocumentApplicationIDs(v.ApplicationIDs, ok); err != nil { return err } } if v.WaveID != nil { ok := object.Key("waveID") ok.String(*v.WaveID) } return nil } type awsRestjson1_serializeOpDisassociateSourceServers struct { } func (*awsRestjson1_serializeOpDisassociateSourceServers) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDisassociateSourceServers) 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.(*DisassociateSourceServersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/DisassociateSourceServers") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDisassociateSourceServersInput(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_serializeOpHttpBindingsDisassociateSourceServersInput(v *DisassociateSourceServersInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDisassociateSourceServersInput(v *DisassociateSourceServersInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ApplicationID != nil { ok := object.Key("applicationID") ok.String(*v.ApplicationID) } if v.SourceServerIDs != nil { ok := object.Key("sourceServerIDs") if err := awsRestjson1_serializeDocumentDisassociateSourceServersRequestSourceServerIDs(v.SourceServerIDs, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpDisconnectFromService struct { } func (*awsRestjson1_serializeOpDisconnectFromService) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDisconnectFromService) 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.(*DisconnectFromServiceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/DisconnectFromService") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDisconnectFromServiceInput(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_serializeOpHttpBindingsDisconnectFromServiceInput(v *DisconnectFromServiceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDisconnectFromServiceInput(v *DisconnectFromServiceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SourceServerID != nil { ok := object.Key("sourceServerID") ok.String(*v.SourceServerID) } return nil } type awsRestjson1_serializeOpFinalizeCutover struct { } func (*awsRestjson1_serializeOpFinalizeCutover) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpFinalizeCutover) 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.(*FinalizeCutoverInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/FinalizeCutover") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentFinalizeCutoverInput(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_serializeOpHttpBindingsFinalizeCutoverInput(v *FinalizeCutoverInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentFinalizeCutoverInput(v *FinalizeCutoverInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SourceServerID != nil { ok := object.Key("sourceServerID") ok.String(*v.SourceServerID) } return nil } type awsRestjson1_serializeOpGetLaunchConfiguration struct { } func (*awsRestjson1_serializeOpGetLaunchConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetLaunchConfiguration) 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.(*GetLaunchConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/GetLaunchConfiguration") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentGetLaunchConfigurationInput(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_serializeOpHttpBindingsGetLaunchConfigurationInput(v *GetLaunchConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentGetLaunchConfigurationInput(v *GetLaunchConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SourceServerID != nil { ok := object.Key("sourceServerID") ok.String(*v.SourceServerID) } return nil } type awsRestjson1_serializeOpGetReplicationConfiguration struct { } func (*awsRestjson1_serializeOpGetReplicationConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetReplicationConfiguration) 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.(*GetReplicationConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/GetReplicationConfiguration") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentGetReplicationConfigurationInput(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_serializeOpHttpBindingsGetReplicationConfigurationInput(v *GetReplicationConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentGetReplicationConfigurationInput(v *GetReplicationConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SourceServerID != nil { ok := object.Key("sourceServerID") ok.String(*v.SourceServerID) } return nil } type awsRestjson1_serializeOpInitializeService struct { } func (*awsRestjson1_serializeOpInitializeService) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpInitializeService) 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.(*InitializeServiceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/InitializeService") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if 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_serializeOpHttpBindingsInitializeServiceInput(v *InitializeServiceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpListApplications struct { } func (*awsRestjson1_serializeOpListApplications) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListApplications) 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.(*ListApplicationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/ListApplications") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentListApplicationsInput(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_serializeOpHttpBindingsListApplicationsInput(v *ListApplicationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListApplicationsInput(v *ListApplicationsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("filters") if err := awsRestjson1_serializeDocumentListApplicationsRequestFilters(v.Filters, ok); err != nil { return err } } if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListExportErrors struct { } func (*awsRestjson1_serializeOpListExportErrors) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListExportErrors) 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.(*ListExportErrorsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/ListExportErrors") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentListExportErrorsInput(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_serializeOpHttpBindingsListExportErrorsInput(v *ListExportErrorsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListExportErrorsInput(v *ListExportErrorsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ExportID != nil { ok := object.Key("exportID") ok.String(*v.ExportID) } if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListExports struct { } func (*awsRestjson1_serializeOpListExports) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListExports) 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.(*ListExportsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/ListExports") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentListExportsInput(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_serializeOpHttpBindingsListExportsInput(v *ListExportsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListExportsInput(v *ListExportsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("filters") if err := awsRestjson1_serializeDocumentListExportsRequestFilters(v.Filters, ok); err != nil { return err } } if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListImportErrors struct { } func (*awsRestjson1_serializeOpListImportErrors) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListImportErrors) 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.(*ListImportErrorsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/ListImportErrors") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentListImportErrorsInput(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_serializeOpHttpBindingsListImportErrorsInput(v *ListImportErrorsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListImportErrorsInput(v *ListImportErrorsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ImportID != nil { ok := object.Key("importID") ok.String(*v.ImportID) } if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListImports struct { } func (*awsRestjson1_serializeOpListImports) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListImports) 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.(*ListImportsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/ListImports") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentListImportsInput(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_serializeOpHttpBindingsListImportsInput(v *ListImportsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListImportsInput(v *ListImportsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("filters") if err := awsRestjson1_serializeDocumentListImportsRequestFilters(v.Filters, ok); err != nil { return err } } if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListSourceServerActions struct { } func (*awsRestjson1_serializeOpListSourceServerActions) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListSourceServerActions) 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.(*ListSourceServerActionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/ListSourceServerActions") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentListSourceServerActionsInput(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_serializeOpHttpBindingsListSourceServerActionsInput(v *ListSourceServerActionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListSourceServerActionsInput(v *ListSourceServerActionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("filters") if err := awsRestjson1_serializeDocumentSourceServerActionsRequestFilters(v.Filters, ok); err != nil { return err } } if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if v.SourceServerID != nil { ok := object.Key("sourceServerID") ok.String(*v.SourceServerID) } return nil } type awsRestjson1_serializeOpListTagsForResource struct { } func (*awsRestjson1_serializeOpListTagsForResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListTagsForResource) 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.(*ListTagsForResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpListTemplateActions struct { } func (*awsRestjson1_serializeOpListTemplateActions) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListTemplateActions) 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.(*ListTemplateActionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/ListTemplateActions") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentListTemplateActionsInput(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_serializeOpHttpBindingsListTemplateActionsInput(v *ListTemplateActionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListTemplateActionsInput(v *ListTemplateActionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("filters") if err := awsRestjson1_serializeDocumentTemplateActionsRequestFilters(v.Filters, ok); err != nil { return err } } if v.LaunchConfigurationTemplateID != nil { ok := object.Key("launchConfigurationTemplateID") ok.String(*v.LaunchConfigurationTemplateID) } if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListWaves struct { } func (*awsRestjson1_serializeOpListWaves) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListWaves) 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.(*ListWavesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/ListWaves") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentListWavesInput(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_serializeOpHttpBindingsListWavesInput(v *ListWavesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListWavesInput(v *ListWavesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("filters") if err := awsRestjson1_serializeDocumentListWavesRequestFilters(v.Filters, ok); err != nil { return err } } if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } return nil } type awsRestjson1_serializeOpMarkAsArchived struct { } func (*awsRestjson1_serializeOpMarkAsArchived) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpMarkAsArchived) 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.(*MarkAsArchivedInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/MarkAsArchived") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentMarkAsArchivedInput(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_serializeOpHttpBindingsMarkAsArchivedInput(v *MarkAsArchivedInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentMarkAsArchivedInput(v *MarkAsArchivedInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SourceServerID != nil { ok := object.Key("sourceServerID") ok.String(*v.SourceServerID) } return nil } type awsRestjson1_serializeOpPutSourceServerAction struct { } func (*awsRestjson1_serializeOpPutSourceServerAction) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpPutSourceServerAction) 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.(*PutSourceServerActionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/PutSourceServerAction") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentPutSourceServerActionInput(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_serializeOpHttpBindingsPutSourceServerActionInput(v *PutSourceServerActionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentPutSourceServerActionInput(v *PutSourceServerActionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ActionID != nil { ok := object.Key("actionID") ok.String(*v.ActionID) } if v.ActionName != nil { ok := object.Key("actionName") ok.String(*v.ActionName) } if v.Active != nil { ok := object.Key("active") ok.Boolean(*v.Active) } if len(v.Category) > 0 { ok := object.Key("category") ok.String(string(v.Category)) } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.DocumentIdentifier != nil { ok := object.Key("documentIdentifier") ok.String(*v.DocumentIdentifier) } if v.DocumentVersion != nil { ok := object.Key("documentVersion") ok.String(*v.DocumentVersion) } if v.ExternalParameters != nil { ok := object.Key("externalParameters") if err := awsRestjson1_serializeDocumentSsmDocumentExternalParameters(v.ExternalParameters, ok); err != nil { return err } } if v.MustSucceedForCutover != nil { ok := object.Key("mustSucceedForCutover") ok.Boolean(*v.MustSucceedForCutover) } { ok := object.Key("order") ok.Integer(v.Order) } if v.Parameters != nil { ok := object.Key("parameters") if err := awsRestjson1_serializeDocumentSsmDocumentParameters(v.Parameters, ok); err != nil { return err } } if v.SourceServerID != nil { ok := object.Key("sourceServerID") ok.String(*v.SourceServerID) } if v.TimeoutSeconds != 0 { ok := object.Key("timeoutSeconds") ok.Integer(v.TimeoutSeconds) } return nil } type awsRestjson1_serializeOpPutTemplateAction struct { } func (*awsRestjson1_serializeOpPutTemplateAction) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpPutTemplateAction) 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.(*PutTemplateActionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/PutTemplateAction") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentPutTemplateActionInput(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_serializeOpHttpBindingsPutTemplateActionInput(v *PutTemplateActionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentPutTemplateActionInput(v *PutTemplateActionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ActionID != nil { ok := object.Key("actionID") ok.String(*v.ActionID) } if v.ActionName != nil { ok := object.Key("actionName") ok.String(*v.ActionName) } if v.Active != nil { ok := object.Key("active") ok.Boolean(*v.Active) } if len(v.Category) > 0 { ok := object.Key("category") ok.String(string(v.Category)) } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.DocumentIdentifier != nil { ok := object.Key("documentIdentifier") ok.String(*v.DocumentIdentifier) } if v.DocumentVersion != nil { ok := object.Key("documentVersion") ok.String(*v.DocumentVersion) } if v.ExternalParameters != nil { ok := object.Key("externalParameters") if err := awsRestjson1_serializeDocumentSsmDocumentExternalParameters(v.ExternalParameters, ok); err != nil { return err } } if v.LaunchConfigurationTemplateID != nil { ok := object.Key("launchConfigurationTemplateID") ok.String(*v.LaunchConfigurationTemplateID) } if v.MustSucceedForCutover != nil { ok := object.Key("mustSucceedForCutover") ok.Boolean(*v.MustSucceedForCutover) } if v.OperatingSystem != nil { ok := object.Key("operatingSystem") ok.String(*v.OperatingSystem) } { ok := object.Key("order") ok.Integer(v.Order) } if v.Parameters != nil { ok := object.Key("parameters") if err := awsRestjson1_serializeDocumentSsmDocumentParameters(v.Parameters, ok); err != nil { return err } } if v.TimeoutSeconds != 0 { ok := object.Key("timeoutSeconds") ok.Integer(v.TimeoutSeconds) } return nil } type awsRestjson1_serializeOpRemoveSourceServerAction struct { } func (*awsRestjson1_serializeOpRemoveSourceServerAction) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpRemoveSourceServerAction) 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.(*RemoveSourceServerActionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/RemoveSourceServerAction") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentRemoveSourceServerActionInput(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_serializeOpHttpBindingsRemoveSourceServerActionInput(v *RemoveSourceServerActionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentRemoveSourceServerActionInput(v *RemoveSourceServerActionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ActionID != nil { ok := object.Key("actionID") ok.String(*v.ActionID) } if v.SourceServerID != nil { ok := object.Key("sourceServerID") ok.String(*v.SourceServerID) } return nil } type awsRestjson1_serializeOpRemoveTemplateAction struct { } func (*awsRestjson1_serializeOpRemoveTemplateAction) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpRemoveTemplateAction) 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.(*RemoveTemplateActionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/RemoveTemplateAction") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentRemoveTemplateActionInput(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_serializeOpHttpBindingsRemoveTemplateActionInput(v *RemoveTemplateActionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentRemoveTemplateActionInput(v *RemoveTemplateActionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ActionID != nil { ok := object.Key("actionID") ok.String(*v.ActionID) } if v.LaunchConfigurationTemplateID != nil { ok := object.Key("launchConfigurationTemplateID") ok.String(*v.LaunchConfigurationTemplateID) } return nil } type awsRestjson1_serializeOpRetryDataReplication struct { } func (*awsRestjson1_serializeOpRetryDataReplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpRetryDataReplication) 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.(*RetryDataReplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/RetryDataReplication") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentRetryDataReplicationInput(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_serializeOpHttpBindingsRetryDataReplicationInput(v *RetryDataReplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentRetryDataReplicationInput(v *RetryDataReplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SourceServerID != nil { ok := object.Key("sourceServerID") ok.String(*v.SourceServerID) } return nil } type awsRestjson1_serializeOpStartCutover struct { } func (*awsRestjson1_serializeOpStartCutover) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartCutover) 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.(*StartCutoverInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/StartCutover") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentStartCutoverInput(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_serializeOpHttpBindingsStartCutoverInput(v *StartCutoverInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentStartCutoverInput(v *StartCutoverInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SourceServerIDs != nil { ok := object.Key("sourceServerIDs") if err := awsRestjson1_serializeDocumentStartCutoverRequestSourceServerIDs(v.SourceServerIDs, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpStartExport struct { } func (*awsRestjson1_serializeOpStartExport) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartExport) 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.(*StartExportInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/StartExport") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentStartExportInput(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_serializeOpHttpBindingsStartExportInput(v *StartExportInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentStartExportInput(v *StartExportInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.S3Bucket != nil { ok := object.Key("s3Bucket") ok.String(*v.S3Bucket) } if v.S3BucketOwner != nil { ok := object.Key("s3BucketOwner") ok.String(*v.S3BucketOwner) } if v.S3Key != nil { ok := object.Key("s3Key") ok.String(*v.S3Key) } return nil } type awsRestjson1_serializeOpStartImport struct { } func (*awsRestjson1_serializeOpStartImport) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartImport) 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.(*StartImportInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/StartImport") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentStartImportInput(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_serializeOpHttpBindingsStartImportInput(v *StartImportInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentStartImportInput(v *StartImportInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.S3BucketSource != nil { ok := object.Key("s3BucketSource") if err := awsRestjson1_serializeDocumentS3BucketSource(v.S3BucketSource, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpStartReplication struct { } func (*awsRestjson1_serializeOpStartReplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartReplication) 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.(*StartReplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/StartReplication") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentStartReplicationInput(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_serializeOpHttpBindingsStartReplicationInput(v *StartReplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentStartReplicationInput(v *StartReplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SourceServerID != nil { ok := object.Key("sourceServerID") ok.String(*v.SourceServerID) } return nil } type awsRestjson1_serializeOpStartTest struct { } func (*awsRestjson1_serializeOpStartTest) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartTest) 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.(*StartTestInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/StartTest") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentStartTestInput(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_serializeOpHttpBindingsStartTestInput(v *StartTestInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentStartTestInput(v *StartTestInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SourceServerIDs != nil { ok := object.Key("sourceServerIDs") if err := awsRestjson1_serializeDocumentStartTestRequestSourceServerIDs(v.SourceServerIDs, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpTagResource struct { } func (*awsRestjson1_serializeOpTagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpTagResource) 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.(*TagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentTagResourceInput(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_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpTerminateTargetInstances struct { } func (*awsRestjson1_serializeOpTerminateTargetInstances) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpTerminateTargetInstances) 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.(*TerminateTargetInstancesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/TerminateTargetInstances") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentTerminateTargetInstancesInput(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_serializeOpHttpBindingsTerminateTargetInstancesInput(v *TerminateTargetInstancesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentTerminateTargetInstancesInput(v *TerminateTargetInstancesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SourceServerIDs != nil { ok := object.Key("sourceServerIDs") if err := awsRestjson1_serializeDocumentTerminateTargetInstancesRequestSourceServerIDs(v.SourceServerIDs, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUnarchiveApplication struct { } func (*awsRestjson1_serializeOpUnarchiveApplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUnarchiveApplication) 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.(*UnarchiveApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/UnarchiveApplication") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUnarchiveApplicationInput(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_serializeOpHttpBindingsUnarchiveApplicationInput(v *UnarchiveApplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUnarchiveApplicationInput(v *UnarchiveApplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ApplicationID != nil { ok := object.Key("applicationID") ok.String(*v.ApplicationID) } return nil } type awsRestjson1_serializeOpUnarchiveWave struct { } func (*awsRestjson1_serializeOpUnarchiveWave) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUnarchiveWave) 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.(*UnarchiveWaveInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/UnarchiveWave") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUnarchiveWaveInput(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_serializeOpHttpBindingsUnarchiveWaveInput(v *UnarchiveWaveInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUnarchiveWaveInput(v *UnarchiveWaveInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.WaveID != nil { ok := object.Key("waveID") ok.String(*v.WaveID) } return nil } type awsRestjson1_serializeOpUntagResource struct { } func (*awsRestjson1_serializeOpUntagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUntagResource) 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.(*UntagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { return err } } if v.TagKeys != nil { for i := range v.TagKeys { encoder.AddQuery("tagKeys").String(v.TagKeys[i]) } } return nil } type awsRestjson1_serializeOpUpdateApplication struct { } func (*awsRestjson1_serializeOpUpdateApplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateApplication) 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.(*UpdateApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/UpdateApplication") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateApplicationInput(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_serializeOpHttpBindingsUpdateApplicationInput(v *UpdateApplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateApplicationInput(v *UpdateApplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ApplicationID != nil { ok := object.Key("applicationID") ok.String(*v.ApplicationID) } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } return nil } type awsRestjson1_serializeOpUpdateLaunchConfiguration struct { } func (*awsRestjson1_serializeOpUpdateLaunchConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateLaunchConfiguration) 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.(*UpdateLaunchConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/UpdateLaunchConfiguration") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateLaunchConfigurationInput(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_serializeOpHttpBindingsUpdateLaunchConfigurationInput(v *UpdateLaunchConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateLaunchConfigurationInput(v *UpdateLaunchConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.BootMode) > 0 { ok := object.Key("bootMode") ok.String(string(v.BootMode)) } if v.CopyPrivateIp != nil { ok := object.Key("copyPrivateIp") ok.Boolean(*v.CopyPrivateIp) } if v.CopyTags != nil { ok := object.Key("copyTags") ok.Boolean(*v.CopyTags) } if v.EnableMapAutoTagging != nil { ok := object.Key("enableMapAutoTagging") ok.Boolean(*v.EnableMapAutoTagging) } if len(v.LaunchDisposition) > 0 { ok := object.Key("launchDisposition") ok.String(string(v.LaunchDisposition)) } if v.Licensing != nil { ok := object.Key("licensing") if err := awsRestjson1_serializeDocumentLicensing(v.Licensing, ok); err != nil { return err } } if v.MapAutoTaggingMpeID != nil { ok := object.Key("mapAutoTaggingMpeID") ok.String(*v.MapAutoTaggingMpeID) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.PostLaunchActions != nil { ok := object.Key("postLaunchActions") if err := awsRestjson1_serializeDocumentPostLaunchActions(v.PostLaunchActions, ok); err != nil { return err } } if v.SourceServerID != nil { ok := object.Key("sourceServerID") ok.String(*v.SourceServerID) } if len(v.TargetInstanceTypeRightSizingMethod) > 0 { ok := object.Key("targetInstanceTypeRightSizingMethod") ok.String(string(v.TargetInstanceTypeRightSizingMethod)) } return nil } type awsRestjson1_serializeOpUpdateLaunchConfigurationTemplate struct { } func (*awsRestjson1_serializeOpUpdateLaunchConfigurationTemplate) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateLaunchConfigurationTemplate) 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.(*UpdateLaunchConfigurationTemplateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/UpdateLaunchConfigurationTemplate") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateLaunchConfigurationTemplateInput(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_serializeOpHttpBindingsUpdateLaunchConfigurationTemplateInput(v *UpdateLaunchConfigurationTemplateInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateLaunchConfigurationTemplateInput(v *UpdateLaunchConfigurationTemplateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssociatePublicIpAddress != nil { ok := object.Key("associatePublicIpAddress") ok.Boolean(*v.AssociatePublicIpAddress) } if len(v.BootMode) > 0 { ok := object.Key("bootMode") ok.String(string(v.BootMode)) } if v.CopyPrivateIp != nil { ok := object.Key("copyPrivateIp") ok.Boolean(*v.CopyPrivateIp) } if v.CopyTags != nil { ok := object.Key("copyTags") ok.Boolean(*v.CopyTags) } if v.EnableMapAutoTagging != nil { ok := object.Key("enableMapAutoTagging") ok.Boolean(*v.EnableMapAutoTagging) } if v.LargeVolumeConf != nil { ok := object.Key("largeVolumeConf") if err := awsRestjson1_serializeDocumentLaunchTemplateDiskConf(v.LargeVolumeConf, ok); err != nil { return err } } if v.LaunchConfigurationTemplateID != nil { ok := object.Key("launchConfigurationTemplateID") ok.String(*v.LaunchConfigurationTemplateID) } if len(v.LaunchDisposition) > 0 { ok := object.Key("launchDisposition") ok.String(string(v.LaunchDisposition)) } if v.Licensing != nil { ok := object.Key("licensing") if err := awsRestjson1_serializeDocumentLicensing(v.Licensing, ok); err != nil { return err } } if v.MapAutoTaggingMpeID != nil { ok := object.Key("mapAutoTaggingMpeID") ok.String(*v.MapAutoTaggingMpeID) } if v.PostLaunchActions != nil { ok := object.Key("postLaunchActions") if err := awsRestjson1_serializeDocumentPostLaunchActions(v.PostLaunchActions, ok); err != nil { return err } } if v.SmallVolumeConf != nil { ok := object.Key("smallVolumeConf") if err := awsRestjson1_serializeDocumentLaunchTemplateDiskConf(v.SmallVolumeConf, ok); err != nil { return err } } if v.SmallVolumeMaxSize != 0 { ok := object.Key("smallVolumeMaxSize") ok.Long(v.SmallVolumeMaxSize) } if len(v.TargetInstanceTypeRightSizingMethod) > 0 { ok := object.Key("targetInstanceTypeRightSizingMethod") ok.String(string(v.TargetInstanceTypeRightSizingMethod)) } return nil } type awsRestjson1_serializeOpUpdateReplicationConfiguration struct { } func (*awsRestjson1_serializeOpUpdateReplicationConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateReplicationConfiguration) 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.(*UpdateReplicationConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/UpdateReplicationConfiguration") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateReplicationConfigurationInput(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_serializeOpHttpBindingsUpdateReplicationConfigurationInput(v *UpdateReplicationConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateReplicationConfigurationInput(v *UpdateReplicationConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssociateDefaultSecurityGroup != nil { ok := object.Key("associateDefaultSecurityGroup") ok.Boolean(*v.AssociateDefaultSecurityGroup) } if v.BandwidthThrottling != 0 { ok := object.Key("bandwidthThrottling") ok.Long(v.BandwidthThrottling) } if v.CreatePublicIP != nil { ok := object.Key("createPublicIP") ok.Boolean(*v.CreatePublicIP) } if len(v.DataPlaneRouting) > 0 { ok := object.Key("dataPlaneRouting") ok.String(string(v.DataPlaneRouting)) } if len(v.DefaultLargeStagingDiskType) > 0 { ok := object.Key("defaultLargeStagingDiskType") ok.String(string(v.DefaultLargeStagingDiskType)) } if len(v.EbsEncryption) > 0 { ok := object.Key("ebsEncryption") ok.String(string(v.EbsEncryption)) } if v.EbsEncryptionKeyArn != nil { ok := object.Key("ebsEncryptionKeyArn") ok.String(*v.EbsEncryptionKeyArn) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.ReplicatedDisks != nil { ok := object.Key("replicatedDisks") if err := awsRestjson1_serializeDocumentReplicationConfigurationReplicatedDisks(v.ReplicatedDisks, ok); err != nil { return err } } if v.ReplicationServerInstanceType != nil { ok := object.Key("replicationServerInstanceType") ok.String(*v.ReplicationServerInstanceType) } if v.ReplicationServersSecurityGroupsIDs != nil { ok := object.Key("replicationServersSecurityGroupsIDs") if err := awsRestjson1_serializeDocumentReplicationServersSecurityGroupsIDs(v.ReplicationServersSecurityGroupsIDs, ok); err != nil { return err } } if v.SourceServerID != nil { ok := object.Key("sourceServerID") ok.String(*v.SourceServerID) } if v.StagingAreaSubnetId != nil { ok := object.Key("stagingAreaSubnetId") ok.String(*v.StagingAreaSubnetId) } if v.StagingAreaTags != nil { ok := object.Key("stagingAreaTags") if err := awsRestjson1_serializeDocumentTagsMap(v.StagingAreaTags, ok); err != nil { return err } } if v.UseDedicatedReplicationServer != nil { ok := object.Key("useDedicatedReplicationServer") ok.Boolean(*v.UseDedicatedReplicationServer) } return nil } type awsRestjson1_serializeOpUpdateReplicationConfigurationTemplate struct { } func (*awsRestjson1_serializeOpUpdateReplicationConfigurationTemplate) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateReplicationConfigurationTemplate) 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.(*UpdateReplicationConfigurationTemplateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/UpdateReplicationConfigurationTemplate") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateReplicationConfigurationTemplateInput(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_serializeOpHttpBindingsUpdateReplicationConfigurationTemplateInput(v *UpdateReplicationConfigurationTemplateInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateReplicationConfigurationTemplateInput(v *UpdateReplicationConfigurationTemplateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Arn != nil { ok := object.Key("arn") ok.String(*v.Arn) } if v.AssociateDefaultSecurityGroup != nil { ok := object.Key("associateDefaultSecurityGroup") ok.Boolean(*v.AssociateDefaultSecurityGroup) } if v.BandwidthThrottling != 0 { ok := object.Key("bandwidthThrottling") ok.Long(v.BandwidthThrottling) } if v.CreatePublicIP != nil { ok := object.Key("createPublicIP") ok.Boolean(*v.CreatePublicIP) } if len(v.DataPlaneRouting) > 0 { ok := object.Key("dataPlaneRouting") ok.String(string(v.DataPlaneRouting)) } if len(v.DefaultLargeStagingDiskType) > 0 { ok := object.Key("defaultLargeStagingDiskType") ok.String(string(v.DefaultLargeStagingDiskType)) } if len(v.EbsEncryption) > 0 { ok := object.Key("ebsEncryption") ok.String(string(v.EbsEncryption)) } if v.EbsEncryptionKeyArn != nil { ok := object.Key("ebsEncryptionKeyArn") ok.String(*v.EbsEncryptionKeyArn) } if v.ReplicationConfigurationTemplateID != nil { ok := object.Key("replicationConfigurationTemplateID") ok.String(*v.ReplicationConfigurationTemplateID) } if v.ReplicationServerInstanceType != nil { ok := object.Key("replicationServerInstanceType") ok.String(*v.ReplicationServerInstanceType) } if v.ReplicationServersSecurityGroupsIDs != nil { ok := object.Key("replicationServersSecurityGroupsIDs") if err := awsRestjson1_serializeDocumentReplicationServersSecurityGroupsIDs(v.ReplicationServersSecurityGroupsIDs, ok); err != nil { return err } } if v.StagingAreaSubnetId != nil { ok := object.Key("stagingAreaSubnetId") ok.String(*v.StagingAreaSubnetId) } if v.StagingAreaTags != nil { ok := object.Key("stagingAreaTags") if err := awsRestjson1_serializeDocumentTagsMap(v.StagingAreaTags, ok); err != nil { return err } } if v.UseDedicatedReplicationServer != nil { ok := object.Key("useDedicatedReplicationServer") ok.Boolean(*v.UseDedicatedReplicationServer) } return nil } type awsRestjson1_serializeOpUpdateSourceServerReplicationType struct { } func (*awsRestjson1_serializeOpUpdateSourceServerReplicationType) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateSourceServerReplicationType) 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.(*UpdateSourceServerReplicationTypeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/UpdateSourceServerReplicationType") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateSourceServerReplicationTypeInput(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_serializeOpHttpBindingsUpdateSourceServerReplicationTypeInput(v *UpdateSourceServerReplicationTypeInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateSourceServerReplicationTypeInput(v *UpdateSourceServerReplicationTypeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.ReplicationType) > 0 { ok := object.Key("replicationType") ok.String(string(v.ReplicationType)) } if v.SourceServerID != nil { ok := object.Key("sourceServerID") ok.String(*v.SourceServerID) } return nil } type awsRestjson1_serializeOpUpdateWave struct { } func (*awsRestjson1_serializeOpUpdateWave) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateWave) 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.(*UpdateWaveInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/UpdateWave") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateWaveInput(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_serializeOpHttpBindingsUpdateWaveInput(v *UpdateWaveInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateWaveInput(v *UpdateWaveInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.WaveID != nil { ok := object.Key("waveID") ok.String(*v.WaveID) } return nil } func awsRestjson1_serializeDocumentActionIDs(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentApplicationIDs(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentApplicationIDsFilter(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentAssociateSourceServersRequestSourceServerIDs(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentChangeServerLifeCycleStateSourceServerLifecycle(v *types.ChangeServerLifeCycleStateSourceServerLifecycle, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.State) > 0 { ok := object.Key("state") ok.String(string(v.State)) } return nil } func awsRestjson1_serializeDocumentDescribeJobsRequestFilters(v *types.DescribeJobsRequestFilters, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.FromDate != nil { ok := object.Key("fromDate") ok.String(*v.FromDate) } if v.JobIDs != nil { ok := object.Key("jobIDs") if err := awsRestjson1_serializeDocumentDescribeJobsRequestFiltersJobIDs(v.JobIDs, ok); err != nil { return err } } if v.ToDate != nil { ok := object.Key("toDate") ok.String(*v.ToDate) } return nil } func awsRestjson1_serializeDocumentDescribeJobsRequestFiltersJobIDs(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentDescribeSourceServersRequestApplicationIDs(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentDescribeSourceServersRequestFilters(v *types.DescribeSourceServersRequestFilters, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ApplicationIDs != nil { ok := object.Key("applicationIDs") if err := awsRestjson1_serializeDocumentDescribeSourceServersRequestApplicationIDs(v.ApplicationIDs, ok); err != nil { return err } } if v.IsArchived != nil { ok := object.Key("isArchived") ok.Boolean(*v.IsArchived) } if v.LifeCycleStates != nil { ok := object.Key("lifeCycleStates") if err := awsRestjson1_serializeDocumentLifeCycleStates(v.LifeCycleStates, ok); err != nil { return err } } if v.ReplicationTypes != nil { ok := object.Key("replicationTypes") if err := awsRestjson1_serializeDocumentReplicationTypes(v.ReplicationTypes, ok); err != nil { return err } } if v.SourceServerIDs != nil { ok := object.Key("sourceServerIDs") if err := awsRestjson1_serializeDocumentDescribeSourceServersRequestFiltersIDs(v.SourceServerIDs, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentDescribeSourceServersRequestFiltersIDs(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentDisassociateSourceServersRequestSourceServerIDs(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentImportIDsFilter(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentLaunchConfigurationTemplateIDs(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentLaunchTemplateDiskConf(v *types.LaunchTemplateDiskConf, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Iops != 0 { ok := object.Key("iops") ok.Long(v.Iops) } if v.Throughput != 0 { ok := object.Key("throughput") ok.Long(v.Throughput) } if len(v.VolumeType) > 0 { ok := object.Key("volumeType") ok.String(string(v.VolumeType)) } return nil } func awsRestjson1_serializeDocumentLicensing(v *types.Licensing, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.OsByol != nil { ok := object.Key("osByol") ok.Boolean(*v.OsByol) } return nil } func awsRestjson1_serializeDocumentLifeCycleStates(v []types.LifeCycleState, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(string(v[i])) } return nil } func awsRestjson1_serializeDocumentListApplicationsRequestFilters(v *types.ListApplicationsRequestFilters, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ApplicationIDs != nil { ok := object.Key("applicationIDs") if err := awsRestjson1_serializeDocumentApplicationIDsFilter(v.ApplicationIDs, ok); err != nil { return err } } if v.IsArchived != nil { ok := object.Key("isArchived") ok.Boolean(*v.IsArchived) } if v.WaveIDs != nil { ok := object.Key("waveIDs") if err := awsRestjson1_serializeDocumentWaveIDsFilter(v.WaveIDs, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentListExportsRequestFilters(v *types.ListExportsRequestFilters, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ExportIDs != nil { ok := object.Key("exportIDs") if err := awsRestjson1_serializeDocumentListExportsRequestFiltersExportIDs(v.ExportIDs, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentListExportsRequestFiltersExportIDs(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentListImportsRequestFilters(v *types.ListImportsRequestFilters, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ImportIDs != nil { ok := object.Key("importIDs") if err := awsRestjson1_serializeDocumentImportIDsFilter(v.ImportIDs, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentListWavesRequestFilters(v *types.ListWavesRequestFilters, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.IsArchived != nil { ok := object.Key("isArchived") ok.Boolean(*v.IsArchived) } if v.WaveIDs != nil { ok := object.Key("waveIDs") if err := awsRestjson1_serializeDocumentWaveIDsFilter(v.WaveIDs, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentPostLaunchActions(v *types.PostLaunchActions, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CloudWatchLogGroupName != nil { ok := object.Key("cloudWatchLogGroupName") ok.String(*v.CloudWatchLogGroupName) } if len(v.Deployment) > 0 { ok := object.Key("deployment") ok.String(string(v.Deployment)) } if v.S3LogBucket != nil { ok := object.Key("s3LogBucket") ok.String(*v.S3LogBucket) } if v.S3OutputKeyPrefix != nil { ok := object.Key("s3OutputKeyPrefix") ok.String(*v.S3OutputKeyPrefix) } if v.SsmDocuments != nil { ok := object.Key("ssmDocuments") if err := awsRestjson1_serializeDocumentSsmDocuments(v.SsmDocuments, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentReplicationConfigurationReplicatedDisk(v *types.ReplicationConfigurationReplicatedDisk, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DeviceName != nil { ok := object.Key("deviceName") ok.String(*v.DeviceName) } if v.Iops != 0 { ok := object.Key("iops") ok.Long(v.Iops) } if v.IsBootDisk != nil { ok := object.Key("isBootDisk") ok.Boolean(*v.IsBootDisk) } if len(v.StagingDiskType) > 0 { ok := object.Key("stagingDiskType") ok.String(string(v.StagingDiskType)) } if v.Throughput != 0 { ok := object.Key("throughput") ok.Long(v.Throughput) } return nil } func awsRestjson1_serializeDocumentReplicationConfigurationReplicatedDisks(v []types.ReplicationConfigurationReplicatedDisk, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentReplicationConfigurationReplicatedDisk(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentReplicationConfigurationTemplateIDs(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentReplicationServersSecurityGroupsIDs(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentReplicationTypes(v []types.ReplicationType, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(string(v[i])) } return nil } func awsRestjson1_serializeDocumentS3BucketSource(v *types.S3BucketSource, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.S3Bucket != nil { ok := object.Key("s3Bucket") ok.String(*v.S3Bucket) } if v.S3BucketOwner != nil { ok := object.Key("s3BucketOwner") ok.String(*v.S3BucketOwner) } if v.S3Key != nil { ok := object.Key("s3Key") ok.String(*v.S3Key) } return nil } func awsRestjson1_serializeDocumentSourceServerActionsRequestFilters(v *types.SourceServerActionsRequestFilters, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ActionIDs != nil { ok := object.Key("actionIDs") if err := awsRestjson1_serializeDocumentActionIDs(v.ActionIDs, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSsmDocument(v *types.SsmDocument, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ActionName != nil { ok := object.Key("actionName") ok.String(*v.ActionName) } if v.ExternalParameters != nil { ok := object.Key("externalParameters") if err := awsRestjson1_serializeDocumentSsmDocumentExternalParameters(v.ExternalParameters, ok); err != nil { return err } } if v.MustSucceedForCutover != nil { ok := object.Key("mustSucceedForCutover") ok.Boolean(*v.MustSucceedForCutover) } if v.Parameters != nil { ok := object.Key("parameters") if err := awsRestjson1_serializeDocumentSsmDocumentParameters(v.Parameters, ok); err != nil { return err } } if v.SsmDocumentName != nil { ok := object.Key("ssmDocumentName") ok.String(*v.SsmDocumentName) } if v.TimeoutSeconds != 0 { ok := object.Key("timeoutSeconds") ok.Integer(v.TimeoutSeconds) } return nil } func awsRestjson1_serializeDocumentSsmDocumentExternalParameters(v map[string]types.SsmExternalParameter, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) if vv := v[key]; vv == nil { continue } if err := awsRestjson1_serializeDocumentSsmExternalParameter(v[key], om); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSsmDocumentParameters(v map[string][]types.SsmParameterStoreParameter, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) if vv := v[key]; vv == nil { continue } if err := awsRestjson1_serializeDocumentSsmParameterStoreParameters(v[key], om); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSsmDocuments(v []types.SsmDocument, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentSsmDocument(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSsmExternalParameter(v types.SsmExternalParameter, value smithyjson.Value) error { object := value.Object() defer object.Close() switch uv := v.(type) { case *types.SsmExternalParameterMemberDynamicPath: av := object.Key("dynamicPath") av.String(uv.Value) default: return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) } return nil } func awsRestjson1_serializeDocumentSsmParameterStoreParameter(v *types.SsmParameterStoreParameter, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ParameterName != nil { ok := object.Key("parameterName") ok.String(*v.ParameterName) } if len(v.ParameterType) > 0 { ok := object.Key("parameterType") ok.String(string(v.ParameterType)) } return nil } func awsRestjson1_serializeDocumentSsmParameterStoreParameters(v []types.SsmParameterStoreParameter, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentSsmParameterStoreParameter(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentStartCutoverRequestSourceServerIDs(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentStartTestRequestSourceServerIDs(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentTagsMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) om.String(v[key]) } return nil } func awsRestjson1_serializeDocumentTemplateActionsRequestFilters(v *types.TemplateActionsRequestFilters, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ActionIDs != nil { ok := object.Key("actionIDs") if err := awsRestjson1_serializeDocumentActionIDs(v.ActionIDs, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentTerminateTargetInstancesRequestSourceServerIDs(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentWaveIDsFilter(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil }
5,639
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/mgn/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpArchiveApplication struct { } func (*validateOpArchiveApplication) ID() string { return "OperationInputValidation" } func (m *validateOpArchiveApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ArchiveApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpArchiveApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpArchiveWave struct { } func (*validateOpArchiveWave) ID() string { return "OperationInputValidation" } func (m *validateOpArchiveWave) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ArchiveWaveInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpArchiveWaveInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpAssociateApplications struct { } func (*validateOpAssociateApplications) ID() string { return "OperationInputValidation" } func (m *validateOpAssociateApplications) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AssociateApplicationsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAssociateApplicationsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpAssociateSourceServers struct { } func (*validateOpAssociateSourceServers) ID() string { return "OperationInputValidation" } func (m *validateOpAssociateSourceServers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AssociateSourceServersInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAssociateSourceServersInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpChangeServerLifeCycleState struct { } func (*validateOpChangeServerLifeCycleState) ID() string { return "OperationInputValidation" } func (m *validateOpChangeServerLifeCycleState) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ChangeServerLifeCycleStateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpChangeServerLifeCycleStateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateApplication struct { } func (*validateOpCreateApplication) ID() string { return "OperationInputValidation" } func (m *validateOpCreateApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateLaunchConfigurationTemplate struct { } func (*validateOpCreateLaunchConfigurationTemplate) ID() string { return "OperationInputValidation" } func (m *validateOpCreateLaunchConfigurationTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateLaunchConfigurationTemplateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateLaunchConfigurationTemplateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateReplicationConfigurationTemplate struct { } func (*validateOpCreateReplicationConfigurationTemplate) ID() string { return "OperationInputValidation" } func (m *validateOpCreateReplicationConfigurationTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateReplicationConfigurationTemplateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateReplicationConfigurationTemplateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateWave struct { } func (*validateOpCreateWave) ID() string { return "OperationInputValidation" } func (m *validateOpCreateWave) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateWaveInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateWaveInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteApplication struct { } func (*validateOpDeleteApplication) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteJob struct { } func (*validateOpDeleteJob) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteLaunchConfigurationTemplate struct { } func (*validateOpDeleteLaunchConfigurationTemplate) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteLaunchConfigurationTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteLaunchConfigurationTemplateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteLaunchConfigurationTemplateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteReplicationConfigurationTemplate struct { } func (*validateOpDeleteReplicationConfigurationTemplate) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteReplicationConfigurationTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteReplicationConfigurationTemplateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteReplicationConfigurationTemplateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteSourceServer struct { } func (*validateOpDeleteSourceServer) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteSourceServer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteSourceServerInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteSourceServerInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteVcenterClient struct { } func (*validateOpDeleteVcenterClient) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteVcenterClient) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteVcenterClientInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteVcenterClientInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteWave struct { } func (*validateOpDeleteWave) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteWave) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteWaveInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteWaveInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeJobLogItems struct { } func (*validateOpDescribeJobLogItems) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeJobLogItems) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeJobLogItemsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeJobLogItemsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDisassociateApplications struct { } func (*validateOpDisassociateApplications) ID() string { return "OperationInputValidation" } func (m *validateOpDisassociateApplications) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DisassociateApplicationsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDisassociateApplicationsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDisassociateSourceServers struct { } func (*validateOpDisassociateSourceServers) ID() string { return "OperationInputValidation" } func (m *validateOpDisassociateSourceServers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DisassociateSourceServersInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDisassociateSourceServersInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDisconnectFromService struct { } func (*validateOpDisconnectFromService) ID() string { return "OperationInputValidation" } func (m *validateOpDisconnectFromService) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DisconnectFromServiceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDisconnectFromServiceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpFinalizeCutover struct { } func (*validateOpFinalizeCutover) ID() string { return "OperationInputValidation" } func (m *validateOpFinalizeCutover) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*FinalizeCutoverInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpFinalizeCutoverInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetLaunchConfiguration struct { } func (*validateOpGetLaunchConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpGetLaunchConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetLaunchConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetLaunchConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetReplicationConfiguration struct { } func (*validateOpGetReplicationConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpGetReplicationConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetReplicationConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetReplicationConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListExportErrors struct { } func (*validateOpListExportErrors) ID() string { return "OperationInputValidation" } func (m *validateOpListExportErrors) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListExportErrorsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListExportErrorsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListImportErrors struct { } func (*validateOpListImportErrors) ID() string { return "OperationInputValidation" } func (m *validateOpListImportErrors) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListImportErrorsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListImportErrorsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListSourceServerActions struct { } func (*validateOpListSourceServerActions) ID() string { return "OperationInputValidation" } func (m *validateOpListSourceServerActions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListSourceServerActionsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListSourceServerActionsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListTagsForResource struct { } func (*validateOpListTagsForResource) ID() string { return "OperationInputValidation" } func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListTagsForResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListTagsForResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListTemplateActions struct { } func (*validateOpListTemplateActions) ID() string { return "OperationInputValidation" } func (m *validateOpListTemplateActions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListTemplateActionsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListTemplateActionsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpMarkAsArchived struct { } func (*validateOpMarkAsArchived) ID() string { return "OperationInputValidation" } func (m *validateOpMarkAsArchived) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*MarkAsArchivedInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpMarkAsArchivedInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpPutSourceServerAction struct { } func (*validateOpPutSourceServerAction) ID() string { return "OperationInputValidation" } func (m *validateOpPutSourceServerAction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PutSourceServerActionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPutSourceServerActionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpPutTemplateAction struct { } func (*validateOpPutTemplateAction) ID() string { return "OperationInputValidation" } func (m *validateOpPutTemplateAction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PutTemplateActionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPutTemplateActionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRemoveSourceServerAction struct { } func (*validateOpRemoveSourceServerAction) ID() string { return "OperationInputValidation" } func (m *validateOpRemoveSourceServerAction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RemoveSourceServerActionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRemoveSourceServerActionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRemoveTemplateAction struct { } func (*validateOpRemoveTemplateAction) ID() string { return "OperationInputValidation" } func (m *validateOpRemoveTemplateAction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RemoveTemplateActionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRemoveTemplateActionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRetryDataReplication struct { } func (*validateOpRetryDataReplication) ID() string { return "OperationInputValidation" } func (m *validateOpRetryDataReplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RetryDataReplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRetryDataReplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartCutover struct { } func (*validateOpStartCutover) ID() string { return "OperationInputValidation" } func (m *validateOpStartCutover) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartCutoverInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartCutoverInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartExport struct { } func (*validateOpStartExport) ID() string { return "OperationInputValidation" } func (m *validateOpStartExport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartExportInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartExportInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartImport struct { } func (*validateOpStartImport) ID() string { return "OperationInputValidation" } func (m *validateOpStartImport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartImportInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartImportInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartReplication struct { } func (*validateOpStartReplication) ID() string { return "OperationInputValidation" } func (m *validateOpStartReplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartReplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartReplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartTest struct { } func (*validateOpStartTest) ID() string { return "OperationInputValidation" } func (m *validateOpStartTest) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartTestInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartTestInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpTagResource struct { } func (*validateOpTagResource) ID() string { return "OperationInputValidation" } func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpTerminateTargetInstances struct { } func (*validateOpTerminateTargetInstances) ID() string { return "OperationInputValidation" } func (m *validateOpTerminateTargetInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TerminateTargetInstancesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTerminateTargetInstancesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUnarchiveApplication struct { } func (*validateOpUnarchiveApplication) ID() string { return "OperationInputValidation" } func (m *validateOpUnarchiveApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UnarchiveApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUnarchiveApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUnarchiveWave struct { } func (*validateOpUnarchiveWave) ID() string { return "OperationInputValidation" } func (m *validateOpUnarchiveWave) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UnarchiveWaveInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUnarchiveWaveInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUntagResource struct { } func (*validateOpUntagResource) ID() string { return "OperationInputValidation" } func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UntagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUntagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateApplication struct { } func (*validateOpUpdateApplication) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateLaunchConfiguration struct { } func (*validateOpUpdateLaunchConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateLaunchConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateLaunchConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateLaunchConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateLaunchConfigurationTemplate struct { } func (*validateOpUpdateLaunchConfigurationTemplate) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateLaunchConfigurationTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateLaunchConfigurationTemplateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateLaunchConfigurationTemplateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateReplicationConfiguration struct { } func (*validateOpUpdateReplicationConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateReplicationConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateReplicationConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateReplicationConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateReplicationConfigurationTemplate struct { } func (*validateOpUpdateReplicationConfigurationTemplate) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateReplicationConfigurationTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateReplicationConfigurationTemplateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateReplicationConfigurationTemplateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateSourceServerReplicationType struct { } func (*validateOpUpdateSourceServerReplicationType) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateSourceServerReplicationType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateSourceServerReplicationTypeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateSourceServerReplicationTypeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateWave struct { } func (*validateOpUpdateWave) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateWave) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateWaveInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateWaveInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpArchiveApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpArchiveApplication{}, middleware.After) } func addOpArchiveWaveValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpArchiveWave{}, middleware.After) } func addOpAssociateApplicationsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociateApplications{}, middleware.After) } func addOpAssociateSourceServersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociateSourceServers{}, middleware.After) } func addOpChangeServerLifeCycleStateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpChangeServerLifeCycleState{}, middleware.After) } func addOpCreateApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateApplication{}, middleware.After) } func addOpCreateLaunchConfigurationTemplateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateLaunchConfigurationTemplate{}, middleware.After) } func addOpCreateReplicationConfigurationTemplateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateReplicationConfigurationTemplate{}, middleware.After) } func addOpCreateWaveValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateWave{}, middleware.After) } func addOpDeleteApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteApplication{}, middleware.After) } func addOpDeleteJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteJob{}, middleware.After) } func addOpDeleteLaunchConfigurationTemplateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteLaunchConfigurationTemplate{}, middleware.After) } func addOpDeleteReplicationConfigurationTemplateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteReplicationConfigurationTemplate{}, middleware.After) } func addOpDeleteSourceServerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteSourceServer{}, middleware.After) } func addOpDeleteVcenterClientValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteVcenterClient{}, middleware.After) } func addOpDeleteWaveValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteWave{}, middleware.After) } func addOpDescribeJobLogItemsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeJobLogItems{}, middleware.After) } func addOpDisassociateApplicationsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisassociateApplications{}, middleware.After) } func addOpDisassociateSourceServersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisassociateSourceServers{}, middleware.After) } func addOpDisconnectFromServiceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisconnectFromService{}, middleware.After) } func addOpFinalizeCutoverValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpFinalizeCutover{}, middleware.After) } func addOpGetLaunchConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetLaunchConfiguration{}, middleware.After) } func addOpGetReplicationConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetReplicationConfiguration{}, middleware.After) } func addOpListExportErrorsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListExportErrors{}, middleware.After) } func addOpListImportErrorsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListImportErrors{}, middleware.After) } func addOpListSourceServerActionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListSourceServerActions{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } func addOpListTemplateActionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTemplateActions{}, middleware.After) } func addOpMarkAsArchivedValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpMarkAsArchived{}, middleware.After) } func addOpPutSourceServerActionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutSourceServerAction{}, middleware.After) } func addOpPutTemplateActionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutTemplateAction{}, middleware.After) } func addOpRemoveSourceServerActionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRemoveSourceServerAction{}, middleware.After) } func addOpRemoveTemplateActionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRemoveTemplateAction{}, middleware.After) } func addOpRetryDataReplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRetryDataReplication{}, middleware.After) } func addOpStartCutoverValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartCutover{}, middleware.After) } func addOpStartExportValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartExport{}, middleware.After) } func addOpStartImportValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartImport{}, middleware.After) } func addOpStartReplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartReplication{}, middleware.After) } func addOpStartTestValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartTest{}, middleware.After) } func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } func addOpTerminateTargetInstancesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTerminateTargetInstances{}, middleware.After) } func addOpUnarchiveApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUnarchiveApplication{}, middleware.After) } func addOpUnarchiveWaveValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUnarchiveWave{}, middleware.After) } func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } func addOpUpdateApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateApplication{}, middleware.After) } func addOpUpdateLaunchConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateLaunchConfiguration{}, middleware.After) } func addOpUpdateLaunchConfigurationTemplateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateLaunchConfigurationTemplate{}, middleware.After) } func addOpUpdateReplicationConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateReplicationConfiguration{}, middleware.After) } func addOpUpdateReplicationConfigurationTemplateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateReplicationConfigurationTemplate{}, middleware.After) } func addOpUpdateSourceServerReplicationTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateSourceServerReplicationType{}, middleware.After) } func addOpUpdateWaveValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateWave{}, middleware.After) } func validateChangeServerLifeCycleStateSourceServerLifecycle(v *types.ChangeServerLifeCycleStateSourceServerLifecycle) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ChangeServerLifeCycleStateSourceServerLifecycle"} if len(v.State) == 0 { invalidParams.Add(smithy.NewErrParamRequired("State")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validatePostLaunchActions(v *types.PostLaunchActions) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PostLaunchActions"} if v.SsmDocuments != nil { if err := validateSsmDocuments(v.SsmDocuments); err != nil { invalidParams.AddNested("SsmDocuments", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateS3BucketSource(v *types.S3BucketSource) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3BucketSource"} if v.S3Bucket == nil { invalidParams.Add(smithy.NewErrParamRequired("S3Bucket")) } if v.S3Key == nil { invalidParams.Add(smithy.NewErrParamRequired("S3Key")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateSsmDocument(v *types.SsmDocument) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SsmDocument"} if v.ActionName == nil { invalidParams.Add(smithy.NewErrParamRequired("ActionName")) } if v.SsmDocumentName == nil { invalidParams.Add(smithy.NewErrParamRequired("SsmDocumentName")) } if v.Parameters != nil { if err := validateSsmDocumentParameters(v.Parameters); err != nil { invalidParams.AddNested("Parameters", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateSsmDocumentParameters(v map[string][]types.SsmParameterStoreParameter) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SsmDocumentParameters"} for key := range v { if err := validateSsmParameterStoreParameters(v[key]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateSsmDocuments(v []types.SsmDocument) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SsmDocuments"} for i := range v { if err := validateSsmDocument(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateSsmParameterStoreParameter(v *types.SsmParameterStoreParameter) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SsmParameterStoreParameter"} if len(v.ParameterType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("ParameterType")) } if v.ParameterName == nil { invalidParams.Add(smithy.NewErrParamRequired("ParameterName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateSsmParameterStoreParameters(v []types.SsmParameterStoreParameter) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SsmParameterStoreParameters"} for i := range v { if err := validateSsmParameterStoreParameter(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpArchiveApplicationInput(v *ArchiveApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ArchiveApplicationInput"} if v.ApplicationID == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpArchiveWaveInput(v *ArchiveWaveInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ArchiveWaveInput"} if v.WaveID == nil { invalidParams.Add(smithy.NewErrParamRequired("WaveID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAssociateApplicationsInput(v *AssociateApplicationsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AssociateApplicationsInput"} if v.WaveID == nil { invalidParams.Add(smithy.NewErrParamRequired("WaveID")) } if v.ApplicationIDs == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationIDs")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAssociateSourceServersInput(v *AssociateSourceServersInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AssociateSourceServersInput"} if v.ApplicationID == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationID")) } if v.SourceServerIDs == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceServerIDs")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpChangeServerLifeCycleStateInput(v *ChangeServerLifeCycleStateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ChangeServerLifeCycleStateInput"} if v.SourceServerID == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceServerID")) } if v.LifeCycle == nil { invalidParams.Add(smithy.NewErrParamRequired("LifeCycle")) } else if v.LifeCycle != nil { if err := validateChangeServerLifeCycleStateSourceServerLifecycle(v.LifeCycle); err != nil { invalidParams.AddNested("LifeCycle", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateApplicationInput(v *CreateApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateApplicationInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateLaunchConfigurationTemplateInput(v *CreateLaunchConfigurationTemplateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateLaunchConfigurationTemplateInput"} if v.PostLaunchActions != nil { if err := validatePostLaunchActions(v.PostLaunchActions); err != nil { invalidParams.AddNested("PostLaunchActions", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateReplicationConfigurationTemplateInput(v *CreateReplicationConfigurationTemplateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateReplicationConfigurationTemplateInput"} if v.StagingAreaSubnetId == nil { invalidParams.Add(smithy.NewErrParamRequired("StagingAreaSubnetId")) } if v.AssociateDefaultSecurityGroup == nil { invalidParams.Add(smithy.NewErrParamRequired("AssociateDefaultSecurityGroup")) } if v.ReplicationServersSecurityGroupsIDs == nil { invalidParams.Add(smithy.NewErrParamRequired("ReplicationServersSecurityGroupsIDs")) } if v.ReplicationServerInstanceType == nil { invalidParams.Add(smithy.NewErrParamRequired("ReplicationServerInstanceType")) } if v.UseDedicatedReplicationServer == nil { invalidParams.Add(smithy.NewErrParamRequired("UseDedicatedReplicationServer")) } if len(v.DefaultLargeStagingDiskType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("DefaultLargeStagingDiskType")) } if len(v.EbsEncryption) == 0 { invalidParams.Add(smithy.NewErrParamRequired("EbsEncryption")) } if len(v.DataPlaneRouting) == 0 { invalidParams.Add(smithy.NewErrParamRequired("DataPlaneRouting")) } if v.CreatePublicIP == nil { invalidParams.Add(smithy.NewErrParamRequired("CreatePublicIP")) } if v.StagingAreaTags == nil { invalidParams.Add(smithy.NewErrParamRequired("StagingAreaTags")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateWaveInput(v *CreateWaveInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateWaveInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteApplicationInput(v *DeleteApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteApplicationInput"} if v.ApplicationID == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteJobInput(v *DeleteJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteJobInput"} if v.JobID == nil { invalidParams.Add(smithy.NewErrParamRequired("JobID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteLaunchConfigurationTemplateInput(v *DeleteLaunchConfigurationTemplateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteLaunchConfigurationTemplateInput"} if v.LaunchConfigurationTemplateID == nil { invalidParams.Add(smithy.NewErrParamRequired("LaunchConfigurationTemplateID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteReplicationConfigurationTemplateInput(v *DeleteReplicationConfigurationTemplateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteReplicationConfigurationTemplateInput"} if v.ReplicationConfigurationTemplateID == nil { invalidParams.Add(smithy.NewErrParamRequired("ReplicationConfigurationTemplateID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteSourceServerInput(v *DeleteSourceServerInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteSourceServerInput"} if v.SourceServerID == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceServerID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteVcenterClientInput(v *DeleteVcenterClientInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteVcenterClientInput"} if v.VcenterClientID == nil { invalidParams.Add(smithy.NewErrParamRequired("VcenterClientID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteWaveInput(v *DeleteWaveInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteWaveInput"} if v.WaveID == nil { invalidParams.Add(smithy.NewErrParamRequired("WaveID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeJobLogItemsInput(v *DescribeJobLogItemsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeJobLogItemsInput"} if v.JobID == nil { invalidParams.Add(smithy.NewErrParamRequired("JobID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDisassociateApplicationsInput(v *DisassociateApplicationsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DisassociateApplicationsInput"} if v.WaveID == nil { invalidParams.Add(smithy.NewErrParamRequired("WaveID")) } if v.ApplicationIDs == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationIDs")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDisassociateSourceServersInput(v *DisassociateSourceServersInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DisassociateSourceServersInput"} if v.ApplicationID == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationID")) } if v.SourceServerIDs == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceServerIDs")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDisconnectFromServiceInput(v *DisconnectFromServiceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DisconnectFromServiceInput"} if v.SourceServerID == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceServerID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpFinalizeCutoverInput(v *FinalizeCutoverInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "FinalizeCutoverInput"} if v.SourceServerID == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceServerID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetLaunchConfigurationInput(v *GetLaunchConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetLaunchConfigurationInput"} if v.SourceServerID == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceServerID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetReplicationConfigurationInput(v *GetReplicationConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetReplicationConfigurationInput"} if v.SourceServerID == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceServerID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListExportErrorsInput(v *ListExportErrorsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListExportErrorsInput"} if v.ExportID == nil { invalidParams.Add(smithy.NewErrParamRequired("ExportID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListImportErrorsInput(v *ListImportErrorsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListImportErrorsInput"} if v.ImportID == nil { invalidParams.Add(smithy.NewErrParamRequired("ImportID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListSourceServerActionsInput(v *ListSourceServerActionsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListSourceServerActionsInput"} if v.SourceServerID == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceServerID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListTemplateActionsInput(v *ListTemplateActionsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListTemplateActionsInput"} if v.LaunchConfigurationTemplateID == nil { invalidParams.Add(smithy.NewErrParamRequired("LaunchConfigurationTemplateID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpMarkAsArchivedInput(v *MarkAsArchivedInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "MarkAsArchivedInput"} if v.SourceServerID == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceServerID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpPutSourceServerActionInput(v *PutSourceServerActionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PutSourceServerActionInput"} if v.SourceServerID == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceServerID")) } if v.ActionName == nil { invalidParams.Add(smithy.NewErrParamRequired("ActionName")) } if v.DocumentIdentifier == nil { invalidParams.Add(smithy.NewErrParamRequired("DocumentIdentifier")) } if v.ActionID == nil { invalidParams.Add(smithy.NewErrParamRequired("ActionID")) } if v.Parameters != nil { if err := validateSsmDocumentParameters(v.Parameters); err != nil { invalidParams.AddNested("Parameters", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpPutTemplateActionInput(v *PutTemplateActionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PutTemplateActionInput"} if v.LaunchConfigurationTemplateID == nil { invalidParams.Add(smithy.NewErrParamRequired("LaunchConfigurationTemplateID")) } if v.ActionName == nil { invalidParams.Add(smithy.NewErrParamRequired("ActionName")) } if v.DocumentIdentifier == nil { invalidParams.Add(smithy.NewErrParamRequired("DocumentIdentifier")) } if v.ActionID == nil { invalidParams.Add(smithy.NewErrParamRequired("ActionID")) } if v.Parameters != nil { if err := validateSsmDocumentParameters(v.Parameters); err != nil { invalidParams.AddNested("Parameters", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRemoveSourceServerActionInput(v *RemoveSourceServerActionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RemoveSourceServerActionInput"} if v.SourceServerID == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceServerID")) } if v.ActionID == nil { invalidParams.Add(smithy.NewErrParamRequired("ActionID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRemoveTemplateActionInput(v *RemoveTemplateActionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RemoveTemplateActionInput"} if v.LaunchConfigurationTemplateID == nil { invalidParams.Add(smithy.NewErrParamRequired("LaunchConfigurationTemplateID")) } if v.ActionID == nil { invalidParams.Add(smithy.NewErrParamRequired("ActionID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRetryDataReplicationInput(v *RetryDataReplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RetryDataReplicationInput"} if v.SourceServerID == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceServerID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartCutoverInput(v *StartCutoverInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartCutoverInput"} if v.SourceServerIDs == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceServerIDs")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartExportInput(v *StartExportInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartExportInput"} if v.S3Bucket == nil { invalidParams.Add(smithy.NewErrParamRequired("S3Bucket")) } if v.S3Key == nil { invalidParams.Add(smithy.NewErrParamRequired("S3Key")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartImportInput(v *StartImportInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartImportInput"} if v.S3BucketSource == nil { invalidParams.Add(smithy.NewErrParamRequired("S3BucketSource")) } else if v.S3BucketSource != nil { if err := validateS3BucketSource(v.S3BucketSource); err != nil { invalidParams.AddNested("S3BucketSource", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartReplicationInput(v *StartReplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartReplicationInput"} if v.SourceServerID == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceServerID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartTestInput(v *StartTestInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartTestInput"} if v.SourceServerIDs == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceServerIDs")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.Tags == nil { invalidParams.Add(smithy.NewErrParamRequired("Tags")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTerminateTargetInstancesInput(v *TerminateTargetInstancesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TerminateTargetInstancesInput"} if v.SourceServerIDs == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceServerIDs")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUnarchiveApplicationInput(v *UnarchiveApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UnarchiveApplicationInput"} if v.ApplicationID == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUnarchiveWaveInput(v *UnarchiveWaveInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UnarchiveWaveInput"} if v.WaveID == nil { invalidParams.Add(smithy.NewErrParamRequired("WaveID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUntagResourceInput(v *UntagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.TagKeys == nil { invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateApplicationInput(v *UpdateApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateApplicationInput"} if v.ApplicationID == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateLaunchConfigurationInput(v *UpdateLaunchConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateLaunchConfigurationInput"} if v.SourceServerID == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceServerID")) } if v.PostLaunchActions != nil { if err := validatePostLaunchActions(v.PostLaunchActions); err != nil { invalidParams.AddNested("PostLaunchActions", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateLaunchConfigurationTemplateInput(v *UpdateLaunchConfigurationTemplateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateLaunchConfigurationTemplateInput"} if v.LaunchConfigurationTemplateID == nil { invalidParams.Add(smithy.NewErrParamRequired("LaunchConfigurationTemplateID")) } if v.PostLaunchActions != nil { if err := validatePostLaunchActions(v.PostLaunchActions); err != nil { invalidParams.AddNested("PostLaunchActions", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateReplicationConfigurationInput(v *UpdateReplicationConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateReplicationConfigurationInput"} if v.SourceServerID == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceServerID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateReplicationConfigurationTemplateInput(v *UpdateReplicationConfigurationTemplateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateReplicationConfigurationTemplateInput"} if v.ReplicationConfigurationTemplateID == nil { invalidParams.Add(smithy.NewErrParamRequired("ReplicationConfigurationTemplateID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateSourceServerReplicationTypeInput(v *UpdateSourceServerReplicationTypeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateSourceServerReplicationTypeInput"} if v.SourceServerID == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceServerID")) } if len(v.ReplicationType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("ReplicationType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateWaveInput(v *UpdateWaveInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateWaveInput"} if v.WaveID == nil { invalidParams.Add(smithy.NewErrParamRequired("WaveID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
2,251
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package endpoints import ( "github.com/aws/aws-sdk-go-v2/aws" endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" "github.com/aws/smithy-go/logging" "regexp" ) // Options is the endpoint resolver configuration options type Options struct { // Logger is a logging implementation that log events should be sent to. Logger logging.Logger // LogDeprecated indicates that deprecated endpoints should be logged to the // provided logger. LogDeprecated bool // ResolvedRegion is used to override the region to be resolved, rather then the // using the value passed to the ResolveEndpoint method. This value is used by the // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative // name. You must not set this value directly in your application. ResolvedRegion string // DisableHTTPS informs the resolver to return an endpoint that does not use the // HTTPS scheme. DisableHTTPS bool // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. UseDualStackEndpoint aws.DualStackEndpointState // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. UseFIPSEndpoint aws.FIPSEndpointState } func (o Options) GetResolvedRegion() string { return o.ResolvedRegion } func (o Options) GetDisableHTTPS() bool { return o.DisableHTTPS } func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { return o.UseDualStackEndpoint } func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { return o.UseFIPSEndpoint } func transformToSharedOptions(options Options) endpoints.Options { return endpoints.Options{ Logger: options.Logger, LogDeprecated: options.LogDeprecated, ResolvedRegion: options.ResolvedRegion, DisableHTTPS: options.DisableHTTPS, UseDualStackEndpoint: options.UseDualStackEndpoint, UseFIPSEndpoint: options.UseFIPSEndpoint, } } // Resolver mgn endpoint resolver type Resolver struct { partitions endpoints.Partitions } // ResolveEndpoint resolves the service endpoint for the given region and options func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { if len(region) == 0 { return endpoint, &aws.MissingRegionError{} } opt := transformToSharedOptions(options) return r.partitions.ResolveEndpoint(region, opt) } // New returns a new Resolver func New() *Resolver { return &Resolver{ partitions: defaultPartitions, } } var partitionRegexp = struct { Aws *regexp.Regexp AwsCn *regexp.Regexp AwsIso *regexp.Regexp AwsIsoB *regexp.Regexp AwsIsoE *regexp.Regexp AwsIsoF *regexp.Regexp AwsUsGov *regexp.Regexp }{ Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), } var defaultPartitions = endpoints.Partitions{ { ID: "aws", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "mgn.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "mgn-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "mgn-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mgn.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "af-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-4", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-south-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "fips-us-east-1", }: endpoints.Endpoint{ Hostname: "mgn-fips.us-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-east-2", }: endpoints.Endpoint{ Hostname: "mgn-fips.us-east-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-2", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-west-1", }: endpoints.Endpoint{ Hostname: "mgn-fips.us-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-west-2", }: endpoints.Endpoint{ Hostname: "mgn-fips.us-west-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-2", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "me-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "sa-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", Variant: endpoints.FIPSVariant, }: { Hostname: "mgn-fips.us-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", Variant: endpoints.FIPSVariant, }: { Hostname: "mgn-fips.us-east-2.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "mgn-fips.us-west-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", Variant: endpoints.FIPSVariant, }: { Hostname: "mgn-fips.us-west-2.amazonaws.com", }, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "mgn.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "mgn-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "mgn-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mgn.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, }, { ID: "aws-iso", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "mgn-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mgn.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, }, { ID: "aws-iso-b", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "mgn-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mgn.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, }, { ID: "aws-iso-e", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "mgn-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mgn.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoE, IsRegionalized: true, }, { ID: "aws-iso-f", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "mgn-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mgn.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoF, IsRegionalized: true, }, { ID: "aws-us-gov", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "mgn.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "mgn-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "mgn-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mgn.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "fips-us-gov-east-1", }: endpoints.Endpoint{ Hostname: "mgn-fips.us-gov-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-east-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-gov-west-1", }: endpoints.Endpoint{ Hostname: "mgn-fips.us-gov-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-west-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "us-gov-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-gov-east-1", Variant: endpoints.FIPSVariant, }: { Hostname: "mgn-fips.us-gov-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-gov-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "mgn-fips.us-gov-west-1.amazonaws.com", }, }, }, }
478
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package endpoints import ( "testing" ) func TestRegexCompile(t *testing.T) { _ = defaultPartitions }
12
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types type ActionCategory string // Enum values for ActionCategory const ( ActionCategoryDisasterRecovery ActionCategory = "DISASTER_RECOVERY" ActionCategoryOperatingSystem ActionCategory = "OPERATING_SYSTEM" ActionCategoryLicenseAndSubscription ActionCategory = "LICENSE_AND_SUBSCRIPTION" ActionCategoryValidation ActionCategory = "VALIDATION" ActionCategoryObservability ActionCategory = "OBSERVABILITY" ActionCategorySecurity ActionCategory = "SECURITY" ActionCategoryNetworking ActionCategory = "NETWORKING" ActionCategoryConfiguration ActionCategory = "CONFIGURATION" ActionCategoryBackup ActionCategory = "BACKUP" ActionCategoryOther ActionCategory = "OTHER" ) // Values returns all known values for ActionCategory. 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 (ActionCategory) Values() []ActionCategory { return []ActionCategory{ "DISASTER_RECOVERY", "OPERATING_SYSTEM", "LICENSE_AND_SUBSCRIPTION", "VALIDATION", "OBSERVABILITY", "SECURITY", "NETWORKING", "CONFIGURATION", "BACKUP", "OTHER", } } type ApplicationHealthStatus string // Enum values for ApplicationHealthStatus const ( ApplicationHealthStatusHealthy ApplicationHealthStatus = "HEALTHY" ApplicationHealthStatusLagging ApplicationHealthStatus = "LAGGING" ApplicationHealthStatusError ApplicationHealthStatus = "ERROR" ) // Values returns all known values for ApplicationHealthStatus. 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 (ApplicationHealthStatus) Values() []ApplicationHealthStatus { return []ApplicationHealthStatus{ "HEALTHY", "LAGGING", "ERROR", } } type ApplicationProgressStatus string // Enum values for ApplicationProgressStatus const ( ApplicationProgressStatusNotStarted ApplicationProgressStatus = "NOT_STARTED" ApplicationProgressStatusInProgress ApplicationProgressStatus = "IN_PROGRESS" ApplicationProgressStatusCompleted ApplicationProgressStatus = "COMPLETED" ) // Values returns all known values for ApplicationProgressStatus. 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 (ApplicationProgressStatus) Values() []ApplicationProgressStatus { return []ApplicationProgressStatus{ "NOT_STARTED", "IN_PROGRESS", "COMPLETED", } } type BootMode string // Enum values for BootMode const ( BootModeLegacyBios BootMode = "LEGACY_BIOS" BootModeUefi BootMode = "UEFI" ) // Values returns all known values for BootMode. 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 (BootMode) Values() []BootMode { return []BootMode{ "LEGACY_BIOS", "UEFI", } } type ChangeServerLifeCycleStateSourceServerLifecycleState string // Enum values for ChangeServerLifeCycleStateSourceServerLifecycleState const ( ChangeServerLifeCycleStateSourceServerLifecycleStateReadyForTest ChangeServerLifeCycleStateSourceServerLifecycleState = "READY_FOR_TEST" ChangeServerLifeCycleStateSourceServerLifecycleStateReadyForCutover ChangeServerLifeCycleStateSourceServerLifecycleState = "READY_FOR_CUTOVER" ChangeServerLifeCycleStateSourceServerLifecycleStateCutover ChangeServerLifeCycleStateSourceServerLifecycleState = "CUTOVER" ) // Values returns all known values for // ChangeServerLifeCycleStateSourceServerLifecycleState. 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 (ChangeServerLifeCycleStateSourceServerLifecycleState) Values() []ChangeServerLifeCycleStateSourceServerLifecycleState { return []ChangeServerLifeCycleStateSourceServerLifecycleState{ "READY_FOR_TEST", "READY_FOR_CUTOVER", "CUTOVER", } } type DataReplicationErrorString string // Enum values for DataReplicationErrorString const ( DataReplicationErrorStringAgentNotSeen DataReplicationErrorString = "AGENT_NOT_SEEN" DataReplicationErrorStringSnapshotsFailure DataReplicationErrorString = "SNAPSHOTS_FAILURE" DataReplicationErrorStringNotConverging DataReplicationErrorString = "NOT_CONVERGING" DataReplicationErrorStringUnstableNetwork DataReplicationErrorString = "UNSTABLE_NETWORK" DataReplicationErrorStringFailedToCreateSecurityGroup DataReplicationErrorString = "FAILED_TO_CREATE_SECURITY_GROUP" DataReplicationErrorStringFailedToLaunchReplicationServer DataReplicationErrorString = "FAILED_TO_LAUNCH_REPLICATION_SERVER" DataReplicationErrorStringFailedToBootReplicationServer DataReplicationErrorString = "FAILED_TO_BOOT_REPLICATION_SERVER" DataReplicationErrorStringFailedToAuthenticateWithService DataReplicationErrorString = "FAILED_TO_AUTHENTICATE_WITH_SERVICE" DataReplicationErrorStringFailedToDownloadReplicationSoftware DataReplicationErrorString = "FAILED_TO_DOWNLOAD_REPLICATION_SOFTWARE" DataReplicationErrorStringFailedToCreateStagingDisks DataReplicationErrorString = "FAILED_TO_CREATE_STAGING_DISKS" DataReplicationErrorStringFailedToAttachStagingDisks DataReplicationErrorString = "FAILED_TO_ATTACH_STAGING_DISKS" DataReplicationErrorStringFailedToPairReplicationServerWithAgent DataReplicationErrorString = "FAILED_TO_PAIR_REPLICATION_SERVER_WITH_AGENT" DataReplicationErrorStringFailedToConnectAgentToReplicationServer DataReplicationErrorString = "FAILED_TO_CONNECT_AGENT_TO_REPLICATION_SERVER" DataReplicationErrorStringFailedToStartDataTransfer DataReplicationErrorString = "FAILED_TO_START_DATA_TRANSFER" DataReplicationErrorStringUnsupportedVmConfiguration DataReplicationErrorString = "UNSUPPORTED_VM_CONFIGURATION" DataReplicationErrorStringLastSnapshotJobFailed DataReplicationErrorString = "LAST_SNAPSHOT_JOB_FAILED" ) // Values returns all known values for DataReplicationErrorString. 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 (DataReplicationErrorString) Values() []DataReplicationErrorString { return []DataReplicationErrorString{ "AGENT_NOT_SEEN", "SNAPSHOTS_FAILURE", "NOT_CONVERGING", "UNSTABLE_NETWORK", "FAILED_TO_CREATE_SECURITY_GROUP", "FAILED_TO_LAUNCH_REPLICATION_SERVER", "FAILED_TO_BOOT_REPLICATION_SERVER", "FAILED_TO_AUTHENTICATE_WITH_SERVICE", "FAILED_TO_DOWNLOAD_REPLICATION_SOFTWARE", "FAILED_TO_CREATE_STAGING_DISKS", "FAILED_TO_ATTACH_STAGING_DISKS", "FAILED_TO_PAIR_REPLICATION_SERVER_WITH_AGENT", "FAILED_TO_CONNECT_AGENT_TO_REPLICATION_SERVER", "FAILED_TO_START_DATA_TRANSFER", "UNSUPPORTED_VM_CONFIGURATION", "LAST_SNAPSHOT_JOB_FAILED", } } type DataReplicationInitiationStepName string // Enum values for DataReplicationInitiationStepName const ( DataReplicationInitiationStepNameWait DataReplicationInitiationStepName = "WAIT" DataReplicationInitiationStepNameCreateSecurityGroup DataReplicationInitiationStepName = "CREATE_SECURITY_GROUP" DataReplicationInitiationStepNameLaunchReplicationServer DataReplicationInitiationStepName = "LAUNCH_REPLICATION_SERVER" DataReplicationInitiationStepNameBootReplicationServer DataReplicationInitiationStepName = "BOOT_REPLICATION_SERVER" DataReplicationInitiationStepNameAuthenticateWithService DataReplicationInitiationStepName = "AUTHENTICATE_WITH_SERVICE" DataReplicationInitiationStepNameDownloadReplicationSoftware DataReplicationInitiationStepName = "DOWNLOAD_REPLICATION_SOFTWARE" DataReplicationInitiationStepNameCreateStagingDisks DataReplicationInitiationStepName = "CREATE_STAGING_DISKS" DataReplicationInitiationStepNameAttachStagingDisks DataReplicationInitiationStepName = "ATTACH_STAGING_DISKS" DataReplicationInitiationStepNamePairReplicationServerWithAgent DataReplicationInitiationStepName = "PAIR_REPLICATION_SERVER_WITH_AGENT" DataReplicationInitiationStepNameConnectAgentToReplicationServer DataReplicationInitiationStepName = "CONNECT_AGENT_TO_REPLICATION_SERVER" DataReplicationInitiationStepNameStartDataTransfer DataReplicationInitiationStepName = "START_DATA_TRANSFER" ) // Values returns all known values for DataReplicationInitiationStepName. 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 (DataReplicationInitiationStepName) Values() []DataReplicationInitiationStepName { return []DataReplicationInitiationStepName{ "WAIT", "CREATE_SECURITY_GROUP", "LAUNCH_REPLICATION_SERVER", "BOOT_REPLICATION_SERVER", "AUTHENTICATE_WITH_SERVICE", "DOWNLOAD_REPLICATION_SOFTWARE", "CREATE_STAGING_DISKS", "ATTACH_STAGING_DISKS", "PAIR_REPLICATION_SERVER_WITH_AGENT", "CONNECT_AGENT_TO_REPLICATION_SERVER", "START_DATA_TRANSFER", } } type DataReplicationInitiationStepStatus string // Enum values for DataReplicationInitiationStepStatus const ( DataReplicationInitiationStepStatusNotStarted DataReplicationInitiationStepStatus = "NOT_STARTED" DataReplicationInitiationStepStatusInProgress DataReplicationInitiationStepStatus = "IN_PROGRESS" DataReplicationInitiationStepStatusSucceeded DataReplicationInitiationStepStatus = "SUCCEEDED" DataReplicationInitiationStepStatusFailed DataReplicationInitiationStepStatus = "FAILED" DataReplicationInitiationStepStatusSkipped DataReplicationInitiationStepStatus = "SKIPPED" ) // Values returns all known values for DataReplicationInitiationStepStatus. 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 (DataReplicationInitiationStepStatus) Values() []DataReplicationInitiationStepStatus { return []DataReplicationInitiationStepStatus{ "NOT_STARTED", "IN_PROGRESS", "SUCCEEDED", "FAILED", "SKIPPED", } } type DataReplicationState string // Enum values for DataReplicationState const ( DataReplicationStateStopped DataReplicationState = "STOPPED" DataReplicationStateInitiating DataReplicationState = "INITIATING" DataReplicationStateInitialSync DataReplicationState = "INITIAL_SYNC" DataReplicationStateBacklog DataReplicationState = "BACKLOG" DataReplicationStateCreatingSnapshot DataReplicationState = "CREATING_SNAPSHOT" DataReplicationStateContinuous DataReplicationState = "CONTINUOUS" DataReplicationStatePaused DataReplicationState = "PAUSED" DataReplicationStateRescan DataReplicationState = "RESCAN" DataReplicationStateStalled DataReplicationState = "STALLED" DataReplicationStateDisconnected DataReplicationState = "DISCONNECTED" DataReplicationStatePendingSnapshotShipping DataReplicationState = "PENDING_SNAPSHOT_SHIPPING" DataReplicationStateShippingSnapshot DataReplicationState = "SHIPPING_SNAPSHOT" ) // Values returns all known values for DataReplicationState. 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 (DataReplicationState) Values() []DataReplicationState { return []DataReplicationState{ "STOPPED", "INITIATING", "INITIAL_SYNC", "BACKLOG", "CREATING_SNAPSHOT", "CONTINUOUS", "PAUSED", "RESCAN", "STALLED", "DISCONNECTED", "PENDING_SNAPSHOT_SHIPPING", "SHIPPING_SNAPSHOT", } } type ExportStatus string // Enum values for ExportStatus const ( ExportStatusPending ExportStatus = "PENDING" ExportStatusStarted ExportStatus = "STARTED" ExportStatusFailed ExportStatus = "FAILED" ExportStatusSucceeded ExportStatus = "SUCCEEDED" ) // Values returns all known values for ExportStatus. 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 (ExportStatus) Values() []ExportStatus { return []ExportStatus{ "PENDING", "STARTED", "FAILED", "SUCCEEDED", } } type FirstBoot string // Enum values for FirstBoot const ( FirstBootWaiting FirstBoot = "WAITING" FirstBootSucceeded FirstBoot = "SUCCEEDED" FirstBootUnknown FirstBoot = "UNKNOWN" FirstBootStopped FirstBoot = "STOPPED" ) // Values returns all known values for FirstBoot. 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 (FirstBoot) Values() []FirstBoot { return []FirstBoot{ "WAITING", "SUCCEEDED", "UNKNOWN", "STOPPED", } } type ImportErrorType string // Enum values for ImportErrorType const ( ImportErrorTypeValidationError ImportErrorType = "VALIDATION_ERROR" ImportErrorTypeProcessingError ImportErrorType = "PROCESSING_ERROR" ) // Values returns all known values for ImportErrorType. 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 (ImportErrorType) Values() []ImportErrorType { return []ImportErrorType{ "VALIDATION_ERROR", "PROCESSING_ERROR", } } type ImportStatus string // Enum values for ImportStatus const ( ImportStatusPending ImportStatus = "PENDING" ImportStatusStarted ImportStatus = "STARTED" ImportStatusFailed ImportStatus = "FAILED" ImportStatusSucceeded ImportStatus = "SUCCEEDED" ) // Values returns all known values for ImportStatus. 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 (ImportStatus) Values() []ImportStatus { return []ImportStatus{ "PENDING", "STARTED", "FAILED", "SUCCEEDED", } } type InitiatedBy string // Enum values for InitiatedBy const ( InitiatedByStartTest InitiatedBy = "START_TEST" InitiatedByStartCutover InitiatedBy = "START_CUTOVER" InitiatedByDiagnostic InitiatedBy = "DIAGNOSTIC" InitiatedByTerminate InitiatedBy = "TERMINATE" ) // Values returns all known values for InitiatedBy. 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 (InitiatedBy) Values() []InitiatedBy { return []InitiatedBy{ "START_TEST", "START_CUTOVER", "DIAGNOSTIC", "TERMINATE", } } type JobLogEvent string // Enum values for JobLogEvent const ( JobLogEventJobStart JobLogEvent = "JOB_START" JobLogEventServerSkipped JobLogEvent = "SERVER_SKIPPED" JobLogEventCleanupStart JobLogEvent = "CLEANUP_START" JobLogEventCleanupEnd JobLogEvent = "CLEANUP_END" JobLogEventCleanupFail JobLogEvent = "CLEANUP_FAIL" JobLogEventSnapshotStart JobLogEvent = "SNAPSHOT_START" JobLogEventSnapshotEnd JobLogEvent = "SNAPSHOT_END" JobLogEventSnapshotFail JobLogEvent = "SNAPSHOT_FAIL" JobLogEventUsingPreviousSnapshot JobLogEvent = "USING_PREVIOUS_SNAPSHOT" JobLogEventConversionStart JobLogEvent = "CONVERSION_START" JobLogEventConversionEnd JobLogEvent = "CONVERSION_END" JobLogEventConversionFail JobLogEvent = "CONVERSION_FAIL" JobLogEventLaunchStart JobLogEvent = "LAUNCH_START" JobLogEventLaunchFailed JobLogEvent = "LAUNCH_FAILED" JobLogEventJobCancel JobLogEvent = "JOB_CANCEL" JobLogEventJobEnd JobLogEvent = "JOB_END" ) // Values returns all known values for JobLogEvent. 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 (JobLogEvent) Values() []JobLogEvent { return []JobLogEvent{ "JOB_START", "SERVER_SKIPPED", "CLEANUP_START", "CLEANUP_END", "CLEANUP_FAIL", "SNAPSHOT_START", "SNAPSHOT_END", "SNAPSHOT_FAIL", "USING_PREVIOUS_SNAPSHOT", "CONVERSION_START", "CONVERSION_END", "CONVERSION_FAIL", "LAUNCH_START", "LAUNCH_FAILED", "JOB_CANCEL", "JOB_END", } } type JobStatus string // Enum values for JobStatus const ( JobStatusPending JobStatus = "PENDING" JobStatusStarted JobStatus = "STARTED" JobStatusCompleted JobStatus = "COMPLETED" ) // Values returns all known values for JobStatus. 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 (JobStatus) Values() []JobStatus { return []JobStatus{ "PENDING", "STARTED", "COMPLETED", } } type JobType string // Enum values for JobType const ( JobTypeLaunch JobType = "LAUNCH" JobTypeTerminate JobType = "TERMINATE" ) // Values returns all known values for JobType. 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 (JobType) Values() []JobType { return []JobType{ "LAUNCH", "TERMINATE", } } type LaunchDisposition string // Enum values for LaunchDisposition const ( LaunchDispositionStopped LaunchDisposition = "STOPPED" LaunchDispositionStarted LaunchDisposition = "STARTED" ) // Values returns all known values for LaunchDisposition. 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 (LaunchDisposition) Values() []LaunchDisposition { return []LaunchDisposition{ "STOPPED", "STARTED", } } type LaunchStatus string // Enum values for LaunchStatus const ( LaunchStatusPending LaunchStatus = "PENDING" LaunchStatusInProgress LaunchStatus = "IN_PROGRESS" LaunchStatusLaunched LaunchStatus = "LAUNCHED" LaunchStatusFailed LaunchStatus = "FAILED" LaunchStatusTerminated LaunchStatus = "TERMINATED" ) // Values returns all known values for LaunchStatus. 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 (LaunchStatus) Values() []LaunchStatus { return []LaunchStatus{ "PENDING", "IN_PROGRESS", "LAUNCHED", "FAILED", "TERMINATED", } } type LifeCycleState string // Enum values for LifeCycleState const ( LifeCycleStateStopped LifeCycleState = "STOPPED" LifeCycleStateNotReady LifeCycleState = "NOT_READY" LifeCycleStateReadyForTest LifeCycleState = "READY_FOR_TEST" LifeCycleStateTesting LifeCycleState = "TESTING" LifeCycleStateReadyForCutover LifeCycleState = "READY_FOR_CUTOVER" LifeCycleStateCuttingOver LifeCycleState = "CUTTING_OVER" LifeCycleStateCutover LifeCycleState = "CUTOVER" LifeCycleStateDisconnected LifeCycleState = "DISCONNECTED" LifeCycleStateDiscovered LifeCycleState = "DISCOVERED" LifeCycleStatePendingInstallation LifeCycleState = "PENDING_INSTALLATION" ) // Values returns all known values for LifeCycleState. 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 (LifeCycleState) Values() []LifeCycleState { return []LifeCycleState{ "STOPPED", "NOT_READY", "READY_FOR_TEST", "TESTING", "READY_FOR_CUTOVER", "CUTTING_OVER", "CUTOVER", "DISCONNECTED", "DISCOVERED", "PENDING_INSTALLATION", } } type PostLaunchActionExecutionStatus string // Enum values for PostLaunchActionExecutionStatus const ( PostLaunchActionExecutionStatusInProgress PostLaunchActionExecutionStatus = "IN_PROGRESS" PostLaunchActionExecutionStatusSuccess PostLaunchActionExecutionStatus = "SUCCESS" PostLaunchActionExecutionStatusFailed PostLaunchActionExecutionStatus = "FAILED" ) // Values returns all known values for PostLaunchActionExecutionStatus. 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 (PostLaunchActionExecutionStatus) Values() []PostLaunchActionExecutionStatus { return []PostLaunchActionExecutionStatus{ "IN_PROGRESS", "SUCCESS", "FAILED", } } type PostLaunchActionsDeploymentType string // Enum values for PostLaunchActionsDeploymentType const ( PostLaunchActionsDeploymentTypeTestAndCutover PostLaunchActionsDeploymentType = "TEST_AND_CUTOVER" PostLaunchActionsDeploymentTypeCutoverOnly PostLaunchActionsDeploymentType = "CUTOVER_ONLY" PostLaunchActionsDeploymentTypeTestOnly PostLaunchActionsDeploymentType = "TEST_ONLY" ) // Values returns all known values for PostLaunchActionsDeploymentType. 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 (PostLaunchActionsDeploymentType) Values() []PostLaunchActionsDeploymentType { return []PostLaunchActionsDeploymentType{ "TEST_AND_CUTOVER", "CUTOVER_ONLY", "TEST_ONLY", } } type ReplicationConfigurationDataPlaneRouting string // Enum values for ReplicationConfigurationDataPlaneRouting const ( ReplicationConfigurationDataPlaneRoutingPrivateIp ReplicationConfigurationDataPlaneRouting = "PRIVATE_IP" ReplicationConfigurationDataPlaneRoutingPublicIp ReplicationConfigurationDataPlaneRouting = "PUBLIC_IP" ) // Values returns all known values for ReplicationConfigurationDataPlaneRouting. // 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 (ReplicationConfigurationDataPlaneRouting) Values() []ReplicationConfigurationDataPlaneRouting { return []ReplicationConfigurationDataPlaneRouting{ "PRIVATE_IP", "PUBLIC_IP", } } type ReplicationConfigurationDefaultLargeStagingDiskType string // Enum values for ReplicationConfigurationDefaultLargeStagingDiskType const ( ReplicationConfigurationDefaultLargeStagingDiskTypeGp2 ReplicationConfigurationDefaultLargeStagingDiskType = "GP2" ReplicationConfigurationDefaultLargeStagingDiskTypeSt1 ReplicationConfigurationDefaultLargeStagingDiskType = "ST1" ReplicationConfigurationDefaultLargeStagingDiskTypeGp3 ReplicationConfigurationDefaultLargeStagingDiskType = "GP3" ) // Values returns all known values for // ReplicationConfigurationDefaultLargeStagingDiskType. 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 (ReplicationConfigurationDefaultLargeStagingDiskType) Values() []ReplicationConfigurationDefaultLargeStagingDiskType { return []ReplicationConfigurationDefaultLargeStagingDiskType{ "GP2", "ST1", "GP3", } } type ReplicationConfigurationEbsEncryption string // Enum values for ReplicationConfigurationEbsEncryption const ( ReplicationConfigurationEbsEncryptionDefault ReplicationConfigurationEbsEncryption = "DEFAULT" ReplicationConfigurationEbsEncryptionCustom ReplicationConfigurationEbsEncryption = "CUSTOM" ) // Values returns all known values for ReplicationConfigurationEbsEncryption. 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 (ReplicationConfigurationEbsEncryption) Values() []ReplicationConfigurationEbsEncryption { return []ReplicationConfigurationEbsEncryption{ "DEFAULT", "CUSTOM", } } type ReplicationConfigurationReplicatedDiskStagingDiskType string // Enum values for ReplicationConfigurationReplicatedDiskStagingDiskType const ( ReplicationConfigurationReplicatedDiskStagingDiskTypeAuto ReplicationConfigurationReplicatedDiskStagingDiskType = "AUTO" ReplicationConfigurationReplicatedDiskStagingDiskTypeGp2 ReplicationConfigurationReplicatedDiskStagingDiskType = "GP2" ReplicationConfigurationReplicatedDiskStagingDiskTypeIo1 ReplicationConfigurationReplicatedDiskStagingDiskType = "IO1" ReplicationConfigurationReplicatedDiskStagingDiskTypeSc1 ReplicationConfigurationReplicatedDiskStagingDiskType = "SC1" ReplicationConfigurationReplicatedDiskStagingDiskTypeSt1 ReplicationConfigurationReplicatedDiskStagingDiskType = "ST1" ReplicationConfigurationReplicatedDiskStagingDiskTypeStandard ReplicationConfigurationReplicatedDiskStagingDiskType = "STANDARD" ReplicationConfigurationReplicatedDiskStagingDiskTypeGp3 ReplicationConfigurationReplicatedDiskStagingDiskType = "GP3" ReplicationConfigurationReplicatedDiskStagingDiskTypeIo2 ReplicationConfigurationReplicatedDiskStagingDiskType = "IO2" ) // Values returns all known values for // ReplicationConfigurationReplicatedDiskStagingDiskType. 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 (ReplicationConfigurationReplicatedDiskStagingDiskType) Values() []ReplicationConfigurationReplicatedDiskStagingDiskType { return []ReplicationConfigurationReplicatedDiskStagingDiskType{ "AUTO", "GP2", "IO1", "SC1", "ST1", "STANDARD", "GP3", "IO2", } } type ReplicationType string // Enum values for ReplicationType const ( ReplicationTypeAgentBased ReplicationType = "AGENT_BASED" ReplicationTypeSnapshotShipping ReplicationType = "SNAPSHOT_SHIPPING" ) // Values returns all known values for ReplicationType. 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 (ReplicationType) Values() []ReplicationType { return []ReplicationType{ "AGENT_BASED", "SNAPSHOT_SHIPPING", } } type SsmDocumentType string // Enum values for SsmDocumentType const ( SsmDocumentTypeAutomation SsmDocumentType = "AUTOMATION" SsmDocumentTypeCommand SsmDocumentType = "COMMAND" ) // Values returns all known values for SsmDocumentType. 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 (SsmDocumentType) Values() []SsmDocumentType { return []SsmDocumentType{ "AUTOMATION", "COMMAND", } } type SsmParameterStoreParameterType string // Enum values for SsmParameterStoreParameterType const ( SsmParameterStoreParameterTypeString SsmParameterStoreParameterType = "STRING" ) // Values returns all known values for SsmParameterStoreParameterType. 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 (SsmParameterStoreParameterType) Values() []SsmParameterStoreParameterType { return []SsmParameterStoreParameterType{ "STRING", } } type TargetInstanceTypeRightSizingMethod string // Enum values for TargetInstanceTypeRightSizingMethod const ( TargetInstanceTypeRightSizingMethodNone TargetInstanceTypeRightSizingMethod = "NONE" TargetInstanceTypeRightSizingMethodBasic TargetInstanceTypeRightSizingMethod = "BASIC" ) // Values returns all known values for TargetInstanceTypeRightSizingMethod. 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 (TargetInstanceTypeRightSizingMethod) Values() []TargetInstanceTypeRightSizingMethod { return []TargetInstanceTypeRightSizingMethod{ "NONE", "BASIC", } } type ValidationExceptionReason string // Enum values for ValidationExceptionReason const ( ValidationExceptionReasonUnknownOperation ValidationExceptionReason = "unknownOperation" ValidationExceptionReasonCannotParse ValidationExceptionReason = "cannotParse" ValidationExceptionReasonFieldValidationFailed ValidationExceptionReason = "fieldValidationFailed" ValidationExceptionReasonOther ValidationExceptionReason = "other" ) // Values returns all known values for ValidationExceptionReason. 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 (ValidationExceptionReason) Values() []ValidationExceptionReason { return []ValidationExceptionReason{ "unknownOperation", "cannotParse", "fieldValidationFailed", "other", } } type VolumeType string // Enum values for VolumeType const ( VolumeTypeIo1 VolumeType = "io1" VolumeTypeIo2 VolumeType = "io2" VolumeTypeGp3 VolumeType = "gp3" VolumeTypeGp2 VolumeType = "gp2" VolumeTypeSt1 VolumeType = "st1" VolumeTypeSc1 VolumeType = "sc1" VolumeTypeStandard VolumeType = "standard" ) // Values returns all known values for VolumeType. 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 (VolumeType) Values() []VolumeType { return []VolumeType{ "io1", "io2", "gp3", "gp2", "st1", "sc1", "standard", } } type WaveHealthStatus string // Enum values for WaveHealthStatus const ( WaveHealthStatusHealthy WaveHealthStatus = "HEALTHY" WaveHealthStatusLagging WaveHealthStatus = "LAGGING" WaveHealthStatusError WaveHealthStatus = "ERROR" ) // Values returns all known values for WaveHealthStatus. 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 (WaveHealthStatus) Values() []WaveHealthStatus { return []WaveHealthStatus{ "HEALTHY", "LAGGING", "ERROR", } } type WaveProgressStatus string // Enum values for WaveProgressStatus const ( WaveProgressStatusNotStarted WaveProgressStatus = "NOT_STARTED" WaveProgressStatusInProgress WaveProgressStatus = "IN_PROGRESS" WaveProgressStatusCompleted WaveProgressStatus = "COMPLETED" ) // Values returns all known values for WaveProgressStatus. 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 (WaveProgressStatus) Values() []WaveProgressStatus { return []WaveProgressStatus{ "NOT_STARTED", "IN_PROGRESS", "COMPLETED", } }
823
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( "fmt" smithy "github.com/aws/smithy-go" ) // Operating denied due to a file permission or access check error. type AccessDeniedException struct { Message *string ErrorCodeOverride *string Code *string noSmithyDocumentSerde } func (e *AccessDeniedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccessDeniedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccessDeniedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccessDeniedException" } return *e.ErrorCodeOverride } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request could not be completed due to a conflict with the current state of // the target resource. type ConflictException struct { Message *string ErrorCodeOverride *string Code *string ResourceId *string ResourceType *string Errors []ErrorDetails noSmithyDocumentSerde } func (e *ConflictException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ConflictException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ConflictException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ConflictException" } return *e.ErrorCodeOverride } func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The server encountered an unexpected condition that prevented it from // fulfilling the request. type InternalServerException struct { Message *string ErrorCodeOverride *string RetryAfterSeconds int64 noSmithyDocumentSerde } func (e *InternalServerException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalServerException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalServerException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalServerException" } return *e.ErrorCodeOverride } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // Resource not found exception. type ResourceNotFoundException struct { Message *string ErrorCodeOverride *string Code *string ResourceId *string ResourceType *string noSmithyDocumentSerde } func (e *ResourceNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceNotFoundException" } return *e.ErrorCodeOverride } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request could not be completed because its exceeded the service quota. type ServiceQuotaExceededException struct { Message *string ErrorCodeOverride *string Code *string ResourceId *string ResourceType *string ServiceCode *string QuotaCode *string QuotaValue int32 noSmithyDocumentSerde } func (e *ServiceQuotaExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ServiceQuotaExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ServiceQuotaExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ServiceQuotaExceededException" } return *e.ErrorCodeOverride } func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Reached throttling quota exception. type ThrottlingException struct { Message *string ErrorCodeOverride *string ServiceCode *string QuotaCode *string RetryAfterSeconds *string noSmithyDocumentSerde } func (e *ThrottlingException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ThrottlingException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ThrottlingException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ThrottlingException" } return *e.ErrorCodeOverride } func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Uninitialized account exception. type UninitializedAccountException struct { Message *string ErrorCodeOverride *string Code *string noSmithyDocumentSerde } func (e *UninitializedAccountException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *UninitializedAccountException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *UninitializedAccountException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "UninitializedAccountException" } return *e.ErrorCodeOverride } func (e *UninitializedAccountException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Validate exception. type ValidationException struct { Message *string ErrorCodeOverride *string Code *string Reason ValidationExceptionReason FieldList []ValidationExceptionField noSmithyDocumentSerde } func (e *ValidationException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ValidationException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ValidationException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ValidationException" } return *e.ErrorCodeOverride } func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
249
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( smithydocument "github.com/aws/smithy-go/document" ) type Application struct { // Application aggregated status. ApplicationAggregatedStatus *ApplicationAggregatedStatus // Application ID. ApplicationID *string // Application ARN. Arn *string // Application creation dateTime. CreationDateTime *string // Application description. Description *string // Application archival status. IsArchived *bool // Application last modified dateTime. LastModifiedDateTime *string // Application name. Name *string // Application tags. Tags map[string]string // Application wave ID. WaveID *string noSmithyDocumentSerde } // Application aggregated status. type ApplicationAggregatedStatus struct { // Application aggregated status health status. HealthStatus ApplicationHealthStatus // Application aggregated status last update dateTime. LastUpdateDateTime *string // Application aggregated status progress status. ProgressStatus ApplicationProgressStatus // Application aggregated status total source servers amount. TotalSourceServers int64 noSmithyDocumentSerde } // The request to change the source server migration lifecycle state. type ChangeServerLifeCycleStateSourceServerLifecycle struct { // The request to change the source server migration lifecycle state. // // This member is required. State ChangeServerLifeCycleStateSourceServerLifecycleState noSmithyDocumentSerde } // Source server CPU information. type CPU struct { // The number of CPU cores on the source server. Cores int64 // The source server's CPU model name. ModelName *string noSmithyDocumentSerde } // Error in data replication. type DataReplicationError struct { // Error in data replication. Error DataReplicationErrorString // Error in data replication. RawError *string noSmithyDocumentSerde } // Request data replication info. type DataReplicationInfo struct { // Error in obtaining data replication info. DataReplicationError *DataReplicationError // Request to query whether data replication has been initiated. DataReplicationInitiation *DataReplicationInitiation // Request to query the data replication state. DataReplicationState DataReplicationState // Request to query the time when data replication will be complete. EtaDateTime *string // Request to query data replication lag duration. LagDuration *string // Request to query data replication last snapshot time. LastSnapshotDateTime *string // Request to query disks replicated. ReplicatedDisks []DataReplicationInfoReplicatedDisk noSmithyDocumentSerde } // Request to query disks replicated. type DataReplicationInfoReplicatedDisk struct { // Request to query data replication backlog size in bytes. BackloggedStorageBytes int64 // Request to query device name. DeviceName *string // Request to query amount of data replicated in bytes. ReplicatedStorageBytes int64 // Request to query amount of data rescanned in bytes. RescannedStorageBytes int64 // Request to query total amount of data replicated in bytes. TotalStorageBytes int64 noSmithyDocumentSerde } // Data replication initiation. type DataReplicationInitiation struct { // Request to query next data initiation date and time. NextAttemptDateTime *string // Request to query data initiation start date and time. StartDateTime *string // Request to query data initiation steps. Steps []DataReplicationInitiationStep noSmithyDocumentSerde } // Data replication initiation step. type DataReplicationInitiationStep struct { // Request to query data initiation step name. Name DataReplicationInitiationStepName // Request to query data initiation status. Status DataReplicationInitiationStepStatus noSmithyDocumentSerde } // Request to describe Job log filters. type DescribeJobsRequestFilters struct { // Request to describe Job log filters by date. FromDate *string // Request to describe Job log filters by job ID. JobIDs []string // Request to describe job log items by last date. ToDate *string noSmithyDocumentSerde } // Request to filter Source Servers list. type DescribeSourceServersRequestFilters struct { // Request to filter Source Servers list by application IDs. ApplicationIDs []string // Request to filter Source Servers list by archived. IsArchived *bool // Request to filter Source Servers list by life cycle states. LifeCycleStates []LifeCycleState // Request to filter Source Servers list by replication type. ReplicationTypes []ReplicationType // Request to filter Source Servers list by Source Server ID. SourceServerIDs []string noSmithyDocumentSerde } // The disk identifier. type Disk struct { // The amount of storage on the disk in bytes. Bytes int64 // The disk or device name. DeviceName *string noSmithyDocumentSerde } // Error details. type ErrorDetails struct { // Error details code. Code *string // Error details message. Message *string // Error details resourceId. ResourceId *string // Error details resourceType. ResourceType *string noSmithyDocumentSerde } // Export errors data. type ExportErrorData struct { // Export errors data raw error. RawError *string noSmithyDocumentSerde } // Export task. type ExportTask struct { // Export task creation datetime. CreationDateTime *string // Export task end datetime. EndDateTime *string // Export task id. ExportID *string // Export task progress percentage. ProgressPercentage *float32 // Export task s3 bucket. S3Bucket *string // Export task s3 bucket owner. S3BucketOwner *string // Export task s3 key. S3Key *string // Export task status. Status ExportStatus // Export task summary. Summary *ExportTaskSummary noSmithyDocumentSerde } // Export task error. type ExportTaskError struct { // Export task error data. ErrorData *ExportErrorData // Export task error datetime. ErrorDateTime *string noSmithyDocumentSerde } // Export task summary. type ExportTaskSummary struct { // Export task summary applications count. ApplicationsCount int64 // Export task summary servers count. ServersCount int64 // Export task summary waves count. WavesCount int64 noSmithyDocumentSerde } // Identification hints. type IdentificationHints struct { // AWS Instance ID identification hint. AwsInstanceID *string // FQDN address identification hint. Fqdn *string // Hostname identification hint. Hostname *string // vCenter VM path identification hint. VmPath *string // vmWare UUID identification hint. VmWareUuid *string noSmithyDocumentSerde } // Import error data. type ImportErrorData struct { // Import error data application ID. ApplicationID *string // Import error data ec2 LaunchTemplate ID. Ec2LaunchTemplateID *string // Import error data raw error. RawError *string // Import error data row number. RowNumber int64 // Import error data source server ID. SourceServerID *string // Import error data wave id. WaveID *string noSmithyDocumentSerde } // Import task. type ImportTask struct { // Import task creation datetime. CreationDateTime *string // Import task end datetime. EndDateTime *string // Import task id. ImportID *string // Import task progress percentage. ProgressPercentage *float32 // Import task s3 bucket source. S3BucketSource *S3BucketSource // Import task status. Status ImportStatus // Import task summary. Summary *ImportTaskSummary noSmithyDocumentSerde } // Import task error. type ImportTaskError struct { // Import task error data. ErrorData *ImportErrorData // Import task error datetime. ErrorDateTime *string // Import task error type. ErrorType ImportErrorType noSmithyDocumentSerde } // Import task summary. type ImportTaskSummary struct { // Import task summary applications. Applications *ImportTaskSummaryApplications // Import task summary servers. Servers *ImportTaskSummaryServers // Import task summary waves. Waves *ImportTaskSummaryWaves noSmithyDocumentSerde } // Import task summary applications. type ImportTaskSummaryApplications struct { // Import task summary applications created count. CreatedCount int64 // Import task summary applications modified count. ModifiedCount int64 noSmithyDocumentSerde } // Import task summary servers. type ImportTaskSummaryServers struct { // Import task summary servers created count. CreatedCount int64 // Import task summary servers modified count. ModifiedCount int64 noSmithyDocumentSerde } // Import task summery waves. type ImportTaskSummaryWaves struct { // Import task summery waves created count. CreatedCount int64 // Import task summery waves modified count. ModifiedCount int64 noSmithyDocumentSerde } // Job. type Job struct { // Job ID. // // This member is required. JobID *string // the ARN of the specific Job. Arn *string // Job creation time. CreationDateTime *string // Job end time. EndDateTime *string // Job initiated by field. InitiatedBy InitiatedBy // Servers participating in a specific Job. ParticipatingServers []ParticipatingServer // Job status. Status JobStatus // Tags associated with specific Job. Tags map[string]string // Job type. Type JobType noSmithyDocumentSerde } // Job log. type JobLog struct { // Job log event. Event JobLogEvent // Job event data EventData *JobLogEventData // Job log event date and time. LogDateTime *string noSmithyDocumentSerde } // Job log data type JobLogEventData struct { // Job Event conversion Server ID. ConversionServerID *string // Job error. RawError *string // Job Event Source Server ID. SourceServerID *string // Job Event Target instance ID. TargetInstanceID *string noSmithyDocumentSerde } // Launch Status of the Job Post Launch Actions. type JobPostLaunchActionsLaunchStatus struct { // AWS Systems Manager Document's execution ID of the of the Job Post Launch // Actions. ExecutionID *string // AWS Systems Manager Document's execution status. ExecutionStatus PostLaunchActionExecutionStatus // AWS Systems Manager Document's failure reason. FailureReason *string // AWS Systems Manager's Document of the of the Job Post Launch Actions. SsmDocument *SsmDocument // AWS Systems Manager Document type. SsmDocumentType SsmDocumentType noSmithyDocumentSerde } type LaunchConfigurationTemplate struct { // ID of the Launch Configuration Template. // // This member is required. LaunchConfigurationTemplateID *string // ARN of the Launch Configuration Template. Arn *string // Associate public Ip address. AssociatePublicIpAddress *bool // Launch configuration template boot mode. BootMode BootMode // Copy private Ip. CopyPrivateIp *bool // Copy tags. CopyTags *bool // EC2 launch template ID. Ec2LaunchTemplateID *string // Enable map auto tagging. EnableMapAutoTagging *bool // Large volume config. LargeVolumeConf *LaunchTemplateDiskConf // Launch disposition. LaunchDisposition LaunchDisposition // Configure Licensing. Licensing *Licensing // Launch configuration template map auto tagging MPE ID. MapAutoTaggingMpeID *string // Post Launch Actions of the Launch Configuration Template. PostLaunchActions *PostLaunchActions // Small volume config. SmallVolumeConf *LaunchTemplateDiskConf // Small volume maximum size. SmallVolumeMaxSize int64 // Tags of the Launch Configuration Template. Tags map[string]string // Target instance type right-sizing method. TargetInstanceTypeRightSizingMethod TargetInstanceTypeRightSizingMethod noSmithyDocumentSerde } // Launched instance. type LaunchedInstance struct { // Launched instance EC2 ID. Ec2InstanceID *string // Launched instance first boot. FirstBoot FirstBoot // Launched instance Job ID. JobID *string noSmithyDocumentSerde } // Launch template disk configuration. type LaunchTemplateDiskConf struct { // Launch template disk iops configuration. Iops int64 // Launch template disk throughput configuration. Throughput int64 // Launch template disk volume type configuration. VolumeType VolumeType noSmithyDocumentSerde } // Configure Licensing. type Licensing struct { // Configure BYOL OS licensing. OsByol *bool noSmithyDocumentSerde } // Lifecycle. type LifeCycle struct { // Lifecycle added to service data and time. AddedToServiceDateTime *string // Lifecycle elapsed time and duration. ElapsedReplicationDuration *string // Lifecycle replication initiation date and time. FirstByteDateTime *string // Lifecycle last Cutover. LastCutover *LifeCycleLastCutover // Lifecycle last seen date and time. LastSeenByServiceDateTime *string // Lifecycle last Test. LastTest *LifeCycleLastTest // Lifecycle state. State LifeCycleState noSmithyDocumentSerde } // Lifecycle last Cutover . type LifeCycleLastCutover struct { // Lifecycle Cutover finalized date and time. Finalized *LifeCycleLastCutoverFinalized // Lifecycle last Cutover initiated. Initiated *LifeCycleLastCutoverInitiated // Lifecycle last Cutover reverted. Reverted *LifeCycleLastCutoverReverted noSmithyDocumentSerde } // Lifecycle Cutover finalized type LifeCycleLastCutoverFinalized struct { // Lifecycle Cutover finalized date and time. ApiCallDateTime *string noSmithyDocumentSerde } // Lifecycle last Cutover initiated. type LifeCycleLastCutoverInitiated struct { // ApiCallDateTime *string // Lifecycle last Cutover initiated by Job ID. JobID *string noSmithyDocumentSerde } // Lifecycle last Cutover reverted. type LifeCycleLastCutoverReverted struct { // Lifecycle last Cutover reverted API call date time. ApiCallDateTime *string noSmithyDocumentSerde } // Lifecycle last Test. type LifeCycleLastTest struct { // Lifecycle last Test finalized. Finalized *LifeCycleLastTestFinalized // Lifecycle last Test initiated. Initiated *LifeCycleLastTestInitiated // Lifecycle last Test reverted. Reverted *LifeCycleLastTestReverted noSmithyDocumentSerde } // Lifecycle last Test finalized. type LifeCycleLastTestFinalized struct { // Lifecycle Test failed API call date and time. ApiCallDateTime *string noSmithyDocumentSerde } // Lifecycle last Test initiated. type LifeCycleLastTestInitiated struct { // Lifecycle last Test initiated API call date and time. ApiCallDateTime *string // Lifecycle last Test initiated Job ID. JobID *string noSmithyDocumentSerde } // Lifecycle last Test reverted. type LifeCycleLastTestReverted struct { // Lifecycle last Test reverted API call date and time. ApiCallDateTime *string noSmithyDocumentSerde } // Applications list filters. type ListApplicationsRequestFilters struct { // Filter applications list by application ID. ApplicationIDs []string // Filter applications list by archival status. IsArchived *bool // Filter applications list by wave ID. WaveIDs []string noSmithyDocumentSerde } // List exports request filters. type ListExportsRequestFilters struct { // List exports request filters export ids. ExportIDs []string noSmithyDocumentSerde } // List imports request filters. type ListImportsRequestFilters struct { // List imports request filters import IDs. ImportIDs []string noSmithyDocumentSerde } // Waves list filters. type ListWavesRequestFilters struct { // Filter waves list by archival status. IsArchived *bool // Filter waves list by wave ID. WaveIDs []string noSmithyDocumentSerde } // Network interface. type NetworkInterface struct { // Network interface IPs. Ips []string // Network interface primary IP. IsPrimary *bool // Network interface Mac address. MacAddress *string noSmithyDocumentSerde } // Operating System. type OS struct { // OS full string. FullString *string noSmithyDocumentSerde } // Server participating in Job. type ParticipatingServer struct { // Participating server Source Server ID. // // This member is required. SourceServerID *string // Participating server launch status. LaunchStatus LaunchStatus // Participating server's launched ec2 instance ID. LaunchedEc2InstanceID *string // Participating server's Post Launch Actions Status. PostLaunchActionsStatus *PostLaunchActionsStatus noSmithyDocumentSerde } // Post Launch Actions to executed on the Test or Cutover instance. type PostLaunchActions struct { // AWS Systems Manager Command's CloudWatch log group name. CloudWatchLogGroupName *string // Deployment type in which AWS Systems Manager Documents will be executed. Deployment PostLaunchActionsDeploymentType // AWS Systems Manager Command's logs S3 log bucket. S3LogBucket *string // AWS Systems Manager Command's logs S3 output key prefix. S3OutputKeyPrefix *string // AWS Systems Manager Documents. SsmDocuments []SsmDocument noSmithyDocumentSerde } // Status of the Post Launch Actions running on the Test or Cutover instance. type PostLaunchActionsStatus struct { // List of Post Launch Action status. PostLaunchActionsLaunchStatusList []JobPostLaunchActionsLaunchStatus // Time where the AWS Systems Manager was detected as running on the Test or // Cutover instance. SsmAgentDiscoveryDatetime *string noSmithyDocumentSerde } // Replication Configuration replicated disk. type ReplicationConfigurationReplicatedDisk struct { // Replication Configuration replicated disk device name. DeviceName *string // Replication Configuration replicated disk IOPs. Iops int64 // Replication Configuration replicated disk boot disk. IsBootDisk *bool // Replication Configuration replicated disk staging disk type. StagingDiskType ReplicationConfigurationReplicatedDiskStagingDiskType // Replication Configuration replicated disk throughput. Throughput int64 noSmithyDocumentSerde } type ReplicationConfigurationTemplate struct { // Replication Configuration template ID. // // This member is required. ReplicationConfigurationTemplateID *string // Replication Configuration template ARN. Arn *string // Replication Configuration template associate default Application Migration // Service Security group. AssociateDefaultSecurityGroup *bool // Replication Configuration template bandwidth throttling. BandwidthThrottling int64 // Replication Configuration template create Public IP. CreatePublicIP *bool // Replication Configuration template data plane routing. DataPlaneRouting ReplicationConfigurationDataPlaneRouting // Replication Configuration template use default large Staging Disk type. DefaultLargeStagingDiskType ReplicationConfigurationDefaultLargeStagingDiskType // Replication Configuration template EBS encryption. EbsEncryption ReplicationConfigurationEbsEncryption // Replication Configuration template EBS encryption key ARN. EbsEncryptionKeyArn *string // Replication Configuration template server instance type. ReplicationServerInstanceType *string // Replication Configuration template server Security Groups IDs. ReplicationServersSecurityGroupsIDs []string // Replication Configuration template Staging Area subnet ID. StagingAreaSubnetId *string // Replication Configuration template Staging Area Tags. StagingAreaTags map[string]string // Replication Configuration template Tags. Tags map[string]string // Replication Configuration template use Dedicated Replication Server. UseDedicatedReplicationServer *bool noSmithyDocumentSerde } // S3 bucket source. type S3BucketSource struct { // S3 bucket source s3 bucket. // // This member is required. S3Bucket *string // S3 bucket source s3 key. // // This member is required. S3Key *string // S3 bucket source s3 bucket owner. S3BucketOwner *string noSmithyDocumentSerde } // Source server properties. type SourceProperties struct { // Source Server CPUs. Cpus []CPU // Source Server disks. Disks []Disk // Source server identification hints. IdentificationHints *IdentificationHints // Source server last update date and time. LastUpdatedDateTime *string // Source server network interfaces. NetworkInterfaces []NetworkInterface // Source server OS. Os *OS // Source server RAM in bytes. RamBytes int64 // Source server recommended instance type. RecommendedInstanceType *string noSmithyDocumentSerde } type SourceServer struct { // Source server application ID. ApplicationID *string // Source server ARN. Arn *string // Source server data replication info. DataReplicationInfo *DataReplicationInfo // Source server fqdn for action framework. FqdnForActionFramework *string // Source server archived status. IsArchived *bool // Source server launched instance. LaunchedInstance *LaunchedInstance // Source server lifecycle state. LifeCycle *LifeCycle // Source server replication type. ReplicationType ReplicationType // Source server properties. SourceProperties *SourceProperties // Source server ID. SourceServerID *string // Source server Tags. Tags map[string]string // Source server user provided ID. UserProvidedID *string // Source server vCenter client id. VcenterClientID *string noSmithyDocumentSerde } type SourceServerActionDocument struct { // Source server post migration custom action ID. ActionID *string // Source server post migration custom action name. ActionName *string // Source server post migration custom action active status. Active *bool // Source server post migration custom action category. Category ActionCategory // Source server post migration custom action description. Description *string // Source server post migration custom action document identifier. DocumentIdentifier *string // Source server post migration custom action document version. DocumentVersion *string // Source server post migration custom action external parameters. ExternalParameters map[string]SsmExternalParameter // Source server post migration custom action must succeed for cutover. MustSucceedForCutover *bool // Source server post migration custom action order. Order int32 // Source server post migration custom action parameters. Parameters map[string][]SsmParameterStoreParameter // Source server post migration custom action timeout in seconds. TimeoutSeconds int32 noSmithyDocumentSerde } // Source server post migration custom action filters. type SourceServerActionsRequestFilters struct { // Action IDs to filter source server post migration custom actions by. ActionIDs []string noSmithyDocumentSerde } // AWS Systems Manager Document. type SsmDocument struct { // User-friendly name for the AWS Systems Manager Document. // // This member is required. ActionName *string // AWS Systems Manager Document name or full ARN. // // This member is required. SsmDocumentName *string // AWS Systems Manager Document external parameters. ExternalParameters map[string]SsmExternalParameter // If true, Cutover will not be enabled if the document has failed. MustSucceedForCutover *bool // AWS Systems Manager Document parameters. Parameters map[string][]SsmParameterStoreParameter // AWS Systems Manager Document timeout seconds. TimeoutSeconds int32 noSmithyDocumentSerde } // AWS Systems Manager Document external parameter. // // The following types satisfy this interface: // // SsmExternalParameterMemberDynamicPath type SsmExternalParameter interface { isSsmExternalParameter() } // AWS Systems Manager Document external parameters dynamic path. type SsmExternalParameterMemberDynamicPath struct { Value string noSmithyDocumentSerde } func (*SsmExternalParameterMemberDynamicPath) isSsmExternalParameter() {} // AWS Systems Manager Parameter Store parameter. type SsmParameterStoreParameter struct { // AWS Systems Manager Parameter Store parameter name. // // This member is required. ParameterName *string // AWS Systems Manager Parameter Store parameter type. // // This member is required. ParameterType SsmParameterStoreParameterType noSmithyDocumentSerde } type TemplateActionDocument struct { // Template post migration custom action ID. ActionID *string // Template post migration custom action name. ActionName *string // Template post migration custom action active status. Active *bool // Template post migration custom action category. Category ActionCategory // Template post migration custom action description. Description *string // Template post migration custom action document identifier. DocumentIdentifier *string // Template post migration custom action document version. DocumentVersion *string // Template post migration custom action external parameters. ExternalParameters map[string]SsmExternalParameter // Template post migration custom action must succeed for cutover. MustSucceedForCutover *bool // Operating system eligible for this template post migration custom action. OperatingSystem *string // Template post migration custom action order. Order int32 // Template post migration custom action parameters. Parameters map[string][]SsmParameterStoreParameter // Template post migration custom action timeout in seconds. TimeoutSeconds int32 noSmithyDocumentSerde } // Template post migration custom action filters. type TemplateActionsRequestFilters struct { // Action IDs to filter template post migration custom actions by. ActionIDs []string noSmithyDocumentSerde } // Validate exception field. type ValidationExceptionField struct { // Validate exception field message. Message *string // Validate exception field name. Name *string noSmithyDocumentSerde } // vCenter client. type VcenterClient struct { // Arn of vCenter client. Arn *string // Datacenter name of vCenter client. DatacenterName *string // Hostname of vCenter client . Hostname *string // Last seen time of vCenter client. LastSeenDatetime *string // Tags for Source Server of vCenter client. SourceServerTags map[string]string // Tags for vCenter client. Tags map[string]string // ID of vCenter client. VcenterClientID *string // Vcenter UUID of vCenter client. VcenterUUID *string noSmithyDocumentSerde } type Wave struct { // Wave ARN. Arn *string // Wave creation dateTime. CreationDateTime *string // Wave description. Description *string // Wave archival status. IsArchived *bool // Wave last modified dateTime. LastModifiedDateTime *string // Wave name. Name *string // Wave tags. Tags map[string]string // Wave aggregated status. WaveAggregatedStatus *WaveAggregatedStatus // Wave ID. WaveID *string noSmithyDocumentSerde } // Wave aggregated status. type WaveAggregatedStatus struct { // Wave aggregated status health status. HealthStatus WaveHealthStatus // Wave aggregated status last update dateTime. LastUpdateDateTime *string // Wave aggregated status progress status. ProgressStatus WaveProgressStatus // DateTime marking when the first source server in the wave started replication. ReplicationStartedDateTime *string // Wave aggregated status total applications amount. TotalApplications int64 noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde // UnknownUnionMember is returned when a union member is returned over the wire, // but has an unknown tag. type UnknownUnionMember struct { Tag string Value []byte noSmithyDocumentSerde } func (*UnknownUnionMember) isSsmExternalParameter() {}
1,311
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types_test import ( "fmt" "github.com/aws/aws-sdk-go-v2/service/mgn/types" ) func ExampleSsmExternalParameter_outputUsage() { var union types.SsmExternalParameter // type switches can be used to check the union value switch v := union.(type) { case *types.SsmExternalParameterMemberDynamicPath: _ = v.Value // Value is string case *types.UnknownUnionMember: fmt.Println("unknown tag:", v.Tag) default: fmt.Println("union is nil or unknown type") } } var _ *string
27
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/defaults" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "net" "net/http" "time" ) const ServiceID = "Migration Hub" const ServiceAPIVersion = "2017-05-31" // Client provides the API client to make operations call for AWS Migration Hub. type Client struct { options Options } // New returns an initialized Client based on the functional options. Provide // additional functional options to further configure the behavior of the client, // such as changing the client's endpoint or adding custom middleware behavior. func New(options Options, optFns ...func(*Options)) *Client { options = options.Copy() resolveDefaultLogger(&options) setResolvedDefaultsMode(&options) resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) resolveDefaultEndpointConfiguration(&options) for _, fn := range optFns { fn(&options) } client := &Client{ options: options, } return client } type Options struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // Configures the events that will be sent to the configured logger. ClientLogMode aws.ClientLogMode // The credentials object to use when signing requests. Credentials aws.CredentialsProvider // The configuration DefaultsMode that the SDK should use when constructing the // clients initial default settings. DefaultsMode aws.DefaultsMode // The endpoint options to be used when attempting to resolve an endpoint. EndpointOptions EndpointResolverOptions // The service endpoint resolver. EndpointResolver EndpointResolver // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 // The logger writer interface to write logging messages to. Logger logging.Logger // The region to send requests to. (Required) Region string // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify // per operation call's retry max attempts. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. If specified in an operation call's functional // options with a value that is different than the constructed client's Options, // the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if // Retryer option is not also specified. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. Currently does not support per operation call // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. The kind of // default retry created by the API client can be changed with the RetryMode // option. Retryer aws.Retryer // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You // should not populate this structure programmatically, or rely on the values here // within your applications. RuntimeEnvironment aws.RuntimeEnvironment // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved // value was at that point in time. Currently does not support per operation call // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient } // WithAPIOptions returns a functional option for setting the Client's APIOptions // option. func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { return func(o *Options) { o.APIOptions = append(o.APIOptions, optFns...) } } // WithEndpointResolver returns a functional option for setting the Client's // EndpointResolver option. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v } } type HTTPClient interface { Do(*http.Request) (*http.Response, error) } // Copy creates a clone where the APIOptions list is deep copied. func (o Options) Copy() Options { to := o to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) copy(to.APIOptions, o.APIOptions) return to } func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() for _, fn := range optFns { fn(&options) } finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err } } for _, fn := range options.APIOptions { if err := fn(stack); err != nil { return nil, metadata, err } } handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) result, metadata, err = handler.Handle(ctx, params) if err != nil { err = &smithy.OperationError{ ServiceID: ServiceID, OperationName: opID, Err: err, } } return result, metadata, err } type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { if o.Logger != nil { return } o.Logger = logging.Nop{} } func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } func setResolvedDefaultsMode(o *Options) { if len(o.resolvedDefaultsMode) > 0 { return } var mode aws.DefaultsMode mode.SetFromString(string(o.DefaultsMode)) if mode == aws.DefaultsModeAuto { mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) } o.resolvedDefaultsMode = mode } // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, DefaultsMode: cfg.DefaultsMode, RuntimeEnvironment: cfg.RuntimeEnvironment, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { var buildable *awshttp.BuildableClient if o.HTTPClient != nil { var ok bool buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) if !ok { return } } else { buildable = awshttp.NewBuildableClient() } modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { dialer.Timeout = dialerTimeout } }) buildable = buildable.WithTransportOptions(func(transport *http.Transport) { if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { transport.TLSHandshakeTimeout = tlsHandshakeTimeout } }) } o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } if len(o.RetryMode) == 0 { modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { o.RetryMode = modeConfig.RetryMode } } if len(o.RetryMode) == 0 { o.RetryMode = aws.RetryModeStandard } var standardOptions []func(*retry.StandardOptions) if v := o.RetryMaxAttempts; v != 0 { standardOptions = append(standardOptions, func(so *retry.StandardOptions) { so.MaxAttempts = v }) } switch o.RetryMode { case aws.RetryModeAdaptive: var adaptiveOptions []func(*retry.AdaptiveModeOptions) if len(standardOptions) != 0 { adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { ao.StandardOptions = append(ao.StandardOptions, standardOptions...) }) } o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) default: o.Retryer = retry.NewStandard(standardOptions...) } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { if cfg.Retryer == nil { return } o.Retryer = cfg.Retryer() } func resolveAWSRetryMode(cfg aws.Config, o *Options) { if len(cfg.RetryMode) == 0 { return } o.RetryMode = cfg.RetryMode } func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { if cfg.RetryMaxAttempts == 0 { return } o.RetryMaxAttempts = cfg.RetryMaxAttempts } func finalizeRetryMaxAttemptOptions(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { return } o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) } func addClientUserAgent(stack *middleware.Stack) error { return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "migrationhub", goModuleVersion)(stack) } func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ CredentialsProvider: o.Credentials, Signer: o.HTTPSignerV4, LogSigning: o.ClientLogMode.IsSigning(), }) return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error } func resolveHTTPSignerV4(o *Options) { if o.HTTPSignerV4 != nil { return } o.HTTPSignerV4 = newDefaultV4Signer(*o) } func newDefaultV4Signer(o Options) *v4.Signer { return v4.NewSigner(func(so *v4.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() }) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, LogRetryAttempts: o.ClientLogMode.IsRetries(), } return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseDualStackEndpoint = value } return nil } // resolves FIPS endpoint configuration func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseFIPSEndpoint = value } return nil } func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ LogRequest: o.ClientLogMode.IsRequest(), LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), LogResponse: o.ClientLogMode.IsResponse(), LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) }
434
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "io/ioutil" "net/http" "strings" "testing" ) func TestClient_resolveRetryOptions(t *testing.T) { nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { return &http.Response{ StatusCode: 200, Header: http.Header{}, Body: ioutil.NopCloser(strings.NewReader("")), }, nil }) cases := map[string]struct { defaultsMode aws.DefaultsMode retryer aws.Retryer retryMaxAttempts int opRetryMaxAttempts *int retryMode aws.RetryMode expectClientRetryMode aws.RetryMode expectClientMaxAttempts int expectOpMaxAttempts int }{ "defaults": { defaultsMode: aws.DefaultsModeStandard, expectClientRetryMode: aws.RetryModeStandard, expectClientMaxAttempts: 3, expectOpMaxAttempts: 3, }, "custom default retry": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, "custom op max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(2), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 2, }, "custom op no change max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(10), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, "custom op 0 max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(0), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, } for name, c := range cases { t.Run(name, func(t *testing.T) { client := NewFromConfig(aws.Config{ DefaultsMode: c.defaultsMode, Retryer: func() func() aws.Retryer { if c.retryer == nil { return nil } return func() aws.Retryer { return c.retryer } }(), HTTPClient: nopClient, RetryMaxAttempts: c.retryMaxAttempts, RetryMode: c.retryMode, }) if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { t.Errorf("expect %v retry mode, got %v", e, a) } if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { t.Errorf("expect %v max attempts, got %v", e, a) } _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, []func(*Options){ func(o *Options) { if c.opRetryMaxAttempts == nil { return } o.RetryMaxAttempts = *c.opRetryMaxAttempts }, }, func(s *middleware.Stack, o Options) error { s.Initialize.Clear() s.Serialize.Clear() s.Build.Clear() s.Finalize.Clear() s.Deserialize.Clear() if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { t.Errorf("expect %v op max attempts, got %v", e, a) } return nil }) if err != nil { t.Fatalf("expect no operation error, got %v", err) } }) } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhub/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Associates a created artifact of an AWS cloud resource, the target receiving // the migration, with the migration task performed by a migration tool. This API // has the following traits: // - Migration tools can call the AssociateCreatedArtifact operation to indicate // which AWS artifact is associated with a migration task. // - The created artifact name must be provided in ARN (Amazon Resource Name) // format which will contain information about type and region; for example: // arn:aws:ec2:us-east-1:488216288981:image/ami-6d0ba87b . // - Examples of the AWS resource behind the created artifact are, AMI's, EC2 // instance, or DMS endpoint, etc. func (c *Client) AssociateCreatedArtifact(ctx context.Context, params *AssociateCreatedArtifactInput, optFns ...func(*Options)) (*AssociateCreatedArtifactOutput, error) { if params == nil { params = &AssociateCreatedArtifactInput{} } result, metadata, err := c.invokeOperation(ctx, "AssociateCreatedArtifact", params, optFns, c.addOperationAssociateCreatedArtifactMiddlewares) if err != nil { return nil, err } out := result.(*AssociateCreatedArtifactOutput) out.ResultMetadata = metadata return out, nil } type AssociateCreatedArtifactInput struct { // An ARN of the AWS resource related to the migration (e.g., AMI, EC2 instance, // RDS instance, etc.) // // This member is required. CreatedArtifact *types.CreatedArtifact // Unique identifier that references the migration task. Do not store personal // data in this field. // // This member is required. MigrationTaskName *string // The name of the ProgressUpdateStream. // // This member is required. ProgressUpdateStream *string // Optional boolean flag to indicate whether any effect should take place. Used to // test if the caller has permission to make the call. DryRun bool noSmithyDocumentSerde } type AssociateCreatedArtifactOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAssociateCreatedArtifactMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateCreatedArtifact{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateCreatedArtifact{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpAssociateCreatedArtifactValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateCreatedArtifact(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 } return nil } func newServiceMetadataMiddleware_opAssociateCreatedArtifact(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgh", OperationName: "AssociateCreatedArtifact", } }
146
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhub/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Associates a discovered resource ID from Application Discovery Service with a // migration task. func (c *Client) AssociateDiscoveredResource(ctx context.Context, params *AssociateDiscoveredResourceInput, optFns ...func(*Options)) (*AssociateDiscoveredResourceOutput, error) { if params == nil { params = &AssociateDiscoveredResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "AssociateDiscoveredResource", params, optFns, c.addOperationAssociateDiscoveredResourceMiddlewares) if err != nil { return nil, err } out := result.(*AssociateDiscoveredResourceOutput) out.ResultMetadata = metadata return out, nil } type AssociateDiscoveredResourceInput struct { // Object representing a Resource. // // This member is required. DiscoveredResource *types.DiscoveredResource // The identifier given to the MigrationTask. Do not store personal data in this // field. // // This member is required. MigrationTaskName *string // The name of the ProgressUpdateStream. // // This member is required. ProgressUpdateStream *string // Optional boolean flag to indicate whether any effect should take place. Used to // test if the caller has permission to make the call. DryRun bool noSmithyDocumentSerde } type AssociateDiscoveredResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAssociateDiscoveredResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateDiscoveredResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateDiscoveredResource{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpAssociateDiscoveredResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateDiscoveredResource(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 } return nil } func newServiceMetadataMiddleware_opAssociateDiscoveredResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgh", OperationName: "AssociateDiscoveredResource", } }
137
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a progress update stream which is an AWS resource used for access // control as well as a namespace for migration task names that is implicitly // linked to your AWS account. It must uniquely identify the migration tool as it // is used for all updates made by the tool; however, it does not need to be unique // for each AWS account because it is scoped to the AWS account. func (c *Client) CreateProgressUpdateStream(ctx context.Context, params *CreateProgressUpdateStreamInput, optFns ...func(*Options)) (*CreateProgressUpdateStreamOutput, error) { if params == nil { params = &CreateProgressUpdateStreamInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateProgressUpdateStream", params, optFns, c.addOperationCreateProgressUpdateStreamMiddlewares) if err != nil { return nil, err } out := result.(*CreateProgressUpdateStreamOutput) out.ResultMetadata = metadata return out, nil } type CreateProgressUpdateStreamInput struct { // The name of the ProgressUpdateStream. Do not store personal data in this field. // // This member is required. ProgressUpdateStreamName *string // Optional boolean flag to indicate whether any effect should take place. Used to // test if the caller has permission to make the call. DryRun bool noSmithyDocumentSerde } type CreateProgressUpdateStreamOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateProgressUpdateStreamMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateProgressUpdateStream{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateProgressUpdateStream{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateProgressUpdateStreamValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateProgressUpdateStream(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 } return nil } func newServiceMetadataMiddleware_opCreateProgressUpdateStream(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgh", OperationName: "CreateProgressUpdateStream", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a progress update stream, including all of its tasks, which was // previously created as an AWS resource used for access control. This API has the // following traits: // - The only parameter needed for DeleteProgressUpdateStream is the stream name // (same as a CreateProgressUpdateStream call). // - The call will return, and a background process will asynchronously delete // the stream and all of its resources (tasks, associated resources, resource // attributes, created artifacts). // - If the stream takes time to be deleted, it might still show up on a // ListProgressUpdateStreams call. // - CreateProgressUpdateStream , ImportMigrationTask , NotifyMigrationTaskState // , and all Associate[*] APIs related to the tasks belonging to the stream will // throw "InvalidInputException" if the stream of the same name is in the process // of being deleted. // - Once the stream and all of its resources are deleted, // CreateProgressUpdateStream for a stream of the same name will succeed, and // that stream will be an entirely new logical resource (without any resources // associated with the old stream). func (c *Client) DeleteProgressUpdateStream(ctx context.Context, params *DeleteProgressUpdateStreamInput, optFns ...func(*Options)) (*DeleteProgressUpdateStreamOutput, error) { if params == nil { params = &DeleteProgressUpdateStreamInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteProgressUpdateStream", params, optFns, c.addOperationDeleteProgressUpdateStreamMiddlewares) if err != nil { return nil, err } out := result.(*DeleteProgressUpdateStreamOutput) out.ResultMetadata = metadata return out, nil } type DeleteProgressUpdateStreamInput struct { // The name of the ProgressUpdateStream. Do not store personal data in this field. // // This member is required. ProgressUpdateStreamName *string // Optional boolean flag to indicate whether any effect should take place. Used to // test if the caller has permission to make the call. DryRun bool noSmithyDocumentSerde } type DeleteProgressUpdateStreamOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteProgressUpdateStreamMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteProgressUpdateStream{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteProgressUpdateStream{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteProgressUpdateStreamValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProgressUpdateStream(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 } return nil } func newServiceMetadataMiddleware_opDeleteProgressUpdateStream(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgh", OperationName: "DeleteProgressUpdateStream", } }
141
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhub/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Gets the migration status of an application. func (c *Client) DescribeApplicationState(ctx context.Context, params *DescribeApplicationStateInput, optFns ...func(*Options)) (*DescribeApplicationStateOutput, error) { if params == nil { params = &DescribeApplicationStateInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeApplicationState", params, optFns, c.addOperationDescribeApplicationStateMiddlewares) if err != nil { return nil, err } out := result.(*DescribeApplicationStateOutput) out.ResultMetadata = metadata return out, nil } type DescribeApplicationStateInput struct { // The configurationId in Application Discovery Service that uniquely identifies // the grouped application. // // This member is required. ApplicationId *string noSmithyDocumentSerde } type DescribeApplicationStateOutput struct { // Status of the application - Not Started, In-Progress, Complete. ApplicationStatus types.ApplicationStatus // The timestamp when the application status was last updated. LastUpdatedTime *time.Time // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeApplicationStateMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeApplicationState{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeApplicationState{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeApplicationStateValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeApplicationState(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 } return nil } func newServiceMetadataMiddleware_opDescribeApplicationState(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgh", OperationName: "DescribeApplicationState", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhub/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves a list of all attributes associated with a specific migration task. func (c *Client) DescribeMigrationTask(ctx context.Context, params *DescribeMigrationTaskInput, optFns ...func(*Options)) (*DescribeMigrationTaskOutput, error) { if params == nil { params = &DescribeMigrationTaskInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeMigrationTask", params, optFns, c.addOperationDescribeMigrationTaskMiddlewares) if err != nil { return nil, err } out := result.(*DescribeMigrationTaskOutput) out.ResultMetadata = metadata return out, nil } type DescribeMigrationTaskInput struct { // The identifier given to the MigrationTask. Do not store personal data in this // field. // // This member is required. MigrationTaskName *string // The name of the ProgressUpdateStream. // // This member is required. ProgressUpdateStream *string noSmithyDocumentSerde } type DescribeMigrationTaskOutput struct { // Object encapsulating information about the migration task. MigrationTask *types.MigrationTask // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeMigrationTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMigrationTask{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeMigrationTask{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeMigrationTaskValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMigrationTask(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 } return nil } func newServiceMetadataMiddleware_opDescribeMigrationTask(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgh", OperationName: "DescribeMigrationTask", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Disassociates a created artifact of an AWS resource with a migration task // performed by a migration tool that was previously associated. This API has the // following traits: // - A migration user can call the DisassociateCreatedArtifacts operation to // disassociate a created AWS Artifact from a migration task. // - The created artifact name must be provided in ARN (Amazon Resource Name) // format which will contain information about type and region; for example: // arn:aws:ec2:us-east-1:488216288981:image/ami-6d0ba87b . // - Examples of the AWS resource behind the created artifact are, AMI's, EC2 // instance, or RDS instance, etc. func (c *Client) DisassociateCreatedArtifact(ctx context.Context, params *DisassociateCreatedArtifactInput, optFns ...func(*Options)) (*DisassociateCreatedArtifactOutput, error) { if params == nil { params = &DisassociateCreatedArtifactInput{} } result, metadata, err := c.invokeOperation(ctx, "DisassociateCreatedArtifact", params, optFns, c.addOperationDisassociateCreatedArtifactMiddlewares) if err != nil { return nil, err } out := result.(*DisassociateCreatedArtifactOutput) out.ResultMetadata = metadata return out, nil } type DisassociateCreatedArtifactInput struct { // An ARN of the AWS resource related to the migration (e.g., AMI, EC2 instance, // RDS instance, etc.) // // This member is required. CreatedArtifactName *string // Unique identifier that references the migration task to be disassociated with // the artifact. Do not store personal data in this field. // // This member is required. MigrationTaskName *string // The name of the ProgressUpdateStream. // // This member is required. ProgressUpdateStream *string // Optional boolean flag to indicate whether any effect should take place. Used to // test if the caller has permission to make the call. DryRun bool noSmithyDocumentSerde } type DisassociateCreatedArtifactOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDisassociateCreatedArtifactMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisassociateCreatedArtifact{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisassociateCreatedArtifact{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDisassociateCreatedArtifactValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateCreatedArtifact(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 } return nil } func newServiceMetadataMiddleware_opDisassociateCreatedArtifact(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgh", OperationName: "DisassociateCreatedArtifact", } }
145
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Disassociate an Application Discovery Service discovered resource from a // migration task. func (c *Client) DisassociateDiscoveredResource(ctx context.Context, params *DisassociateDiscoveredResourceInput, optFns ...func(*Options)) (*DisassociateDiscoveredResourceOutput, error) { if params == nil { params = &DisassociateDiscoveredResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "DisassociateDiscoveredResource", params, optFns, c.addOperationDisassociateDiscoveredResourceMiddlewares) if err != nil { return nil, err } out := result.(*DisassociateDiscoveredResourceOutput) out.ResultMetadata = metadata return out, nil } type DisassociateDiscoveredResourceInput struct { // ConfigurationId of the Application Discovery Service resource to be // disassociated. // // This member is required. ConfigurationId *string // The identifier given to the MigrationTask. Do not store personal data in this // field. // // This member is required. MigrationTaskName *string // The name of the ProgressUpdateStream. // // This member is required. ProgressUpdateStream *string // Optional boolean flag to indicate whether any effect should take place. Used to // test if the caller has permission to make the call. DryRun bool noSmithyDocumentSerde } type DisassociateDiscoveredResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDisassociateDiscoveredResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisassociateDiscoveredResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisassociateDiscoveredResource{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDisassociateDiscoveredResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateDiscoveredResource(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 } return nil } func newServiceMetadataMiddleware_opDisassociateDiscoveredResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgh", OperationName: "DisassociateDiscoveredResource", } }
137
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Registers a new migration task which represents a server, database, etc., being // migrated to AWS by a migration tool. This API is a prerequisite to calling the // NotifyMigrationTaskState API as the migration tool must first register the // migration task with Migration Hub. func (c *Client) ImportMigrationTask(ctx context.Context, params *ImportMigrationTaskInput, optFns ...func(*Options)) (*ImportMigrationTaskOutput, error) { if params == nil { params = &ImportMigrationTaskInput{} } result, metadata, err := c.invokeOperation(ctx, "ImportMigrationTask", params, optFns, c.addOperationImportMigrationTaskMiddlewares) if err != nil { return nil, err } out := result.(*ImportMigrationTaskOutput) out.ResultMetadata = metadata return out, nil } type ImportMigrationTaskInput struct { // Unique identifier that references the migration task. Do not store personal // data in this field. // // This member is required. MigrationTaskName *string // The name of the ProgressUpdateStream. > // // This member is required. ProgressUpdateStream *string // Optional boolean flag to indicate whether any effect should take place. Used to // test if the caller has permission to make the call. DryRun bool noSmithyDocumentSerde } type ImportMigrationTaskOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationImportMigrationTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpImportMigrationTask{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpImportMigrationTask{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpImportMigrationTaskValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opImportMigrationTask(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 } return nil } func newServiceMetadataMiddleware_opImportMigrationTask(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgh", OperationName: "ImportMigrationTask", } }
133
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhub/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all the migration statuses for your applications. If you use the optional // ApplicationIds parameter, only the migration statuses for those applications // will be returned. func (c *Client) ListApplicationStates(ctx context.Context, params *ListApplicationStatesInput, optFns ...func(*Options)) (*ListApplicationStatesOutput, error) { if params == nil { params = &ListApplicationStatesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListApplicationStates", params, optFns, c.addOperationListApplicationStatesMiddlewares) if err != nil { return nil, err } out := result.(*ListApplicationStatesOutput) out.ResultMetadata = metadata return out, nil } type ListApplicationStatesInput struct { // The configurationIds from the Application Discovery Service that uniquely // identifies your applications. ApplicationIds []string // Maximum number of results to be returned per page. MaxResults *int32 // If a NextToken was returned by a previous call, there are more results // available. To retrieve the next page of results, make the call again using the // returned token in NextToken . NextToken *string noSmithyDocumentSerde } type ListApplicationStatesOutput struct { // A list of Applications that exist in Application Discovery Service. ApplicationStateList []types.ApplicationState // If a NextToken was returned by a previous call, there are more results // available. To retrieve the next page of results, make the call again using the // returned token in NextToken . NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListApplicationStatesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListApplicationStates{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListApplicationStates{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListApplicationStates(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 } return nil } // ListApplicationStatesAPIClient is a client that implements the // ListApplicationStates operation. type ListApplicationStatesAPIClient interface { ListApplicationStates(context.Context, *ListApplicationStatesInput, ...func(*Options)) (*ListApplicationStatesOutput, error) } var _ ListApplicationStatesAPIClient = (*Client)(nil) // ListApplicationStatesPaginatorOptions is the paginator options for // ListApplicationStates type ListApplicationStatesPaginatorOptions struct { // Maximum number of results to be returned per page. 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 } // ListApplicationStatesPaginator is a paginator for ListApplicationStates type ListApplicationStatesPaginator struct { options ListApplicationStatesPaginatorOptions client ListApplicationStatesAPIClient params *ListApplicationStatesInput nextToken *string firstPage bool } // NewListApplicationStatesPaginator returns a new ListApplicationStatesPaginator func NewListApplicationStatesPaginator(client ListApplicationStatesAPIClient, params *ListApplicationStatesInput, optFns ...func(*ListApplicationStatesPaginatorOptions)) *ListApplicationStatesPaginator { if params == nil { params = &ListApplicationStatesInput{} } options := ListApplicationStatesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListApplicationStatesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListApplicationStatesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListApplicationStates page. func (p *ListApplicationStatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationStatesOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxResults = limit result, err := p.client.ListApplicationStates(ctx, &params, 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_opListApplicationStates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgh", OperationName: "ListApplicationStates", } }
228
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhub/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the created artifacts attached to a given migration task in an update // stream. This API has the following traits: // - Gets the list of the created artifacts while migration is taking place. // - Shows the artifacts created by the migration tool that was associated by // the AssociateCreatedArtifact API. // - Lists created artifacts in a paginated interface. func (c *Client) ListCreatedArtifacts(ctx context.Context, params *ListCreatedArtifactsInput, optFns ...func(*Options)) (*ListCreatedArtifactsOutput, error) { if params == nil { params = &ListCreatedArtifactsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListCreatedArtifacts", params, optFns, c.addOperationListCreatedArtifactsMiddlewares) if err != nil { return nil, err } out := result.(*ListCreatedArtifactsOutput) out.ResultMetadata = metadata return out, nil } type ListCreatedArtifactsInput struct { // Unique identifier that references the migration task. Do not store personal // data in this field. // // This member is required. MigrationTaskName *string // The name of the ProgressUpdateStream. // // This member is required. ProgressUpdateStream *string // Maximum number of results to be returned per page. MaxResults *int32 // If a NextToken was returned by a previous call, there are more results // available. To retrieve the next page of results, make the call again using the // returned token in NextToken . NextToken *string noSmithyDocumentSerde } type ListCreatedArtifactsOutput struct { // List of created artifacts up to the maximum number of results specified in the // request. CreatedArtifactList []types.CreatedArtifact // If there are more created artifacts than the max result, return the next token // to be passed to the next call as a bookmark of where to start from. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListCreatedArtifactsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListCreatedArtifacts{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListCreatedArtifacts{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListCreatedArtifactsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCreatedArtifacts(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 } return nil } // ListCreatedArtifactsAPIClient is a client that implements the // ListCreatedArtifacts operation. type ListCreatedArtifactsAPIClient interface { ListCreatedArtifacts(context.Context, *ListCreatedArtifactsInput, ...func(*Options)) (*ListCreatedArtifactsOutput, error) } var _ ListCreatedArtifactsAPIClient = (*Client)(nil) // ListCreatedArtifactsPaginatorOptions is the paginator options for // ListCreatedArtifacts type ListCreatedArtifactsPaginatorOptions struct { // Maximum number of results to be returned per page. 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 } // ListCreatedArtifactsPaginator is a paginator for ListCreatedArtifacts type ListCreatedArtifactsPaginator struct { options ListCreatedArtifactsPaginatorOptions client ListCreatedArtifactsAPIClient params *ListCreatedArtifactsInput nextToken *string firstPage bool } // NewListCreatedArtifactsPaginator returns a new ListCreatedArtifactsPaginator func NewListCreatedArtifactsPaginator(client ListCreatedArtifactsAPIClient, params *ListCreatedArtifactsInput, optFns ...func(*ListCreatedArtifactsPaginatorOptions)) *ListCreatedArtifactsPaginator { if params == nil { params = &ListCreatedArtifactsInput{} } options := ListCreatedArtifactsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListCreatedArtifactsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListCreatedArtifactsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListCreatedArtifacts page. func (p *ListCreatedArtifactsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCreatedArtifactsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxResults = limit result, err := p.client.ListCreatedArtifacts(ctx, &params, 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_opListCreatedArtifacts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgh", OperationName: "ListCreatedArtifacts", } }
241
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhub/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists discovered resources associated with the given MigrationTask . func (c *Client) ListDiscoveredResources(ctx context.Context, params *ListDiscoveredResourcesInput, optFns ...func(*Options)) (*ListDiscoveredResourcesOutput, error) { if params == nil { params = &ListDiscoveredResourcesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListDiscoveredResources", params, optFns, c.addOperationListDiscoveredResourcesMiddlewares) if err != nil { return nil, err } out := result.(*ListDiscoveredResourcesOutput) out.ResultMetadata = metadata return out, nil } type ListDiscoveredResourcesInput struct { // The name of the MigrationTask. Do not store personal data in this field. // // This member is required. MigrationTaskName *string // The name of the ProgressUpdateStream. // // This member is required. ProgressUpdateStream *string // The maximum number of results returned per page. MaxResults *int32 // If a NextToken was returned by a previous call, there are more results // available. To retrieve the next page of results, make the call again using the // returned token in NextToken . NextToken *string noSmithyDocumentSerde } type ListDiscoveredResourcesOutput struct { // Returned list of discovered resources associated with the given MigrationTask. DiscoveredResourceList []types.DiscoveredResource // If there are more discovered resources than the max result, return the next // token to be passed to the next call as a bookmark of where to start from. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListDiscoveredResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListDiscoveredResources{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListDiscoveredResources{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListDiscoveredResourcesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDiscoveredResources(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 } return nil } // ListDiscoveredResourcesAPIClient is a client that implements the // ListDiscoveredResources operation. type ListDiscoveredResourcesAPIClient interface { ListDiscoveredResources(context.Context, *ListDiscoveredResourcesInput, ...func(*Options)) (*ListDiscoveredResourcesOutput, error) } var _ ListDiscoveredResourcesAPIClient = (*Client)(nil) // ListDiscoveredResourcesPaginatorOptions is the paginator options for // ListDiscoveredResources type ListDiscoveredResourcesPaginatorOptions struct { // The maximum number of results returned per page. 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 } // ListDiscoveredResourcesPaginator is a paginator for ListDiscoveredResources type ListDiscoveredResourcesPaginator struct { options ListDiscoveredResourcesPaginatorOptions client ListDiscoveredResourcesAPIClient params *ListDiscoveredResourcesInput nextToken *string firstPage bool } // NewListDiscoveredResourcesPaginator returns a new // ListDiscoveredResourcesPaginator func NewListDiscoveredResourcesPaginator(client ListDiscoveredResourcesAPIClient, params *ListDiscoveredResourcesInput, optFns ...func(*ListDiscoveredResourcesPaginatorOptions)) *ListDiscoveredResourcesPaginator { if params == nil { params = &ListDiscoveredResourcesInput{} } options := ListDiscoveredResourcesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListDiscoveredResourcesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListDiscoveredResourcesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListDiscoveredResources page. func (p *ListDiscoveredResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDiscoveredResourcesOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxResults = limit result, err := p.client.ListDiscoveredResources(ctx, &params, 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_opListDiscoveredResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgh", OperationName: "ListDiscoveredResources", } }
235
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhub/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all, or filtered by resource name, migration tasks associated with the // user account making this call. This API has the following traits: // - Can show a summary list of the most recent migration tasks. // - Can show a summary list of migration tasks associated with a given // discovered resource. // - Lists migration tasks in a paginated interface. func (c *Client) ListMigrationTasks(ctx context.Context, params *ListMigrationTasksInput, optFns ...func(*Options)) (*ListMigrationTasksOutput, error) { if params == nil { params = &ListMigrationTasksInput{} } result, metadata, err := c.invokeOperation(ctx, "ListMigrationTasks", params, optFns, c.addOperationListMigrationTasksMiddlewares) if err != nil { return nil, err } out := result.(*ListMigrationTasksOutput) out.ResultMetadata = metadata return out, nil } type ListMigrationTasksInput struct { // Value to specify how many results are returned per page. MaxResults *int32 // If a NextToken was returned by a previous call, there are more results // available. To retrieve the next page of results, make the call again using the // returned token in NextToken . NextToken *string // Filter migration tasks by discovered resource name. ResourceName *string noSmithyDocumentSerde } type ListMigrationTasksOutput struct { // Lists the migration task's summary which includes: MigrationTaskName , // ProgressPercent , ProgressUpdateStream , Status , and the UpdateDateTime for // each task. MigrationTaskSummaryList []types.MigrationTaskSummary // If there are more migration tasks than the max result, return the next token to // be passed to the next call as a bookmark of where to start from. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListMigrationTasksMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListMigrationTasks{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListMigrationTasks{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListMigrationTasks(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 } return nil } // ListMigrationTasksAPIClient is a client that implements the ListMigrationTasks // operation. type ListMigrationTasksAPIClient interface { ListMigrationTasks(context.Context, *ListMigrationTasksInput, ...func(*Options)) (*ListMigrationTasksOutput, error) } var _ ListMigrationTasksAPIClient = (*Client)(nil) // ListMigrationTasksPaginatorOptions is the paginator options for // ListMigrationTasks type ListMigrationTasksPaginatorOptions struct { // Value to specify how many results are returned per page. 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 } // ListMigrationTasksPaginator is a paginator for ListMigrationTasks type ListMigrationTasksPaginator struct { options ListMigrationTasksPaginatorOptions client ListMigrationTasksAPIClient params *ListMigrationTasksInput nextToken *string firstPage bool } // NewListMigrationTasksPaginator returns a new ListMigrationTasksPaginator func NewListMigrationTasksPaginator(client ListMigrationTasksAPIClient, params *ListMigrationTasksInput, optFns ...func(*ListMigrationTasksPaginatorOptions)) *ListMigrationTasksPaginator { if params == nil { params = &ListMigrationTasksInput{} } options := ListMigrationTasksPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListMigrationTasksPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListMigrationTasksPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListMigrationTasks page. func (p *ListMigrationTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMigrationTasksOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxResults = limit result, err := p.client.ListMigrationTasks(ctx, &params, 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_opListMigrationTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgh", OperationName: "ListMigrationTasks", } }
231
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhub/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists progress update streams associated with the user account making this call. func (c *Client) ListProgressUpdateStreams(ctx context.Context, params *ListProgressUpdateStreamsInput, optFns ...func(*Options)) (*ListProgressUpdateStreamsOutput, error) { if params == nil { params = &ListProgressUpdateStreamsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListProgressUpdateStreams", params, optFns, c.addOperationListProgressUpdateStreamsMiddlewares) if err != nil { return nil, err } out := result.(*ListProgressUpdateStreamsOutput) out.ResultMetadata = metadata return out, nil } type ListProgressUpdateStreamsInput struct { // Filter to limit the maximum number of results to list per page. MaxResults *int32 // If a NextToken was returned by a previous call, there are more results // available. To retrieve the next page of results, make the call again using the // returned token in NextToken . NextToken *string noSmithyDocumentSerde } type ListProgressUpdateStreamsOutput struct { // If there are more streams created than the max result, return the next token to // be passed to the next call as a bookmark of where to start from. NextToken *string // List of progress update streams up to the max number of results passed in the // input. ProgressUpdateStreamSummaryList []types.ProgressUpdateStreamSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListProgressUpdateStreamsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListProgressUpdateStreams{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListProgressUpdateStreams{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListProgressUpdateStreams(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 } return nil } // ListProgressUpdateStreamsAPIClient is a client that implements the // ListProgressUpdateStreams operation. type ListProgressUpdateStreamsAPIClient interface { ListProgressUpdateStreams(context.Context, *ListProgressUpdateStreamsInput, ...func(*Options)) (*ListProgressUpdateStreamsOutput, error) } var _ ListProgressUpdateStreamsAPIClient = (*Client)(nil) // ListProgressUpdateStreamsPaginatorOptions is the paginator options for // ListProgressUpdateStreams type ListProgressUpdateStreamsPaginatorOptions struct { // Filter to limit the maximum number of results to list per page. 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 } // ListProgressUpdateStreamsPaginator is a paginator for ListProgressUpdateStreams type ListProgressUpdateStreamsPaginator struct { options ListProgressUpdateStreamsPaginatorOptions client ListProgressUpdateStreamsAPIClient params *ListProgressUpdateStreamsInput nextToken *string firstPage bool } // NewListProgressUpdateStreamsPaginator returns a new // ListProgressUpdateStreamsPaginator func NewListProgressUpdateStreamsPaginator(client ListProgressUpdateStreamsAPIClient, params *ListProgressUpdateStreamsInput, optFns ...func(*ListProgressUpdateStreamsPaginatorOptions)) *ListProgressUpdateStreamsPaginator { if params == nil { params = &ListProgressUpdateStreamsInput{} } options := ListProgressUpdateStreamsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListProgressUpdateStreamsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListProgressUpdateStreamsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListProgressUpdateStreams page. func (p *ListProgressUpdateStreamsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProgressUpdateStreamsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxResults = limit result, err := p.client.ListProgressUpdateStreams(ctx, &params, 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_opListProgressUpdateStreams(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgh", OperationName: "ListProgressUpdateStreams", } }
223
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhub/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Sets the migration state of an application. For a given application identified // by the value passed to ApplicationId , its status is set or updated by passing // one of three values to Status : NOT_STARTED | IN_PROGRESS | COMPLETED . func (c *Client) NotifyApplicationState(ctx context.Context, params *NotifyApplicationStateInput, optFns ...func(*Options)) (*NotifyApplicationStateOutput, error) { if params == nil { params = &NotifyApplicationStateInput{} } result, metadata, err := c.invokeOperation(ctx, "NotifyApplicationState", params, optFns, c.addOperationNotifyApplicationStateMiddlewares) if err != nil { return nil, err } out := result.(*NotifyApplicationStateOutput) out.ResultMetadata = metadata return out, nil } type NotifyApplicationStateInput struct { // The configurationId in Application Discovery Service that uniquely identifies // the grouped application. // // This member is required. ApplicationId *string // Status of the application - Not Started, In-Progress, Complete. // // This member is required. Status types.ApplicationStatus // Optional boolean flag to indicate whether any effect should take place. Used to // test if the caller has permission to make the call. DryRun bool // The timestamp when the application state changed. UpdateDateTime *time.Time noSmithyDocumentSerde } type NotifyApplicationStateOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationNotifyApplicationStateMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpNotifyApplicationState{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpNotifyApplicationState{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpNotifyApplicationStateValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opNotifyApplicationState(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 } return nil } func newServiceMetadataMiddleware_opNotifyApplicationState(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgh", OperationName: "NotifyApplicationState", } }
137
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhub/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Notifies Migration Hub of the current status, progress, or other detail // regarding a migration task. This API has the following traits: // - Migration tools will call the NotifyMigrationTaskState API to share the // latest progress and status. // - MigrationTaskName is used for addressing updates to the correct target. // - ProgressUpdateStream is used for access control and to provide a namespace // for each migration tool. func (c *Client) NotifyMigrationTaskState(ctx context.Context, params *NotifyMigrationTaskStateInput, optFns ...func(*Options)) (*NotifyMigrationTaskStateOutput, error) { if params == nil { params = &NotifyMigrationTaskStateInput{} } result, metadata, err := c.invokeOperation(ctx, "NotifyMigrationTaskState", params, optFns, c.addOperationNotifyMigrationTaskStateMiddlewares) if err != nil { return nil, err } out := result.(*NotifyMigrationTaskStateOutput) out.ResultMetadata = metadata return out, nil } type NotifyMigrationTaskStateInput struct { // Unique identifier that references the migration task. Do not store personal // data in this field. // // This member is required. MigrationTaskName *string // Number of seconds after the UpdateDateTime within which the Migration Hub can // expect an update. If Migration Hub does not receive an update within the // specified interval, then the migration task will be considered stale. // // This member is required. NextUpdateSeconds int32 // The name of the ProgressUpdateStream. // // This member is required. ProgressUpdateStream *string // Information about the task's progress and status. // // This member is required. Task *types.Task // The timestamp when the task was gathered. // // This member is required. UpdateDateTime *time.Time // Optional boolean flag to indicate whether any effect should take place. Used to // test if the caller has permission to make the call. DryRun bool noSmithyDocumentSerde } type NotifyMigrationTaskStateOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationNotifyMigrationTaskStateMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpNotifyMigrationTaskState{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpNotifyMigrationTaskState{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpNotifyMigrationTaskStateValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opNotifyMigrationTaskState(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 } return nil } func newServiceMetadataMiddleware_opNotifyMigrationTaskState(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgh", OperationName: "NotifyMigrationTaskState", } }
155
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhub/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Provides identifying details of the resource being migrated so that it can be // associated in the Application Discovery Service repository. This association // occurs asynchronously after PutResourceAttributes returns. // - Keep in mind that subsequent calls to PutResourceAttributes will override // previously stored attributes. For example, if it is first called with a MAC // address, but later, it is desired to add an IP address, it will then be required // to call it with both the IP and MAC addresses to prevent overriding the MAC // address. // - Note the instructions regarding the special use case of the // ResourceAttributeList (https://docs.aws.amazon.com/migrationhub/latest/ug/API_PutResourceAttributes.html#migrationhub-PutResourceAttributes-request-ResourceAttributeList) // parameter when specifying any "VM" related value. // // Because this is an asynchronous call, it will always return 200, whether an // association occurs or not. To confirm if an association was found based on the // provided details, call ListDiscoveredResources . func (c *Client) PutResourceAttributes(ctx context.Context, params *PutResourceAttributesInput, optFns ...func(*Options)) (*PutResourceAttributesOutput, error) { if params == nil { params = &PutResourceAttributesInput{} } result, metadata, err := c.invokeOperation(ctx, "PutResourceAttributes", params, optFns, c.addOperationPutResourceAttributesMiddlewares) if err != nil { return nil, err } out := result.(*PutResourceAttributesOutput) out.ResultMetadata = metadata return out, nil } type PutResourceAttributesInput struct { // Unique identifier that references the migration task. Do not store personal // data in this field. // // This member is required. MigrationTaskName *string // The name of the ProgressUpdateStream. // // This member is required. ProgressUpdateStream *string // Information about the resource that is being migrated. This data will be used // to map the task to a resource in the Application Discovery Service repository. // Takes the object array of ResourceAttribute where the Type field is reserved // for the following values: IPV4_ADDRESS | IPV6_ADDRESS | MAC_ADDRESS | FQDN | // VM_MANAGER_ID | VM_MANAGED_OBJECT_REFERENCE | VM_NAME | VM_PATH | BIOS_ID | // MOTHERBOARD_SERIAL_NUMBER where the identifying value can be a string up to 256 // characters. // - If any "VM" related value is set for a ResourceAttribute object, it is // required that VM_MANAGER_ID , as a minimum, is always set. If VM_MANAGER_ID is // not set, then all "VM" fields will be discarded and "VM" fields will not be used // for matching the migration task to a server in Application Discovery Service // repository. See the Example (https://docs.aws.amazon.com/migrationhub/latest/ug/API_PutResourceAttributes.html#API_PutResourceAttributes_Examples) // section below for a use case of specifying "VM" related values. // - If a server you are trying to match has multiple IP or MAC addresses, you // should provide as many as you know in separate type/value pairs passed to the // ResourceAttributeList parameter to maximize the chances of matching. // // This member is required. ResourceAttributeList []types.ResourceAttribute // Optional boolean flag to indicate whether any effect should take place. Used to // test if the caller has permission to make the call. DryRun bool noSmithyDocumentSerde } type PutResourceAttributesOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationPutResourceAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutResourceAttributes{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutResourceAttributes{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpPutResourceAttributesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutResourceAttributes(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 } return nil } func newServiceMetadataMiddleware_opPutResourceAttributes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgh", OperationName: "PutResourceAttributes", } }
165
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/migrationhub/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "strings" ) type awsAwsjson11_deserializeOpAssociateCreatedArtifact struct { } func (*awsAwsjson11_deserializeOpAssociateCreatedArtifact) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpAssociateCreatedArtifact) 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_deserializeOpErrorAssociateCreatedArtifact(response, &metadata) } output := &AssociateCreatedArtifactOutput{} 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_deserializeOpDocumentAssociateCreatedArtifactOutput(&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_deserializeOpErrorAssociateCreatedArtifact(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("DryRunOperation", errorCode): return awsAwsjson11_deserializeErrorDryRunOperation(response, errorBody) case strings.EqualFold("HomeRegionNotSetException", errorCode): return awsAwsjson11_deserializeErrorHomeRegionNotSetException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnauthorizedOperation", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperation(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpAssociateDiscoveredResource struct { } func (*awsAwsjson11_deserializeOpAssociateDiscoveredResource) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpAssociateDiscoveredResource) 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_deserializeOpErrorAssociateDiscoveredResource(response, &metadata) } output := &AssociateDiscoveredResourceOutput{} 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_deserializeOpDocumentAssociateDiscoveredResourceOutput(&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_deserializeOpErrorAssociateDiscoveredResource(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("DryRunOperation", errorCode): return awsAwsjson11_deserializeErrorDryRunOperation(response, errorBody) case strings.EqualFold("HomeRegionNotSetException", errorCode): return awsAwsjson11_deserializeErrorHomeRegionNotSetException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("PolicyErrorException", errorCode): return awsAwsjson11_deserializeErrorPolicyErrorException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnauthorizedOperation", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperation(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateProgressUpdateStream struct { } func (*awsAwsjson11_deserializeOpCreateProgressUpdateStream) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateProgressUpdateStream) 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_deserializeOpErrorCreateProgressUpdateStream(response, &metadata) } output := &CreateProgressUpdateStreamOutput{} 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_deserializeOpDocumentCreateProgressUpdateStreamOutput(&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_deserializeOpErrorCreateProgressUpdateStream(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("DryRunOperation", errorCode): return awsAwsjson11_deserializeErrorDryRunOperation(response, errorBody) case strings.EqualFold("HomeRegionNotSetException", errorCode): return awsAwsjson11_deserializeErrorHomeRegionNotSetException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnauthorizedOperation", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperation(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteProgressUpdateStream struct { } func (*awsAwsjson11_deserializeOpDeleteProgressUpdateStream) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteProgressUpdateStream) 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_deserializeOpErrorDeleteProgressUpdateStream(response, &metadata) } output := &DeleteProgressUpdateStreamOutput{} 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_deserializeOpDocumentDeleteProgressUpdateStreamOutput(&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_deserializeOpErrorDeleteProgressUpdateStream(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("DryRunOperation", errorCode): return awsAwsjson11_deserializeErrorDryRunOperation(response, errorBody) case strings.EqualFold("HomeRegionNotSetException", errorCode): return awsAwsjson11_deserializeErrorHomeRegionNotSetException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnauthorizedOperation", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperation(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeApplicationState struct { } func (*awsAwsjson11_deserializeOpDescribeApplicationState) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeApplicationState) 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_deserializeOpErrorDescribeApplicationState(response, &metadata) } output := &DescribeApplicationStateOutput{} 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_deserializeOpDocumentDescribeApplicationStateOutput(&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_deserializeOpErrorDescribeApplicationState(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("HomeRegionNotSetException", errorCode): return awsAwsjson11_deserializeErrorHomeRegionNotSetException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("PolicyErrorException", errorCode): return awsAwsjson11_deserializeErrorPolicyErrorException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeMigrationTask struct { } func (*awsAwsjson11_deserializeOpDescribeMigrationTask) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeMigrationTask) 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_deserializeOpErrorDescribeMigrationTask(response, &metadata) } output := &DescribeMigrationTaskOutput{} 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_deserializeOpDocumentDescribeMigrationTaskOutput(&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_deserializeOpErrorDescribeMigrationTask(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("HomeRegionNotSetException", errorCode): return awsAwsjson11_deserializeErrorHomeRegionNotSetException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDisassociateCreatedArtifact struct { } func (*awsAwsjson11_deserializeOpDisassociateCreatedArtifact) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDisassociateCreatedArtifact) 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_deserializeOpErrorDisassociateCreatedArtifact(response, &metadata) } output := &DisassociateCreatedArtifactOutput{} 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_deserializeOpDocumentDisassociateCreatedArtifactOutput(&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_deserializeOpErrorDisassociateCreatedArtifact(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("DryRunOperation", errorCode): return awsAwsjson11_deserializeErrorDryRunOperation(response, errorBody) case strings.EqualFold("HomeRegionNotSetException", errorCode): return awsAwsjson11_deserializeErrorHomeRegionNotSetException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnauthorizedOperation", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperation(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDisassociateDiscoveredResource struct { } func (*awsAwsjson11_deserializeOpDisassociateDiscoveredResource) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDisassociateDiscoveredResource) 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_deserializeOpErrorDisassociateDiscoveredResource(response, &metadata) } output := &DisassociateDiscoveredResourceOutput{} 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_deserializeOpDocumentDisassociateDiscoveredResourceOutput(&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_deserializeOpErrorDisassociateDiscoveredResource(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("DryRunOperation", errorCode): return awsAwsjson11_deserializeErrorDryRunOperation(response, errorBody) case strings.EqualFold("HomeRegionNotSetException", errorCode): return awsAwsjson11_deserializeErrorHomeRegionNotSetException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnauthorizedOperation", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperation(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpImportMigrationTask struct { } func (*awsAwsjson11_deserializeOpImportMigrationTask) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpImportMigrationTask) 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_deserializeOpErrorImportMigrationTask(response, &metadata) } output := &ImportMigrationTaskOutput{} 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_deserializeOpDocumentImportMigrationTaskOutput(&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_deserializeOpErrorImportMigrationTask(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("DryRunOperation", errorCode): return awsAwsjson11_deserializeErrorDryRunOperation(response, errorBody) case strings.EqualFold("HomeRegionNotSetException", errorCode): return awsAwsjson11_deserializeErrorHomeRegionNotSetException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnauthorizedOperation", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperation(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListApplicationStates struct { } func (*awsAwsjson11_deserializeOpListApplicationStates) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListApplicationStates) 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_deserializeOpErrorListApplicationStates(response, &metadata) } output := &ListApplicationStatesOutput{} 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_deserializeOpDocumentListApplicationStatesOutput(&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_deserializeOpErrorListApplicationStates(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("HomeRegionNotSetException", errorCode): return awsAwsjson11_deserializeErrorHomeRegionNotSetException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListCreatedArtifacts struct { } func (*awsAwsjson11_deserializeOpListCreatedArtifacts) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListCreatedArtifacts) 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_deserializeOpErrorListCreatedArtifacts(response, &metadata) } output := &ListCreatedArtifactsOutput{} 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_deserializeOpDocumentListCreatedArtifactsOutput(&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_deserializeOpErrorListCreatedArtifacts(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("HomeRegionNotSetException", errorCode): return awsAwsjson11_deserializeErrorHomeRegionNotSetException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListDiscoveredResources struct { } func (*awsAwsjson11_deserializeOpListDiscoveredResources) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListDiscoveredResources) 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_deserializeOpErrorListDiscoveredResources(response, &metadata) } output := &ListDiscoveredResourcesOutput{} 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_deserializeOpDocumentListDiscoveredResourcesOutput(&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_deserializeOpErrorListDiscoveredResources(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("HomeRegionNotSetException", errorCode): return awsAwsjson11_deserializeErrorHomeRegionNotSetException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListMigrationTasks struct { } func (*awsAwsjson11_deserializeOpListMigrationTasks) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListMigrationTasks) 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_deserializeOpErrorListMigrationTasks(response, &metadata) } output := &ListMigrationTasksOutput{} 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_deserializeOpDocumentListMigrationTasksOutput(&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_deserializeOpErrorListMigrationTasks(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("HomeRegionNotSetException", errorCode): return awsAwsjson11_deserializeErrorHomeRegionNotSetException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("PolicyErrorException", errorCode): return awsAwsjson11_deserializeErrorPolicyErrorException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListProgressUpdateStreams struct { } func (*awsAwsjson11_deserializeOpListProgressUpdateStreams) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListProgressUpdateStreams) 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_deserializeOpErrorListProgressUpdateStreams(response, &metadata) } output := &ListProgressUpdateStreamsOutput{} 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_deserializeOpDocumentListProgressUpdateStreamsOutput(&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_deserializeOpErrorListProgressUpdateStreams(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("HomeRegionNotSetException", errorCode): return awsAwsjson11_deserializeErrorHomeRegionNotSetException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpNotifyApplicationState struct { } func (*awsAwsjson11_deserializeOpNotifyApplicationState) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpNotifyApplicationState) 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_deserializeOpErrorNotifyApplicationState(response, &metadata) } output := &NotifyApplicationStateOutput{} 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_deserializeOpDocumentNotifyApplicationStateOutput(&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_deserializeOpErrorNotifyApplicationState(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("DryRunOperation", errorCode): return awsAwsjson11_deserializeErrorDryRunOperation(response, errorBody) case strings.EqualFold("HomeRegionNotSetException", errorCode): return awsAwsjson11_deserializeErrorHomeRegionNotSetException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("PolicyErrorException", errorCode): return awsAwsjson11_deserializeErrorPolicyErrorException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnauthorizedOperation", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperation(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpNotifyMigrationTaskState struct { } func (*awsAwsjson11_deserializeOpNotifyMigrationTaskState) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpNotifyMigrationTaskState) 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_deserializeOpErrorNotifyMigrationTaskState(response, &metadata) } output := &NotifyMigrationTaskStateOutput{} 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_deserializeOpDocumentNotifyMigrationTaskStateOutput(&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_deserializeOpErrorNotifyMigrationTaskState(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("DryRunOperation", errorCode): return awsAwsjson11_deserializeErrorDryRunOperation(response, errorBody) case strings.EqualFold("HomeRegionNotSetException", errorCode): return awsAwsjson11_deserializeErrorHomeRegionNotSetException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnauthorizedOperation", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperation(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpPutResourceAttributes struct { } func (*awsAwsjson11_deserializeOpPutResourceAttributes) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpPutResourceAttributes) 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_deserializeOpErrorPutResourceAttributes(response, &metadata) } output := &PutResourceAttributesOutput{} 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_deserializeOpDocumentPutResourceAttributesOutput(&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_deserializeOpErrorPutResourceAttributes(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("DryRunOperation", errorCode): return awsAwsjson11_deserializeErrorDryRunOperation(response, errorBody) case strings.EqualFold("HomeRegionNotSetException", errorCode): return awsAwsjson11_deserializeErrorHomeRegionNotSetException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnauthorizedOperation", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperation(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsAwsjson11_deserializeErrorAccessDeniedException(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.AccessDeniedException{} err := awsAwsjson11_deserializeDocumentAccessDeniedException(&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_deserializeErrorDryRunOperation(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.DryRunOperation{} err := awsAwsjson11_deserializeDocumentDryRunOperation(&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_deserializeErrorHomeRegionNotSetException(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.HomeRegionNotSetException{} err := awsAwsjson11_deserializeDocumentHomeRegionNotSetException(&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_deserializeErrorInternalServerError(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.InternalServerError{} err := awsAwsjson11_deserializeDocumentInternalServerError(&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_deserializeErrorInvalidInputException(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.InvalidInputException{} err := awsAwsjson11_deserializeDocumentInvalidInputException(&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_deserializeErrorPolicyErrorException(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.PolicyErrorException{} err := awsAwsjson11_deserializeDocumentPolicyErrorException(&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_deserializeErrorResourceNotFoundException(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.ResourceNotFoundException{} err := awsAwsjson11_deserializeDocumentResourceNotFoundException(&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_deserializeErrorServiceUnavailableException(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.ServiceUnavailableException{} err := awsAwsjson11_deserializeDocumentServiceUnavailableException(&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_deserializeErrorThrottlingException(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.ThrottlingException{} err := awsAwsjson11_deserializeDocumentThrottlingException(&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_deserializeErrorUnauthorizedOperation(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.UnauthorizedOperation{} err := awsAwsjson11_deserializeDocumentUnauthorizedOperation(&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_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, 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.AccessDeniedException if *v == nil { sv = &types.AccessDeniedException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentApplicationState(v **types.ApplicationState, 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.ApplicationState if *v == nil { sv = &types.ApplicationState{} } else { sv = *v } for key, value := range shape { switch key { case "ApplicationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationId to be of type string, got %T instead", value) } sv.ApplicationId = ptr.String(jtv) } case "ApplicationStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationStatus to be of type string, got %T instead", value) } sv.ApplicationStatus = types.ApplicationStatus(jtv) } case "LastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected UpdateDateTime to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentApplicationStateList(v *[]types.ApplicationState, 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.ApplicationState if *v == nil { cv = []types.ApplicationState{} } else { cv = *v } for _, value := range shape { var col types.ApplicationState destAddr := &col if err := awsAwsjson11_deserializeDocumentApplicationState(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentCreatedArtifact(v **types.CreatedArtifact, 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.CreatedArtifact if *v == nil { sv = &types.CreatedArtifact{} } else { sv = *v } for key, value := range shape { switch key { case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CreatedArtifactDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CreatedArtifactName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentCreatedArtifactList(v *[]types.CreatedArtifact, 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.CreatedArtifact if *v == nil { cv = []types.CreatedArtifact{} } else { cv = *v } for _, value := range shape { var col types.CreatedArtifact destAddr := &col if err := awsAwsjson11_deserializeDocumentCreatedArtifact(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentDiscoveredResource(v **types.DiscoveredResource, 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.DiscoveredResource if *v == nil { sv = &types.DiscoveredResource{} } 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 "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DiscoveredResourceDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDiscoveredResourceList(v *[]types.DiscoveredResource, 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.DiscoveredResource if *v == nil { cv = []types.DiscoveredResource{} } else { cv = *v } for _, value := range shape { var col types.DiscoveredResource destAddr := &col if err := awsAwsjson11_deserializeDocumentDiscoveredResource(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentDryRunOperation(v **types.DryRunOperation, 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.DryRunOperation if *v == nil { sv = &types.DryRunOperation{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHomeRegionNotSetException(v **types.HomeRegionNotSetException, 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.HomeRegionNotSetException if *v == nil { sv = &types.HomeRegionNotSetException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentInternalServerError(v **types.InternalServerError, 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.InternalServerError if *v == nil { sv = &types.InternalServerError{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentInvalidInputException(v **types.InvalidInputException, 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.InvalidInputException if *v == nil { sv = &types.InvalidInputException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentLatestResourceAttributeList(v *[]types.ResourceAttribute, 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.ResourceAttribute if *v == nil { cv = []types.ResourceAttribute{} } else { cv = *v } for _, value := range shape { var col types.ResourceAttribute destAddr := &col if err := awsAwsjson11_deserializeDocumentResourceAttribute(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentMigrationTask(v **types.MigrationTask, 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.MigrationTask if *v == nil { sv = &types.MigrationTask{} } else { sv = *v } for key, value := range shape { switch key { case "MigrationTaskName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MigrationTaskName to be of type string, got %T instead", value) } sv.MigrationTaskName = ptr.String(jtv) } case "ProgressUpdateStream": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProgressUpdateStream to be of type string, got %T instead", value) } sv.ProgressUpdateStream = ptr.String(jtv) } case "ResourceAttributeList": if err := awsAwsjson11_deserializeDocumentLatestResourceAttributeList(&sv.ResourceAttributeList, value); err != nil { return err } case "Task": if err := awsAwsjson11_deserializeDocumentTask(&sv.Task, value); err != nil { return err } case "UpdateDateTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected UpdateDateTime to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentMigrationTaskSummary(v **types.MigrationTaskSummary, 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.MigrationTaskSummary if *v == nil { sv = &types.MigrationTaskSummary{} } else { sv = *v } for key, value := range shape { switch key { case "MigrationTaskName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MigrationTaskName to be of type string, got %T instead", value) } sv.MigrationTaskName = ptr.String(jtv) } case "ProgressPercent": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected ProgressPercent to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ProgressPercent = ptr.Int32(int32(i64)) } case "ProgressUpdateStream": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProgressUpdateStream to be of type string, got %T instead", value) } sv.ProgressUpdateStream = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Status to be of type string, got %T instead", value) } sv.Status = types.Status(jtv) } case "StatusDetail": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StatusDetail to be of type string, got %T instead", value) } sv.StatusDetail = ptr.String(jtv) } case "UpdateDateTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected UpdateDateTime to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentMigrationTaskSummaryList(v *[]types.MigrationTaskSummary, 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.MigrationTaskSummary if *v == nil { cv = []types.MigrationTaskSummary{} } else { cv = *v } for _, value := range shape { var col types.MigrationTaskSummary destAddr := &col if err := awsAwsjson11_deserializeDocumentMigrationTaskSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentPolicyErrorException(v **types.PolicyErrorException, 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.PolicyErrorException if *v == nil { sv = &types.PolicyErrorException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentProgressUpdateStreamSummary(v **types.ProgressUpdateStreamSummary, 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.ProgressUpdateStreamSummary if *v == nil { sv = &types.ProgressUpdateStreamSummary{} } else { sv = *v } for key, value := range shape { switch key { case "ProgressUpdateStreamName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProgressUpdateStream to be of type string, got %T instead", value) } sv.ProgressUpdateStreamName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentProgressUpdateStreamSummaryList(v *[]types.ProgressUpdateStreamSummary, 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.ProgressUpdateStreamSummary if *v == nil { cv = []types.ProgressUpdateStreamSummary{} } else { cv = *v } for _, value := range shape { var col types.ProgressUpdateStreamSummary destAddr := &col if err := awsAwsjson11_deserializeDocumentProgressUpdateStreamSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentResourceAttribute(v **types.ResourceAttribute, 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.ResourceAttribute if *v == nil { sv = &types.ResourceAttribute{} } else { sv = *v } for key, value := range shape { switch key { case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceAttributeType to be of type string, got %T instead", value) } sv.Type = types.ResourceAttributeType(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceAttributeValue to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, 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.ResourceNotFoundException if *v == nil { sv = &types.ResourceNotFoundException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, 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.ServiceUnavailableException if *v == nil { sv = &types.ServiceUnavailableException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentTask(v **types.Task, 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.Task if *v == nil { sv = &types.Task{} } else { sv = *v } for key, value := range shape { switch key { case "ProgressPercent": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected ProgressPercent to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ProgressPercent = ptr.Int32(int32(i64)) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Status to be of type string, got %T instead", value) } sv.Status = types.Status(jtv) } case "StatusDetail": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StatusDetail to be of type string, got %T instead", value) } sv.StatusDetail = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentThrottlingException(v **types.ThrottlingException, 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.ThrottlingException if *v == nil { sv = &types.ThrottlingException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RetryAfterSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected RetryAfterSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RetryAfterSeconds = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentUnauthorizedOperation(v **types.UnauthorizedOperation, 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.UnauthorizedOperation if *v == nil { sv = &types.UnauthorizedOperation{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentAssociateCreatedArtifactOutput(v **AssociateCreatedArtifactOutput, 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 *AssociateCreatedArtifactOutput if *v == nil { sv = &AssociateCreatedArtifactOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentAssociateDiscoveredResourceOutput(v **AssociateDiscoveredResourceOutput, 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 *AssociateDiscoveredResourceOutput if *v == nil { sv = &AssociateDiscoveredResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateProgressUpdateStreamOutput(v **CreateProgressUpdateStreamOutput, 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 *CreateProgressUpdateStreamOutput if *v == nil { sv = &CreateProgressUpdateStreamOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeleteProgressUpdateStreamOutput(v **DeleteProgressUpdateStreamOutput, 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 *DeleteProgressUpdateStreamOutput if *v == nil { sv = &DeleteProgressUpdateStreamOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeApplicationStateOutput(v **DescribeApplicationStateOutput, 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 *DescribeApplicationStateOutput if *v == nil { sv = &DescribeApplicationStateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ApplicationStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationStatus to be of type string, got %T instead", value) } sv.ApplicationStatus = types.ApplicationStatus(jtv) } case "LastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected UpdateDateTime to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeMigrationTaskOutput(v **DescribeMigrationTaskOutput, 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 *DescribeMigrationTaskOutput if *v == nil { sv = &DescribeMigrationTaskOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MigrationTask": if err := awsAwsjson11_deserializeDocumentMigrationTask(&sv.MigrationTask, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDisassociateCreatedArtifactOutput(v **DisassociateCreatedArtifactOutput, 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 *DisassociateCreatedArtifactOutput if *v == nil { sv = &DisassociateCreatedArtifactOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDisassociateDiscoveredResourceOutput(v **DisassociateDiscoveredResourceOutput, 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 *DisassociateDiscoveredResourceOutput if *v == nil { sv = &DisassociateDiscoveredResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentImportMigrationTaskOutput(v **ImportMigrationTaskOutput, 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 *ImportMigrationTaskOutput if *v == nil { sv = &ImportMigrationTaskOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListApplicationStatesOutput(v **ListApplicationStatesOutput, 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 *ListApplicationStatesOutput if *v == nil { sv = &ListApplicationStatesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ApplicationStateList": if err := awsAwsjson11_deserializeDocumentApplicationStateList(&sv.ApplicationStateList, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Token to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListCreatedArtifactsOutput(v **ListCreatedArtifactsOutput, 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 *ListCreatedArtifactsOutput if *v == nil { sv = &ListCreatedArtifactsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "CreatedArtifactList": if err := awsAwsjson11_deserializeDocumentCreatedArtifactList(&sv.CreatedArtifactList, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Token to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListDiscoveredResourcesOutput(v **ListDiscoveredResourcesOutput, 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 *ListDiscoveredResourcesOutput if *v == nil { sv = &ListDiscoveredResourcesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DiscoveredResourceList": if err := awsAwsjson11_deserializeDocumentDiscoveredResourceList(&sv.DiscoveredResourceList, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Token to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListMigrationTasksOutput(v **ListMigrationTasksOutput, 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 *ListMigrationTasksOutput if *v == nil { sv = &ListMigrationTasksOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MigrationTaskSummaryList": if err := awsAwsjson11_deserializeDocumentMigrationTaskSummaryList(&sv.MigrationTaskSummaryList, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Token to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListProgressUpdateStreamsOutput(v **ListProgressUpdateStreamsOutput, 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 *ListProgressUpdateStreamsOutput if *v == nil { sv = &ListProgressUpdateStreamsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Token to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "ProgressUpdateStreamSummaryList": if err := awsAwsjson11_deserializeDocumentProgressUpdateStreamSummaryList(&sv.ProgressUpdateStreamSummaryList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentNotifyApplicationStateOutput(v **NotifyApplicationStateOutput, 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 *NotifyApplicationStateOutput if *v == nil { sv = &NotifyApplicationStateOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentNotifyMigrationTaskStateOutput(v **NotifyMigrationTaskStateOutput, 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 *NotifyMigrationTaskStateOutput if *v == nil { sv = &NotifyMigrationTaskStateOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentPutResourceAttributesOutput(v **PutResourceAttributesOutput, 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 *PutResourceAttributesOutput if *v == nil { sv = &PutResourceAttributesOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil }
4,356
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package migrationhub provides the API client, operations, and parameter types // for AWS Migration Hub. // // The AWS Migration Hub API methods help to obtain server and application // migration status and integrate your resource-specific migration tool by // providing a programmatic interface to Migration Hub. Remember that you must set // your AWS Migration Hub home region before you call any of these APIs, or a // HomeRegionNotSetException error will be returned. Also, you must make the API // calls while in your home region. package migrationhub
13
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" "errors" "fmt" "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" internalendpoints "github.com/aws/aws-sdk-go-v2/service/migrationhub/internal/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "net/url" "strings" ) // EndpointResolverOptions is the service endpoint resolver options type EndpointResolverOptions = internalendpoints.Options // EndpointResolver interface for resolving service endpoints. type EndpointResolver interface { ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) } var _ EndpointResolver = &internalendpoints.Resolver{} // NewDefaultEndpointResolver constructs a new service endpoint resolver func NewDefaultEndpointResolver() *internalendpoints.Resolver { return internalendpoints.New() } // EndpointResolverFunc is a helper utility that wraps a function so it satisfies // the EndpointResolver interface. This is useful when you want to add additional // endpoint resolving logic, or stub out specific endpoints with custom values. type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { return fn(region, options) } func resolveDefaultEndpointConfiguration(o *Options) { if o.EndpointResolver != nil { return } o.EndpointResolver = NewDefaultEndpointResolver() } // EndpointResolverFromURL returns an EndpointResolver configured using the // provided endpoint url. By default, the resolved endpoint resolver uses the // client region as signing region, and the endpoint source is set to // EndpointSourceCustom.You can provide functional options to configure endpoint // values for the resolved endpoint. func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} for _, fn := range optFns { fn(&e) } return EndpointResolverFunc( func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { if len(e.SigningRegion) == 0 { e.SigningRegion = region } return e, nil }, ) } type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions } func (*ResolveEndpoint) ID() string { return "ResolveEndpoint" } func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } if m.Resolver == nil { return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") } eo := m.Options eo.Logger = middleware.GetLogger(ctx) var endpoint aws.Endpoint endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) if err != nil { return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) } req.URL, err = url.Parse(endpoint.URL) if err != nil { return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) } if len(awsmiddleware.GetSigningName(ctx)) == 0 { signingName := endpoint.SigningName if len(signingName) == 0 { signingName = "mgh" } ctx = awsmiddleware.SetSigningName(ctx, signingName) } ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { return stack.Serialize.Insert(&ResolveEndpoint{ Resolver: o.EndpointResolver, Options: o.EndpointOptions, }, "OperationSerializer", middleware.Before) } func removeResolveEndpointMiddleware(stack *middleware.Stack) error { _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) return err } type wrappedEndpointResolver struct { awsResolver aws.EndpointResolverWithOptions resolver EndpointResolver } func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { if w.awsResolver == nil { goto fallback } endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) if err == nil { return endpoint, nil } if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { return endpoint, err } fallback: if w.resolver == nil { return endpoint, fmt.Errorf("default endpoint resolver provided was nil") } return w.resolver.ResolveEndpoint(region, options) } type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { return a(service, region) } var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) // withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver. // If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided // fallbackResolver for resolution. // // fallbackResolver must not be nil func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { var resolver aws.EndpointResolverWithOptions if awsResolverWithOptions != nil { resolver = awsResolverWithOptions } else if awsResolver != nil { resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) } return &wrappedEndpointResolver{ awsResolver: resolver, resolver: fallbackResolver, } } func finalizeClientEndpointResolverOptions(options *Options) { options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() if len(options.EndpointOptions.ResolvedRegion) == 0 { const fipsInfix = "-fips-" const fipsPrefix = "fips-" const fipsSuffix = "-fips" if strings.Contains(options.Region, fipsInfix) || strings.Contains(options.Region, fipsPrefix) || strings.Contains(options.Region, fipsSuffix) { options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled } } }
201
aws-sdk-go-v2
aws
Go
// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. package migrationhub // goModuleVersion is the tagged release for this module const goModuleVersion = "1.13.12"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/migrationhub/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "path" ) type awsAwsjson11_serializeOpAssociateCreatedArtifact struct { } func (*awsAwsjson11_serializeOpAssociateCreatedArtifact) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpAssociateCreatedArtifact) 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.(*AssociateCreatedArtifactInput) _ = 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("AWSMigrationHub.AssociateCreatedArtifact") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentAssociateCreatedArtifactInput(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_serializeOpAssociateDiscoveredResource struct { } func (*awsAwsjson11_serializeOpAssociateDiscoveredResource) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpAssociateDiscoveredResource) 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.(*AssociateDiscoveredResourceInput) _ = 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("AWSMigrationHub.AssociateDiscoveredResource") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentAssociateDiscoveredResourceInput(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_serializeOpCreateProgressUpdateStream struct { } func (*awsAwsjson11_serializeOpCreateProgressUpdateStream) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateProgressUpdateStream) 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.(*CreateProgressUpdateStreamInput) _ = 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("AWSMigrationHub.CreateProgressUpdateStream") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateProgressUpdateStreamInput(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_serializeOpDeleteProgressUpdateStream struct { } func (*awsAwsjson11_serializeOpDeleteProgressUpdateStream) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteProgressUpdateStream) 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.(*DeleteProgressUpdateStreamInput) _ = 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("AWSMigrationHub.DeleteProgressUpdateStream") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteProgressUpdateStreamInput(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_serializeOpDescribeApplicationState struct { } func (*awsAwsjson11_serializeOpDescribeApplicationState) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeApplicationState) 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.(*DescribeApplicationStateInput) _ = 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("AWSMigrationHub.DescribeApplicationState") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeApplicationStateInput(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_serializeOpDescribeMigrationTask struct { } func (*awsAwsjson11_serializeOpDescribeMigrationTask) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeMigrationTask) 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.(*DescribeMigrationTaskInput) _ = 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("AWSMigrationHub.DescribeMigrationTask") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeMigrationTaskInput(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_serializeOpDisassociateCreatedArtifact struct { } func (*awsAwsjson11_serializeOpDisassociateCreatedArtifact) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDisassociateCreatedArtifact) 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.(*DisassociateCreatedArtifactInput) _ = 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("AWSMigrationHub.DisassociateCreatedArtifact") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDisassociateCreatedArtifactInput(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_serializeOpDisassociateDiscoveredResource struct { } func (*awsAwsjson11_serializeOpDisassociateDiscoveredResource) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDisassociateDiscoveredResource) 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.(*DisassociateDiscoveredResourceInput) _ = 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("AWSMigrationHub.DisassociateDiscoveredResource") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDisassociateDiscoveredResourceInput(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_serializeOpImportMigrationTask struct { } func (*awsAwsjson11_serializeOpImportMigrationTask) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpImportMigrationTask) 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.(*ImportMigrationTaskInput) _ = 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("AWSMigrationHub.ImportMigrationTask") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentImportMigrationTaskInput(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_serializeOpListApplicationStates struct { } func (*awsAwsjson11_serializeOpListApplicationStates) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListApplicationStates) 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.(*ListApplicationStatesInput) _ = 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("AWSMigrationHub.ListApplicationStates") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListApplicationStatesInput(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_serializeOpListCreatedArtifacts struct { } func (*awsAwsjson11_serializeOpListCreatedArtifacts) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListCreatedArtifacts) 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.(*ListCreatedArtifactsInput) _ = 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("AWSMigrationHub.ListCreatedArtifacts") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListCreatedArtifactsInput(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_serializeOpListDiscoveredResources struct { } func (*awsAwsjson11_serializeOpListDiscoveredResources) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListDiscoveredResources) 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.(*ListDiscoveredResourcesInput) _ = 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("AWSMigrationHub.ListDiscoveredResources") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListDiscoveredResourcesInput(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_serializeOpListMigrationTasks struct { } func (*awsAwsjson11_serializeOpListMigrationTasks) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListMigrationTasks) 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.(*ListMigrationTasksInput) _ = 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("AWSMigrationHub.ListMigrationTasks") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListMigrationTasksInput(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_serializeOpListProgressUpdateStreams struct { } func (*awsAwsjson11_serializeOpListProgressUpdateStreams) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListProgressUpdateStreams) 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.(*ListProgressUpdateStreamsInput) _ = 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("AWSMigrationHub.ListProgressUpdateStreams") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListProgressUpdateStreamsInput(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_serializeOpNotifyApplicationState struct { } func (*awsAwsjson11_serializeOpNotifyApplicationState) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpNotifyApplicationState) 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.(*NotifyApplicationStateInput) _ = 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("AWSMigrationHub.NotifyApplicationState") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentNotifyApplicationStateInput(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_serializeOpNotifyMigrationTaskState struct { } func (*awsAwsjson11_serializeOpNotifyMigrationTaskState) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpNotifyMigrationTaskState) 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.(*NotifyMigrationTaskStateInput) _ = 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("AWSMigrationHub.NotifyMigrationTaskState") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentNotifyMigrationTaskStateInput(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_serializeOpPutResourceAttributes struct { } func (*awsAwsjson11_serializeOpPutResourceAttributes) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpPutResourceAttributes) 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.(*PutResourceAttributesInput) _ = 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("AWSMigrationHub.PutResourceAttributes") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentPutResourceAttributesInput(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) } func awsAwsjson11_serializeDocumentApplicationIds(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsAwsjson11_serializeDocumentCreatedArtifact(v *types.CreatedArtifact, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } return nil } func awsAwsjson11_serializeDocumentDiscoveredResource(v *types.DiscoveredResource, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ConfigurationId != nil { ok := object.Key("ConfigurationId") ok.String(*v.ConfigurationId) } if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } return nil } func awsAwsjson11_serializeDocumentResourceAttribute(v *types.ResourceAttribute, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Type) > 0 { ok := object.Key("Type") ok.String(string(v.Type)) } if v.Value != nil { ok := object.Key("Value") ok.String(*v.Value) } return nil } func awsAwsjson11_serializeDocumentResourceAttributeList(v []types.ResourceAttribute, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentResourceAttribute(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentTask(v *types.Task, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ProgressPercent != nil { ok := object.Key("ProgressPercent") ok.Integer(*v.ProgressPercent) } if len(v.Status) > 0 { ok := object.Key("Status") ok.String(string(v.Status)) } if v.StatusDetail != nil { ok := object.Key("StatusDetail") ok.String(*v.StatusDetail) } return nil } func awsAwsjson11_serializeOpDocumentAssociateCreatedArtifactInput(v *AssociateCreatedArtifactInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CreatedArtifact != nil { ok := object.Key("CreatedArtifact") if err := awsAwsjson11_serializeDocumentCreatedArtifact(v.CreatedArtifact, ok); err != nil { return err } } if v.DryRun { ok := object.Key("DryRun") ok.Boolean(v.DryRun) } if v.MigrationTaskName != nil { ok := object.Key("MigrationTaskName") ok.String(*v.MigrationTaskName) } if v.ProgressUpdateStream != nil { ok := object.Key("ProgressUpdateStream") ok.String(*v.ProgressUpdateStream) } return nil } func awsAwsjson11_serializeOpDocumentAssociateDiscoveredResourceInput(v *AssociateDiscoveredResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DiscoveredResource != nil { ok := object.Key("DiscoveredResource") if err := awsAwsjson11_serializeDocumentDiscoveredResource(v.DiscoveredResource, ok); err != nil { return err } } if v.DryRun { ok := object.Key("DryRun") ok.Boolean(v.DryRun) } if v.MigrationTaskName != nil { ok := object.Key("MigrationTaskName") ok.String(*v.MigrationTaskName) } if v.ProgressUpdateStream != nil { ok := object.Key("ProgressUpdateStream") ok.String(*v.ProgressUpdateStream) } return nil } func awsAwsjson11_serializeOpDocumentCreateProgressUpdateStreamInput(v *CreateProgressUpdateStreamInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DryRun { ok := object.Key("DryRun") ok.Boolean(v.DryRun) } if v.ProgressUpdateStreamName != nil { ok := object.Key("ProgressUpdateStreamName") ok.String(*v.ProgressUpdateStreamName) } return nil } func awsAwsjson11_serializeOpDocumentDeleteProgressUpdateStreamInput(v *DeleteProgressUpdateStreamInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DryRun { ok := object.Key("DryRun") ok.Boolean(v.DryRun) } if v.ProgressUpdateStreamName != nil { ok := object.Key("ProgressUpdateStreamName") ok.String(*v.ProgressUpdateStreamName) } return nil } func awsAwsjson11_serializeOpDocumentDescribeApplicationStateInput(v *DescribeApplicationStateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ApplicationId != nil { ok := object.Key("ApplicationId") ok.String(*v.ApplicationId) } return nil } func awsAwsjson11_serializeOpDocumentDescribeMigrationTaskInput(v *DescribeMigrationTaskInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MigrationTaskName != nil { ok := object.Key("MigrationTaskName") ok.String(*v.MigrationTaskName) } if v.ProgressUpdateStream != nil { ok := object.Key("ProgressUpdateStream") ok.String(*v.ProgressUpdateStream) } return nil } func awsAwsjson11_serializeOpDocumentDisassociateCreatedArtifactInput(v *DisassociateCreatedArtifactInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CreatedArtifactName != nil { ok := object.Key("CreatedArtifactName") ok.String(*v.CreatedArtifactName) } if v.DryRun { ok := object.Key("DryRun") ok.Boolean(v.DryRun) } if v.MigrationTaskName != nil { ok := object.Key("MigrationTaskName") ok.String(*v.MigrationTaskName) } if v.ProgressUpdateStream != nil { ok := object.Key("ProgressUpdateStream") ok.String(*v.ProgressUpdateStream) } return nil } func awsAwsjson11_serializeOpDocumentDisassociateDiscoveredResourceInput(v *DisassociateDiscoveredResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ConfigurationId != nil { ok := object.Key("ConfigurationId") ok.String(*v.ConfigurationId) } if v.DryRun { ok := object.Key("DryRun") ok.Boolean(v.DryRun) } if v.MigrationTaskName != nil { ok := object.Key("MigrationTaskName") ok.String(*v.MigrationTaskName) } if v.ProgressUpdateStream != nil { ok := object.Key("ProgressUpdateStream") ok.String(*v.ProgressUpdateStream) } return nil } func awsAwsjson11_serializeOpDocumentImportMigrationTaskInput(v *ImportMigrationTaskInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DryRun { ok := object.Key("DryRun") ok.Boolean(v.DryRun) } if v.MigrationTaskName != nil { ok := object.Key("MigrationTaskName") ok.String(*v.MigrationTaskName) } if v.ProgressUpdateStream != nil { ok := object.Key("ProgressUpdateStream") ok.String(*v.ProgressUpdateStream) } return nil } func awsAwsjson11_serializeOpDocumentListApplicationStatesInput(v *ListApplicationStatesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ApplicationIds != nil { ok := object.Key("ApplicationIds") if err := awsAwsjson11_serializeDocumentApplicationIds(v.ApplicationIds, ok); err != nil { return err } } if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } return nil } func awsAwsjson11_serializeOpDocumentListCreatedArtifactsInput(v *ListCreatedArtifactsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.MigrationTaskName != nil { ok := object.Key("MigrationTaskName") ok.String(*v.MigrationTaskName) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } if v.ProgressUpdateStream != nil { ok := object.Key("ProgressUpdateStream") ok.String(*v.ProgressUpdateStream) } return nil } func awsAwsjson11_serializeOpDocumentListDiscoveredResourcesInput(v *ListDiscoveredResourcesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.MigrationTaskName != nil { ok := object.Key("MigrationTaskName") ok.String(*v.MigrationTaskName) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } if v.ProgressUpdateStream != nil { ok := object.Key("ProgressUpdateStream") ok.String(*v.ProgressUpdateStream) } return nil } func awsAwsjson11_serializeOpDocumentListMigrationTasksInput(v *ListMigrationTasksInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } if v.ResourceName != nil { ok := object.Key("ResourceName") ok.String(*v.ResourceName) } return nil } func awsAwsjson11_serializeOpDocumentListProgressUpdateStreamsInput(v *ListProgressUpdateStreamsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } return nil } func awsAwsjson11_serializeOpDocumentNotifyApplicationStateInput(v *NotifyApplicationStateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ApplicationId != nil { ok := object.Key("ApplicationId") ok.String(*v.ApplicationId) } if v.DryRun { ok := object.Key("DryRun") ok.Boolean(v.DryRun) } if len(v.Status) > 0 { ok := object.Key("Status") ok.String(string(v.Status)) } if v.UpdateDateTime != nil { ok := object.Key("UpdateDateTime") ok.Double(smithytime.FormatEpochSeconds(*v.UpdateDateTime)) } return nil } func awsAwsjson11_serializeOpDocumentNotifyMigrationTaskStateInput(v *NotifyMigrationTaskStateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DryRun { ok := object.Key("DryRun") ok.Boolean(v.DryRun) } if v.MigrationTaskName != nil { ok := object.Key("MigrationTaskName") ok.String(*v.MigrationTaskName) } { ok := object.Key("NextUpdateSeconds") ok.Integer(v.NextUpdateSeconds) } if v.ProgressUpdateStream != nil { ok := object.Key("ProgressUpdateStream") ok.String(*v.ProgressUpdateStream) } if v.Task != nil { ok := object.Key("Task") if err := awsAwsjson11_serializeDocumentTask(v.Task, ok); err != nil { return err } } if v.UpdateDateTime != nil { ok := object.Key("UpdateDateTime") ok.Double(smithytime.FormatEpochSeconds(*v.UpdateDateTime)) } return nil } func awsAwsjson11_serializeOpDocumentPutResourceAttributesInput(v *PutResourceAttributesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DryRun { ok := object.Key("DryRun") ok.Boolean(v.DryRun) } if v.MigrationTaskName != nil { ok := object.Key("MigrationTaskName") ok.String(*v.MigrationTaskName) } if v.ProgressUpdateStream != nil { ok := object.Key("ProgressUpdateStream") ok.String(*v.ProgressUpdateStream) } if v.ResourceAttributeList != nil { ok := object.Key("ResourceAttributeList") if err := awsAwsjson11_serializeDocumentResourceAttributeList(v.ResourceAttributeList, ok); err != nil { return err } } return nil }
1,458
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhub import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/migrationhub/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpAssociateCreatedArtifact struct { } func (*validateOpAssociateCreatedArtifact) ID() string { return "OperationInputValidation" } func (m *validateOpAssociateCreatedArtifact) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AssociateCreatedArtifactInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAssociateCreatedArtifactInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpAssociateDiscoveredResource struct { } func (*validateOpAssociateDiscoveredResource) ID() string { return "OperationInputValidation" } func (m *validateOpAssociateDiscoveredResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AssociateDiscoveredResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAssociateDiscoveredResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateProgressUpdateStream struct { } func (*validateOpCreateProgressUpdateStream) ID() string { return "OperationInputValidation" } func (m *validateOpCreateProgressUpdateStream) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateProgressUpdateStreamInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateProgressUpdateStreamInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteProgressUpdateStream struct { } func (*validateOpDeleteProgressUpdateStream) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteProgressUpdateStream) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteProgressUpdateStreamInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteProgressUpdateStreamInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeApplicationState struct { } func (*validateOpDescribeApplicationState) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeApplicationState) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeApplicationStateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeApplicationStateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeMigrationTask struct { } func (*validateOpDescribeMigrationTask) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeMigrationTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeMigrationTaskInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeMigrationTaskInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDisassociateCreatedArtifact struct { } func (*validateOpDisassociateCreatedArtifact) ID() string { return "OperationInputValidation" } func (m *validateOpDisassociateCreatedArtifact) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DisassociateCreatedArtifactInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDisassociateCreatedArtifactInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDisassociateDiscoveredResource struct { } func (*validateOpDisassociateDiscoveredResource) ID() string { return "OperationInputValidation" } func (m *validateOpDisassociateDiscoveredResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DisassociateDiscoveredResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDisassociateDiscoveredResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpImportMigrationTask struct { } func (*validateOpImportMigrationTask) ID() string { return "OperationInputValidation" } func (m *validateOpImportMigrationTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ImportMigrationTaskInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpImportMigrationTaskInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListCreatedArtifacts struct { } func (*validateOpListCreatedArtifacts) ID() string { return "OperationInputValidation" } func (m *validateOpListCreatedArtifacts) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListCreatedArtifactsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListCreatedArtifactsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListDiscoveredResources struct { } func (*validateOpListDiscoveredResources) ID() string { return "OperationInputValidation" } func (m *validateOpListDiscoveredResources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListDiscoveredResourcesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListDiscoveredResourcesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpNotifyApplicationState struct { } func (*validateOpNotifyApplicationState) ID() string { return "OperationInputValidation" } func (m *validateOpNotifyApplicationState) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*NotifyApplicationStateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpNotifyApplicationStateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpNotifyMigrationTaskState struct { } func (*validateOpNotifyMigrationTaskState) ID() string { return "OperationInputValidation" } func (m *validateOpNotifyMigrationTaskState) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*NotifyMigrationTaskStateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpNotifyMigrationTaskStateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpPutResourceAttributes struct { } func (*validateOpPutResourceAttributes) ID() string { return "OperationInputValidation" } func (m *validateOpPutResourceAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PutResourceAttributesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPutResourceAttributesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpAssociateCreatedArtifactValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociateCreatedArtifact{}, middleware.After) } func addOpAssociateDiscoveredResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociateDiscoveredResource{}, middleware.After) } func addOpCreateProgressUpdateStreamValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateProgressUpdateStream{}, middleware.After) } func addOpDeleteProgressUpdateStreamValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteProgressUpdateStream{}, middleware.After) } func addOpDescribeApplicationStateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeApplicationState{}, middleware.After) } func addOpDescribeMigrationTaskValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeMigrationTask{}, middleware.After) } func addOpDisassociateCreatedArtifactValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisassociateCreatedArtifact{}, middleware.After) } func addOpDisassociateDiscoveredResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisassociateDiscoveredResource{}, middleware.After) } func addOpImportMigrationTaskValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpImportMigrationTask{}, middleware.After) } func addOpListCreatedArtifactsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListCreatedArtifacts{}, middleware.After) } func addOpListDiscoveredResourcesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListDiscoveredResources{}, middleware.After) } func addOpNotifyApplicationStateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpNotifyApplicationState{}, middleware.After) } func addOpNotifyMigrationTaskStateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpNotifyMigrationTaskState{}, middleware.After) } func addOpPutResourceAttributesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutResourceAttributes{}, middleware.After) } func validateCreatedArtifact(v *types.CreatedArtifact) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreatedArtifact"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDiscoveredResource(v *types.DiscoveredResource) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DiscoveredResource"} if v.ConfigurationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ConfigurationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateResourceAttribute(v *types.ResourceAttribute) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ResourceAttribute"} if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } if v.Value == nil { invalidParams.Add(smithy.NewErrParamRequired("Value")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateResourceAttributeList(v []types.ResourceAttribute) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ResourceAttributeList"} for i := range v { if err := validateResourceAttribute(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTask(v *types.Task) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Task"} if len(v.Status) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Status")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAssociateCreatedArtifactInput(v *AssociateCreatedArtifactInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AssociateCreatedArtifactInput"} if v.ProgressUpdateStream == nil { invalidParams.Add(smithy.NewErrParamRequired("ProgressUpdateStream")) } if v.MigrationTaskName == nil { invalidParams.Add(smithy.NewErrParamRequired("MigrationTaskName")) } if v.CreatedArtifact == nil { invalidParams.Add(smithy.NewErrParamRequired("CreatedArtifact")) } else if v.CreatedArtifact != nil { if err := validateCreatedArtifact(v.CreatedArtifact); err != nil { invalidParams.AddNested("CreatedArtifact", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAssociateDiscoveredResourceInput(v *AssociateDiscoveredResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AssociateDiscoveredResourceInput"} if v.ProgressUpdateStream == nil { invalidParams.Add(smithy.NewErrParamRequired("ProgressUpdateStream")) } if v.MigrationTaskName == nil { invalidParams.Add(smithy.NewErrParamRequired("MigrationTaskName")) } if v.DiscoveredResource == nil { invalidParams.Add(smithy.NewErrParamRequired("DiscoveredResource")) } else if v.DiscoveredResource != nil { if err := validateDiscoveredResource(v.DiscoveredResource); err != nil { invalidParams.AddNested("DiscoveredResource", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateProgressUpdateStreamInput(v *CreateProgressUpdateStreamInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateProgressUpdateStreamInput"} if v.ProgressUpdateStreamName == nil { invalidParams.Add(smithy.NewErrParamRequired("ProgressUpdateStreamName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteProgressUpdateStreamInput(v *DeleteProgressUpdateStreamInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteProgressUpdateStreamInput"} if v.ProgressUpdateStreamName == nil { invalidParams.Add(smithy.NewErrParamRequired("ProgressUpdateStreamName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeApplicationStateInput(v *DescribeApplicationStateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeApplicationStateInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeMigrationTaskInput(v *DescribeMigrationTaskInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeMigrationTaskInput"} if v.ProgressUpdateStream == nil { invalidParams.Add(smithy.NewErrParamRequired("ProgressUpdateStream")) } if v.MigrationTaskName == nil { invalidParams.Add(smithy.NewErrParamRequired("MigrationTaskName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDisassociateCreatedArtifactInput(v *DisassociateCreatedArtifactInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DisassociateCreatedArtifactInput"} if v.ProgressUpdateStream == nil { invalidParams.Add(smithy.NewErrParamRequired("ProgressUpdateStream")) } if v.MigrationTaskName == nil { invalidParams.Add(smithy.NewErrParamRequired("MigrationTaskName")) } if v.CreatedArtifactName == nil { invalidParams.Add(smithy.NewErrParamRequired("CreatedArtifactName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDisassociateDiscoveredResourceInput(v *DisassociateDiscoveredResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DisassociateDiscoveredResourceInput"} if v.ProgressUpdateStream == nil { invalidParams.Add(smithy.NewErrParamRequired("ProgressUpdateStream")) } if v.MigrationTaskName == nil { invalidParams.Add(smithy.NewErrParamRequired("MigrationTaskName")) } if v.ConfigurationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ConfigurationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpImportMigrationTaskInput(v *ImportMigrationTaskInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ImportMigrationTaskInput"} if v.ProgressUpdateStream == nil { invalidParams.Add(smithy.NewErrParamRequired("ProgressUpdateStream")) } if v.MigrationTaskName == nil { invalidParams.Add(smithy.NewErrParamRequired("MigrationTaskName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListCreatedArtifactsInput(v *ListCreatedArtifactsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListCreatedArtifactsInput"} if v.ProgressUpdateStream == nil { invalidParams.Add(smithy.NewErrParamRequired("ProgressUpdateStream")) } if v.MigrationTaskName == nil { invalidParams.Add(smithy.NewErrParamRequired("MigrationTaskName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListDiscoveredResourcesInput(v *ListDiscoveredResourcesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListDiscoveredResourcesInput"} if v.ProgressUpdateStream == nil { invalidParams.Add(smithy.NewErrParamRequired("ProgressUpdateStream")) } if v.MigrationTaskName == nil { invalidParams.Add(smithy.NewErrParamRequired("MigrationTaskName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpNotifyApplicationStateInput(v *NotifyApplicationStateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "NotifyApplicationStateInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if len(v.Status) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Status")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpNotifyMigrationTaskStateInput(v *NotifyMigrationTaskStateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "NotifyMigrationTaskStateInput"} if v.ProgressUpdateStream == nil { invalidParams.Add(smithy.NewErrParamRequired("ProgressUpdateStream")) } if v.MigrationTaskName == nil { invalidParams.Add(smithy.NewErrParamRequired("MigrationTaskName")) } if v.Task == nil { invalidParams.Add(smithy.NewErrParamRequired("Task")) } else if v.Task != nil { if err := validateTask(v.Task); err != nil { invalidParams.AddNested("Task", err.(smithy.InvalidParamsError)) } } if v.UpdateDateTime == nil { invalidParams.Add(smithy.NewErrParamRequired("UpdateDateTime")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpPutResourceAttributesInput(v *PutResourceAttributesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PutResourceAttributesInput"} if v.ProgressUpdateStream == nil { invalidParams.Add(smithy.NewErrParamRequired("ProgressUpdateStream")) } if v.MigrationTaskName == nil { invalidParams.Add(smithy.NewErrParamRequired("MigrationTaskName")) } if v.ResourceAttributeList == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceAttributeList")) } else if v.ResourceAttributeList != nil { if err := validateResourceAttributeList(v.ResourceAttributeList); err != nil { invalidParams.AddNested("ResourceAttributeList", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
708
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package endpoints import ( "github.com/aws/aws-sdk-go-v2/aws" endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" "github.com/aws/smithy-go/logging" "regexp" ) // Options is the endpoint resolver configuration options type Options struct { // Logger is a logging implementation that log events should be sent to. Logger logging.Logger // LogDeprecated indicates that deprecated endpoints should be logged to the // provided logger. LogDeprecated bool // ResolvedRegion is used to override the region to be resolved, rather then the // using the value passed to the ResolveEndpoint method. This value is used by the // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative // name. You must not set this value directly in your application. ResolvedRegion string // DisableHTTPS informs the resolver to return an endpoint that does not use the // HTTPS scheme. DisableHTTPS bool // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. UseDualStackEndpoint aws.DualStackEndpointState // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. UseFIPSEndpoint aws.FIPSEndpointState } func (o Options) GetResolvedRegion() string { return o.ResolvedRegion } func (o Options) GetDisableHTTPS() bool { return o.DisableHTTPS } func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { return o.UseDualStackEndpoint } func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { return o.UseFIPSEndpoint } func transformToSharedOptions(options Options) endpoints.Options { return endpoints.Options{ Logger: options.Logger, LogDeprecated: options.LogDeprecated, ResolvedRegion: options.ResolvedRegion, DisableHTTPS: options.DisableHTTPS, UseDualStackEndpoint: options.UseDualStackEndpoint, UseFIPSEndpoint: options.UseFIPSEndpoint, } } // Resolver Migration Hub endpoint resolver type Resolver struct { partitions endpoints.Partitions } // ResolveEndpoint resolves the service endpoint for the given region and options func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { if len(region) == 0 { return endpoint, &aws.MissingRegionError{} } opt := transformToSharedOptions(options) return r.partitions.ResolveEndpoint(region, opt) } // New returns a new Resolver func New() *Resolver { return &Resolver{ partitions: defaultPartitions, } } var partitionRegexp = struct { Aws *regexp.Regexp AwsCn *regexp.Regexp AwsIso *regexp.Regexp AwsIsoB *regexp.Regexp AwsIsoE *regexp.Regexp AwsIsoF *regexp.Regexp AwsUsGov *regexp.Regexp }{ Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), } var defaultPartitions = endpoints.Partitions{ { ID: "aws", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "mgh.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "mgh-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "mgh-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mgh.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "mgh.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "mgh-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "mgh-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mgh.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, }, { ID: "aws-iso", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "mgh-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mgh.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, }, { ID: "aws-iso-b", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "mgh-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mgh.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, }, { ID: "aws-iso-e", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "mgh-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mgh.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoE, IsRegionalized: true, }, { ID: "aws-iso-f", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "mgh-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mgh.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoF, IsRegionalized: true, }, { ID: "aws-us-gov", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "mgh.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "mgh-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "mgh-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mgh.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, }, }
320
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package endpoints import ( "testing" ) func TestRegexCompile(t *testing.T) { _ = defaultPartitions }
12
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types type ApplicationStatus string // Enum values for ApplicationStatus const ( ApplicationStatusNotStarted ApplicationStatus = "NOT_STARTED" ApplicationStatusInProgress ApplicationStatus = "IN_PROGRESS" ApplicationStatusCompleted ApplicationStatus = "COMPLETED" ) // Values returns all known values for ApplicationStatus. 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 (ApplicationStatus) Values() []ApplicationStatus { return []ApplicationStatus{ "NOT_STARTED", "IN_PROGRESS", "COMPLETED", } } type ResourceAttributeType string // Enum values for ResourceAttributeType const ( ResourceAttributeTypeIpv4Address ResourceAttributeType = "IPV4_ADDRESS" ResourceAttributeTypeIpv6Address ResourceAttributeType = "IPV6_ADDRESS" ResourceAttributeTypeMacAddress ResourceAttributeType = "MAC_ADDRESS" ResourceAttributeTypeFqdn ResourceAttributeType = "FQDN" ResourceAttributeTypeVmManagerId ResourceAttributeType = "VM_MANAGER_ID" ResourceAttributeTypeVmManagedObjectReference ResourceAttributeType = "VM_MANAGED_OBJECT_REFERENCE" ResourceAttributeTypeVmName ResourceAttributeType = "VM_NAME" ResourceAttributeTypeVmPath ResourceAttributeType = "VM_PATH" ResourceAttributeTypeBiosId ResourceAttributeType = "BIOS_ID" ResourceAttributeTypeMotherboardSerialNumber ResourceAttributeType = "MOTHERBOARD_SERIAL_NUMBER" ) // Values returns all known values for ResourceAttributeType. 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 (ResourceAttributeType) Values() []ResourceAttributeType { return []ResourceAttributeType{ "IPV4_ADDRESS", "IPV6_ADDRESS", "MAC_ADDRESS", "FQDN", "VM_MANAGER_ID", "VM_MANAGED_OBJECT_REFERENCE", "VM_NAME", "VM_PATH", "BIOS_ID", "MOTHERBOARD_SERIAL_NUMBER", } } type Status string // Enum values for Status const ( StatusNotStarted Status = "NOT_STARTED" StatusInProgress Status = "IN_PROGRESS" StatusFailed Status = "FAILED" StatusCompleted Status = "COMPLETED" ) // Values returns all known values for Status. 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 (Status) Values() []Status { return []Status{ "NOT_STARTED", "IN_PROGRESS", "FAILED", "COMPLETED", } }
80
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( "fmt" smithy "github.com/aws/smithy-go" ) // You do not have sufficient access to perform this action. type AccessDeniedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AccessDeniedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccessDeniedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccessDeniedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccessDeniedException" } return *e.ErrorCodeOverride } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Exception raised to indicate a successfully authorized action when the DryRun // flag is set to "true". type DryRunOperation struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *DryRunOperation) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *DryRunOperation) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *DryRunOperation) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "DryRunOperation" } return *e.ErrorCodeOverride } func (e *DryRunOperation) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The home region is not set. Set the home region to continue. type HomeRegionNotSetException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *HomeRegionNotSetException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *HomeRegionNotSetException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *HomeRegionNotSetException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "HomeRegionNotSetException" } return *e.ErrorCodeOverride } func (e *HomeRegionNotSetException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Exception raised when an internal, configuration, or dependency error is // encountered. type InternalServerError struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InternalServerError) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalServerError) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalServerError) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalServerError" } return *e.ErrorCodeOverride } func (e *InternalServerError) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // Exception raised when the provided input violates a policy constraint or is // entered in the wrong format or data type. type InvalidInputException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidInputException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidInputException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidInputException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidInputException" } return *e.ErrorCodeOverride } func (e *InvalidInputException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Exception raised when there are problems accessing Application Discovery // Service (Application Discovery Service); most likely due to a misconfigured // policy or the migrationhub-discovery role is missing or not configured // correctly. type PolicyErrorException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *PolicyErrorException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *PolicyErrorException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *PolicyErrorException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "PolicyErrorException" } return *e.ErrorCodeOverride } func (e *PolicyErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Exception raised when the request references a resource (Application Discovery // Service configuration, update stream, migration task, etc.) that does not exist // in Application Discovery Service (Application Discovery Service) or in Migration // Hub's repository. type ResourceNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ResourceNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceNotFoundException" } return *e.ErrorCodeOverride } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Exception raised when there is an internal, configuration, or dependency error // encountered. type ServiceUnavailableException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ServiceUnavailableException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ServiceUnavailableException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ServiceUnavailableException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ServiceUnavailableException" } return *e.ErrorCodeOverride } func (e *ServiceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // The request was denied due to request throttling. type ThrottlingException struct { Message *string ErrorCodeOverride *string RetryAfterSeconds int32 noSmithyDocumentSerde } func (e *ThrottlingException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ThrottlingException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ThrottlingException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ThrottlingException" } return *e.ErrorCodeOverride } func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Exception raised to indicate a request was not authorized when the DryRun flag // is set to "true". type UnauthorizedOperation struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *UnauthorizedOperation) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *UnauthorizedOperation) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *UnauthorizedOperation) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "UnauthorizedOperation" } return *e.ErrorCodeOverride } func (e *UnauthorizedOperation) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
282
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( smithydocument "github.com/aws/smithy-go/document" "time" ) // The state of an application discovered through Migration Hub import, the AWS // Agentless Discovery Connector, or the AWS Application Discovery Agent. type ApplicationState struct { // The configurationId from the Application Discovery Service that uniquely // identifies an application. ApplicationId *string // The current status of an application. ApplicationStatus ApplicationStatus // The timestamp when the application status was last updated. LastUpdatedTime *time.Time noSmithyDocumentSerde } // An ARN of the AWS cloud resource target receiving the migration (e.g., AMI, EC2 // instance, RDS instance, etc.). type CreatedArtifact struct { // An ARN that uniquely identifies the result of a migration task. // // This member is required. Name *string // A description that can be free-form text to record additional detail about the // artifact for clarity or for later reference. Description *string noSmithyDocumentSerde } // Object representing the on-premises resource being migrated. type DiscoveredResource struct { // The configurationId in Application Discovery Service that uniquely identifies // the on-premise resource. // // This member is required. ConfigurationId *string // A description that can be free-form text to record additional detail about the // discovered resource for clarity or later reference. Description *string noSmithyDocumentSerde } // Represents a migration task in a migration tool. type MigrationTask struct { // Unique identifier that references the migration task. Do not store personal // data in this field. MigrationTaskName *string // A name that identifies the vendor of the migration tool being used. ProgressUpdateStream *string // Information about the resource that is being migrated. This data will be used // to map the task to a resource in the Application Discovery Service repository. ResourceAttributeList []ResourceAttribute // Task object encapsulating task information. Task *Task // The timestamp when the task was gathered. UpdateDateTime *time.Time noSmithyDocumentSerde } // MigrationTaskSummary includes MigrationTaskName , ProgressPercent , // ProgressUpdateStream , Status , and UpdateDateTime for each task. type MigrationTaskSummary struct { // Unique identifier that references the migration task. Do not store personal // data in this field. MigrationTaskName *string // Indication of the percentage completion of the task. ProgressPercent *int32 // An AWS resource used for access control. It should uniquely identify the // migration tool as it is used for all updates made by the tool. ProgressUpdateStream *string // Status of the task. Status Status // Detail information of what is being done within the overall status state. StatusDetail *string // The timestamp when the task was gathered. UpdateDateTime *time.Time noSmithyDocumentSerde } // Summary of the AWS resource used for access control that is implicitly linked // to your AWS account. type ProgressUpdateStreamSummary struct { // The name of the ProgressUpdateStream. Do not store personal data in this field. ProgressUpdateStreamName *string noSmithyDocumentSerde } // Attribute associated with a resource. Note the corresponding format required // per type listed below: IPV4 x.x.x.x where x is an integer in the range [0,255] // IPV6 y : y : y : y : y : y : y : y where y is a hexadecimal between 0 and FFFF. // [0, FFFF] MAC_ADDRESS ^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$ FQDN // ^[^<>{}\\/?,=\p{Cntrl}]{1,256}$ type ResourceAttribute struct { // Type of resource. // // This member is required. Type ResourceAttributeType // Value of the resource type. // // This member is required. Value *string noSmithyDocumentSerde } // Task object encapsulating task information. type Task struct { // Status of the task - Not Started, In-Progress, Complete. // // This member is required. Status Status // Indication of the percentage completion of the task. ProgressPercent *int32 // Details of task status as notified by a migration tool. A tool might use this // field to provide clarifying information about the status that is unique to that // tool or that explains an error state. StatusDetail *string noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
159
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhubconfig import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/defaults" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "net" "net/http" "time" ) const ServiceID = "MigrationHub Config" const ServiceAPIVersion = "2019-06-30" // Client provides the API client to make operations call for AWS Migration Hub // Config. type Client struct { options Options } // New returns an initialized Client based on the functional options. Provide // additional functional options to further configure the behavior of the client, // such as changing the client's endpoint or adding custom middleware behavior. func New(options Options, optFns ...func(*Options)) *Client { options = options.Copy() resolveDefaultLogger(&options) setResolvedDefaultsMode(&options) resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) resolveDefaultEndpointConfiguration(&options) for _, fn := range optFns { fn(&options) } client := &Client{ options: options, } return client } type Options struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // Configures the events that will be sent to the configured logger. ClientLogMode aws.ClientLogMode // The credentials object to use when signing requests. Credentials aws.CredentialsProvider // The configuration DefaultsMode that the SDK should use when constructing the // clients initial default settings. DefaultsMode aws.DefaultsMode // The endpoint options to be used when attempting to resolve an endpoint. EndpointOptions EndpointResolverOptions // The service endpoint resolver. EndpointResolver EndpointResolver // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 // The logger writer interface to write logging messages to. Logger logging.Logger // The region to send requests to. (Required) Region string // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify // per operation call's retry max attempts. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. If specified in an operation call's functional // options with a value that is different than the constructed client's Options, // the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if // Retryer option is not also specified. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. Currently does not support per operation call // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. The kind of // default retry created by the API client can be changed with the RetryMode // option. Retryer aws.Retryer // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You // should not populate this structure programmatically, or rely on the values here // within your applications. RuntimeEnvironment aws.RuntimeEnvironment // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved // value was at that point in time. Currently does not support per operation call // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient } // WithAPIOptions returns a functional option for setting the Client's APIOptions // option. func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { return func(o *Options) { o.APIOptions = append(o.APIOptions, optFns...) } } // WithEndpointResolver returns a functional option for setting the Client's // EndpointResolver option. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v } } type HTTPClient interface { Do(*http.Request) (*http.Response, error) } // Copy creates a clone where the APIOptions list is deep copied. func (o Options) Copy() Options { to := o to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) copy(to.APIOptions, o.APIOptions) return to } func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() for _, fn := range optFns { fn(&options) } finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err } } for _, fn := range options.APIOptions { if err := fn(stack); err != nil { return nil, metadata, err } } handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) result, metadata, err = handler.Handle(ctx, params) if err != nil { err = &smithy.OperationError{ ServiceID: ServiceID, OperationName: opID, Err: err, } } return result, metadata, err } type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { if o.Logger != nil { return } o.Logger = logging.Nop{} } func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } func setResolvedDefaultsMode(o *Options) { if len(o.resolvedDefaultsMode) > 0 { return } var mode aws.DefaultsMode mode.SetFromString(string(o.DefaultsMode)) if mode == aws.DefaultsModeAuto { mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) } o.resolvedDefaultsMode = mode } // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, DefaultsMode: cfg.DefaultsMode, RuntimeEnvironment: cfg.RuntimeEnvironment, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { var buildable *awshttp.BuildableClient if o.HTTPClient != nil { var ok bool buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) if !ok { return } } else { buildable = awshttp.NewBuildableClient() } modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { dialer.Timeout = dialerTimeout } }) buildable = buildable.WithTransportOptions(func(transport *http.Transport) { if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { transport.TLSHandshakeTimeout = tlsHandshakeTimeout } }) } o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } if len(o.RetryMode) == 0 { modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { o.RetryMode = modeConfig.RetryMode } } if len(o.RetryMode) == 0 { o.RetryMode = aws.RetryModeStandard } var standardOptions []func(*retry.StandardOptions) if v := o.RetryMaxAttempts; v != 0 { standardOptions = append(standardOptions, func(so *retry.StandardOptions) { so.MaxAttempts = v }) } switch o.RetryMode { case aws.RetryModeAdaptive: var adaptiveOptions []func(*retry.AdaptiveModeOptions) if len(standardOptions) != 0 { adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { ao.StandardOptions = append(ao.StandardOptions, standardOptions...) }) } o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) default: o.Retryer = retry.NewStandard(standardOptions...) } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { if cfg.Retryer == nil { return } o.Retryer = cfg.Retryer() } func resolveAWSRetryMode(cfg aws.Config, o *Options) { if len(cfg.RetryMode) == 0 { return } o.RetryMode = cfg.RetryMode } func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { if cfg.RetryMaxAttempts == 0 { return } o.RetryMaxAttempts = cfg.RetryMaxAttempts } func finalizeRetryMaxAttemptOptions(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { return } o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) } func addClientUserAgent(stack *middleware.Stack) error { return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "migrationhubconfig", goModuleVersion)(stack) } func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ CredentialsProvider: o.Credentials, Signer: o.HTTPSignerV4, LogSigning: o.ClientLogMode.IsSigning(), }) return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error } func resolveHTTPSignerV4(o *Options) { if o.HTTPSignerV4 != nil { return } o.HTTPSignerV4 = newDefaultV4Signer(*o) } func newDefaultV4Signer(o Options) *v4.Signer { return v4.NewSigner(func(so *v4.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() }) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, LogRetryAttempts: o.ClientLogMode.IsRetries(), } return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseDualStackEndpoint = value } return nil } // resolves FIPS endpoint configuration func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseFIPSEndpoint = value } return nil } func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ LogRequest: o.ClientLogMode.IsRequest(), LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), LogResponse: o.ClientLogMode.IsResponse(), LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) }
435
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhubconfig import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "io/ioutil" "net/http" "strings" "testing" ) func TestClient_resolveRetryOptions(t *testing.T) { nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { return &http.Response{ StatusCode: 200, Header: http.Header{}, Body: ioutil.NopCloser(strings.NewReader("")), }, nil }) cases := map[string]struct { defaultsMode aws.DefaultsMode retryer aws.Retryer retryMaxAttempts int opRetryMaxAttempts *int retryMode aws.RetryMode expectClientRetryMode aws.RetryMode expectClientMaxAttempts int expectOpMaxAttempts int }{ "defaults": { defaultsMode: aws.DefaultsModeStandard, expectClientRetryMode: aws.RetryModeStandard, expectClientMaxAttempts: 3, expectOpMaxAttempts: 3, }, "custom default retry": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, "custom op max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(2), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 2, }, "custom op no change max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(10), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, "custom op 0 max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(0), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, } for name, c := range cases { t.Run(name, func(t *testing.T) { client := NewFromConfig(aws.Config{ DefaultsMode: c.defaultsMode, Retryer: func() func() aws.Retryer { if c.retryer == nil { return nil } return func() aws.Retryer { return c.retryer } }(), HTTPClient: nopClient, RetryMaxAttempts: c.retryMaxAttempts, RetryMode: c.retryMode, }) if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { t.Errorf("expect %v retry mode, got %v", e, a) } if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { t.Errorf("expect %v max attempts, got %v", e, a) } _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, []func(*Options){ func(o *Options) { if c.opRetryMaxAttempts == nil { return } o.RetryMaxAttempts = *c.opRetryMaxAttempts }, }, func(s *middleware.Stack, o Options) error { s.Initialize.Clear() s.Serialize.Clear() s.Build.Clear() s.Finalize.Clear() s.Deserialize.Clear() if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { t.Errorf("expect %v op max attempts, got %v", e, a) } return nil }) if err != nil { t.Fatalf("expect no operation error, got %v", err) } }) } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhubconfig import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhubconfig/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // This API sets up the home region for the calling account only. func (c *Client) CreateHomeRegionControl(ctx context.Context, params *CreateHomeRegionControlInput, optFns ...func(*Options)) (*CreateHomeRegionControlOutput, error) { if params == nil { params = &CreateHomeRegionControlInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateHomeRegionControl", params, optFns, c.addOperationCreateHomeRegionControlMiddlewares) if err != nil { return nil, err } out := result.(*CreateHomeRegionControlOutput) out.ResultMetadata = metadata return out, nil } type CreateHomeRegionControlInput struct { // The name of the home region of the calling account. // // This member is required. HomeRegion *string // The account for which this command sets up a home region control. The Target is // always of type ACCOUNT . // // This member is required. Target *types.Target // Optional Boolean flag to indicate whether any effect should take place. It // tests whether the caller has permission to make the call. DryRun bool noSmithyDocumentSerde } type CreateHomeRegionControlOutput struct { // This object is the HomeRegionControl object that's returned by a successful // call to CreateHomeRegionControl . HomeRegionControl *types.HomeRegionControl // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateHomeRegionControlMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateHomeRegionControl{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateHomeRegionControl{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateHomeRegionControlValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateHomeRegionControl(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 } return nil } func newServiceMetadataMiddleware_opCreateHomeRegionControl(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgh", OperationName: "CreateHomeRegionControl", } }
136
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhubconfig import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhubconfig/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // This API permits filtering on the ControlId and HomeRegion fields. func (c *Client) DescribeHomeRegionControls(ctx context.Context, params *DescribeHomeRegionControlsInput, optFns ...func(*Options)) (*DescribeHomeRegionControlsOutput, error) { if params == nil { params = &DescribeHomeRegionControlsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeHomeRegionControls", params, optFns, c.addOperationDescribeHomeRegionControlsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeHomeRegionControlsOutput) out.ResultMetadata = metadata return out, nil } type DescribeHomeRegionControlsInput struct { // The ControlID is a unique identifier string of your HomeRegionControl object. ControlId *string // The name of the home region you'd like to view. HomeRegion *string // The maximum number of filtering results to display per page. MaxResults *int32 // If a NextToken was returned by a previous call, more results are available. To // retrieve the next page of results, make the call again using the returned token // in NextToken . NextToken *string // The target parameter specifies the identifier to which the home region is // applied, which is always of type ACCOUNT . It applies the home region to the // current ACCOUNT . Target *types.Target noSmithyDocumentSerde } type DescribeHomeRegionControlsOutput struct { // An array that contains your HomeRegionControl objects. HomeRegionControls []types.HomeRegionControl // If a NextToken was returned by a previous call, more results are available. To // retrieve the next page of results, make the call again using the returned token // in NextToken . NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeHomeRegionControlsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeHomeRegionControls{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeHomeRegionControls{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeHomeRegionControlsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeHomeRegionControls(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 } return nil } // DescribeHomeRegionControlsAPIClient is a client that implements the // DescribeHomeRegionControls operation. type DescribeHomeRegionControlsAPIClient interface { DescribeHomeRegionControls(context.Context, *DescribeHomeRegionControlsInput, ...func(*Options)) (*DescribeHomeRegionControlsOutput, error) } var _ DescribeHomeRegionControlsAPIClient = (*Client)(nil) // DescribeHomeRegionControlsPaginatorOptions is the paginator options for // DescribeHomeRegionControls type DescribeHomeRegionControlsPaginatorOptions struct { // The maximum number of filtering results to display per page. 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 } // DescribeHomeRegionControlsPaginator is a paginator for // DescribeHomeRegionControls type DescribeHomeRegionControlsPaginator struct { options DescribeHomeRegionControlsPaginatorOptions client DescribeHomeRegionControlsAPIClient params *DescribeHomeRegionControlsInput nextToken *string firstPage bool } // NewDescribeHomeRegionControlsPaginator returns a new // DescribeHomeRegionControlsPaginator func NewDescribeHomeRegionControlsPaginator(client DescribeHomeRegionControlsAPIClient, params *DescribeHomeRegionControlsInput, optFns ...func(*DescribeHomeRegionControlsPaginatorOptions)) *DescribeHomeRegionControlsPaginator { if params == nil { params = &DescribeHomeRegionControlsInput{} } options := DescribeHomeRegionControlsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeHomeRegionControlsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeHomeRegionControlsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeHomeRegionControls page. func (p *DescribeHomeRegionControlsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeHomeRegionControlsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxResults = limit result, err := p.client.DescribeHomeRegionControls(ctx, &params, 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_opDescribeHomeRegionControls(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgh", OperationName: "DescribeHomeRegionControls", } }
238
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhubconfig import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the calling account’s home region, if configured. This API is used by // other AWS services to determine the regional endpoint for calling AWS // Application Discovery Service and Migration Hub. You must call GetHomeRegion at // least once before you call any other AWS Application Discovery Service and AWS // Migration Hub APIs, to obtain the account's Migration Hub home region. func (c *Client) GetHomeRegion(ctx context.Context, params *GetHomeRegionInput, optFns ...func(*Options)) (*GetHomeRegionOutput, error) { if params == nil { params = &GetHomeRegionInput{} } result, metadata, err := c.invokeOperation(ctx, "GetHomeRegion", params, optFns, c.addOperationGetHomeRegionMiddlewares) if err != nil { return nil, err } out := result.(*GetHomeRegionOutput) out.ResultMetadata = metadata return out, nil } type GetHomeRegionInput struct { noSmithyDocumentSerde } type GetHomeRegionOutput struct { // The name of the home region of the calling account. HomeRegion *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetHomeRegionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetHomeRegion{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetHomeRegion{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetHomeRegion(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 } return nil } func newServiceMetadataMiddleware_opGetHomeRegion(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mgh", OperationName: "GetHomeRegion", } }
119
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhubconfig import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/migrationhubconfig/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "strings" ) type awsAwsjson11_deserializeOpCreateHomeRegionControl struct { } func (*awsAwsjson11_deserializeOpCreateHomeRegionControl) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateHomeRegionControl) 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_deserializeOpErrorCreateHomeRegionControl(response, &metadata) } output := &CreateHomeRegionControlOutput{} 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_deserializeOpDocumentCreateHomeRegionControlOutput(&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_deserializeOpErrorCreateHomeRegionControl(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("DryRunOperation", errorCode): return awsAwsjson11_deserializeErrorDryRunOperation(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeHomeRegionControls struct { } func (*awsAwsjson11_deserializeOpDescribeHomeRegionControls) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeHomeRegionControls) 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_deserializeOpErrorDescribeHomeRegionControls(response, &metadata) } output := &DescribeHomeRegionControlsOutput{} 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_deserializeOpDocumentDescribeHomeRegionControlsOutput(&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_deserializeOpErrorDescribeHomeRegionControls(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetHomeRegion struct { } func (*awsAwsjson11_deserializeOpGetHomeRegion) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetHomeRegion) 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_deserializeOpErrorGetHomeRegion(response, &metadata) } output := &GetHomeRegionOutput{} 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_deserializeOpDocumentGetHomeRegionOutput(&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_deserializeOpErrorGetHomeRegion(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsAwsjson11_deserializeErrorAccessDeniedException(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.AccessDeniedException{} err := awsAwsjson11_deserializeDocumentAccessDeniedException(&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_deserializeErrorDryRunOperation(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.DryRunOperation{} err := awsAwsjson11_deserializeDocumentDryRunOperation(&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_deserializeErrorInternalServerError(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.InternalServerError{} err := awsAwsjson11_deserializeDocumentInternalServerError(&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_deserializeErrorInvalidInputException(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.InvalidInputException{} err := awsAwsjson11_deserializeDocumentInvalidInputException(&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_deserializeErrorServiceUnavailableException(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.ServiceUnavailableException{} err := awsAwsjson11_deserializeDocumentServiceUnavailableException(&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_deserializeErrorThrottlingException(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.ThrottlingException{} err := awsAwsjson11_deserializeDocumentThrottlingException(&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_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, 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.AccessDeniedException if *v == nil { sv = &types.AccessDeniedException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDryRunOperation(v **types.DryRunOperation, 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.DryRunOperation if *v == nil { sv = &types.DryRunOperation{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHomeRegionControl(v **types.HomeRegionControl, 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.HomeRegionControl if *v == nil { sv = &types.HomeRegionControl{} } else { sv = *v } for key, value := range shape { switch key { case "ControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ControlId to be of type string, got %T instead", value) } sv.ControlId = ptr.String(jtv) } case "HomeRegion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HomeRegion to be of type string, got %T instead", value) } sv.HomeRegion = ptr.String(jtv) } case "RequestedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.RequestedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected RequestedTime to be a JSON Number, got %T instead", value) } } case "Target": if err := awsAwsjson11_deserializeDocumentTarget(&sv.Target, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHomeRegionControls(v *[]types.HomeRegionControl, 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.HomeRegionControl if *v == nil { cv = []types.HomeRegionControl{} } else { cv = *v } for _, value := range shape { var col types.HomeRegionControl destAddr := &col if err := awsAwsjson11_deserializeDocumentHomeRegionControl(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentInternalServerError(v **types.InternalServerError, 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.InternalServerError if *v == nil { sv = &types.InternalServerError{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentInvalidInputException(v **types.InvalidInputException, 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.InvalidInputException if *v == nil { sv = &types.InvalidInputException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, 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.ServiceUnavailableException if *v == nil { sv = &types.ServiceUnavailableException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentTarget(v **types.Target, 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.Target if *v == nil { sv = &types.Target{} } else { sv = *v } for key, value := range shape { switch key { case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TargetId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TargetType to be of type string, got %T instead", value) } sv.Type = types.TargetType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentThrottlingException(v **types.ThrottlingException, 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.ThrottlingException if *v == nil { sv = &types.ThrottlingException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RetryAfterSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected RetryAfterSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RetryAfterSeconds = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateHomeRegionControlOutput(v **CreateHomeRegionControlOutput, 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 *CreateHomeRegionControlOutput if *v == nil { sv = &CreateHomeRegionControlOutput{} } else { sv = *v } for key, value := range shape { switch key { case "HomeRegionControl": if err := awsAwsjson11_deserializeDocumentHomeRegionControl(&sv.HomeRegionControl, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeHomeRegionControlsOutput(v **DescribeHomeRegionControlsOutput, 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 *DescribeHomeRegionControlsOutput if *v == nil { sv = &DescribeHomeRegionControlsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "HomeRegionControls": if err := awsAwsjson11_deserializeDocumentHomeRegionControls(&sv.HomeRegionControls, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Token to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetHomeRegionOutput(v **GetHomeRegionOutput, 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 *GetHomeRegionOutput if *v == nil { sv = &GetHomeRegionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "HomeRegion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HomeRegion to be of type string, got %T instead", value) } sv.HomeRegion = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil }
1,130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package migrationhubconfig provides the API client, operations, and parameter // types for AWS Migration Hub Config. // // The AWS Migration Hub home region APIs are available specifically for working // with your Migration Hub home region. You can use these APIs to determine a home // region, as well as to create and work with controls that describe the home // region. // - You must make API calls for write actions (create, notify, associate, // disassociate, import, or put) while in your home region, or a // HomeRegionNotSetException error is returned. // - API calls for read actions (list, describe, stop, and delete) are permitted // outside of your home region. // - If you call a write API outside the home region, an InvalidInputException is // returned. // - You can call GetHomeRegion action to obtain the account's Migration Hub home // region. // // For specific API usage, see the sections that follow in this AWS Migration Hub // Home Region API reference. package migrationhubconfig
23
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhubconfig import ( "context" "errors" "fmt" "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" internalendpoints "github.com/aws/aws-sdk-go-v2/service/migrationhubconfig/internal/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "net/url" "strings" ) // EndpointResolverOptions is the service endpoint resolver options type EndpointResolverOptions = internalendpoints.Options // EndpointResolver interface for resolving service endpoints. type EndpointResolver interface { ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) } var _ EndpointResolver = &internalendpoints.Resolver{} // NewDefaultEndpointResolver constructs a new service endpoint resolver func NewDefaultEndpointResolver() *internalendpoints.Resolver { return internalendpoints.New() } // EndpointResolverFunc is a helper utility that wraps a function so it satisfies // the EndpointResolver interface. This is useful when you want to add additional // endpoint resolving logic, or stub out specific endpoints with custom values. type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { return fn(region, options) } func resolveDefaultEndpointConfiguration(o *Options) { if o.EndpointResolver != nil { return } o.EndpointResolver = NewDefaultEndpointResolver() } // EndpointResolverFromURL returns an EndpointResolver configured using the // provided endpoint url. By default, the resolved endpoint resolver uses the // client region as signing region, and the endpoint source is set to // EndpointSourceCustom.You can provide functional options to configure endpoint // values for the resolved endpoint. func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} for _, fn := range optFns { fn(&e) } return EndpointResolverFunc( func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { if len(e.SigningRegion) == 0 { e.SigningRegion = region } return e, nil }, ) } type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions } func (*ResolveEndpoint) ID() string { return "ResolveEndpoint" } func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } if m.Resolver == nil { return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") } eo := m.Options eo.Logger = middleware.GetLogger(ctx) var endpoint aws.Endpoint endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) if err != nil { return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) } req.URL, err = url.Parse(endpoint.URL) if err != nil { return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) } if len(awsmiddleware.GetSigningName(ctx)) == 0 { signingName := endpoint.SigningName if len(signingName) == 0 { signingName = "mgh" } ctx = awsmiddleware.SetSigningName(ctx, signingName) } ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { return stack.Serialize.Insert(&ResolveEndpoint{ Resolver: o.EndpointResolver, Options: o.EndpointOptions, }, "OperationSerializer", middleware.Before) } func removeResolveEndpointMiddleware(stack *middleware.Stack) error { _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) return err } type wrappedEndpointResolver struct { awsResolver aws.EndpointResolverWithOptions resolver EndpointResolver } func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { if w.awsResolver == nil { goto fallback } endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) if err == nil { return endpoint, nil } if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { return endpoint, err } fallback: if w.resolver == nil { return endpoint, fmt.Errorf("default endpoint resolver provided was nil") } return w.resolver.ResolveEndpoint(region, options) } type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { return a(service, region) } var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) // withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver. // If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided // fallbackResolver for resolution. // // fallbackResolver must not be nil func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { var resolver aws.EndpointResolverWithOptions if awsResolverWithOptions != nil { resolver = awsResolverWithOptions } else if awsResolver != nil { resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) } return &wrappedEndpointResolver{ awsResolver: resolver, resolver: fallbackResolver, } } func finalizeClientEndpointResolverOptions(options *Options) { options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() if len(options.EndpointOptions.ResolvedRegion) == 0 { const fipsInfix = "-fips-" const fipsPrefix = "fips-" const fipsSuffix = "-fips" if strings.Contains(options.Region, fipsInfix) || strings.Contains(options.Region, fipsPrefix) || strings.Contains(options.Region, fipsSuffix) { options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled } } }
201
aws-sdk-go-v2
aws
Go
// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. package migrationhubconfig // goModuleVersion is the tagged release for this module const goModuleVersion = "1.13.12"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhubconfig
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhubconfig import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/migrationhubconfig/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "path" ) type awsAwsjson11_serializeOpCreateHomeRegionControl struct { } func (*awsAwsjson11_serializeOpCreateHomeRegionControl) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateHomeRegionControl) 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.(*CreateHomeRegionControlInput) _ = 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("AWSMigrationHubMultiAccountService.CreateHomeRegionControl") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateHomeRegionControlInput(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_serializeOpDescribeHomeRegionControls struct { } func (*awsAwsjson11_serializeOpDescribeHomeRegionControls) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeHomeRegionControls) 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.(*DescribeHomeRegionControlsInput) _ = 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("AWSMigrationHubMultiAccountService.DescribeHomeRegionControls") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeHomeRegionControlsInput(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_serializeOpGetHomeRegion struct { } func (*awsAwsjson11_serializeOpGetHomeRegion) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetHomeRegion) 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.(*GetHomeRegionInput) _ = 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("AWSMigrationHubMultiAccountService.GetHomeRegion") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetHomeRegionInput(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) } func awsAwsjson11_serializeDocumentTarget(v *types.Target, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Id != nil { ok := object.Key("Id") ok.String(*v.Id) } if len(v.Type) > 0 { ok := object.Key("Type") ok.String(string(v.Type)) } return nil } func awsAwsjson11_serializeOpDocumentCreateHomeRegionControlInput(v *CreateHomeRegionControlInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DryRun { ok := object.Key("DryRun") ok.Boolean(v.DryRun) } if v.HomeRegion != nil { ok := object.Key("HomeRegion") ok.String(*v.HomeRegion) } if v.Target != nil { ok := object.Key("Target") if err := awsAwsjson11_serializeDocumentTarget(v.Target, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentDescribeHomeRegionControlsInput(v *DescribeHomeRegionControlsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ControlId != nil { ok := object.Key("ControlId") ok.String(*v.ControlId) } if v.HomeRegion != nil { ok := object.Key("HomeRegion") ok.String(*v.HomeRegion) } if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } if v.Target != nil { ok := object.Key("Target") if err := awsAwsjson11_serializeDocumentTarget(v.Target, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentGetHomeRegionInput(v *GetHomeRegionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() return nil }
263
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhubconfig import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/migrationhubconfig/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpCreateHomeRegionControl struct { } func (*validateOpCreateHomeRegionControl) ID() string { return "OperationInputValidation" } func (m *validateOpCreateHomeRegionControl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateHomeRegionControlInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateHomeRegionControlInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeHomeRegionControls struct { } func (*validateOpDescribeHomeRegionControls) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeHomeRegionControls) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeHomeRegionControlsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeHomeRegionControlsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpCreateHomeRegionControlValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateHomeRegionControl{}, middleware.After) } func addOpDescribeHomeRegionControlsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeHomeRegionControls{}, middleware.After) } func validateTarget(v *types.Target) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Target"} if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateHomeRegionControlInput(v *CreateHomeRegionControlInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateHomeRegionControlInput"} if v.HomeRegion == nil { invalidParams.Add(smithy.NewErrParamRequired("HomeRegion")) } if v.Target == nil { invalidParams.Add(smithy.NewErrParamRequired("Target")) } else if v.Target != nil { if err := validateTarget(v.Target); err != nil { invalidParams.AddNested("Target", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeHomeRegionControlsInput(v *DescribeHomeRegionControlsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeHomeRegionControlsInput"} if v.Target != nil { if err := validateTarget(v.Target); err != nil { invalidParams.AddNested("Target", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
114
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package endpoints import ( "github.com/aws/aws-sdk-go-v2/aws" endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" "github.com/aws/smithy-go/logging" "regexp" ) // Options is the endpoint resolver configuration options type Options struct { // Logger is a logging implementation that log events should be sent to. Logger logging.Logger // LogDeprecated indicates that deprecated endpoints should be logged to the // provided logger. LogDeprecated bool // ResolvedRegion is used to override the region to be resolved, rather then the // using the value passed to the ResolveEndpoint method. This value is used by the // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative // name. You must not set this value directly in your application. ResolvedRegion string // DisableHTTPS informs the resolver to return an endpoint that does not use the // HTTPS scheme. DisableHTTPS bool // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. UseDualStackEndpoint aws.DualStackEndpointState // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. UseFIPSEndpoint aws.FIPSEndpointState } func (o Options) GetResolvedRegion() string { return o.ResolvedRegion } func (o Options) GetDisableHTTPS() bool { return o.DisableHTTPS } func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { return o.UseDualStackEndpoint } func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { return o.UseFIPSEndpoint } func transformToSharedOptions(options Options) endpoints.Options { return endpoints.Options{ Logger: options.Logger, LogDeprecated: options.LogDeprecated, ResolvedRegion: options.ResolvedRegion, DisableHTTPS: options.DisableHTTPS, UseDualStackEndpoint: options.UseDualStackEndpoint, UseFIPSEndpoint: options.UseFIPSEndpoint, } } // Resolver MigrationHub Config endpoint resolver type Resolver struct { partitions endpoints.Partitions } // ResolveEndpoint resolves the service endpoint for the given region and options func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { if len(region) == 0 { return endpoint, &aws.MissingRegionError{} } opt := transformToSharedOptions(options) return r.partitions.ResolveEndpoint(region, opt) } // New returns a new Resolver func New() *Resolver { return &Resolver{ partitions: defaultPartitions, } } var partitionRegexp = struct { Aws *regexp.Regexp AwsCn *regexp.Regexp AwsIso *regexp.Regexp AwsIsoB *regexp.Regexp AwsIsoE *regexp.Regexp AwsIsoF *regexp.Regexp AwsUsGov *regexp.Regexp }{ Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), } var defaultPartitions = endpoints.Partitions{ { ID: "aws", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "migrationhub-config.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "migrationhub-config-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "migrationhub-config-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "migrationhub-config.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "migrationhub-config.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "migrationhub-config-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "migrationhub-config-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "migrationhub-config.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, }, { ID: "aws-iso", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "migrationhub-config-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "migrationhub-config.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, }, { ID: "aws-iso-b", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "migrationhub-config-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "migrationhub-config.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, }, { ID: "aws-iso-e", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "migrationhub-config-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "migrationhub-config.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoE, IsRegionalized: true, }, { ID: "aws-iso-f", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "migrationhub-config-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "migrationhub-config.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoF, IsRegionalized: true, }, { ID: "aws-us-gov", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "migrationhub-config.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "migrationhub-config-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "migrationhub-config-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "migrationhub-config.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, }, }
297
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package endpoints import ( "testing" ) func TestRegexCompile(t *testing.T) { _ = defaultPartitions }
12
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types type TargetType string // Enum values for TargetType const ( TargetTypeAccount TargetType = "ACCOUNT" ) // Values returns all known values for TargetType. 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 (TargetType) Values() []TargetType { return []TargetType{ "ACCOUNT", } }
20
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( "fmt" smithy "github.com/aws/smithy-go" ) // You do not have sufficient access to perform this action. type AccessDeniedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AccessDeniedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccessDeniedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccessDeniedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccessDeniedException" } return *e.ErrorCodeOverride } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Exception raised to indicate that authorization of an action was successful, // when the DryRun flag is set to true. type DryRunOperation struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *DryRunOperation) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *DryRunOperation) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *DryRunOperation) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "DryRunOperation" } return *e.ErrorCodeOverride } func (e *DryRunOperation) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Exception raised when an internal, configuration, or dependency error is // encountered. type InternalServerError struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InternalServerError) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalServerError) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalServerError) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalServerError" } return *e.ErrorCodeOverride } func (e *InternalServerError) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // Exception raised when the provided input violates a policy constraint or is // entered in the wrong format or data type. type InvalidInputException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidInputException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidInputException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidInputException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidInputException" } return *e.ErrorCodeOverride } func (e *InvalidInputException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Exception raised when a request fails due to temporary unavailability of the // service. type ServiceUnavailableException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ServiceUnavailableException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ServiceUnavailableException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ServiceUnavailableException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ServiceUnavailableException" } return *e.ErrorCodeOverride } func (e *ServiceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // The request was denied due to request throttling. type ThrottlingException struct { Message *string ErrorCodeOverride *string RetryAfterSeconds int32 noSmithyDocumentSerde } func (e *ThrottlingException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ThrottlingException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ThrottlingException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ThrottlingException" } return *e.ErrorCodeOverride } func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
171
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( smithydocument "github.com/aws/smithy-go/document" "time" ) // A home region control is an object that specifies the home region for an // account, with some additional information. It contains a target (always of type // ACCOUNT ), an ID, and a time at which the home region was set. type HomeRegionControl struct { // A unique identifier that's generated for each home region control. It's always // a string that begins with "hrc-" followed by 12 lowercase letters and numbers. ControlId *string // The AWS Region that's been set as home region. For example, "us-west-2" or // "eu-central-1" are valid home regions. HomeRegion *string // A timestamp representing the time when the customer called // CreateHomeregionControl and set the home region for the account. RequestedTime *time.Time // The target parameter specifies the identifier to which the home region is // applied, which is always an ACCOUNT . It applies the home region to the current // ACCOUNT . Target *Target noSmithyDocumentSerde } // The target parameter specifies the identifier to which the home region is // applied, which is always an ACCOUNT . It applies the home region to the current // ACCOUNT . type Target struct { // The target type is always an ACCOUNT . // // This member is required. Type TargetType // The TargetID is a 12-character identifier of the ACCOUNT for which the control // was created. (This must be the current account.) Id *string noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
53
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhuborchestrator import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/defaults" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "net" "net/http" "time" ) const ServiceID = "MigrationHubOrchestrator" const ServiceAPIVersion = "2021-08-28" // Client provides the API client to make operations call for AWS Migration Hub // Orchestrator. type Client struct { options Options } // New returns an initialized Client based on the functional options. Provide // additional functional options to further configure the behavior of the client, // such as changing the client's endpoint or adding custom middleware behavior. func New(options Options, optFns ...func(*Options)) *Client { options = options.Copy() resolveDefaultLogger(&options) setResolvedDefaultsMode(&options) resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) resolveDefaultEndpointConfiguration(&options) for _, fn := range optFns { fn(&options) } client := &Client{ options: options, } return client } type Options struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // Configures the events that will be sent to the configured logger. ClientLogMode aws.ClientLogMode // The credentials object to use when signing requests. Credentials aws.CredentialsProvider // The configuration DefaultsMode that the SDK should use when constructing the // clients initial default settings. DefaultsMode aws.DefaultsMode // The endpoint options to be used when attempting to resolve an endpoint. EndpointOptions EndpointResolverOptions // The service endpoint resolver. EndpointResolver EndpointResolver // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 // The logger writer interface to write logging messages to. Logger logging.Logger // The region to send requests to. (Required) Region string // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify // per operation call's retry max attempts. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. If specified in an operation call's functional // options with a value that is different than the constructed client's Options, // the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if // Retryer option is not also specified. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. Currently does not support per operation call // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. The kind of // default retry created by the API client can be changed with the RetryMode // option. Retryer aws.Retryer // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You // should not populate this structure programmatically, or rely on the values here // within your applications. RuntimeEnvironment aws.RuntimeEnvironment // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved // value was at that point in time. Currently does not support per operation call // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient } // WithAPIOptions returns a functional option for setting the Client's APIOptions // option. func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { return func(o *Options) { o.APIOptions = append(o.APIOptions, optFns...) } } // WithEndpointResolver returns a functional option for setting the Client's // EndpointResolver option. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v } } type HTTPClient interface { Do(*http.Request) (*http.Response, error) } // Copy creates a clone where the APIOptions list is deep copied. func (o Options) Copy() Options { to := o to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) copy(to.APIOptions, o.APIOptions) return to } func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() for _, fn := range optFns { fn(&options) } finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err } } for _, fn := range options.APIOptions { if err := fn(stack); err != nil { return nil, metadata, err } } handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) result, metadata, err = handler.Handle(ctx, params) if err != nil { err = &smithy.OperationError{ ServiceID: ServiceID, OperationName: opID, Err: err, } } return result, metadata, err } type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { if o.Logger != nil { return } o.Logger = logging.Nop{} } func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } func setResolvedDefaultsMode(o *Options) { if len(o.resolvedDefaultsMode) > 0 { return } var mode aws.DefaultsMode mode.SetFromString(string(o.DefaultsMode)) if mode == aws.DefaultsModeAuto { mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) } o.resolvedDefaultsMode = mode } // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, DefaultsMode: cfg.DefaultsMode, RuntimeEnvironment: cfg.RuntimeEnvironment, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { var buildable *awshttp.BuildableClient if o.HTTPClient != nil { var ok bool buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) if !ok { return } } else { buildable = awshttp.NewBuildableClient() } modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { dialer.Timeout = dialerTimeout } }) buildable = buildable.WithTransportOptions(func(transport *http.Transport) { if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { transport.TLSHandshakeTimeout = tlsHandshakeTimeout } }) } o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } if len(o.RetryMode) == 0 { modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { o.RetryMode = modeConfig.RetryMode } } if len(o.RetryMode) == 0 { o.RetryMode = aws.RetryModeStandard } var standardOptions []func(*retry.StandardOptions) if v := o.RetryMaxAttempts; v != 0 { standardOptions = append(standardOptions, func(so *retry.StandardOptions) { so.MaxAttempts = v }) } switch o.RetryMode { case aws.RetryModeAdaptive: var adaptiveOptions []func(*retry.AdaptiveModeOptions) if len(standardOptions) != 0 { adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { ao.StandardOptions = append(ao.StandardOptions, standardOptions...) }) } o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) default: o.Retryer = retry.NewStandard(standardOptions...) } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { if cfg.Retryer == nil { return } o.Retryer = cfg.Retryer() } func resolveAWSRetryMode(cfg aws.Config, o *Options) { if len(cfg.RetryMode) == 0 { return } o.RetryMode = cfg.RetryMode } func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { if cfg.RetryMaxAttempts == 0 { return } o.RetryMaxAttempts = cfg.RetryMaxAttempts } func finalizeRetryMaxAttemptOptions(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { return } o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) } func addClientUserAgent(stack *middleware.Stack) error { return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "migrationhuborchestrator", goModuleVersion)(stack) } func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ CredentialsProvider: o.Credentials, Signer: o.HTTPSignerV4, LogSigning: o.ClientLogMode.IsSigning(), }) return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error } func resolveHTTPSignerV4(o *Options) { if o.HTTPSignerV4 != nil { return } o.HTTPSignerV4 = newDefaultV4Signer(*o) } func newDefaultV4Signer(o Options) *v4.Signer { return v4.NewSigner(func(so *v4.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() }) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, LogRetryAttempts: o.ClientLogMode.IsRetries(), } return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseDualStackEndpoint = value } return nil } // resolves FIPS endpoint configuration func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseFIPSEndpoint = value } return nil } func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ LogRequest: o.ClientLogMode.IsRequest(), LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), LogResponse: o.ClientLogMode.IsResponse(), LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) }
435
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhuborchestrator import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "io/ioutil" "net/http" "strings" "testing" ) func TestClient_resolveRetryOptions(t *testing.T) { nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { return &http.Response{ StatusCode: 200, Header: http.Header{}, Body: ioutil.NopCloser(strings.NewReader("")), }, nil }) cases := map[string]struct { defaultsMode aws.DefaultsMode retryer aws.Retryer retryMaxAttempts int opRetryMaxAttempts *int retryMode aws.RetryMode expectClientRetryMode aws.RetryMode expectClientMaxAttempts int expectOpMaxAttempts int }{ "defaults": { defaultsMode: aws.DefaultsModeStandard, expectClientRetryMode: aws.RetryModeStandard, expectClientMaxAttempts: 3, expectOpMaxAttempts: 3, }, "custom default retry": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, "custom op max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(2), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 2, }, "custom op no change max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(10), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, "custom op 0 max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(0), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, } for name, c := range cases { t.Run(name, func(t *testing.T) { client := NewFromConfig(aws.Config{ DefaultsMode: c.defaultsMode, Retryer: func() func() aws.Retryer { if c.retryer == nil { return nil } return func() aws.Retryer { return c.retryer } }(), HTTPClient: nopClient, RetryMaxAttempts: c.retryMaxAttempts, RetryMode: c.retryMode, }) if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { t.Errorf("expect %v retry mode, got %v", e, a) } if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { t.Errorf("expect %v max attempts, got %v", e, a) } _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, []func(*Options){ func(o *Options) { if c.opRetryMaxAttempts == nil { return } o.RetryMaxAttempts = *c.opRetryMaxAttempts }, }, func(s *middleware.Stack, o Options) error { s.Initialize.Clear() s.Serialize.Clear() s.Build.Clear() s.Finalize.Clear() s.Deserialize.Clear() if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { t.Errorf("expect %v op max attempts, got %v", e, a) } return nil }) if err != nil { t.Fatalf("expect no operation error, got %v", err) } }) } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhuborchestrator import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhuborchestrator/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Create a workflow to orchestrate your migrations. func (c *Client) CreateWorkflow(ctx context.Context, params *CreateWorkflowInput, optFns ...func(*Options)) (*CreateWorkflowOutput, error) { if params == nil { params = &CreateWorkflowInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateWorkflow", params, optFns, c.addOperationCreateWorkflowMiddlewares) if err != nil { return nil, err } out := result.(*CreateWorkflowOutput) out.ResultMetadata = metadata return out, nil } type CreateWorkflowInput struct { // The configuration ID of the application configured in Application Discovery // Service. // // This member is required. ApplicationConfigurationId *string // The input parameters required to create a migration workflow. // // This member is required. InputParameters map[string]types.StepInput // The name of the migration workflow. // // This member is required. Name *string // The ID of the template. // // This member is required. TemplateId *string // The description of the migration workflow. Description *string // The servers on which a step will be run. StepTargets []string // The tags to add on a migration workflow. Tags map[string]string noSmithyDocumentSerde } type CreateWorkflowOutput struct { // The configuration ID of the application configured in Application Discovery // Service. AdsApplicationConfigurationId *string // The Amazon Resource Name (ARN) of the migration workflow. Arn *string // The time at which the migration workflow was created. CreationTime *time.Time // The description of the migration workflow. Description *string // The ID of the migration workflow. Id *string // The name of the migration workflow. Name *string // The status of the migration workflow. Status types.MigrationWorkflowStatusEnum // The servers on which a step will be run. StepTargets []string // The tags to add on a migration workflow. Tags map[string]string // The ID of the template. TemplateId *string // The inputs for creating a migration workflow. WorkflowInputs map[string]types.StepInput // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateWorkflowMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateWorkflow{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateWorkflow{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateWorkflowValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWorkflow(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 } return nil } func newServiceMetadataMiddleware_opCreateWorkflow(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "migrationhub-orchestrator", OperationName: "CreateWorkflow", } }
182
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhuborchestrator import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhuborchestrator/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Create a step in the migration workflow. func (c *Client) CreateWorkflowStep(ctx context.Context, params *CreateWorkflowStepInput, optFns ...func(*Options)) (*CreateWorkflowStepOutput, error) { if params == nil { params = &CreateWorkflowStepInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateWorkflowStep", params, optFns, c.addOperationCreateWorkflowStepMiddlewares) if err != nil { return nil, err } out := result.(*CreateWorkflowStepOutput) out.ResultMetadata = metadata return out, nil } type CreateWorkflowStepInput struct { // The name of the step. // // This member is required. Name *string // The action type of the step. You must run and update the status of a manual // step for the workflow to continue after the completion of the step. // // This member is required. StepActionType types.StepActionType // The ID of the step group. // // This member is required. StepGroupId *string // The ID of the migration workflow. // // This member is required. WorkflowId *string // The description of the step. Description *string // The next step. Next []string // The key value pairs added for the expected output. Outputs []types.WorkflowStepOutput // The previous step. Previous []string // The servers on which a step will be run. StepTarget []string // The custom script to run tests on source or target environments. WorkflowStepAutomationConfiguration *types.WorkflowStepAutomationConfiguration noSmithyDocumentSerde } type CreateWorkflowStepOutput struct { // The ID of the step. Id *string // The name of the step. Name *string // The ID of the step group. StepGroupId *string // The ID of the migration workflow. WorkflowId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateWorkflowStepMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateWorkflowStep{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateWorkflowStep{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateWorkflowStepValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWorkflowStep(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 } return nil } func newServiceMetadataMiddleware_opCreateWorkflowStep(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "migrationhub-orchestrator", OperationName: "CreateWorkflowStep", } }
168
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhuborchestrator import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhuborchestrator/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Create a step group in a migration workflow. func (c *Client) CreateWorkflowStepGroup(ctx context.Context, params *CreateWorkflowStepGroupInput, optFns ...func(*Options)) (*CreateWorkflowStepGroupOutput, error) { if params == nil { params = &CreateWorkflowStepGroupInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateWorkflowStepGroup", params, optFns, c.addOperationCreateWorkflowStepGroupMiddlewares) if err != nil { return nil, err } out := result.(*CreateWorkflowStepGroupOutput) out.ResultMetadata = metadata return out, nil } type CreateWorkflowStepGroupInput struct { // The name of the step group. // // This member is required. Name *string // The ID of the migration workflow that will contain the step group. // // This member is required. WorkflowId *string // The description of the step group. Description *string // The next step group. Next []string // The previous step group. Previous []string noSmithyDocumentSerde } type CreateWorkflowStepGroupOutput struct { // The time at which the step group is created. CreationTime *time.Time // The description of the step group. Description *string // The ID of the step group. Id *string // The name of the step group. Name *string // The next step group. Next []string // The previous step group. Previous []string // List of AWS services utilized in a migration workflow. Tools []types.Tool // The ID of the migration workflow that contains the step group. WorkflowId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateWorkflowStepGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateWorkflowStepGroup{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateWorkflowStepGroup{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateWorkflowStepGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWorkflowStepGroup(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 } return nil } func newServiceMetadataMiddleware_opCreateWorkflowStepGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "migrationhub-orchestrator", OperationName: "CreateWorkflowStepGroup", } }
161
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhuborchestrator import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhuborchestrator/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Delete a migration workflow. You must pause a running workflow in Migration Hub // Orchestrator console to delete it. func (c *Client) DeleteWorkflow(ctx context.Context, params *DeleteWorkflowInput, optFns ...func(*Options)) (*DeleteWorkflowOutput, error) { if params == nil { params = &DeleteWorkflowInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteWorkflow", params, optFns, c.addOperationDeleteWorkflowMiddlewares) if err != nil { return nil, err } out := result.(*DeleteWorkflowOutput) out.ResultMetadata = metadata return out, nil } type DeleteWorkflowInput struct { // The ID of the migration workflow you want to delete. // // This member is required. Id *string noSmithyDocumentSerde } type DeleteWorkflowOutput struct { // The Amazon Resource Name (ARN) of the migration workflow. Arn *string // The ID of the migration workflow. Id *string // The status of the migration workflow. Status types.MigrationWorkflowStatusEnum // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteWorkflowMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteWorkflow{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteWorkflow{}, middleware.After) if 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); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteWorkflowValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteWorkflow(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 } return nil } func newServiceMetadataMiddleware_opDeleteWorkflow(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "migrationhub-orchestrator", OperationName: "DeleteWorkflow", } }
132