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 opensearch 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/opensearch/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all packages associated with an Amazon OpenSearch Service domain. For // more information, see Custom packages for Amazon OpenSearch Service (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/custom-packages.html) // . func (c *Client) ListPackagesForDomain(ctx context.Context, params *ListPackagesForDomainInput, optFns ...func(*Options)) (*ListPackagesForDomainOutput, error) { if params == nil { params = &ListPackagesForDomainInput{} } result, metadata, err := c.invokeOperation(ctx, "ListPackagesForDomain", params, optFns, c.addOperationListPackagesForDomainMiddlewares) if err != nil { return nil, err } out := result.(*ListPackagesForDomainOutput) out.ResultMetadata = metadata return out, nil } // Container for the request parameters to the ListPackagesForDomain operation. type ListPackagesForDomainInput struct { // The name of the domain for which you want to list associated packages. // // This member is required. DomainName *string // An optional parameter that specifies the maximum number of results to return. // You can use nextToken to get the next page of results. MaxResults int32 // If your initial ListPackagesForDomain operation returns a nextToken , you can // include the returned nextToken in subsequent ListPackagesForDomain operations, // which returns results in the next page. NextToken *string noSmithyDocumentSerde } // Container for the response parameters to the ListPackagesForDomain operation. type ListPackagesForDomainOutput struct { // List of all packages associated with a domain. DomainPackageDetailsList []types.DomainPackageDetails // When nextToken is returned, there are more results available. The value of // nextToken is a unique pagination token for each page. Make the call again using // the returned token to retrieve the next page. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListPackagesForDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListPackagesForDomain{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListPackagesForDomain{}, 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 = addOpListPackagesForDomainValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPackagesForDomain(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 } // ListPackagesForDomainAPIClient is a client that implements the // ListPackagesForDomain operation. type ListPackagesForDomainAPIClient interface { ListPackagesForDomain(context.Context, *ListPackagesForDomainInput, ...func(*Options)) (*ListPackagesForDomainOutput, error) } var _ ListPackagesForDomainAPIClient = (*Client)(nil) // ListPackagesForDomainPaginatorOptions is the paginator options for // ListPackagesForDomain type ListPackagesForDomainPaginatorOptions struct { // An optional parameter that specifies the maximum number of results to return. // You can use nextToken to get the next page of 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 } // ListPackagesForDomainPaginator is a paginator for ListPackagesForDomain type ListPackagesForDomainPaginator struct { options ListPackagesForDomainPaginatorOptions client ListPackagesForDomainAPIClient params *ListPackagesForDomainInput nextToken *string firstPage bool } // NewListPackagesForDomainPaginator returns a new ListPackagesForDomainPaginator func NewListPackagesForDomainPaginator(client ListPackagesForDomainAPIClient, params *ListPackagesForDomainInput, optFns ...func(*ListPackagesForDomainPaginatorOptions)) *ListPackagesForDomainPaginator { if params == nil { params = &ListPackagesForDomainInput{} } options := ListPackagesForDomainPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListPackagesForDomainPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListPackagesForDomainPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListPackagesForDomain page. func (p *ListPackagesForDomainPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPackagesForDomainOutput, 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.ListPackagesForDomain(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_opListPackagesForDomain(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "es", OperationName: "ListPackagesForDomain", } }
232
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/opensearch/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves a list of configuration changes that are scheduled for a domain. // These changes can be service software updates (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/service-software.html) // or blue/green Auto-Tune enhancements (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html#auto-tune-types) // . func (c *Client) ListScheduledActions(ctx context.Context, params *ListScheduledActionsInput, optFns ...func(*Options)) (*ListScheduledActionsOutput, error) { if params == nil { params = &ListScheduledActionsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListScheduledActions", params, optFns, c.addOperationListScheduledActionsMiddlewares) if err != nil { return nil, err } out := result.(*ListScheduledActionsOutput) out.ResultMetadata = metadata return out, nil } type ListScheduledActionsInput struct { // The name of the domain. // // This member is required. DomainName *string // An optional parameter that specifies the maximum number of results to return. // You can use nextToken to get the next page of results. MaxResults int32 // If your initial ListScheduledActions operation returns a nextToken , you can // include the returned nextToken in subsequent ListScheduledActions operations, // which returns results in the next page. NextToken *string noSmithyDocumentSerde } type ListScheduledActionsOutput struct { // When nextToken is returned, there are more results available. The value of // nextToken is a unique pagination token for each page. Make the call again using // the returned token to retrieve the next page. NextToken *string // A list of actions that are scheduled for the domain. ScheduledActions []types.ScheduledAction // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListScheduledActionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListScheduledActions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListScheduledActions{}, 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 = addOpListScheduledActionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListScheduledActions(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 } // ListScheduledActionsAPIClient is a client that implements the // ListScheduledActions operation. type ListScheduledActionsAPIClient interface { ListScheduledActions(context.Context, *ListScheduledActionsInput, ...func(*Options)) (*ListScheduledActionsOutput, error) } var _ ListScheduledActionsAPIClient = (*Client)(nil) // ListScheduledActionsPaginatorOptions is the paginator options for // ListScheduledActions type ListScheduledActionsPaginatorOptions struct { // An optional parameter that specifies the maximum number of results to return. // You can use nextToken to get the next page of 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 } // ListScheduledActionsPaginator is a paginator for ListScheduledActions type ListScheduledActionsPaginator struct { options ListScheduledActionsPaginatorOptions client ListScheduledActionsAPIClient params *ListScheduledActionsInput nextToken *string firstPage bool } // NewListScheduledActionsPaginator returns a new ListScheduledActionsPaginator func NewListScheduledActionsPaginator(client ListScheduledActionsAPIClient, params *ListScheduledActionsInput, optFns ...func(*ListScheduledActionsPaginatorOptions)) *ListScheduledActionsPaginator { if params == nil { params = &ListScheduledActionsInput{} } options := ListScheduledActionsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListScheduledActionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListScheduledActionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListScheduledActions page. func (p *ListScheduledActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListScheduledActionsOutput, 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.ListScheduledActions(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_opListScheduledActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "es", OperationName: "ListScheduledActions", } }
231
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch 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/opensearch/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns all resource tags for an Amazon OpenSearch Service domain. For more // information, see Tagging Amazon OpenSearch Service domains (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-awsresourcetagging.html) // . func (c *Client) ListTags(ctx context.Context, params *ListTagsInput, optFns ...func(*Options)) (*ListTagsOutput, error) { if params == nil { params = &ListTagsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListTags", params, optFns, c.addOperationListTagsMiddlewares) if err != nil { return nil, err } out := result.(*ListTagsOutput) out.ResultMetadata = metadata return out, nil } // Container for the parameters to the ListTags operation. type ListTagsInput struct { // Amazon Resource Name (ARN) for the domain to view tags for. // // This member is required. ARN *string noSmithyDocumentSerde } // The results of a ListTags operation. type ListTagsOutput struct { // List of resource tags associated with the specified domain. TagList []types.Tag // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListTagsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListTags{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTags{}, 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 = addOpListTagsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTags(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_opListTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "es", OperationName: "ListTags", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all versions of OpenSearch and Elasticsearch that Amazon OpenSearch // Service supports. func (c *Client) ListVersions(ctx context.Context, params *ListVersionsInput, optFns ...func(*Options)) (*ListVersionsOutput, error) { if params == nil { params = &ListVersionsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListVersions", params, optFns, c.addOperationListVersionsMiddlewares) if err != nil { return nil, err } out := result.(*ListVersionsOutput) out.ResultMetadata = metadata return out, nil } // Container for the request parameters to the ListVersions operation. type ListVersionsInput struct { // An optional parameter that specifies the maximum number of results to return. // You can use nextToken to get the next page of results. MaxResults int32 // If your initial ListVersions operation returns a nextToken , you can include the // returned nextToken in subsequent ListVersions operations, which returns results // in the next page. NextToken *string noSmithyDocumentSerde } // Container for the parameters for response received from the ListVersions // operation. type ListVersionsOutput struct { // When nextToken is returned, there are more results available. The value of // nextToken is a unique pagination token for each page. Make the call again using // the returned token to retrieve the next page. NextToken *string // A list of all versions of OpenSearch and Elasticsearch that Amazon OpenSearch // Service supports. Versions []string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListVersions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListVersions{}, 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_opListVersions(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 } // ListVersionsAPIClient is a client that implements the ListVersions operation. type ListVersionsAPIClient interface { ListVersions(context.Context, *ListVersionsInput, ...func(*Options)) (*ListVersionsOutput, error) } var _ ListVersionsAPIClient = (*Client)(nil) // ListVersionsPaginatorOptions is the paginator options for ListVersions type ListVersionsPaginatorOptions struct { // An optional parameter that specifies the maximum number of results to return. // You can use nextToken to get the next page of 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 } // ListVersionsPaginator is a paginator for ListVersions type ListVersionsPaginator struct { options ListVersionsPaginatorOptions client ListVersionsAPIClient params *ListVersionsInput nextToken *string firstPage bool } // NewListVersionsPaginator returns a new ListVersionsPaginator func NewListVersionsPaginator(client ListVersionsAPIClient, params *ListVersionsInput, optFns ...func(*ListVersionsPaginatorOptions)) *ListVersionsPaginator { if params == nil { params = &ListVersionsInput{} } options := ListVersionsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListVersionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListVersionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListVersions page. func (p *ListVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVersionsOutput, 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.ListVersions(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_opListVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "es", OperationName: "ListVersions", } }
222
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch 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/opensearch/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves information about each Amazon Web Services principal that is allowed // to access a given Amazon OpenSearch Service domain through the use of an // interface VPC endpoint. func (c *Client) ListVpcEndpointAccess(ctx context.Context, params *ListVpcEndpointAccessInput, optFns ...func(*Options)) (*ListVpcEndpointAccessOutput, error) { if params == nil { params = &ListVpcEndpointAccessInput{} } result, metadata, err := c.invokeOperation(ctx, "ListVpcEndpointAccess", params, optFns, c.addOperationListVpcEndpointAccessMiddlewares) if err != nil { return nil, err } out := result.(*ListVpcEndpointAccessOutput) out.ResultMetadata = metadata return out, nil } type ListVpcEndpointAccessInput struct { // The name of the OpenSearch Service domain to retrieve access information for. // // This member is required. DomainName *string // If your initial ListVpcEndpointAccess operation returns a nextToken , you can // include the returned nextToken in subsequent ListVpcEndpointAccess operations, // which returns results in the next page. NextToken *string noSmithyDocumentSerde } type ListVpcEndpointAccessOutput struct { // A list of IAM principals (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html) // that can currently access the domain. // // This member is required. AuthorizedPrincipalList []types.AuthorizedPrincipal // When nextToken is returned, there are more results available. The value of // nextToken is a unique pagination token for each page. Make the call again using // the returned token to retrieve the next page. // // This member is required. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListVpcEndpointAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListVpcEndpointAccess{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListVpcEndpointAccess{}, 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 = addOpListVpcEndpointAccessValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVpcEndpointAccess(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_opListVpcEndpointAccess(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "es", OperationName: "ListVpcEndpointAccess", } }
142
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch 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/opensearch/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves all Amazon OpenSearch Service-managed VPC endpoints in the current // Amazon Web Services account and Region. func (c *Client) ListVpcEndpoints(ctx context.Context, params *ListVpcEndpointsInput, optFns ...func(*Options)) (*ListVpcEndpointsOutput, error) { if params == nil { params = &ListVpcEndpointsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListVpcEndpoints", params, optFns, c.addOperationListVpcEndpointsMiddlewares) if err != nil { return nil, err } out := result.(*ListVpcEndpointsOutput) out.ResultMetadata = metadata return out, nil } type ListVpcEndpointsInput struct { // If your initial ListVpcEndpoints operation returns a nextToken , you can include // the returned nextToken in subsequent ListVpcEndpoints operations, which returns // results in the next page. NextToken *string noSmithyDocumentSerde } type ListVpcEndpointsOutput struct { // When nextToken is returned, there are more results available. The value of // nextToken is a unique pagination token for each page. Make the call again using // the returned token to retrieve the next page. // // This member is required. NextToken *string // Information about each endpoint. // // This member is required. VpcEndpointSummaryList []types.VpcEndpointSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListVpcEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListVpcEndpoints{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListVpcEndpoints{}, 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_opListVpcEndpoints(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_opListVpcEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "es", OperationName: "ListVpcEndpoints", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch 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/opensearch/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves all Amazon OpenSearch Service-managed VPC endpoints associated with a // particular domain. func (c *Client) ListVpcEndpointsForDomain(ctx context.Context, params *ListVpcEndpointsForDomainInput, optFns ...func(*Options)) (*ListVpcEndpointsForDomainOutput, error) { if params == nil { params = &ListVpcEndpointsForDomainInput{} } result, metadata, err := c.invokeOperation(ctx, "ListVpcEndpointsForDomain", params, optFns, c.addOperationListVpcEndpointsForDomainMiddlewares) if err != nil { return nil, err } out := result.(*ListVpcEndpointsForDomainOutput) out.ResultMetadata = metadata return out, nil } type ListVpcEndpointsForDomainInput struct { // The name of the domain to list associated VPC endpoints for. // // This member is required. DomainName *string // If your initial ListEndpointsForDomain operation returns a nextToken , you can // include the returned nextToken in subsequent ListEndpointsForDomain operations, // which returns results in the next page. NextToken *string noSmithyDocumentSerde } type ListVpcEndpointsForDomainOutput struct { // When nextToken is returned, there are more results available. The value of // nextToken is a unique pagination token for each page. Make the call again using // the returned token to retrieve the next page. // // This member is required. NextToken *string // Information about each endpoint associated with the domain. // // This member is required. VpcEndpointSummaryList []types.VpcEndpointSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListVpcEndpointsForDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListVpcEndpointsForDomain{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListVpcEndpointsForDomain{}, 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 = addOpListVpcEndpointsForDomainValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVpcEndpointsForDomain(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_opListVpcEndpointsForDomain(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "es", OperationName: "ListVpcEndpointsForDomain", } }
140
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch 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" ) // Allows you to purchase Amazon OpenSearch Service Reserved Instances. func (c *Client) PurchaseReservedInstanceOffering(ctx context.Context, params *PurchaseReservedInstanceOfferingInput, optFns ...func(*Options)) (*PurchaseReservedInstanceOfferingOutput, error) { if params == nil { params = &PurchaseReservedInstanceOfferingInput{} } result, metadata, err := c.invokeOperation(ctx, "PurchaseReservedInstanceOffering", params, optFns, c.addOperationPurchaseReservedInstanceOfferingMiddlewares) if err != nil { return nil, err } out := result.(*PurchaseReservedInstanceOfferingOutput) out.ResultMetadata = metadata return out, nil } // Container for request parameters to the PurchaseReservedInstanceOffering // operation. type PurchaseReservedInstanceOfferingInput struct { // A customer-specified identifier to track this reservation. // // This member is required. ReservationName *string // The ID of the Reserved Instance offering to purchase. // // This member is required. ReservedInstanceOfferingId *string // The number of OpenSearch instances to reserve. InstanceCount int32 noSmithyDocumentSerde } // Represents the output of a PurchaseReservedInstanceOffering operation. type PurchaseReservedInstanceOfferingOutput struct { // The customer-specified identifier used to track this reservation. ReservationName *string // The ID of the Reserved Instance offering that was purchased. ReservedInstanceId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationPurchaseReservedInstanceOfferingMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpPurchaseReservedInstanceOffering{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPurchaseReservedInstanceOffering{}, 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 = addOpPurchaseReservedInstanceOfferingValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPurchaseReservedInstanceOffering(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_opPurchaseReservedInstanceOffering(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "es", OperationName: "PurchaseReservedInstanceOffering", } }
138
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch 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/opensearch/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Allows the remote Amazon OpenSearch Service domain owner to reject an inbound // cross-cluster connection request. func (c *Client) RejectInboundConnection(ctx context.Context, params *RejectInboundConnectionInput, optFns ...func(*Options)) (*RejectInboundConnectionOutput, error) { if params == nil { params = &RejectInboundConnectionInput{} } result, metadata, err := c.invokeOperation(ctx, "RejectInboundConnection", params, optFns, c.addOperationRejectInboundConnectionMiddlewares) if err != nil { return nil, err } out := result.(*RejectInboundConnectionOutput) out.ResultMetadata = metadata return out, nil } // Container for the request parameters to the RejectInboundConnection operation. type RejectInboundConnectionInput struct { // The unique identifier of the inbound connection to reject. // // This member is required. ConnectionId *string noSmithyDocumentSerde } // Represents the output of a RejectInboundConnection operation. type RejectInboundConnectionOutput struct { // Contains details about the rejected inbound connection. Connection *types.InboundConnection // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRejectInboundConnectionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpRejectInboundConnection{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRejectInboundConnection{}, 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 = addOpRejectInboundConnectionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRejectInboundConnection(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_opRejectInboundConnection(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "es", OperationName: "RejectInboundConnection", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch 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" ) // Removes the specified set of tags from an Amazon OpenSearch Service domain. For // more information, see Tagging Amazon OpenSearch Service domains (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains.html#managedomains-awsresorcetagging) // . func (c *Client) RemoveTags(ctx context.Context, params *RemoveTagsInput, optFns ...func(*Options)) (*RemoveTagsOutput, error) { if params == nil { params = &RemoveTagsInput{} } result, metadata, err := c.invokeOperation(ctx, "RemoveTags", params, optFns, c.addOperationRemoveTagsMiddlewares) if err != nil { return nil, err } out := result.(*RemoveTagsOutput) out.ResultMetadata = metadata return out, nil } // Container for the request parameters to the RemoveTags operation. type RemoveTagsInput struct { // The Amazon Resource Name (ARN) of the domain from which you want to delete the // specified tags. // // This member is required. ARN *string // The list of tag keys to remove from the domain. // // This member is required. TagKeys []string noSmithyDocumentSerde } type RemoveTagsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRemoveTagsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpRemoveTags{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRemoveTags{}, 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 = addOpRemoveTagsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveTags(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_opRemoveTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "es", OperationName: "RemoveTags", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch 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" ) // Revokes access to an Amazon OpenSearch Service domain that was provided through // an interface VPC endpoint. func (c *Client) RevokeVpcEndpointAccess(ctx context.Context, params *RevokeVpcEndpointAccessInput, optFns ...func(*Options)) (*RevokeVpcEndpointAccessOutput, error) { if params == nil { params = &RevokeVpcEndpointAccessInput{} } result, metadata, err := c.invokeOperation(ctx, "RevokeVpcEndpointAccess", params, optFns, c.addOperationRevokeVpcEndpointAccessMiddlewares) if err != nil { return nil, err } out := result.(*RevokeVpcEndpointAccessOutput) out.ResultMetadata = metadata return out, nil } type RevokeVpcEndpointAccessInput struct { // The account ID to revoke access from. // // This member is required. Account *string // The name of the OpenSearch Service domain. // // This member is required. DomainName *string noSmithyDocumentSerde } type RevokeVpcEndpointAccessOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRevokeVpcEndpointAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpRevokeVpcEndpointAccess{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRevokeVpcEndpointAccess{}, 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 = addOpRevokeVpcEndpointAccessValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRevokeVpcEndpointAccess(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_opRevokeVpcEndpointAccess(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "es", OperationName: "RevokeVpcEndpointAccess", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch 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/opensearch/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Schedules a service software update for an Amazon OpenSearch Service domain. // For more information, see Service software updates in Amazon OpenSearch Service (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/service-software.html) // . func (c *Client) StartServiceSoftwareUpdate(ctx context.Context, params *StartServiceSoftwareUpdateInput, optFns ...func(*Options)) (*StartServiceSoftwareUpdateOutput, error) { if params == nil { params = &StartServiceSoftwareUpdateInput{} } result, metadata, err := c.invokeOperation(ctx, "StartServiceSoftwareUpdate", params, optFns, c.addOperationStartServiceSoftwareUpdateMiddlewares) if err != nil { return nil, err } out := result.(*StartServiceSoftwareUpdateOutput) out.ResultMetadata = metadata return out, nil } // Container for the request parameters to the StartServiceSoftwareUpdate // operation. type StartServiceSoftwareUpdateInput struct { // The name of the domain that you want to update to the latest service software. // // This member is required. DomainName *string // The Epoch timestamp when you want the service software update to start. You // only need to specify this parameter if you set ScheduleAt to TIMESTAMP . DesiredStartTime *int64 // When to start the service software update. // - NOW - Immediately schedules the update to happen in the current hour if // there's capacity available. // - TIMESTAMP - Lets you specify a custom date and time to apply the update. If // you specify this value, you must also provide a value for DesiredStartTime . // - OFF_PEAK_WINDOW - Marks the update to be picked up during an upcoming // off-peak window. There's no guarantee that the update will happen during the // next immediate window. Depending on capacity, it might happen in subsequent // days. // Default: NOW if you don't specify a value for DesiredStartTime , and TIMESTAMP // if you do. ScheduleAt types.ScheduleAt noSmithyDocumentSerde } // Represents the output of a StartServiceSoftwareUpdate operation. Contains the // status of the update. type StartServiceSoftwareUpdateOutput struct { // The current status of the OpenSearch Service software update. ServiceSoftwareOptions *types.ServiceSoftwareOptions // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartServiceSoftwareUpdateMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpStartServiceSoftwareUpdate{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartServiceSoftwareUpdate{}, 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 = addOpStartServiceSoftwareUpdateValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartServiceSoftwareUpdate(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_opStartServiceSoftwareUpdate(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "es", OperationName: "StartServiceSoftwareUpdate", } }
148
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch 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/opensearch/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Modifies the cluster configuration of the specified Amazon OpenSearch Service // domain.sl func (c *Client) UpdateDomainConfig(ctx context.Context, params *UpdateDomainConfigInput, optFns ...func(*Options)) (*UpdateDomainConfigOutput, error) { if params == nil { params = &UpdateDomainConfigInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateDomainConfig", params, optFns, c.addOperationUpdateDomainConfigMiddlewares) if err != nil { return nil, err } out := result.(*UpdateDomainConfigOutput) out.ResultMetadata = metadata return out, nil } // Container for the request parameters to the UpdateDomain operation. type UpdateDomainConfigInput struct { // The name of the domain that you're updating. // // This member is required. DomainName *string // Identity and Access Management (IAM) access policy as a JSON-formatted string. AccessPolicies *string // Key-value pairs to specify advanced configuration options. The following // key-value pairs are supported: // - "rest.action.multi.allow_explicit_index": "true" | "false" - Note the use of // a string rather than a boolean. Specifies whether explicit references to indexes // are allowed inside the body of HTTP requests. If you want to configure access // policies for domain sub-resources, such as specific indexes and domain APIs, you // must disable this property. Default is true. // - "indices.fielddata.cache.size": "80" - Note the use of a string rather than // a boolean. Specifies the percentage of heap space allocated to field data. // Default is unbounded. // - "indices.query.bool.max_clause_count": "1024" - Note the use of a string // rather than a boolean. Specifies the maximum number of clauses allowed in a // Lucene boolean query. Default is 1,024. Queries with more than the permitted // number of clauses result in a TooManyClauses error. // For more information, see Advanced cluster parameters (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options) // . AdvancedOptions map[string]string // Options for fine-grained access control. AdvancedSecurityOptions *types.AdvancedSecurityOptionsInput // Options for Auto-Tune. AutoTuneOptions *types.AutoTuneOptions // Changes that you want to make to the cluster configuration, such as the // instance type and number of EC2 instances. ClusterConfig *types.ClusterConfig // Key-value pairs to configure Amazon Cognito authentication for OpenSearch // Dashboards. CognitoOptions *types.CognitoOptions // Additional options for the domain endpoint, such as whether to require HTTPS // for all traffic. DomainEndpointOptions *types.DomainEndpointOptions // This flag, when set to True, specifies whether the UpdateDomain request should // return the results of a dry run analysis without actually applying the change. A // dry run determines what type of deployment the update will cause. DryRun *bool // The type of dry run to perform. // - Basic only returns the type of deployment (blue/green or dynamic) that the // update will cause. // - Verbose runs an additional check to validate the changes you're making. For // more information, see Validating a domain update (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-configuration-changes#validation-check) // . DryRunMode types.DryRunMode // The type and size of the EBS volume to attach to instances in the domain. EBSOptions *types.EBSOptions // Encryption at rest options for the domain. EncryptionAtRestOptions *types.EncryptionAtRestOptions // Options to publish OpenSearch logs to Amazon CloudWatch Logs. LogPublishingOptions map[string]types.LogPublishingOption // Node-to-node encryption options for the domain. NodeToNodeEncryptionOptions *types.NodeToNodeEncryptionOptions // Off-peak window options for the domain. OffPeakWindowOptions *types.OffPeakWindowOptions // Option to set the time, in UTC format, for the daily automated snapshot. // Default value is 0 hours. SnapshotOptions *types.SnapshotOptions // Service software update options for the domain. SoftwareUpdateOptions *types.SoftwareUpdateOptions // Options to specify the subnets and security groups for a VPC endpoint. For more // information, see Launching your Amazon OpenSearch Service domains using a VPC (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/vpc.html) // . VPCOptions *types.VPCOptions noSmithyDocumentSerde } // The results of an UpdateDomain request. Contains the status of the domain being // updated. type UpdateDomainConfigOutput struct { // The status of the updated domain. // // This member is required. DomainConfig *types.DomainConfig // The status of the dry run being performed on the domain, if any. DryRunProgressStatus *types.DryRunProgressStatus // Results of the dry run performed in the update domain request. DryRunResults *types.DryRunResults // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateDomainConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateDomainConfig{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateDomainConfig{}, 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 = addOpUpdateDomainConfigValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDomainConfig(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_opUpdateDomainConfig(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "es", OperationName: "UpdateDomainConfig", } }
216
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch 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/opensearch/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates a package for use with Amazon OpenSearch Service domains. For more // information, see Custom packages for Amazon OpenSearch Service (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/custom-packages.html) // . func (c *Client) UpdatePackage(ctx context.Context, params *UpdatePackageInput, optFns ...func(*Options)) (*UpdatePackageOutput, error) { if params == nil { params = &UpdatePackageInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdatePackage", params, optFns, c.addOperationUpdatePackageMiddlewares) if err != nil { return nil, err } out := result.(*UpdatePackageOutput) out.ResultMetadata = metadata return out, nil } // Container for request parameters to the UpdatePackage operation. type UpdatePackageInput struct { // The unique identifier for the package. // // This member is required. PackageID *string // Amazon S3 bucket and key for the package. // // This member is required. PackageSource *types.PackageSource // Commit message for the updated file, which is shown as part of // GetPackageVersionHistoryResponse . CommitMessage *string // A new description of the package. PackageDescription *string noSmithyDocumentSerde } // Container for the response returned by the UpdatePackage operation. type UpdatePackageOutput struct { // Information about a package. PackageDetails *types.PackageDetails // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdatePackageMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdatePackage{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdatePackage{}, 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 = addOpUpdatePackageValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePackage(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_opUpdatePackage(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "es", OperationName: "UpdatePackage", } }
141
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch 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/opensearch/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Reschedules a planned domain configuration change for a later time. This change // can be a scheduled service software update (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/service-software.html) // or a blue/green Auto-Tune enhancement (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html#auto-tune-types) // . func (c *Client) UpdateScheduledAction(ctx context.Context, params *UpdateScheduledActionInput, optFns ...func(*Options)) (*UpdateScheduledActionOutput, error) { if params == nil { params = &UpdateScheduledActionInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateScheduledAction", params, optFns, c.addOperationUpdateScheduledActionMiddlewares) if err != nil { return nil, err } out := result.(*UpdateScheduledActionOutput) out.ResultMetadata = metadata return out, nil } type UpdateScheduledActionInput struct { // The unique identifier of the action to reschedule. To retrieve this ID, send a // ListScheduledActions (https://docs.aws.amazon.com/opensearch-service/latest/APIReference/API_ListScheduledActions.html) // request. // // This member is required. ActionID *string // The type of action to reschedule. Can be one of SERVICE_SOFTWARE_UPDATE , // JVM_HEAP_SIZE_TUNING , or JVM_YOUNG_GEN_TUNING . To retrieve this value, send a // ListScheduledActions (https://docs.aws.amazon.com/opensearch-service/latest/APIReference/API_ListScheduledActions.html) // request. // // This member is required. ActionType types.ActionType // The name of the domain to reschedule an action for. // // This member is required. DomainName *string // When to schedule the action. // - NOW - Immediately schedules the update to happen in the current hour if // there's capacity available. // - TIMESTAMP - Lets you specify a custom date and time to apply the update. If // you specify this value, you must also provide a value for DesiredStartTime . // - OFF_PEAK_WINDOW - Marks the action to be picked up during an upcoming // off-peak window. There's no guarantee that the change will be implemented during // the next immediate window. Depending on capacity, it might happen in subsequent // days. // // This member is required. ScheduleAt types.ScheduleAt // The time to implement the change, in Coordinated Universal Time (UTC). Only // specify this parameter if you set ScheduleAt to TIMESTAMP . DesiredStartTime *int64 noSmithyDocumentSerde } type UpdateScheduledActionOutput struct { // Information about the rescheduled action. ScheduledAction *types.ScheduledAction // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateScheduledActionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateScheduledAction{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateScheduledAction{}, 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 = addOpUpdateScheduledActionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateScheduledAction(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_opUpdateScheduledAction(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "es", OperationName: "UpdateScheduledAction", } }
160
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch 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/opensearch/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Modifies an Amazon OpenSearch Service-managed interface VPC endpoint. func (c *Client) UpdateVpcEndpoint(ctx context.Context, params *UpdateVpcEndpointInput, optFns ...func(*Options)) (*UpdateVpcEndpointOutput, error) { if params == nil { params = &UpdateVpcEndpointInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateVpcEndpoint", params, optFns, c.addOperationUpdateVpcEndpointMiddlewares) if err != nil { return nil, err } out := result.(*UpdateVpcEndpointOutput) out.ResultMetadata = metadata return out, nil } type UpdateVpcEndpointInput struct { // The unique identifier of the endpoint. // // This member is required. VpcEndpointId *string // The security groups and/or subnets to add, remove, or modify. // // This member is required. VpcOptions *types.VPCOptions noSmithyDocumentSerde } type UpdateVpcEndpointOutput struct { // The endpoint to be updated. // // This member is required. VpcEndpoint *types.VpcEndpoint // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateVpcEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateVpcEndpoint{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateVpcEndpoint{}, 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 = addOpUpdateVpcEndpointValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateVpcEndpoint(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_opUpdateVpcEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "es", OperationName: "UpdateVpcEndpoint", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch 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/opensearch/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Allows you to either upgrade your Amazon OpenSearch Service domain or perform // an upgrade eligibility check to a compatible version of OpenSearch or // Elasticsearch. func (c *Client) UpgradeDomain(ctx context.Context, params *UpgradeDomainInput, optFns ...func(*Options)) (*UpgradeDomainOutput, error) { if params == nil { params = &UpgradeDomainInput{} } result, metadata, err := c.invokeOperation(ctx, "UpgradeDomain", params, optFns, c.addOperationUpgradeDomainMiddlewares) if err != nil { return nil, err } out := result.(*UpgradeDomainOutput) out.ResultMetadata = metadata return out, nil } // Container for the request parameters to the UpgradeDomain operation. type UpgradeDomainInput struct { // Name of the OpenSearch Service domain that you want to upgrade. // // This member is required. DomainName *string // OpenSearch or Elasticsearch version to which you want to upgrade, in the format // Opensearch_X.Y or Elasticsearch_X.Y. // // This member is required. TargetVersion *string // Only supports the override_main_response_version parameter and not other // advanced options. You can only include this option when upgrading to an // OpenSearch version. Specifies whether the domain reports its version as 7.10 so // that it continues to work with Elasticsearch OSS clients and plugins. AdvancedOptions map[string]string // When true, indicates that an upgrade eligibility check needs to be performed. // Does not actually perform the upgrade. PerformCheckOnly *bool noSmithyDocumentSerde } // Container for the response returned by UpgradeDomain operation. type UpgradeDomainOutput struct { // The advanced options configuration for the domain. AdvancedOptions map[string]string // Container for information about a configuration change happening on a domain. ChangeProgressDetails *types.ChangeProgressDetails // The name of the domain that was upgraded. DomainName *string // When true, indicates that an upgrade eligibility check was performed. PerformCheckOnly *bool // OpenSearch or Elasticsearch version that the domain was upgraded to. TargetVersion *string // The unique identifier of the domain upgrade. UpgradeId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpgradeDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpgradeDomain{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpgradeDomain{}, 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 = addOpUpgradeDomainValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpgradeDomain(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_opUpgradeDomain(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "es", OperationName: "UpgradeDomain", } }
160
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/opensearch/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" "io/ioutil" "math" "strings" ) type awsRestjson1_deserializeOpAcceptInboundConnection struct { } func (*awsRestjson1_deserializeOpAcceptInboundConnection) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpAcceptInboundConnection) 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_deserializeOpErrorAcceptInboundConnection(response, &metadata) } output := &AcceptInboundConnectionOutput{} 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_deserializeOpDocumentAcceptInboundConnectionOutput(&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_deserializeOpErrorAcceptInboundConnection(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("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentAcceptInboundConnectionOutput(v **AcceptInboundConnectionOutput, 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 *AcceptInboundConnectionOutput if *v == nil { sv = &AcceptInboundConnectionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Connection": if err := awsRestjson1_deserializeDocumentInboundConnection(&sv.Connection, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpAddTags struct { } func (*awsRestjson1_deserializeOpAddTags) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpAddTags) 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_deserializeOpErrorAddTags(response, &metadata) } output := &AddTagsOutput{} 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_deserializeOpErrorAddTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpAssociatePackage struct { } func (*awsRestjson1_deserializeOpAssociatePackage) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpAssociatePackage) 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_deserializeOpErrorAssociatePackage(response, &metadata) } output := &AssociatePackageOutput{} 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_deserializeOpDocumentAssociatePackageOutput(&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_deserializeOpErrorAssociatePackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentAssociatePackageOutput(v **AssociatePackageOutput, 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 *AssociatePackageOutput if *v == nil { sv = &AssociatePackageOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DomainPackageDetails": if err := awsRestjson1_deserializeDocumentDomainPackageDetails(&sv.DomainPackageDetails, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpAuthorizeVpcEndpointAccess struct { } func (*awsRestjson1_deserializeOpAuthorizeVpcEndpointAccess) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpAuthorizeVpcEndpointAccess) 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_deserializeOpErrorAuthorizeVpcEndpointAccess(response, &metadata) } output := &AuthorizeVpcEndpointAccessOutput{} 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_deserializeOpDocumentAuthorizeVpcEndpointAccessOutput(&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_deserializeOpErrorAuthorizeVpcEndpointAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentAuthorizeVpcEndpointAccessOutput(v **AuthorizeVpcEndpointAccessOutput, 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 *AuthorizeVpcEndpointAccessOutput if *v == nil { sv = &AuthorizeVpcEndpointAccessOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AuthorizedPrincipal": if err := awsRestjson1_deserializeDocumentAuthorizedPrincipal(&sv.AuthorizedPrincipal, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCancelServiceSoftwareUpdate struct { } func (*awsRestjson1_deserializeOpCancelServiceSoftwareUpdate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCancelServiceSoftwareUpdate) 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_deserializeOpErrorCancelServiceSoftwareUpdate(response, &metadata) } output := &CancelServiceSoftwareUpdateOutput{} 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_deserializeOpDocumentCancelServiceSoftwareUpdateOutput(&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_deserializeOpErrorCancelServiceSoftwareUpdate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCancelServiceSoftwareUpdateOutput(v **CancelServiceSoftwareUpdateOutput, 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 *CancelServiceSoftwareUpdateOutput if *v == nil { sv = &CancelServiceSoftwareUpdateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ServiceSoftwareOptions": if err := awsRestjson1_deserializeDocumentServiceSoftwareOptions(&sv.ServiceSoftwareOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateDomain struct { } func (*awsRestjson1_deserializeOpCreateDomain) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateDomain) 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_deserializeOpErrorCreateDomain(response, &metadata) } output := &CreateDomainOutput{} 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_deserializeOpDocumentCreateDomainOutput(&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_deserializeOpErrorCreateDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidTypeException", errorCode): return awsRestjson1_deserializeErrorInvalidTypeException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateDomainOutput(v **CreateDomainOutput, 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 *CreateDomainOutput if *v == nil { sv = &CreateDomainOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DomainStatus": if err := awsRestjson1_deserializeDocumentDomainStatus(&sv.DomainStatus, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateOutboundConnection struct { } func (*awsRestjson1_deserializeOpCreateOutboundConnection) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateOutboundConnection) 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_deserializeOpErrorCreateOutboundConnection(response, &metadata) } output := &CreateOutboundConnectionOutput{} 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_deserializeOpDocumentCreateOutboundConnectionOutput(&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_deserializeOpErrorCreateOutboundConnection(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("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateOutboundConnectionOutput(v **CreateOutboundConnectionOutput, 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 *CreateOutboundConnectionOutput if *v == nil { sv = &CreateOutboundConnectionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ConnectionAlias": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectionAlias to be of type string, got %T instead", value) } sv.ConnectionAlias = ptr.String(jtv) } case "ConnectionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectionId to be of type string, got %T instead", value) } sv.ConnectionId = ptr.String(jtv) } case "ConnectionMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectionMode to be of type string, got %T instead", value) } sv.ConnectionMode = types.ConnectionMode(jtv) } case "ConnectionProperties": if err := awsRestjson1_deserializeDocumentConnectionProperties(&sv.ConnectionProperties, value); err != nil { return err } case "ConnectionStatus": if err := awsRestjson1_deserializeDocumentOutboundConnectionStatus(&sv.ConnectionStatus, value); err != nil { return err } case "LocalDomainInfo": if err := awsRestjson1_deserializeDocumentDomainInformationContainer(&sv.LocalDomainInfo, value); err != nil { return err } case "RemoteDomainInfo": if err := awsRestjson1_deserializeDocumentDomainInformationContainer(&sv.RemoteDomainInfo, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreatePackage struct { } func (*awsRestjson1_deserializeOpCreatePackage) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreatePackage) 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_deserializeOpErrorCreatePackage(response, &metadata) } output := &CreatePackageOutput{} 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_deserializeOpDocumentCreatePackageOutput(&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_deserializeOpErrorCreatePackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidTypeException", errorCode): return awsRestjson1_deserializeErrorInvalidTypeException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreatePackageOutput(v **CreatePackageOutput, 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 *CreatePackageOutput if *v == nil { sv = &CreatePackageOutput{} } else { sv = *v } for key, value := range shape { switch key { case "PackageDetails": if err := awsRestjson1_deserializeDocumentPackageDetails(&sv.PackageDetails, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateVpcEndpoint struct { } func (*awsRestjson1_deserializeOpCreateVpcEndpoint) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateVpcEndpoint) 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_deserializeOpErrorCreateVpcEndpoint(response, &metadata) } output := &CreateVpcEndpointOutput{} 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_deserializeOpDocumentCreateVpcEndpointOutput(&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_deserializeOpErrorCreateVpcEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateVpcEndpointOutput(v **CreateVpcEndpointOutput, 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 *CreateVpcEndpointOutput if *v == nil { sv = &CreateVpcEndpointOutput{} } else { sv = *v } for key, value := range shape { switch key { case "VpcEndpoint": if err := awsRestjson1_deserializeDocumentVpcEndpoint(&sv.VpcEndpoint, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteDomain struct { } func (*awsRestjson1_deserializeOpDeleteDomain) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteDomain) 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_deserializeOpErrorDeleteDomain(response, &metadata) } output := &DeleteDomainOutput{} 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_deserializeOpDocumentDeleteDomainOutput(&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_deserializeOpErrorDeleteDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteDomainOutput(v **DeleteDomainOutput, 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 *DeleteDomainOutput if *v == nil { sv = &DeleteDomainOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DomainStatus": if err := awsRestjson1_deserializeDocumentDomainStatus(&sv.DomainStatus, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteInboundConnection struct { } func (*awsRestjson1_deserializeOpDeleteInboundConnection) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteInboundConnection) 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_deserializeOpErrorDeleteInboundConnection(response, &metadata) } output := &DeleteInboundConnectionOutput{} 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_deserializeOpDocumentDeleteInboundConnectionOutput(&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_deserializeOpErrorDeleteInboundConnection(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("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteInboundConnectionOutput(v **DeleteInboundConnectionOutput, 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 *DeleteInboundConnectionOutput if *v == nil { sv = &DeleteInboundConnectionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Connection": if err := awsRestjson1_deserializeDocumentInboundConnection(&sv.Connection, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteOutboundConnection struct { } func (*awsRestjson1_deserializeOpDeleteOutboundConnection) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteOutboundConnection) 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_deserializeOpErrorDeleteOutboundConnection(response, &metadata) } output := &DeleteOutboundConnectionOutput{} 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_deserializeOpDocumentDeleteOutboundConnectionOutput(&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_deserializeOpErrorDeleteOutboundConnection(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("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteOutboundConnectionOutput(v **DeleteOutboundConnectionOutput, 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 *DeleteOutboundConnectionOutput if *v == nil { sv = &DeleteOutboundConnectionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Connection": if err := awsRestjson1_deserializeDocumentOutboundConnection(&sv.Connection, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeletePackage struct { } func (*awsRestjson1_deserializeOpDeletePackage) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeletePackage) 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_deserializeOpErrorDeletePackage(response, &metadata) } output := &DeletePackageOutput{} 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_deserializeOpDocumentDeletePackageOutput(&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_deserializeOpErrorDeletePackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeletePackageOutput(v **DeletePackageOutput, 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 *DeletePackageOutput if *v == nil { sv = &DeletePackageOutput{} } else { sv = *v } for key, value := range shape { switch key { case "PackageDetails": if err := awsRestjson1_deserializeDocumentPackageDetails(&sv.PackageDetails, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteVpcEndpoint struct { } func (*awsRestjson1_deserializeOpDeleteVpcEndpoint) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteVpcEndpoint) 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_deserializeOpErrorDeleteVpcEndpoint(response, &metadata) } output := &DeleteVpcEndpointOutput{} 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_deserializeOpDocumentDeleteVpcEndpointOutput(&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_deserializeOpErrorDeleteVpcEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteVpcEndpointOutput(v **DeleteVpcEndpointOutput, 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 *DeleteVpcEndpointOutput if *v == nil { sv = &DeleteVpcEndpointOutput{} } else { sv = *v } for key, value := range shape { switch key { case "VpcEndpointSummary": if err := awsRestjson1_deserializeDocumentVpcEndpointSummary(&sv.VpcEndpointSummary, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeDomain struct { } func (*awsRestjson1_deserializeOpDescribeDomain) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeDomain) 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_deserializeOpErrorDescribeDomain(response, &metadata) } output := &DescribeDomainOutput{} 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_deserializeOpDocumentDescribeDomainOutput(&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_deserializeOpErrorDescribeDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeDomainOutput(v **DescribeDomainOutput, 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 *DescribeDomainOutput if *v == nil { sv = &DescribeDomainOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DomainStatus": if err := awsRestjson1_deserializeDocumentDomainStatus(&sv.DomainStatus, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeDomainAutoTunes struct { } func (*awsRestjson1_deserializeOpDescribeDomainAutoTunes) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeDomainAutoTunes) 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_deserializeOpErrorDescribeDomainAutoTunes(response, &metadata) } output := &DescribeDomainAutoTunesOutput{} 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_deserializeOpDocumentDescribeDomainAutoTunesOutput(&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_deserializeOpErrorDescribeDomainAutoTunes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeDomainAutoTunesOutput(v **DescribeDomainAutoTunesOutput, 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 *DescribeDomainAutoTunesOutput if *v == nil { sv = &DescribeDomainAutoTunesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AutoTunes": if err := awsRestjson1_deserializeDocumentAutoTuneList(&sv.AutoTunes, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeDomainChangeProgress struct { } func (*awsRestjson1_deserializeOpDescribeDomainChangeProgress) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeDomainChangeProgress) 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_deserializeOpErrorDescribeDomainChangeProgress(response, &metadata) } output := &DescribeDomainChangeProgressOutput{} 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_deserializeOpDocumentDescribeDomainChangeProgressOutput(&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_deserializeOpErrorDescribeDomainChangeProgress(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeDomainChangeProgressOutput(v **DescribeDomainChangeProgressOutput, 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 *DescribeDomainChangeProgressOutput if *v == nil { sv = &DescribeDomainChangeProgressOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ChangeProgressStatus": if err := awsRestjson1_deserializeDocumentChangeProgressStatusDetails(&sv.ChangeProgressStatus, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeDomainConfig struct { } func (*awsRestjson1_deserializeOpDescribeDomainConfig) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeDomainConfig) 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_deserializeOpErrorDescribeDomainConfig(response, &metadata) } output := &DescribeDomainConfigOutput{} 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_deserializeOpDocumentDescribeDomainConfigOutput(&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_deserializeOpErrorDescribeDomainConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeDomainConfigOutput(v **DescribeDomainConfigOutput, 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 *DescribeDomainConfigOutput if *v == nil { sv = &DescribeDomainConfigOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DomainConfig": if err := awsRestjson1_deserializeDocumentDomainConfig(&sv.DomainConfig, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeDomainHealth struct { } func (*awsRestjson1_deserializeOpDescribeDomainHealth) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeDomainHealth) 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_deserializeOpErrorDescribeDomainHealth(response, &metadata) } output := &DescribeDomainHealthOutput{} 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_deserializeOpDocumentDescribeDomainHealthOutput(&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_deserializeOpErrorDescribeDomainHealth(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeDomainHealthOutput(v **DescribeDomainHealthOutput, 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 *DescribeDomainHealthOutput if *v == nil { sv = &DescribeDomainHealthOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ActiveAvailabilityZoneCount": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NumberOfAZs to be of type string, got %T instead", value) } sv.ActiveAvailabilityZoneCount = ptr.String(jtv) } case "AvailabilityZoneCount": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NumberOfAZs to be of type string, got %T instead", value) } sv.AvailabilityZoneCount = ptr.String(jtv) } case "ClusterHealth": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainHealth to be of type string, got %T instead", value) } sv.ClusterHealth = types.DomainHealth(jtv) } case "DataNodeCount": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NumberOfNodes to be of type string, got %T instead", value) } sv.DataNodeCount = ptr.String(jtv) } case "DedicatedMaster": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DedicatedMaster = ptr.Bool(jtv) } case "DomainState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainState to be of type string, got %T instead", value) } sv.DomainState = types.DomainState(jtv) } case "EnvironmentInformation": if err := awsRestjson1_deserializeDocumentEnvironmentInfoList(&sv.EnvironmentInformation, value); err != nil { return err } case "MasterEligibleNodeCount": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NumberOfNodes to be of type string, got %T instead", value) } sv.MasterEligibleNodeCount = ptr.String(jtv) } case "MasterNode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MasterNodeStatus to be of type string, got %T instead", value) } sv.MasterNode = types.MasterNodeStatus(jtv) } case "StandByAvailabilityZoneCount": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NumberOfAZs to be of type string, got %T instead", value) } sv.StandByAvailabilityZoneCount = ptr.String(jtv) } case "TotalShards": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NumberOfShards to be of type string, got %T instead", value) } sv.TotalShards = ptr.String(jtv) } case "TotalUnAssignedShards": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NumberOfShards to be of type string, got %T instead", value) } sv.TotalUnAssignedShards = ptr.String(jtv) } case "WarmNodeCount": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NumberOfNodes to be of type string, got %T instead", value) } sv.WarmNodeCount = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeDomainNodes struct { } func (*awsRestjson1_deserializeOpDescribeDomainNodes) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeDomainNodes) 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_deserializeOpErrorDescribeDomainNodes(response, &metadata) } output := &DescribeDomainNodesOutput{} 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_deserializeOpDocumentDescribeDomainNodesOutput(&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_deserializeOpErrorDescribeDomainNodes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("DependencyFailureException", errorCode): return awsRestjson1_deserializeErrorDependencyFailureException(response, errorBody) case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeDomainNodesOutput(v **DescribeDomainNodesOutput, 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 *DescribeDomainNodesOutput if *v == nil { sv = &DescribeDomainNodesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DomainNodesStatusList": if err := awsRestjson1_deserializeDocumentDomainNodesStatusList(&sv.DomainNodesStatusList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeDomains struct { } func (*awsRestjson1_deserializeOpDescribeDomains) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeDomains) 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_deserializeOpErrorDescribeDomains(response, &metadata) } output := &DescribeDomainsOutput{} 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_deserializeOpDocumentDescribeDomainsOutput(&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_deserializeOpErrorDescribeDomains(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeDomainsOutput(v **DescribeDomainsOutput, 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 *DescribeDomainsOutput if *v == nil { sv = &DescribeDomainsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DomainStatusList": if err := awsRestjson1_deserializeDocumentDomainStatusList(&sv.DomainStatusList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeDryRunProgress struct { } func (*awsRestjson1_deserializeOpDescribeDryRunProgress) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeDryRunProgress) 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_deserializeOpErrorDescribeDryRunProgress(response, &metadata) } output := &DescribeDryRunProgressOutput{} 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_deserializeOpDocumentDescribeDryRunProgressOutput(&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_deserializeOpErrorDescribeDryRunProgress(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeDryRunProgressOutput(v **DescribeDryRunProgressOutput, 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 *DescribeDryRunProgressOutput if *v == nil { sv = &DescribeDryRunProgressOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DryRunConfig": if err := awsRestjson1_deserializeDocumentDomainStatus(&sv.DryRunConfig, value); err != nil { return err } case "DryRunProgressStatus": if err := awsRestjson1_deserializeDocumentDryRunProgressStatus(&sv.DryRunProgressStatus, value); err != nil { return err } case "DryRunResults": if err := awsRestjson1_deserializeDocumentDryRunResults(&sv.DryRunResults, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeInboundConnections struct { } func (*awsRestjson1_deserializeOpDescribeInboundConnections) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeInboundConnections) 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_deserializeOpErrorDescribeInboundConnections(response, &metadata) } output := &DescribeInboundConnectionsOutput{} 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_deserializeOpDocumentDescribeInboundConnectionsOutput(&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_deserializeOpErrorDescribeInboundConnections(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("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InvalidPaginationTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeInboundConnectionsOutput(v **DescribeInboundConnectionsOutput, 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 *DescribeInboundConnectionsOutput if *v == nil { sv = &DescribeInboundConnectionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Connections": if err := awsRestjson1_deserializeDocumentInboundConnections(&sv.Connections, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeInstanceTypeLimits struct { } func (*awsRestjson1_deserializeOpDescribeInstanceTypeLimits) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeInstanceTypeLimits) 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_deserializeOpErrorDescribeInstanceTypeLimits(response, &metadata) } output := &DescribeInstanceTypeLimitsOutput{} 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_deserializeOpDocumentDescribeInstanceTypeLimitsOutput(&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_deserializeOpErrorDescribeInstanceTypeLimits(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidTypeException", errorCode): return awsRestjson1_deserializeErrorInvalidTypeException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeInstanceTypeLimitsOutput(v **DescribeInstanceTypeLimitsOutput, 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 *DescribeInstanceTypeLimitsOutput if *v == nil { sv = &DescribeInstanceTypeLimitsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "LimitsByRole": if err := awsRestjson1_deserializeDocumentLimitsByRole(&sv.LimitsByRole, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeOutboundConnections struct { } func (*awsRestjson1_deserializeOpDescribeOutboundConnections) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeOutboundConnections) 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_deserializeOpErrorDescribeOutboundConnections(response, &metadata) } output := &DescribeOutboundConnectionsOutput{} 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_deserializeOpDocumentDescribeOutboundConnectionsOutput(&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_deserializeOpErrorDescribeOutboundConnections(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("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InvalidPaginationTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeOutboundConnectionsOutput(v **DescribeOutboundConnectionsOutput, 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 *DescribeOutboundConnectionsOutput if *v == nil { sv = &DescribeOutboundConnectionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Connections": if err := awsRestjson1_deserializeDocumentOutboundConnections(&sv.Connections, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribePackages struct { } func (*awsRestjson1_deserializeOpDescribePackages) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribePackages) 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_deserializeOpErrorDescribePackages(response, &metadata) } output := &DescribePackagesOutput{} 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_deserializeOpDocumentDescribePackagesOutput(&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_deserializeOpErrorDescribePackages(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribePackagesOutput(v **DescribePackagesOutput, 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 *DescribePackagesOutput if *v == nil { sv = &DescribePackagesOutput{} } 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 String to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "PackageDetailsList": if err := awsRestjson1_deserializeDocumentPackageDetailsList(&sv.PackageDetailsList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeReservedInstanceOfferings struct { } func (*awsRestjson1_deserializeOpDescribeReservedInstanceOfferings) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeReservedInstanceOfferings) 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_deserializeOpErrorDescribeReservedInstanceOfferings(response, &metadata) } output := &DescribeReservedInstanceOfferingsOutput{} 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_deserializeOpDocumentDescribeReservedInstanceOfferingsOutput(&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_deserializeOpErrorDescribeReservedInstanceOfferings(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("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeReservedInstanceOfferingsOutput(v **DescribeReservedInstanceOfferingsOutput, 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 *DescribeReservedInstanceOfferingsOutput if *v == nil { sv = &DescribeReservedInstanceOfferingsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "ReservedInstanceOfferings": if err := awsRestjson1_deserializeDocumentReservedInstanceOfferingList(&sv.ReservedInstanceOfferings, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeReservedInstances struct { } func (*awsRestjson1_deserializeOpDescribeReservedInstances) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeReservedInstances) 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_deserializeOpErrorDescribeReservedInstances(response, &metadata) } output := &DescribeReservedInstancesOutput{} 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_deserializeOpDocumentDescribeReservedInstancesOutput(&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_deserializeOpErrorDescribeReservedInstances(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("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeReservedInstancesOutput(v **DescribeReservedInstancesOutput, 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 *DescribeReservedInstancesOutput if *v == nil { sv = &DescribeReservedInstancesOutput{} } 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 String to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "ReservedInstances": if err := awsRestjson1_deserializeDocumentReservedInstanceList(&sv.ReservedInstances, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeVpcEndpoints struct { } func (*awsRestjson1_deserializeOpDescribeVpcEndpoints) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeVpcEndpoints) 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_deserializeOpErrorDescribeVpcEndpoints(response, &metadata) } output := &DescribeVpcEndpointsOutput{} 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_deserializeOpDocumentDescribeVpcEndpointsOutput(&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_deserializeOpErrorDescribeVpcEndpoints(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeVpcEndpointsOutput(v **DescribeVpcEndpointsOutput, 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 *DescribeVpcEndpointsOutput if *v == nil { sv = &DescribeVpcEndpointsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "VpcEndpointErrors": if err := awsRestjson1_deserializeDocumentVpcEndpointErrorList(&sv.VpcEndpointErrors, value); err != nil { return err } case "VpcEndpoints": if err := awsRestjson1_deserializeDocumentVpcEndpoints(&sv.VpcEndpoints, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDissociatePackage struct { } func (*awsRestjson1_deserializeOpDissociatePackage) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDissociatePackage) 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_deserializeOpErrorDissociatePackage(response, &metadata) } output := &DissociatePackageOutput{} 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_deserializeOpDocumentDissociatePackageOutput(&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_deserializeOpErrorDissociatePackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDissociatePackageOutput(v **DissociatePackageOutput, 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 *DissociatePackageOutput if *v == nil { sv = &DissociatePackageOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DomainPackageDetails": if err := awsRestjson1_deserializeDocumentDomainPackageDetails(&sv.DomainPackageDetails, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetCompatibleVersions struct { } func (*awsRestjson1_deserializeOpGetCompatibleVersions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetCompatibleVersions) 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_deserializeOpErrorGetCompatibleVersions(response, &metadata) } output := &GetCompatibleVersionsOutput{} 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_deserializeOpDocumentGetCompatibleVersionsOutput(&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_deserializeOpErrorGetCompatibleVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetCompatibleVersionsOutput(v **GetCompatibleVersionsOutput, 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 *GetCompatibleVersionsOutput if *v == nil { sv = &GetCompatibleVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "CompatibleVersions": if err := awsRestjson1_deserializeDocumentCompatibleVersionsList(&sv.CompatibleVersions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetPackageVersionHistory struct { } func (*awsRestjson1_deserializeOpGetPackageVersionHistory) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetPackageVersionHistory) 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_deserializeOpErrorGetPackageVersionHistory(response, &metadata) } output := &GetPackageVersionHistoryOutput{} 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_deserializeOpDocumentGetPackageVersionHistoryOutput(&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_deserializeOpErrorGetPackageVersionHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetPackageVersionHistoryOutput(v **GetPackageVersionHistoryOutput, 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 *GetPackageVersionHistoryOutput if *v == nil { sv = &GetPackageVersionHistoryOutput{} } 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 String to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "PackageID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PackageID to be of type string, got %T instead", value) } sv.PackageID = ptr.String(jtv) } case "PackageVersionHistoryList": if err := awsRestjson1_deserializeDocumentPackageVersionHistoryList(&sv.PackageVersionHistoryList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetUpgradeHistory struct { } func (*awsRestjson1_deserializeOpGetUpgradeHistory) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetUpgradeHistory) 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_deserializeOpErrorGetUpgradeHistory(response, &metadata) } output := &GetUpgradeHistoryOutput{} 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_deserializeOpDocumentGetUpgradeHistoryOutput(&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_deserializeOpErrorGetUpgradeHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetUpgradeHistoryOutput(v **GetUpgradeHistoryOutput, 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 *GetUpgradeHistoryOutput if *v == nil { sv = &GetUpgradeHistoryOutput{} } 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 String to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "UpgradeHistories": if err := awsRestjson1_deserializeDocumentUpgradeHistoryList(&sv.UpgradeHistories, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetUpgradeStatus struct { } func (*awsRestjson1_deserializeOpGetUpgradeStatus) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetUpgradeStatus) 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_deserializeOpErrorGetUpgradeStatus(response, &metadata) } output := &GetUpgradeStatusOutput{} 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_deserializeOpDocumentGetUpgradeStatusOutput(&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_deserializeOpErrorGetUpgradeStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetUpgradeStatusOutput(v **GetUpgradeStatusOutput, 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 *GetUpgradeStatusOutput if *v == nil { sv = &GetUpgradeStatusOutput{} } else { sv = *v } for key, value := range shape { switch key { case "StepStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UpgradeStatus to be of type string, got %T instead", value) } sv.StepStatus = types.UpgradeStatus(jtv) } case "UpgradeName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UpgradeName to be of type string, got %T instead", value) } sv.UpgradeName = ptr.String(jtv) } case "UpgradeStep": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UpgradeStep to be of type string, got %T instead", value) } sv.UpgradeStep = types.UpgradeStep(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListDomainNames struct { } func (*awsRestjson1_deserializeOpListDomainNames) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListDomainNames) 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_deserializeOpErrorListDomainNames(response, &metadata) } output := &ListDomainNamesOutput{} 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_deserializeOpDocumentListDomainNamesOutput(&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_deserializeOpErrorListDomainNames(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListDomainNamesOutput(v **ListDomainNamesOutput, 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 *ListDomainNamesOutput if *v == nil { sv = &ListDomainNamesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DomainNames": if err := awsRestjson1_deserializeDocumentDomainInfoList(&sv.DomainNames, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListDomainsForPackage struct { } func (*awsRestjson1_deserializeOpListDomainsForPackage) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListDomainsForPackage) 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_deserializeOpErrorListDomainsForPackage(response, &metadata) } output := &ListDomainsForPackageOutput{} 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_deserializeOpDocumentListDomainsForPackageOutput(&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_deserializeOpErrorListDomainsForPackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListDomainsForPackageOutput(v **ListDomainsForPackageOutput, 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 *ListDomainsForPackageOutput if *v == nil { sv = &ListDomainsForPackageOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DomainPackageDetailsList": if err := awsRestjson1_deserializeDocumentDomainPackageDetailsList(&sv.DomainPackageDetailsList, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListInstanceTypeDetails struct { } func (*awsRestjson1_deserializeOpListInstanceTypeDetails) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListInstanceTypeDetails) 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_deserializeOpErrorListInstanceTypeDetails(response, &metadata) } output := &ListInstanceTypeDetailsOutput{} 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_deserializeOpDocumentListInstanceTypeDetailsOutput(&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_deserializeOpErrorListInstanceTypeDetails(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListInstanceTypeDetailsOutput(v **ListInstanceTypeDetailsOutput, 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 *ListInstanceTypeDetailsOutput if *v == nil { sv = &ListInstanceTypeDetailsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "InstanceTypeDetails": if err := awsRestjson1_deserializeDocumentInstanceTypeDetailsList(&sv.InstanceTypeDetails, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListPackagesForDomain struct { } func (*awsRestjson1_deserializeOpListPackagesForDomain) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListPackagesForDomain) 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_deserializeOpErrorListPackagesForDomain(response, &metadata) } output := &ListPackagesForDomainOutput{} 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_deserializeOpDocumentListPackagesForDomainOutput(&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_deserializeOpErrorListPackagesForDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListPackagesForDomainOutput(v **ListPackagesForDomainOutput, 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 *ListPackagesForDomainOutput if *v == nil { sv = &ListPackagesForDomainOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DomainPackageDetailsList": if err := awsRestjson1_deserializeDocumentDomainPackageDetailsList(&sv.DomainPackageDetailsList, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListScheduledActions struct { } func (*awsRestjson1_deserializeOpListScheduledActions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListScheduledActions) 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_deserializeOpErrorListScheduledActions(response, &metadata) } output := &ListScheduledActionsOutput{} 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_deserializeOpDocumentListScheduledActionsOutput(&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_deserializeOpErrorListScheduledActions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidPaginationTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListScheduledActionsOutput(v **ListScheduledActionsOutput, 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 *ListScheduledActionsOutput if *v == nil { sv = &ListScheduledActionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "ScheduledActions": if err := awsRestjson1_deserializeDocumentScheduledActionsList(&sv.ScheduledActions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTags struct { } func (*awsRestjson1_deserializeOpListTags) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTags) 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_deserializeOpErrorListTags(response, &metadata) } output := &ListTagsOutput{} 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_deserializeOpDocumentListTagsOutput(&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_deserializeOpErrorListTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListTagsOutput(v **ListTagsOutput, 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 *ListTagsOutput if *v == nil { sv = &ListTagsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "TagList": if err := awsRestjson1_deserializeDocumentTagList(&sv.TagList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListVersions struct { } func (*awsRestjson1_deserializeOpListVersions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListVersions) 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_deserializeOpErrorListVersions(response, &metadata) } output := &ListVersionsOutput{} 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_deserializeOpDocumentListVersionsOutput(&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_deserializeOpErrorListVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListVersionsOutput(v **ListVersionsOutput, 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 *ListVersionsOutput if *v == nil { sv = &ListVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "Versions": if err := awsRestjson1_deserializeDocumentVersionList(&sv.Versions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListVpcEndpointAccess struct { } func (*awsRestjson1_deserializeOpListVpcEndpointAccess) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListVpcEndpointAccess) 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_deserializeOpErrorListVpcEndpointAccess(response, &metadata) } output := &ListVpcEndpointAccessOutput{} 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_deserializeOpDocumentListVpcEndpointAccessOutput(&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_deserializeOpErrorListVpcEndpointAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListVpcEndpointAccessOutput(v **ListVpcEndpointAccessOutput, 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 *ListVpcEndpointAccessOutput if *v == nil { sv = &ListVpcEndpointAccessOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AuthorizedPrincipalList": if err := awsRestjson1_deserializeDocumentAuthorizedPrincipalList(&sv.AuthorizedPrincipalList, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListVpcEndpoints struct { } func (*awsRestjson1_deserializeOpListVpcEndpoints) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListVpcEndpoints) 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_deserializeOpErrorListVpcEndpoints(response, &metadata) } output := &ListVpcEndpointsOutput{} 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_deserializeOpDocumentListVpcEndpointsOutput(&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_deserializeOpErrorListVpcEndpoints(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListVpcEndpointsOutput(v **ListVpcEndpointsOutput, 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 *ListVpcEndpointsOutput if *v == nil { sv = &ListVpcEndpointsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "VpcEndpointSummaryList": if err := awsRestjson1_deserializeDocumentVpcEndpointSummaryList(&sv.VpcEndpointSummaryList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListVpcEndpointsForDomain struct { } func (*awsRestjson1_deserializeOpListVpcEndpointsForDomain) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListVpcEndpointsForDomain) 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_deserializeOpErrorListVpcEndpointsForDomain(response, &metadata) } output := &ListVpcEndpointsForDomainOutput{} 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_deserializeOpDocumentListVpcEndpointsForDomainOutput(&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_deserializeOpErrorListVpcEndpointsForDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListVpcEndpointsForDomainOutput(v **ListVpcEndpointsForDomainOutput, 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 *ListVpcEndpointsForDomainOutput if *v == nil { sv = &ListVpcEndpointsForDomainOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "VpcEndpointSummaryList": if err := awsRestjson1_deserializeDocumentVpcEndpointSummaryList(&sv.VpcEndpointSummaryList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpPurchaseReservedInstanceOffering struct { } func (*awsRestjson1_deserializeOpPurchaseReservedInstanceOffering) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpPurchaseReservedInstanceOffering) 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_deserializeOpErrorPurchaseReservedInstanceOffering(response, &metadata) } output := &PurchaseReservedInstanceOfferingOutput{} 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_deserializeOpDocumentPurchaseReservedInstanceOfferingOutput(&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_deserializeOpErrorPurchaseReservedInstanceOffering(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("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentPurchaseReservedInstanceOfferingOutput(v **PurchaseReservedInstanceOfferingOutput, 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 *PurchaseReservedInstanceOfferingOutput if *v == nil { sv = &PurchaseReservedInstanceOfferingOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ReservationName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReservationToken to be of type string, got %T instead", value) } sv.ReservationName = ptr.String(jtv) } case "ReservedInstanceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GUID to be of type string, got %T instead", value) } sv.ReservedInstanceId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpRejectInboundConnection struct { } func (*awsRestjson1_deserializeOpRejectInboundConnection) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpRejectInboundConnection) 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_deserializeOpErrorRejectInboundConnection(response, &metadata) } output := &RejectInboundConnectionOutput{} 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_deserializeOpDocumentRejectInboundConnectionOutput(&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_deserializeOpErrorRejectInboundConnection(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("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentRejectInboundConnectionOutput(v **RejectInboundConnectionOutput, 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 *RejectInboundConnectionOutput if *v == nil { sv = &RejectInboundConnectionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Connection": if err := awsRestjson1_deserializeDocumentInboundConnection(&sv.Connection, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpRemoveTags struct { } func (*awsRestjson1_deserializeOpRemoveTags) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpRemoveTags) 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_deserializeOpErrorRemoveTags(response, &metadata) } output := &RemoveTagsOutput{} 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_deserializeOpErrorRemoveTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpRevokeVpcEndpointAccess struct { } func (*awsRestjson1_deserializeOpRevokeVpcEndpointAccess) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpRevokeVpcEndpointAccess) 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_deserializeOpErrorRevokeVpcEndpointAccess(response, &metadata) } output := &RevokeVpcEndpointAccessOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorRevokeVpcEndpointAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpStartServiceSoftwareUpdate struct { } func (*awsRestjson1_deserializeOpStartServiceSoftwareUpdate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartServiceSoftwareUpdate) 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_deserializeOpErrorStartServiceSoftwareUpdate(response, &metadata) } output := &StartServiceSoftwareUpdateOutput{} 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_deserializeOpDocumentStartServiceSoftwareUpdateOutput(&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_deserializeOpErrorStartServiceSoftwareUpdate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentStartServiceSoftwareUpdateOutput(v **StartServiceSoftwareUpdateOutput, 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 *StartServiceSoftwareUpdateOutput if *v == nil { sv = &StartServiceSoftwareUpdateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ServiceSoftwareOptions": if err := awsRestjson1_deserializeDocumentServiceSoftwareOptions(&sv.ServiceSoftwareOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateDomainConfig struct { } func (*awsRestjson1_deserializeOpUpdateDomainConfig) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateDomainConfig) 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_deserializeOpErrorUpdateDomainConfig(response, &metadata) } output := &UpdateDomainConfigOutput{} 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_deserializeOpDocumentUpdateDomainConfigOutput(&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_deserializeOpErrorUpdateDomainConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidTypeException", errorCode): return awsRestjson1_deserializeErrorInvalidTypeException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateDomainConfigOutput(v **UpdateDomainConfigOutput, 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 *UpdateDomainConfigOutput if *v == nil { sv = &UpdateDomainConfigOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DomainConfig": if err := awsRestjson1_deserializeDocumentDomainConfig(&sv.DomainConfig, value); err != nil { return err } case "DryRunProgressStatus": if err := awsRestjson1_deserializeDocumentDryRunProgressStatus(&sv.DryRunProgressStatus, value); err != nil { return err } case "DryRunResults": if err := awsRestjson1_deserializeDocumentDryRunResults(&sv.DryRunResults, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdatePackage struct { } func (*awsRestjson1_deserializeOpUpdatePackage) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdatePackage) 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_deserializeOpErrorUpdatePackage(response, &metadata) } output := &UpdatePackageOutput{} 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_deserializeOpDocumentUpdatePackageOutput(&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_deserializeOpErrorUpdatePackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdatePackageOutput(v **UpdatePackageOutput, 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 *UpdatePackageOutput if *v == nil { sv = &UpdatePackageOutput{} } else { sv = *v } for key, value := range shape { switch key { case "PackageDetails": if err := awsRestjson1_deserializeDocumentPackageDetails(&sv.PackageDetails, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateScheduledAction struct { } func (*awsRestjson1_deserializeOpUpdateScheduledAction) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateScheduledAction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) 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_deserializeOpErrorUpdateScheduledAction(response, &metadata) } output := &UpdateScheduledActionOutput{} 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_deserializeOpDocumentUpdateScheduledActionOutput(&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_deserializeOpErrorUpdateScheduledAction(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("SlotNotAvailableException", errorCode): return awsRestjson1_deserializeErrorSlotNotAvailableException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateScheduledActionOutput(v **UpdateScheduledActionOutput, 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 *UpdateScheduledActionOutput if *v == nil { sv = &UpdateScheduledActionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ScheduledAction": if err := awsRestjson1_deserializeDocumentScheduledAction(&sv.ScheduledAction, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateVpcEndpoint struct { } func (*awsRestjson1_deserializeOpUpdateVpcEndpoint) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateVpcEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) 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_deserializeOpErrorUpdateVpcEndpoint(response, &metadata) } output := &UpdateVpcEndpointOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentUpdateVpcEndpointOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateVpcEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateVpcEndpointOutput(v **UpdateVpcEndpointOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateVpcEndpointOutput if *v == nil { sv = &UpdateVpcEndpointOutput{} } else { sv = *v } for key, value := range shape { switch key { case "VpcEndpoint": if err := awsRestjson1_deserializeDocumentVpcEndpoint(&sv.VpcEndpoint, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpgradeDomain struct { } func (*awsRestjson1_deserializeOpUpgradeDomain) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpgradeDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUpgradeDomain(response, &metadata) } output := &UpgradeDomainOutput{} out.Result = output 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_deserializeOpDocumentUpgradeDomainOutput(&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_deserializeOpErrorUpgradeDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpgradeDomainOutput(v **UpgradeDomainOutput, 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 *UpgradeDomainOutput if *v == nil { sv = &UpgradeDomainOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AdvancedOptions": if err := awsRestjson1_deserializeDocumentAdvancedOptions(&sv.AdvancedOptions, value); err != nil { return err } case "ChangeProgressDetails": if err := awsRestjson1_deserializeDocumentChangeProgressDetails(&sv.ChangeProgressDetails, value); err != nil { return err } case "DomainName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) } sv.DomainName = ptr.String(jtv) } case "PerformCheckOnly": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.PerformCheckOnly = ptr.Bool(jtv) } case "TargetVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VersionString to be of type string, got %T instead", value) } sv.TargetVersion = ptr.String(jtv) } case "UpgradeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.UpgradeId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv 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_deserializeErrorBaseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.BaseException{} 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_deserializeDocumentBaseException(&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_deserializeErrorDependencyFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.DependencyFailureException{} 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_deserializeDocumentDependencyFailureException(&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_deserializeErrorDisabledOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.DisabledOperationException{} 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_deserializeDocumentDisabledOperationException(&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_deserializeErrorInternalException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalException{} 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_deserializeDocumentInternalException(&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_deserializeErrorInvalidPaginationTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidPaginationTokenException{} 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_deserializeDocumentInvalidPaginationTokenException(&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_deserializeErrorInvalidTypeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidTypeException{} 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_deserializeDocumentInvalidTypeException(&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_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.LimitExceededException{} 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_deserializeDocumentLimitExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorResourceAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceAlreadyExistsException{} 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_deserializeDocumentResourceAlreadyExistsException(&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_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_deserializeErrorSlotNotAvailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.SlotNotAvailableException{} 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_deserializeDocumentSlotNotAvailableException(&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 "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 awsRestjson1_deserializeDocumentAccessPoliciesStatus(v **types.AccessPoliciesStatus, 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.AccessPoliciesStatus if *v == nil { sv = &types.AccessPoliciesStatus{} } else { sv = *v } for key, value := range shape { switch key { case "Options": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyDocument to be of type string, got %T instead", value) } sv.Options = ptr.String(jtv) } case "Status": if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAdditionalLimit(v **types.AdditionalLimit, 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.AdditionalLimit if *v == nil { sv = &types.AdditionalLimit{} } else { sv = *v } for key, value := range shape { switch key { case "LimitName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitName to be of type string, got %T instead", value) } sv.LimitName = ptr.String(jtv) } case "LimitValues": if err := awsRestjson1_deserializeDocumentLimitValueList(&sv.LimitValues, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAdditionalLimitList(v *[]types.AdditionalLimit, 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.AdditionalLimit if *v == nil { cv = []types.AdditionalLimit{} } else { cv = *v } for _, value := range shape { var col types.AdditionalLimit destAddr := &col if err := awsRestjson1_deserializeDocumentAdditionalLimit(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAdvancedOptions(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 String to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentAdvancedOptionsStatus(v **types.AdvancedOptionsStatus, 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.AdvancedOptionsStatus if *v == nil { sv = &types.AdvancedOptionsStatus{} } else { sv = *v } for key, value := range shape { switch key { case "Options": if err := awsRestjson1_deserializeDocumentAdvancedOptions(&sv.Options, value); err != nil { return err } case "Status": if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAdvancedSecurityOptions(v **types.AdvancedSecurityOptions, 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.AdvancedSecurityOptions if *v == nil { sv = &types.AdvancedSecurityOptions{} } else { sv = *v } for key, value := range shape { switch key { case "AnonymousAuthDisableDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.AnonymousAuthDisableDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DisableTimestamp to be a JSON Number, got %T instead", value) } } case "AnonymousAuthEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AnonymousAuthEnabled = ptr.Bool(jtv) } case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } case "InternalUserDatabaseEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.InternalUserDatabaseEnabled = ptr.Bool(jtv) } case "SAMLOptions": if err := awsRestjson1_deserializeDocumentSAMLOptionsOutput(&sv.SAMLOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAdvancedSecurityOptionsStatus(v **types.AdvancedSecurityOptionsStatus, 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.AdvancedSecurityOptionsStatus if *v == nil { sv = &types.AdvancedSecurityOptionsStatus{} } else { sv = *v } for key, value := range shape { switch key { case "Options": if err := awsRestjson1_deserializeDocumentAdvancedSecurityOptions(&sv.Options, value); err != nil { return err } case "Status": if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAuthorizedPrincipal(v **types.AuthorizedPrincipal, 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.AuthorizedPrincipal if *v == nil { sv = &types.AuthorizedPrincipal{} } else { sv = *v } for key, value := range shape { switch key { case "Principal": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Principal = ptr.String(jtv) } case "PrincipalType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PrincipalType to be of type string, got %T instead", value) } sv.PrincipalType = types.PrincipalType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAuthorizedPrincipalList(v *[]types.AuthorizedPrincipal, 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.AuthorizedPrincipal if *v == nil { cv = []types.AuthorizedPrincipal{} } else { cv = *v } for _, value := range shape { var col types.AuthorizedPrincipal destAddr := &col if err := awsRestjson1_deserializeDocumentAuthorizedPrincipal(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAutoTune(v **types.AutoTune, 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.AutoTune if *v == nil { sv = &types.AutoTune{} } else { sv = *v } for key, value := range shape { switch key { case "AutoTuneDetails": if err := awsRestjson1_deserializeDocumentAutoTuneDetails(&sv.AutoTuneDetails, value); err != nil { return err } case "AutoTuneType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AutoTuneType to be of type string, got %T instead", value) } sv.AutoTuneType = types.AutoTuneType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAutoTuneDetails(v **types.AutoTuneDetails, 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.AutoTuneDetails if *v == nil { sv = &types.AutoTuneDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ScheduledAutoTuneDetails": if err := awsRestjson1_deserializeDocumentScheduledAutoTuneDetails(&sv.ScheduledAutoTuneDetails, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAutoTuneList(v *[]types.AutoTune, 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.AutoTune if *v == nil { cv = []types.AutoTune{} } else { cv = *v } for _, value := range shape { var col types.AutoTune destAddr := &col if err := awsRestjson1_deserializeDocumentAutoTune(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAutoTuneMaintenanceSchedule(v **types.AutoTuneMaintenanceSchedule, 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.AutoTuneMaintenanceSchedule if *v == nil { sv = &types.AutoTuneMaintenanceSchedule{} } else { sv = *v } for key, value := range shape { switch key { case "CronExpressionForRecurrence": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.CronExpressionForRecurrence = ptr.String(jtv) } case "Duration": if err := awsRestjson1_deserializeDocumentDuration(&sv.Duration, value); err != nil { return err } case "StartAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected StartAt to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAutoTuneMaintenanceScheduleList(v *[]types.AutoTuneMaintenanceSchedule, 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.AutoTuneMaintenanceSchedule if *v == nil { cv = []types.AutoTuneMaintenanceSchedule{} } else { cv = *v } for _, value := range shape { var col types.AutoTuneMaintenanceSchedule destAddr := &col if err := awsRestjson1_deserializeDocumentAutoTuneMaintenanceSchedule(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAutoTuneOptions(v **types.AutoTuneOptions, 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.AutoTuneOptions if *v == nil { sv = &types.AutoTuneOptions{} } else { sv = *v } for key, value := range shape { switch key { case "DesiredState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AutoTuneDesiredState to be of type string, got %T instead", value) } sv.DesiredState = types.AutoTuneDesiredState(jtv) } case "MaintenanceSchedules": if err := awsRestjson1_deserializeDocumentAutoTuneMaintenanceScheduleList(&sv.MaintenanceSchedules, value); err != nil { return err } case "RollbackOnDisable": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RollbackOnDisable to be of type string, got %T instead", value) } sv.RollbackOnDisable = types.RollbackOnDisable(jtv) } case "UseOffPeakWindow": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseOffPeakWindow = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAutoTuneOptionsOutput(v **types.AutoTuneOptionsOutput, 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.AutoTuneOptionsOutput if *v == nil { sv = &types.AutoTuneOptionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ErrorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AutoTuneState to be of type string, got %T instead", value) } sv.State = types.AutoTuneState(jtv) } case "UseOffPeakWindow": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseOffPeakWindow = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAutoTuneOptionsStatus(v **types.AutoTuneOptionsStatus, 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.AutoTuneOptionsStatus if *v == nil { sv = &types.AutoTuneOptionsStatus{} } else { sv = *v } for key, value := range shape { switch key { case "Options": if err := awsRestjson1_deserializeDocumentAutoTuneOptions(&sv.Options, value); err != nil { return err } case "Status": if err := awsRestjson1_deserializeDocumentAutoTuneStatus(&sv.Status, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAutoTuneStatus(v **types.AutoTuneStatus, 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.AutoTuneStatus if *v == nil { sv = &types.AutoTuneStatus{} } else { sv = *v } for key, value := range shape { switch key { case "CreationDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected UpdateTimestamp to be a JSON Number, got %T instead", value) } } case "ErrorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "PendingDeletion": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.PendingDeletion = ptr.Bool(jtv) } case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AutoTuneState to be of type string, got %T instead", value) } sv.State = types.AutoTuneState(jtv) } case "UpdateDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.UpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected UpdateTimestamp to be a JSON Number, got %T instead", value) } } case "UpdateVersion": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected UIntValue to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.UpdateVersion = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAvailabilityZoneInfo(v **types.AvailabilityZoneInfo, 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.AvailabilityZoneInfo if *v == nil { sv = &types.AvailabilityZoneInfo{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityZoneName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AvailabilityZone to be of type string, got %T instead", value) } sv.AvailabilityZoneName = ptr.String(jtv) } case "AvailableDataNodeCount": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NumberOfNodes to be of type string, got %T instead", value) } sv.AvailableDataNodeCount = ptr.String(jtv) } case "ConfiguredDataNodeCount": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NumberOfNodes to be of type string, got %T instead", value) } sv.ConfiguredDataNodeCount = ptr.String(jtv) } case "TotalShards": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NumberOfShards to be of type string, got %T instead", value) } sv.TotalShards = ptr.String(jtv) } case "TotalUnAssignedShards": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NumberOfShards to be of type string, got %T instead", value) } sv.TotalUnAssignedShards = ptr.String(jtv) } case "ZoneStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ZoneStatus to be of type string, got %T instead", value) } sv.ZoneStatus = types.ZoneStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAvailabilityZoneInfoList(v *[]types.AvailabilityZoneInfo, 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.AvailabilityZoneInfo if *v == nil { cv = []types.AvailabilityZoneInfo{} } else { cv = *v } for _, value := range shape { var col types.AvailabilityZoneInfo destAddr := &col if err := awsRestjson1_deserializeDocumentAvailabilityZoneInfo(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAvailabilityZoneList(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 AvailabilityZone to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAWSDomainInformation(v **types.AWSDomainInformation, 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.AWSDomainInformation if *v == nil { sv = &types.AWSDomainInformation{} } else { sv = *v } for key, value := range shape { switch key { case "DomainName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) } sv.DomainName = ptr.String(jtv) } case "OwnerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OwnerId to be of type string, got %T instead", value) } sv.OwnerId = ptr.String(jtv) } case "Region": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Region to be of type string, got %T instead", value) } sv.Region = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBaseException(v **types.BaseException, 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.BaseException if *v == nil { sv = &types.BaseException{} } 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 awsRestjson1_deserializeDocumentChangeProgressDetails(v **types.ChangeProgressDetails, 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.ChangeProgressDetails if *v == nil { sv = &types.ChangeProgressDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ChangeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GUID to be of type string, got %T instead", value) } sv.ChangeId = ptr.String(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Message to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentChangeProgressStage(v **types.ChangeProgressStage, 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.ChangeProgressStage if *v == nil { sv = &types.ChangeProgressStage{} } 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 Description to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "LastUpdated": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdated = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdated to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChangeProgressStageName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChangeProgressStageStatus to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentChangeProgressStageList(v *[]types.ChangeProgressStage, 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.ChangeProgressStage if *v == nil { cv = []types.ChangeProgressStage{} } else { cv = *v } for _, value := range shape { var col types.ChangeProgressStage destAddr := &col if err := awsRestjson1_deserializeDocumentChangeProgressStage(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentChangeProgressStatusDetails(v **types.ChangeProgressStatusDetails, 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.ChangeProgressStatusDetails if *v == nil { sv = &types.ChangeProgressStatusDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ChangeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GUID to be of type string, got %T instead", value) } sv.ChangeId = ptr.String(jtv) } case "ChangeProgressStages": if err := awsRestjson1_deserializeDocumentChangeProgressStageList(&sv.ChangeProgressStages, value); err != nil { return err } case "CompletedProperties": if err := awsRestjson1_deserializeDocumentStringList(&sv.CompletedProperties, value); err != nil { return err } case "PendingProperties": if err := awsRestjson1_deserializeDocumentStringList(&sv.PendingProperties, value); err != nil { return err } case "StartTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected UpdateTimestamp to be a JSON Number, got %T instead", value) } } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OverallChangeStatus to be of type string, got %T instead", value) } sv.Status = types.OverallChangeStatus(jtv) } case "TotalNumberOfStages": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected TotalNumberOfStages to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalNumberOfStages = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentClusterConfig(v **types.ClusterConfig, 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.ClusterConfig if *v == nil { sv = &types.ClusterConfig{} } else { sv = *v } for key, value := range shape { switch key { case "ColdStorageOptions": if err := awsRestjson1_deserializeDocumentColdStorageOptions(&sv.ColdStorageOptions, value); err != nil { return err } case "DedicatedMasterCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected IntegerClass to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DedicatedMasterCount = ptr.Int32(int32(i64)) } case "DedicatedMasterEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DedicatedMasterEnabled = ptr.Bool(jtv) } case "DedicatedMasterType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OpenSearchPartitionInstanceType to be of type string, got %T instead", value) } sv.DedicatedMasterType = types.OpenSearchPartitionInstanceType(jtv) } case "InstanceCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected IntegerClass to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.InstanceCount = ptr.Int32(int32(i64)) } case "InstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OpenSearchPartitionInstanceType to be of type string, got %T instead", value) } sv.InstanceType = types.OpenSearchPartitionInstanceType(jtv) } case "MultiAZWithStandbyEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.MultiAZWithStandbyEnabled = ptr.Bool(jtv) } case "WarmCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected IntegerClass to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.WarmCount = ptr.Int32(int32(i64)) } case "WarmEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.WarmEnabled = ptr.Bool(jtv) } case "WarmType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OpenSearchWarmPartitionInstanceType to be of type string, got %T instead", value) } sv.WarmType = types.OpenSearchWarmPartitionInstanceType(jtv) } case "ZoneAwarenessConfig": if err := awsRestjson1_deserializeDocumentZoneAwarenessConfig(&sv.ZoneAwarenessConfig, value); err != nil { return err } case "ZoneAwarenessEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.ZoneAwarenessEnabled = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentClusterConfigStatus(v **types.ClusterConfigStatus, 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.ClusterConfigStatus if *v == nil { sv = &types.ClusterConfigStatus{} } else { sv = *v } for key, value := range shape { switch key { case "Options": if err := awsRestjson1_deserializeDocumentClusterConfig(&sv.Options, value); err != nil { return err } case "Status": if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCognitoOptions(v **types.CognitoOptions, 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.CognitoOptions if *v == nil { sv = &types.CognitoOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } case "IdentityPoolId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IdentityPoolId to be of type string, got %T instead", value) } sv.IdentityPoolId = ptr.String(jtv) } case "RoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) } sv.RoleArn = ptr.String(jtv) } case "UserPoolId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UserPoolId to be of type string, got %T instead", value) } sv.UserPoolId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCognitoOptionsStatus(v **types.CognitoOptionsStatus, 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.CognitoOptionsStatus if *v == nil { sv = &types.CognitoOptionsStatus{} } else { sv = *v } for key, value := range shape { switch key { case "Options": if err := awsRestjson1_deserializeDocumentCognitoOptions(&sv.Options, value); err != nil { return err } case "Status": if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentColdStorageOptions(v **types.ColdStorageOptions, 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.ColdStorageOptions if *v == nil { sv = &types.ColdStorageOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCompatibleVersionsList(v *[]types.CompatibleVersionsMap, 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.CompatibleVersionsMap if *v == nil { cv = []types.CompatibleVersionsMap{} } else { cv = *v } for _, value := range shape { var col types.CompatibleVersionsMap destAddr := &col if err := awsRestjson1_deserializeDocumentCompatibleVersionsMap(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCompatibleVersionsMap(v **types.CompatibleVersionsMap, 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.CompatibleVersionsMap if *v == nil { sv = &types.CompatibleVersionsMap{} } else { sv = *v } for key, value := range shape { switch key { case "SourceVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VersionString to be of type string, got %T instead", value) } sv.SourceVersion = ptr.String(jtv) } case "TargetVersions": if err := awsRestjson1_deserializeDocumentVersionList(&sv.TargetVersions, value); err != nil { return err } default: _, _ = key, value } } *v = sv 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 "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 awsRestjson1_deserializeDocumentConnectionProperties(v **types.ConnectionProperties, 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.ConnectionProperties if *v == nil { sv = &types.ConnectionProperties{} } else { sv = *v } for key, value := range shape { switch key { case "CrossClusterSearch": if err := awsRestjson1_deserializeDocumentCrossClusterSearchConnectionProperties(&sv.CrossClusterSearch, value); err != nil { return err } case "Endpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Endpoint to be of type string, got %T instead", value) } sv.Endpoint = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCrossClusterSearchConnectionProperties(v **types.CrossClusterSearchConnectionProperties, 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.CrossClusterSearchConnectionProperties if *v == nil { sv = &types.CrossClusterSearchConnectionProperties{} } else { sv = *v } for key, value := range shape { switch key { case "SkipUnavailable": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SkipUnavailableStatus to be of type string, got %T instead", value) } sv.SkipUnavailable = types.SkipUnavailableStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDependencyFailureException(v **types.DependencyFailureException, 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.DependencyFailureException if *v == nil { sv = &types.DependencyFailureException{} } 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 awsRestjson1_deserializeDocumentDisabledOperationException(v **types.DisabledOperationException, 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.DisabledOperationException if *v == nil { sv = &types.DisabledOperationException{} } 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 awsRestjson1_deserializeDocumentDomainConfig(v **types.DomainConfig, 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.DomainConfig if *v == nil { sv = &types.DomainConfig{} } else { sv = *v } for key, value := range shape { switch key { case "AccessPolicies": if err := awsRestjson1_deserializeDocumentAccessPoliciesStatus(&sv.AccessPolicies, value); err != nil { return err } case "AdvancedOptions": if err := awsRestjson1_deserializeDocumentAdvancedOptionsStatus(&sv.AdvancedOptions, value); err != nil { return err } case "AdvancedSecurityOptions": if err := awsRestjson1_deserializeDocumentAdvancedSecurityOptionsStatus(&sv.AdvancedSecurityOptions, value); err != nil { return err } case "AutoTuneOptions": if err := awsRestjson1_deserializeDocumentAutoTuneOptionsStatus(&sv.AutoTuneOptions, value); err != nil { return err } case "ChangeProgressDetails": if err := awsRestjson1_deserializeDocumentChangeProgressDetails(&sv.ChangeProgressDetails, value); err != nil { return err } case "ClusterConfig": if err := awsRestjson1_deserializeDocumentClusterConfigStatus(&sv.ClusterConfig, value); err != nil { return err } case "CognitoOptions": if err := awsRestjson1_deserializeDocumentCognitoOptionsStatus(&sv.CognitoOptions, value); err != nil { return err } case "DomainEndpointOptions": if err := awsRestjson1_deserializeDocumentDomainEndpointOptionsStatus(&sv.DomainEndpointOptions, value); err != nil { return err } case "EBSOptions": if err := awsRestjson1_deserializeDocumentEBSOptionsStatus(&sv.EBSOptions, value); err != nil { return err } case "EncryptionAtRestOptions": if err := awsRestjson1_deserializeDocumentEncryptionAtRestOptionsStatus(&sv.EncryptionAtRestOptions, value); err != nil { return err } case "EngineVersion": if err := awsRestjson1_deserializeDocumentVersionStatus(&sv.EngineVersion, value); err != nil { return err } case "LogPublishingOptions": if err := awsRestjson1_deserializeDocumentLogPublishingOptionsStatus(&sv.LogPublishingOptions, value); err != nil { return err } case "NodeToNodeEncryptionOptions": if err := awsRestjson1_deserializeDocumentNodeToNodeEncryptionOptionsStatus(&sv.NodeToNodeEncryptionOptions, value); err != nil { return err } case "OffPeakWindowOptions": if err := awsRestjson1_deserializeDocumentOffPeakWindowOptionsStatus(&sv.OffPeakWindowOptions, value); err != nil { return err } case "SnapshotOptions": if err := awsRestjson1_deserializeDocumentSnapshotOptionsStatus(&sv.SnapshotOptions, value); err != nil { return err } case "SoftwareUpdateOptions": if err := awsRestjson1_deserializeDocumentSoftwareUpdateOptionsStatus(&sv.SoftwareUpdateOptions, value); err != nil { return err } case "VPCOptions": if err := awsRestjson1_deserializeDocumentVPCDerivedInfoStatus(&sv.VPCOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDomainEndpointOptions(v **types.DomainEndpointOptions, 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.DomainEndpointOptions if *v == nil { sv = &types.DomainEndpointOptions{} } else { sv = *v } for key, value := range shape { switch key { case "CustomEndpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainNameFqdn to be of type string, got %T instead", value) } sv.CustomEndpoint = ptr.String(jtv) } case "CustomEndpointCertificateArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.CustomEndpointCertificateArn = ptr.String(jtv) } case "CustomEndpointEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CustomEndpointEnabled = ptr.Bool(jtv) } case "EnforceHTTPS": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnforceHTTPS = ptr.Bool(jtv) } case "TLSSecurityPolicy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TLSSecurityPolicy to be of type string, got %T instead", value) } sv.TLSSecurityPolicy = types.TLSSecurityPolicy(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDomainEndpointOptionsStatus(v **types.DomainEndpointOptionsStatus, 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.DomainEndpointOptionsStatus if *v == nil { sv = &types.DomainEndpointOptionsStatus{} } else { sv = *v } for key, value := range shape { switch key { case "Options": if err := awsRestjson1_deserializeDocumentDomainEndpointOptions(&sv.Options, value); err != nil { return err } case "Status": if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDomainInfo(v **types.DomainInfo, 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.DomainInfo if *v == nil { sv = &types.DomainInfo{} } else { sv = *v } for key, value := range shape { switch key { case "DomainName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) } sv.DomainName = ptr.String(jtv) } case "EngineType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EngineType to be of type string, got %T instead", value) } sv.EngineType = types.EngineType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDomainInfoList(v *[]types.DomainInfo, 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.DomainInfo if *v == nil { cv = []types.DomainInfo{} } else { cv = *v } for _, value := range shape { var col types.DomainInfo destAddr := &col if err := awsRestjson1_deserializeDocumentDomainInfo(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDomainInformationContainer(v **types.DomainInformationContainer, 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.DomainInformationContainer if *v == nil { sv = &types.DomainInformationContainer{} } else { sv = *v } for key, value := range shape { switch key { case "AWSDomainInformation": if err := awsRestjson1_deserializeDocumentAWSDomainInformation(&sv.AWSDomainInformation, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDomainNodesStatus(v **types.DomainNodesStatus, 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.DomainNodesStatus if *v == nil { sv = &types.DomainNodesStatus{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityZone": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AvailabilityZone to be of type string, got %T instead", value) } sv.AvailabilityZone = ptr.String(jtv) } case "InstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OpenSearchPartitionInstanceType to be of type string, got %T instead", value) } sv.InstanceType = types.OpenSearchPartitionInstanceType(jtv) } case "NodeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NodeId to be of type string, got %T instead", value) } sv.NodeId = ptr.String(jtv) } case "NodeStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NodeStatus to be of type string, got %T instead", value) } sv.NodeStatus = types.NodeStatus(jtv) } case "NodeType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NodeType to be of type string, got %T instead", value) } sv.NodeType = types.NodeType(jtv) } case "StorageSize": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VolumeSize to be of type string, got %T instead", value) } sv.StorageSize = ptr.String(jtv) } case "StorageType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StorageTypeName to be of type string, got %T instead", value) } sv.StorageType = ptr.String(jtv) } case "StorageVolumeType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VolumeType to be of type string, got %T instead", value) } sv.StorageVolumeType = types.VolumeType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDomainNodesStatusList(v *[]types.DomainNodesStatus, 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.DomainNodesStatus if *v == nil { cv = []types.DomainNodesStatus{} } else { cv = *v } for _, value := range shape { var col types.DomainNodesStatus destAddr := &col if err := awsRestjson1_deserializeDocumentDomainNodesStatus(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDomainPackageDetails(v **types.DomainPackageDetails, 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.DomainPackageDetails if *v == nil { sv = &types.DomainPackageDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DomainName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) } sv.DomainName = ptr.String(jtv) } case "DomainPackageStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainPackageStatus to be of type string, got %T instead", value) } sv.DomainPackageStatus = types.DomainPackageStatus(jtv) } case "ErrorDetails": if err := awsRestjson1_deserializeDocumentErrorDetails(&sv.ErrorDetails, value); err != nil { return err } case "LastUpdated": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdated = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdated to be a JSON Number, got %T instead", value) } } case "PackageID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PackageID to be of type string, got %T instead", value) } sv.PackageID = ptr.String(jtv) } case "PackageName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PackageName to be of type string, got %T instead", value) } sv.PackageName = ptr.String(jtv) } case "PackageType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PackageType to be of type string, got %T instead", value) } sv.PackageType = types.PackageType(jtv) } case "PackageVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PackageVersion to be of type string, got %T instead", value) } sv.PackageVersion = ptr.String(jtv) } case "ReferencePath": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReferencePath to be of type string, got %T instead", value) } sv.ReferencePath = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDomainPackageDetailsList(v *[]types.DomainPackageDetails, 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.DomainPackageDetails if *v == nil { cv = []types.DomainPackageDetails{} } else { cv = *v } for _, value := range shape { var col types.DomainPackageDetails destAddr := &col if err := awsRestjson1_deserializeDocumentDomainPackageDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDomainStatus(v **types.DomainStatus, 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.DomainStatus if *v == nil { sv = &types.DomainStatus{} } else { sv = *v } for key, value := range shape { switch key { case "AccessPolicies": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyDocument to be of type string, got %T instead", value) } sv.AccessPolicies = ptr.String(jtv) } case "AdvancedOptions": if err := awsRestjson1_deserializeDocumentAdvancedOptions(&sv.AdvancedOptions, value); err != nil { return err } case "AdvancedSecurityOptions": if err := awsRestjson1_deserializeDocumentAdvancedSecurityOptions(&sv.AdvancedSecurityOptions, value); err != nil { return err } case "ARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.ARN = ptr.String(jtv) } case "AutoTuneOptions": if err := awsRestjson1_deserializeDocumentAutoTuneOptionsOutput(&sv.AutoTuneOptions, value); err != nil { return err } case "ChangeProgressDetails": if err := awsRestjson1_deserializeDocumentChangeProgressDetails(&sv.ChangeProgressDetails, value); err != nil { return err } case "ClusterConfig": if err := awsRestjson1_deserializeDocumentClusterConfig(&sv.ClusterConfig, value); err != nil { return err } case "CognitoOptions": if err := awsRestjson1_deserializeDocumentCognitoOptions(&sv.CognitoOptions, value); err != nil { return err } case "Created": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Created = ptr.Bool(jtv) } case "Deleted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Deleted = ptr.Bool(jtv) } case "DomainEndpointOptions": if err := awsRestjson1_deserializeDocumentDomainEndpointOptions(&sv.DomainEndpointOptions, value); err != nil { return err } case "DomainId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainId to be of type string, got %T instead", value) } sv.DomainId = ptr.String(jtv) } case "DomainName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) } sv.DomainName = ptr.String(jtv) } case "EBSOptions": if err := awsRestjson1_deserializeDocumentEBSOptions(&sv.EBSOptions, value); err != nil { return err } case "EncryptionAtRestOptions": if err := awsRestjson1_deserializeDocumentEncryptionAtRestOptions(&sv.EncryptionAtRestOptions, value); err != nil { return err } case "Endpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServiceUrl to be of type string, got %T instead", value) } sv.Endpoint = ptr.String(jtv) } case "Endpoints": if err := awsRestjson1_deserializeDocumentEndpointsMap(&sv.Endpoints, value); err != nil { return err } case "EngineVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VersionString to be of type string, got %T instead", value) } sv.EngineVersion = ptr.String(jtv) } case "LogPublishingOptions": if err := awsRestjson1_deserializeDocumentLogPublishingOptions(&sv.LogPublishingOptions, value); err != nil { return err } case "NodeToNodeEncryptionOptions": if err := awsRestjson1_deserializeDocumentNodeToNodeEncryptionOptions(&sv.NodeToNodeEncryptionOptions, value); err != nil { return err } case "OffPeakWindowOptions": if err := awsRestjson1_deserializeDocumentOffPeakWindowOptions(&sv.OffPeakWindowOptions, value); err != nil { return err } case "Processing": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Processing = ptr.Bool(jtv) } case "ServiceSoftwareOptions": if err := awsRestjson1_deserializeDocumentServiceSoftwareOptions(&sv.ServiceSoftwareOptions, value); err != nil { return err } case "SnapshotOptions": if err := awsRestjson1_deserializeDocumentSnapshotOptions(&sv.SnapshotOptions, value); err != nil { return err } case "SoftwareUpdateOptions": if err := awsRestjson1_deserializeDocumentSoftwareUpdateOptions(&sv.SoftwareUpdateOptions, value); err != nil { return err } case "UpgradeProcessing": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UpgradeProcessing = ptr.Bool(jtv) } case "VPCOptions": if err := awsRestjson1_deserializeDocumentVPCDerivedInfo(&sv.VPCOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDomainStatusList(v *[]types.DomainStatus, 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.DomainStatus if *v == nil { cv = []types.DomainStatus{} } else { cv = *v } for _, value := range shape { var col types.DomainStatus destAddr := &col if err := awsRestjson1_deserializeDocumentDomainStatus(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDryRunProgressStatus(v **types.DryRunProgressStatus, 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.DryRunProgressStatus if *v == nil { sv = &types.DryRunProgressStatus{} } else { sv = *v } for key, value := range shape { switch key { case "CreationDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.CreationDate = ptr.String(jtv) } case "DryRunId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GUID to be of type string, got %T instead", value) } sv.DryRunId = ptr.String(jtv) } case "DryRunStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.DryRunStatus = ptr.String(jtv) } case "UpdateDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.UpdateDate = ptr.String(jtv) } case "ValidationFailures": if err := awsRestjson1_deserializeDocumentValidationFailures(&sv.ValidationFailures, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDryRunResults(v **types.DryRunResults, 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.DryRunResults if *v == nil { sv = &types.DryRunResults{} } else { sv = *v } for key, value := range shape { switch key { case "DeploymentType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeploymentType to be of type string, got %T instead", value) } sv.DeploymentType = ptr.String(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Message to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDuration(v **types.Duration, 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.Duration if *v == nil { sv = &types.Duration{} } else { sv = *v } for key, value := range shape { switch key { case "Unit": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TimeUnit to be of type string, got %T instead", value) } sv.Unit = types.TimeUnit(jtv) } case "Value": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected DurationValue to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Value = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEBSOptions(v **types.EBSOptions, 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.EBSOptions if *v == nil { sv = &types.EBSOptions{} } else { sv = *v } for key, value := range shape { switch key { case "EBSEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EBSEnabled = ptr.Bool(jtv) } case "Iops": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected IntegerClass to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Iops = ptr.Int32(int32(i64)) } case "Throughput": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected IntegerClass to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Throughput = ptr.Int32(int32(i64)) } case "VolumeSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected IntegerClass to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.VolumeSize = ptr.Int32(int32(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_deserializeDocumentEBSOptionsStatus(v **types.EBSOptionsStatus, 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.EBSOptionsStatus if *v == nil { sv = &types.EBSOptionsStatus{} } else { sv = *v } for key, value := range shape { switch key { case "Options": if err := awsRestjson1_deserializeDocumentEBSOptions(&sv.Options, value); err != nil { return err } case "Status": if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEncryptionAtRestOptions(v **types.EncryptionAtRestOptions, 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.EncryptionAtRestOptions if *v == nil { sv = &types.EncryptionAtRestOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } case "KmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEncryptionAtRestOptionsStatus(v **types.EncryptionAtRestOptionsStatus, 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.EncryptionAtRestOptionsStatus if *v == nil { sv = &types.EncryptionAtRestOptionsStatus{} } else { sv = *v } for key, value := range shape { switch key { case "Options": if err := awsRestjson1_deserializeDocumentEncryptionAtRestOptions(&sv.Options, value); err != nil { return err } case "Status": if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEndpointsMap(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 ServiceUrl to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentEnvironmentInfo(v **types.EnvironmentInfo, 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.EnvironmentInfo if *v == nil { sv = &types.EnvironmentInfo{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityZoneInformation": if err := awsRestjson1_deserializeDocumentAvailabilityZoneInfoList(&sv.AvailabilityZoneInformation, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEnvironmentInfoList(v *[]types.EnvironmentInfo, 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.EnvironmentInfo if *v == nil { cv = []types.EnvironmentInfo{} } else { cv = *v } for _, value := range shape { var col types.EnvironmentInfo destAddr := &col if err := awsRestjson1_deserializeDocumentEnvironmentInfo(&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 "ErrorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "ErrorType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorType to be of type string, got %T instead", value) } sv.ErrorType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInboundConnection(v **types.InboundConnection, 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.InboundConnection if *v == nil { sv = &types.InboundConnection{} } else { sv = *v } for key, value := range shape { switch key { case "ConnectionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectionId to be of type string, got %T instead", value) } sv.ConnectionId = ptr.String(jtv) } case "ConnectionMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectionMode to be of type string, got %T instead", value) } sv.ConnectionMode = types.ConnectionMode(jtv) } case "ConnectionStatus": if err := awsRestjson1_deserializeDocumentInboundConnectionStatus(&sv.ConnectionStatus, value); err != nil { return err } case "LocalDomainInfo": if err := awsRestjson1_deserializeDocumentDomainInformationContainer(&sv.LocalDomainInfo, value); err != nil { return err } case "RemoteDomainInfo": if err := awsRestjson1_deserializeDocumentDomainInformationContainer(&sv.RemoteDomainInfo, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInboundConnections(v *[]types.InboundConnection, 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.InboundConnection if *v == nil { cv = []types.InboundConnection{} } else { cv = *v } for _, value := range shape { var col types.InboundConnection destAddr := &col if err := awsRestjson1_deserializeDocumentInboundConnection(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInboundConnectionStatus(v **types.InboundConnectionStatus, 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.InboundConnectionStatus if *v == nil { sv = &types.InboundConnectionStatus{} } 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 ConnectionStatusMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "StatusCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected InboundConnectionStatusCode to be of type string, got %T instead", value) } sv.StatusCode = types.InboundConnectionStatusCode(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInstanceCountLimits(v **types.InstanceCountLimits, 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.InstanceCountLimits if *v == nil { sv = &types.InstanceCountLimits{} } else { sv = *v } for key, value := range shape { switch key { case "MaximumInstanceCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MaximumInstanceCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaximumInstanceCount = int32(i64) } case "MinimumInstanceCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MinimumInstanceCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MinimumInstanceCount = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInstanceLimits(v **types.InstanceLimits, 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.InstanceLimits if *v == nil { sv = &types.InstanceLimits{} } else { sv = *v } for key, value := range shape { switch key { case "InstanceCountLimits": if err := awsRestjson1_deserializeDocumentInstanceCountLimits(&sv.InstanceCountLimits, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInstanceRoleList(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 InstanceRole to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInstanceTypeDetails(v **types.InstanceTypeDetails, 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.InstanceTypeDetails if *v == nil { sv = &types.InstanceTypeDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AdvancedSecurityEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AdvancedSecurityEnabled = ptr.Bool(jtv) } case "AppLogsEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AppLogsEnabled = ptr.Bool(jtv) } case "AvailabilityZones": if err := awsRestjson1_deserializeDocumentAvailabilityZoneList(&sv.AvailabilityZones, value); err != nil { return err } case "CognitoEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CognitoEnabled = ptr.Bool(jtv) } case "EncryptionEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EncryptionEnabled = ptr.Bool(jtv) } case "InstanceRole": if err := awsRestjson1_deserializeDocumentInstanceRoleList(&sv.InstanceRole, value); err != nil { return err } case "InstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OpenSearchPartitionInstanceType to be of type string, got %T instead", value) } sv.InstanceType = types.OpenSearchPartitionInstanceType(jtv) } case "WarmEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.WarmEnabled = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInstanceTypeDetailsList(v *[]types.InstanceTypeDetails, 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.InstanceTypeDetails if *v == nil { cv = []types.InstanceTypeDetails{} } else { cv = *v } for _, value := range shape { var col types.InstanceTypeDetails destAddr := &col if err := awsRestjson1_deserializeDocumentInstanceTypeDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInternalException(v **types.InternalException, 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.InternalException if *v == nil { sv = &types.InternalException{} } 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 awsRestjson1_deserializeDocumentInvalidPaginationTokenException(v **types.InvalidPaginationTokenException, 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.InvalidPaginationTokenException if *v == nil { sv = &types.InvalidPaginationTokenException{} } 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 awsRestjson1_deserializeDocumentInvalidTypeException(v **types.InvalidTypeException, 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.InvalidTypeException if *v == nil { sv = &types.InvalidTypeException{} } 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 awsRestjson1_deserializeDocumentIssues(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 Issue to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LimitExceededException if *v == nil { sv = &types.LimitExceededException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLimits(v **types.Limits, 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.Limits if *v == nil { sv = &types.Limits{} } else { sv = *v } for key, value := range shape { switch key { case "AdditionalLimits": if err := awsRestjson1_deserializeDocumentAdditionalLimitList(&sv.AdditionalLimits, value); err != nil { return err } case "InstanceLimits": if err := awsRestjson1_deserializeDocumentInstanceLimits(&sv.InstanceLimits, value); err != nil { return err } case "StorageTypes": if err := awsRestjson1_deserializeDocumentStorageTypeList(&sv.StorageTypes, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLimitsByRole(v *map[string]types.Limits, 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.Limits if *v == nil { mv = map[string]types.Limits{} } else { mv = *v } for key, value := range shape { var parsedVal types.Limits mapVar := parsedVal destAddr := &mapVar if err := awsRestjson1_deserializeDocumentLimits(&destAddr, value); err != nil { return err } parsedVal = *destAddr mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentLimitValueList(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 LimitValue to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentLogPublishingOption(v **types.LogPublishingOption, 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.LogPublishingOption if *v == nil { sv = &types.LogPublishingOption{} } else { sv = *v } for key, value := range shape { switch key { case "CloudWatchLogsLogGroupArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CloudWatchLogsLogGroupArn to be of type string, got %T instead", value) } sv.CloudWatchLogsLogGroupArn = ptr.String(jtv) } case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLogPublishingOptions(v *map[string]types.LogPublishingOption, 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.LogPublishingOption if *v == nil { mv = map[string]types.LogPublishingOption{} } else { mv = *v } for key, value := range shape { var parsedVal types.LogPublishingOption mapVar := parsedVal destAddr := &mapVar if err := awsRestjson1_deserializeDocumentLogPublishingOption(&destAddr, value); err != nil { return err } parsedVal = *destAddr mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentLogPublishingOptionsStatus(v **types.LogPublishingOptionsStatus, 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.LogPublishingOptionsStatus if *v == nil { sv = &types.LogPublishingOptionsStatus{} } else { sv = *v } for key, value := range shape { switch key { case "Options": if err := awsRestjson1_deserializeDocumentLogPublishingOptions(&sv.Options, value); err != nil { return err } case "Status": if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNodeToNodeEncryptionOptions(v **types.NodeToNodeEncryptionOptions, 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.NodeToNodeEncryptionOptions if *v == nil { sv = &types.NodeToNodeEncryptionOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNodeToNodeEncryptionOptionsStatus(v **types.NodeToNodeEncryptionOptionsStatus, 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.NodeToNodeEncryptionOptionsStatus if *v == nil { sv = &types.NodeToNodeEncryptionOptionsStatus{} } else { sv = *v } for key, value := range shape { switch key { case "Options": if err := awsRestjson1_deserializeDocumentNodeToNodeEncryptionOptions(&sv.Options, value); err != nil { return err } case "Status": if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentOffPeakWindow(v **types.OffPeakWindow, 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.OffPeakWindow if *v == nil { sv = &types.OffPeakWindow{} } else { sv = *v } for key, value := range shape { switch key { case "WindowStartTime": if err := awsRestjson1_deserializeDocumentWindowStartTime(&sv.WindowStartTime, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentOffPeakWindowOptions(v **types.OffPeakWindowOptions, 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.OffPeakWindowOptions if *v == nil { sv = &types.OffPeakWindowOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } case "OffPeakWindow": if err := awsRestjson1_deserializeDocumentOffPeakWindow(&sv.OffPeakWindow, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentOffPeakWindowOptionsStatus(v **types.OffPeakWindowOptionsStatus, 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.OffPeakWindowOptionsStatus if *v == nil { sv = &types.OffPeakWindowOptionsStatus{} } else { sv = *v } for key, value := range shape { switch key { case "Options": if err := awsRestjson1_deserializeDocumentOffPeakWindowOptions(&sv.Options, value); err != nil { return err } case "Status": if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentOptionStatus(v **types.OptionStatus, 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.OptionStatus if *v == nil { sv = &types.OptionStatus{} } else { sv = *v } for key, value := range shape { switch key { case "CreationDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected UpdateTimestamp to be a JSON Number, got %T instead", value) } } case "PendingDeletion": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.PendingDeletion = ptr.Bool(jtv) } case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OptionState to be of type string, got %T instead", value) } sv.State = types.OptionState(jtv) } case "UpdateDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.UpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected UpdateTimestamp to be a JSON Number, got %T instead", value) } } case "UpdateVersion": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected UIntValue to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.UpdateVersion = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentOutboundConnection(v **types.OutboundConnection, 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.OutboundConnection if *v == nil { sv = &types.OutboundConnection{} } else { sv = *v } for key, value := range shape { switch key { case "ConnectionAlias": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectionAlias to be of type string, got %T instead", value) } sv.ConnectionAlias = ptr.String(jtv) } case "ConnectionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectionId to be of type string, got %T instead", value) } sv.ConnectionId = ptr.String(jtv) } case "ConnectionMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectionMode to be of type string, got %T instead", value) } sv.ConnectionMode = types.ConnectionMode(jtv) } case "ConnectionProperties": if err := awsRestjson1_deserializeDocumentConnectionProperties(&sv.ConnectionProperties, value); err != nil { return err } case "ConnectionStatus": if err := awsRestjson1_deserializeDocumentOutboundConnectionStatus(&sv.ConnectionStatus, value); err != nil { return err } case "LocalDomainInfo": if err := awsRestjson1_deserializeDocumentDomainInformationContainer(&sv.LocalDomainInfo, value); err != nil { return err } case "RemoteDomainInfo": if err := awsRestjson1_deserializeDocumentDomainInformationContainer(&sv.RemoteDomainInfo, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentOutboundConnections(v *[]types.OutboundConnection, 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.OutboundConnection if *v == nil { cv = []types.OutboundConnection{} } else { cv = *v } for _, value := range shape { var col types.OutboundConnection destAddr := &col if err := awsRestjson1_deserializeDocumentOutboundConnection(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentOutboundConnectionStatus(v **types.OutboundConnectionStatus, 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.OutboundConnectionStatus if *v == nil { sv = &types.OutboundConnectionStatus{} } 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 ConnectionStatusMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "StatusCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OutboundConnectionStatusCode to be of type string, got %T instead", value) } sv.StatusCode = types.OutboundConnectionStatusCode(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPackageDetails(v **types.PackageDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PackageDetails if *v == nil { sv = &types.PackageDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AvailablePackageVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PackageVersion to be of type string, got %T instead", value) } sv.AvailablePackageVersion = ptr.String(jtv) } case "CreatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CreatedAt to be a JSON Number, got %T instead", value) } } case "ErrorDetails": if err := awsRestjson1_deserializeDocumentErrorDetails(&sv.ErrorDetails, value); err != nil { return err } case "LastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastUpdated to be a JSON Number, got %T instead", value) } } case "PackageDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PackageDescription to be of type string, got %T instead", value) } sv.PackageDescription = ptr.String(jtv) } case "PackageID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PackageID to be of type string, got %T instead", value) } sv.PackageID = ptr.String(jtv) } case "PackageName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PackageName to be of type string, got %T instead", value) } sv.PackageName = ptr.String(jtv) } case "PackageStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PackageStatus to be of type string, got %T instead", value) } sv.PackageStatus = types.PackageStatus(jtv) } case "PackageType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PackageType to be of type string, got %T instead", value) } sv.PackageType = types.PackageType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPackageDetailsList(v *[]types.PackageDetails, 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.PackageDetails if *v == nil { cv = []types.PackageDetails{} } else { cv = *v } for _, value := range shape { var col types.PackageDetails destAddr := &col if err := awsRestjson1_deserializeDocumentPackageDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPackageVersionHistory(v **types.PackageVersionHistory, 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.PackageVersionHistory if *v == nil { sv = &types.PackageVersionHistory{} } else { sv = *v } for key, value := range shape { switch key { case "CommitMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CommitMessage to be of type string, got %T instead", value) } sv.CommitMessage = ptr.String(jtv) } case "CreatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CreatedAt to be a JSON Number, got %T instead", value) } } case "PackageVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PackageVersion to be of type string, got %T instead", value) } sv.PackageVersion = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPackageVersionHistoryList(v *[]types.PackageVersionHistory, 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.PackageVersionHistory if *v == nil { cv = []types.PackageVersionHistory{} } else { cv = *v } for _, value := range shape { var col types.PackageVersionHistory destAddr := &col if err := awsRestjson1_deserializeDocumentPackageVersionHistory(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRecurringCharge(v **types.RecurringCharge, 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.RecurringCharge if *v == nil { sv = &types.RecurringCharge{} } else { sv = *v } for key, value := range shape { switch key { case "RecurringChargeAmount": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.RecurringChargeAmount = ptr.Float64(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.RecurringChargeAmount = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "RecurringChargeFrequency": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RecurringChargeFrequency = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRecurringChargeList(v *[]types.RecurringCharge, 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.RecurringCharge if *v == nil { cv = []types.RecurringCharge{} } else { cv = *v } for _, value := range shape { var col types.RecurringCharge destAddr := &col if err := awsRestjson1_deserializeDocumentRecurringCharge(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentReservedInstance(v **types.ReservedInstance, 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.ReservedInstance if *v == nil { sv = &types.ReservedInstance{} } else { sv = *v } for key, value := range shape { switch key { case "BillingSubscriptionId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BillingSubscriptionId = ptr.Int64(i64) } case "CurrencyCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.CurrencyCode = ptr.String(jtv) } case "Duration": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Duration = int32(i64) } case "FixedPrice": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.FixedPrice = ptr.Float64(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.FixedPrice = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "InstanceCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.InstanceCount = int32(i64) } case "InstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OpenSearchPartitionInstanceType to be of type string, got %T instead", value) } sv.InstanceType = types.OpenSearchPartitionInstanceType(jtv) } case "PaymentOption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReservedInstancePaymentOption to be of type string, got %T instead", value) } sv.PaymentOption = types.ReservedInstancePaymentOption(jtv) } case "RecurringCharges": if err := awsRestjson1_deserializeDocumentRecurringChargeList(&sv.RecurringCharges, value); err != nil { return err } case "ReservationName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReservationToken to be of type string, got %T instead", value) } sv.ReservationName = ptr.String(jtv) } case "ReservedInstanceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GUID to be of type string, got %T instead", value) } sv.ReservedInstanceId = ptr.String(jtv) } case "ReservedInstanceOfferingId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ReservedInstanceOfferingId = ptr.String(jtv) } case "StartTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected UpdateTimestamp to be a JSON Number, got %T instead", value) } } case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.State = ptr.String(jtv) } case "UsagePrice": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.UsagePrice = ptr.Float64(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.UsagePrice = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentReservedInstanceList(v *[]types.ReservedInstance, 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.ReservedInstance if *v == nil { cv = []types.ReservedInstance{} } else { cv = *v } for _, value := range shape { var col types.ReservedInstance destAddr := &col if err := awsRestjson1_deserializeDocumentReservedInstance(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentReservedInstanceOffering(v **types.ReservedInstanceOffering, 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.ReservedInstanceOffering if *v == nil { sv = &types.ReservedInstanceOffering{} } else { sv = *v } for key, value := range shape { switch key { case "CurrencyCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.CurrencyCode = ptr.String(jtv) } case "Duration": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Duration = int32(i64) } case "FixedPrice": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.FixedPrice = ptr.Float64(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.FixedPrice = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "InstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OpenSearchPartitionInstanceType to be of type string, got %T instead", value) } sv.InstanceType = types.OpenSearchPartitionInstanceType(jtv) } case "PaymentOption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReservedInstancePaymentOption to be of type string, got %T instead", value) } sv.PaymentOption = types.ReservedInstancePaymentOption(jtv) } case "RecurringCharges": if err := awsRestjson1_deserializeDocumentRecurringChargeList(&sv.RecurringCharges, value); err != nil { return err } case "ReservedInstanceOfferingId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GUID to be of type string, got %T instead", value) } sv.ReservedInstanceOfferingId = ptr.String(jtv) } case "UsagePrice": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.UsagePrice = ptr.Float64(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.UsagePrice = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentReservedInstanceOfferingList(v *[]types.ReservedInstanceOffering, 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.ReservedInstanceOffering if *v == nil { cv = []types.ReservedInstanceOffering{} } else { cv = *v } for _, value := range shape { var col types.ReservedInstanceOffering destAddr := &col if err := awsRestjson1_deserializeDocumentReservedInstanceOffering(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentResourceAlreadyExistsException(v **types.ResourceAlreadyExistsException, 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.ResourceAlreadyExistsException if *v == nil { sv = &types.ResourceAlreadyExistsException{} } 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 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 "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 awsRestjson1_deserializeDocumentSAMLIdp(v **types.SAMLIdp, 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.SAMLIdp if *v == nil { sv = &types.SAMLIdp{} } else { sv = *v } for key, value := range shape { switch key { case "EntityId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SAMLEntityId to be of type string, got %T instead", value) } sv.EntityId = ptr.String(jtv) } case "MetadataContent": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SAMLMetadata to be of type string, got %T instead", value) } sv.MetadataContent = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSAMLOptionsOutput(v **types.SAMLOptionsOutput, 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.SAMLOptionsOutput if *v == nil { sv = &types.SAMLOptionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } case "Idp": if err := awsRestjson1_deserializeDocumentSAMLIdp(&sv.Idp, value); err != nil { return err } case "RolesKey": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RolesKey = ptr.String(jtv) } case "SessionTimeoutMinutes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected IntegerClass to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SessionTimeoutMinutes = ptr.Int32(int32(i64)) } case "SubjectKey": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.SubjectKey = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentScheduledAction(v **types.ScheduledAction, 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.ScheduledAction if *v == nil { sv = &types.ScheduledAction{} } else { sv = *v } for key, value := range shape { switch key { case "Cancellable": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Cancellable = ptr.Bool(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Mandatory": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Mandatory = ptr.Bool(jtv) } case "ScheduledBy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ScheduledBy to be of type string, got %T instead", value) } sv.ScheduledBy = types.ScheduledBy(jtv) } case "ScheduledTime": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ScheduledTime = ptr.Int64(i64) } case "Severity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionSeverity to be of type string, got %T instead", value) } sv.Severity = types.ActionSeverity(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionStatus to be of type string, got %T instead", value) } sv.Status = types.ActionStatus(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionType to be of type string, got %T instead", value) } sv.Type = types.ActionType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentScheduledActionsList(v *[]types.ScheduledAction, 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.ScheduledAction if *v == nil { cv = []types.ScheduledAction{} } else { cv = *v } for _, value := range shape { var col types.ScheduledAction destAddr := &col if err := awsRestjson1_deserializeDocumentScheduledAction(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentScheduledAutoTuneDetails(v **types.ScheduledAutoTuneDetails, 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.ScheduledAutoTuneDetails if *v == nil { sv = &types.ScheduledAutoTuneDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Action": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ScheduledAutoTuneDescription to be of type string, got %T instead", value) } sv.Action = ptr.String(jtv) } case "ActionType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ScheduledAutoTuneActionType to be of type string, got %T instead", value) } sv.ActionType = types.ScheduledAutoTuneActionType(jtv) } case "Date": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Date = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected AutoTuneDate to be a JSON Number, got %T instead", value) } } case "Severity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ScheduledAutoTuneSeverityType to be of type string, got %T instead", value) } sv.Severity = types.ScheduledAutoTuneSeverityType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentServiceSoftwareOptions(v **types.ServiceSoftwareOptions, 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.ServiceSoftwareOptions if *v == nil { sv = &types.ServiceSoftwareOptions{} } else { sv = *v } for key, value := range shape { switch key { case "AutomatedUpdateDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.AutomatedUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DeploymentCloseDateTimeStamp to be a JSON Number, got %T instead", value) } } case "Cancellable": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Cancellable = ptr.Bool(jtv) } case "CurrentVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.CurrentVersion = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "NewVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.NewVersion = ptr.String(jtv) } case "OptionalDeployment": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.OptionalDeployment = ptr.Bool(jtv) } case "UpdateAvailable": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UpdateAvailable = ptr.Bool(jtv) } case "UpdateStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeploymentStatus to be of type string, got %T instead", value) } sv.UpdateStatus = types.DeploymentStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSlotList(v *[]int64, 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 []int64 if *v == nil { cv = []int64{} } else { cv = *v } for _, value := range shape { var col int64 if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } col = i64 } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSlotNotAvailableException(v **types.SlotNotAvailableException, 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.SlotNotAvailableException if *v == nil { sv = &types.SlotNotAvailableException{} } 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 "SlotSuggestions": if err := awsRestjson1_deserializeDocumentSlotList(&sv.SlotSuggestions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSnapshotOptions(v **types.SnapshotOptions, 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.SnapshotOptions if *v == nil { sv = &types.SnapshotOptions{} } else { sv = *v } for key, value := range shape { switch key { case "AutomatedSnapshotStartHour": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected IntegerClass to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.AutomatedSnapshotStartHour = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSnapshotOptionsStatus(v **types.SnapshotOptionsStatus, 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.SnapshotOptionsStatus if *v == nil { sv = &types.SnapshotOptionsStatus{} } else { sv = *v } for key, value := range shape { switch key { case "Options": if err := awsRestjson1_deserializeDocumentSnapshotOptions(&sv.Options, value); err != nil { return err } case "Status": if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSoftwareUpdateOptions(v **types.SoftwareUpdateOptions, 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.SoftwareUpdateOptions if *v == nil { sv = &types.SoftwareUpdateOptions{} } else { sv = *v } for key, value := range shape { switch key { case "AutoSoftwareUpdateEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AutoSoftwareUpdateEnabled = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSoftwareUpdateOptionsStatus(v **types.SoftwareUpdateOptionsStatus, 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.SoftwareUpdateOptionsStatus if *v == nil { sv = &types.SoftwareUpdateOptionsStatus{} } else { sv = *v } for key, value := range shape { switch key { case "Options": if err := awsRestjson1_deserializeDocumentSoftwareUpdateOptions(&sv.Options, value); err != nil { return err } case "Status": if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStorageType(v **types.StorageType, 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.StorageType if *v == nil { sv = &types.StorageType{} } else { sv = *v } for key, value := range shape { switch key { case "StorageSubTypeName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StorageSubTypeName to be of type string, got %T instead", value) } sv.StorageSubTypeName = ptr.String(jtv) } case "StorageTypeLimits": if err := awsRestjson1_deserializeDocumentStorageTypeLimitList(&sv.StorageTypeLimits, value); err != nil { return err } case "StorageTypeName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StorageTypeName to be of type string, got %T instead", value) } sv.StorageTypeName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStorageTypeLimit(v **types.StorageTypeLimit, 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.StorageTypeLimit if *v == nil { sv = &types.StorageTypeLimit{} } else { sv = *v } for key, value := range shape { switch key { case "LimitName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitName to be of type string, got %T instead", value) } sv.LimitName = ptr.String(jtv) } case "LimitValues": if err := awsRestjson1_deserializeDocumentLimitValueList(&sv.LimitValues, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStorageTypeLimitList(v *[]types.StorageTypeLimit, 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.StorageTypeLimit if *v == nil { cv = []types.StorageTypeLimit{} } else { cv = *v } for _, value := range shape { var col types.StorageTypeLimit destAddr := &col if err := awsRestjson1_deserializeDocumentStorageTypeLimit(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentStorageTypeList(v *[]types.StorageType, 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.StorageType if *v == nil { cv = []types.StorageType{} } else { cv = *v } for _, value := range shape { var col types.StorageType destAddr := &col if err := awsRestjson1_deserializeDocumentStorageType(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentStringList(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 String to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTag(v **types.Tag, 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.Tag if *v == nil { sv = &types.Tag{} } else { sv = *v } for key, value := range shape { switch key { case "Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) } sv.Key = ptr.String(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTagList(v *[]types.Tag, 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.Tag if *v == nil { cv = []types.Tag{} } else { cv = *v } for _, value := range shape { var col types.Tag destAddr := &col if err := awsRestjson1_deserializeDocumentTag(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentUpgradeHistory(v **types.UpgradeHistory, 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.UpgradeHistory if *v == nil { sv = &types.UpgradeHistory{} } else { sv = *v } for key, value := range shape { switch key { case "StartTimestamp": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected StartTimestamp to be a JSON Number, got %T instead", value) } } case "StepsList": if err := awsRestjson1_deserializeDocumentUpgradeStepsList(&sv.StepsList, value); err != nil { return err } case "UpgradeName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UpgradeName to be of type string, got %T instead", value) } sv.UpgradeName = ptr.String(jtv) } case "UpgradeStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UpgradeStatus to be of type string, got %T instead", value) } sv.UpgradeStatus = types.UpgradeStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUpgradeHistoryList(v *[]types.UpgradeHistory, 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.UpgradeHistory if *v == nil { cv = []types.UpgradeHistory{} } else { cv = *v } for _, value := range shape { var col types.UpgradeHistory destAddr := &col if err := awsRestjson1_deserializeDocumentUpgradeHistory(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentUpgradeStepItem(v **types.UpgradeStepItem, 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.UpgradeStepItem if *v == nil { sv = &types.UpgradeStepItem{} } else { sv = *v } for key, value := range shape { switch key { case "Issues": if err := awsRestjson1_deserializeDocumentIssues(&sv.Issues, value); err != nil { return err } case "ProgressPercent": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.ProgressPercent = ptr.Float64(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.ProgressPercent = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "UpgradeStep": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UpgradeStep to be of type string, got %T instead", value) } sv.UpgradeStep = types.UpgradeStep(jtv) } case "UpgradeStepStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UpgradeStatus to be of type string, got %T instead", value) } sv.UpgradeStepStatus = types.UpgradeStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUpgradeStepsList(v *[]types.UpgradeStepItem, 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.UpgradeStepItem if *v == nil { cv = []types.UpgradeStepItem{} } else { cv = *v } for _, value := range shape { var col types.UpgradeStepItem destAddr := &col if err := awsRestjson1_deserializeDocumentUpgradeStepItem(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv 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 "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 awsRestjson1_deserializeDocumentValidationFailure(v **types.ValidationFailure, 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.ValidationFailure if *v == nil { sv = &types.ValidationFailure{} } 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 String 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 String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentValidationFailures(v *[]types.ValidationFailure, 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.ValidationFailure if *v == nil { cv = []types.ValidationFailure{} } else { cv = *v } for _, value := range shape { var col types.ValidationFailure destAddr := &col if err := awsRestjson1_deserializeDocumentValidationFailure(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentVersionList(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 VersionString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentVersionStatus(v **types.VersionStatus, 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.VersionStatus if *v == nil { sv = &types.VersionStatus{} } else { sv = *v } for key, value := range shape { switch key { case "Options": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VersionString to be of type string, got %T instead", value) } sv.Options = ptr.String(jtv) } case "Status": if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVPCDerivedInfo(v **types.VPCDerivedInfo, 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.VPCDerivedInfo if *v == nil { sv = &types.VPCDerivedInfo{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityZones": if err := awsRestjson1_deserializeDocumentStringList(&sv.AvailabilityZones, value); err != nil { return err } case "SecurityGroupIds": if err := awsRestjson1_deserializeDocumentStringList(&sv.SecurityGroupIds, value); err != nil { return err } case "SubnetIds": if err := awsRestjson1_deserializeDocumentStringList(&sv.SubnetIds, value); err != nil { return err } case "VPCId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.VPCId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVPCDerivedInfoStatus(v **types.VPCDerivedInfoStatus, 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.VPCDerivedInfoStatus if *v == nil { sv = &types.VPCDerivedInfoStatus{} } else { sv = *v } for key, value := range shape { switch key { case "Options": if err := awsRestjson1_deserializeDocumentVPCDerivedInfo(&sv.Options, value); err != nil { return err } case "Status": if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVpcEndpoint(v **types.VpcEndpoint, 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.VpcEndpoint if *v == nil { sv = &types.VpcEndpoint{} } else { sv = *v } for key, value := range shape { switch key { case "DomainArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainArn to be of type string, got %T instead", value) } sv.DomainArn = ptr.String(jtv) } case "Endpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Endpoint to be of type string, got %T instead", value) } sv.Endpoint = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcEndpointStatus to be of type string, got %T instead", value) } sv.Status = types.VpcEndpointStatus(jtv) } case "VpcEndpointId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcEndpointId to be of type string, got %T instead", value) } sv.VpcEndpointId = ptr.String(jtv) } case "VpcEndpointOwner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AWSAccount to be of type string, got %T instead", value) } sv.VpcEndpointOwner = ptr.String(jtv) } case "VpcOptions": if err := awsRestjson1_deserializeDocumentVPCDerivedInfo(&sv.VpcOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVpcEndpointError(v **types.VpcEndpointError, 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.VpcEndpointError if *v == nil { sv = &types.VpcEndpointError{} } else { sv = *v } for key, value := range shape { switch key { case "ErrorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcEndpointErrorCode to be of type string, got %T instead", value) } sv.ErrorCode = types.VpcEndpointErrorCode(jtv) } case "ErrorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "VpcEndpointId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcEndpointId to be of type string, got %T instead", value) } sv.VpcEndpointId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVpcEndpointErrorList(v *[]types.VpcEndpointError, 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.VpcEndpointError if *v == nil { cv = []types.VpcEndpointError{} } else { cv = *v } for _, value := range shape { var col types.VpcEndpointError destAddr := &col if err := awsRestjson1_deserializeDocumentVpcEndpointError(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentVpcEndpoints(v *[]types.VpcEndpoint, 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.VpcEndpoint if *v == nil { cv = []types.VpcEndpoint{} } else { cv = *v } for _, value := range shape { var col types.VpcEndpoint destAddr := &col if err := awsRestjson1_deserializeDocumentVpcEndpoint(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentVpcEndpointSummary(v **types.VpcEndpointSummary, 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.VpcEndpointSummary if *v == nil { sv = &types.VpcEndpointSummary{} } else { sv = *v } for key, value := range shape { switch key { case "DomainArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainArn to be of type string, got %T instead", value) } sv.DomainArn = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcEndpointStatus to be of type string, got %T instead", value) } sv.Status = types.VpcEndpointStatus(jtv) } case "VpcEndpointId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcEndpointId to be of type string, got %T instead", value) } sv.VpcEndpointId = ptr.String(jtv) } case "VpcEndpointOwner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.VpcEndpointOwner = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVpcEndpointSummaryList(v *[]types.VpcEndpointSummary, 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.VpcEndpointSummary if *v == nil { cv = []types.VpcEndpointSummary{} } else { cv = *v } for _, value := range shape { var col types.VpcEndpointSummary destAddr := &col if err := awsRestjson1_deserializeDocumentVpcEndpointSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentWindowStartTime(v **types.WindowStartTime, 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.WindowStartTime if *v == nil { sv = &types.WindowStartTime{} } else { sv = *v } for key, value := range shape { switch key { case "Hours": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StartTimeHours to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Hours = i64 } case "Minutes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StartTimeMinutes to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Minutes = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentZoneAwarenessConfig(v **types.ZoneAwarenessConfig, 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.ZoneAwarenessConfig if *v == nil { sv = &types.ZoneAwarenessConfig{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityZoneCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected IntegerClass to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.AvailabilityZoneCount = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil }
16,805
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package opensearch provides the API client, operations, and parameter types for // Amazon OpenSearch Service. // // Use the Amazon OpenSearch Service configuration API to create, configure, and // manage OpenSearch Service domains. For sample code that uses the configuration // API, see the Amazon OpenSearch Service Developer Guide (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/opensearch-configuration-samples.html) // . The guide also contains sample code (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/request-signing.html) // for sending signed HTTP requests to the OpenSearch APIs. The endpoint for // configuration service requests is Region specific: es.region.amazonaws.com. For // example, es.us-east-1.amazonaws.com. For a current list of supported Regions and // endpoints, see Amazon Web Services service endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#service-regions) // . package opensearch
16
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch 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/opensearch/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 = "es" } 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 opensearch // goModuleVersion is the tagged release for this module const goModuleVersion = "1.18.2"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/opensearch/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" ) type awsRestjson1_serializeOpAcceptInboundConnection struct { } func (*awsRestjson1_serializeOpAcceptInboundConnection) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpAcceptInboundConnection) 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.(*AcceptInboundConnectionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/cc/inboundConnection/{ConnectionId}/accept") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" 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_serializeOpHttpBindingsAcceptInboundConnectionInput(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_serializeOpHttpBindingsAcceptInboundConnectionInput(v *AcceptInboundConnectionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ConnectionId == nil || len(*v.ConnectionId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ConnectionId must not be empty")} } if v.ConnectionId != nil { if err := encoder.SetURI("ConnectionId").String(*v.ConnectionId); err != nil { return err } } return nil } type awsRestjson1_serializeOpAddTags struct { } func (*awsRestjson1_serializeOpAddTags) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpAddTags) 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.(*AddTagsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/tags") 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_serializeOpDocumentAddTagsInput(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_serializeOpHttpBindingsAddTagsInput(v *AddTagsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentAddTagsInput(v *AddTagsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ARN != nil { ok := object.Key("ARN") ok.String(*v.ARN) } if v.TagList != nil { ok := object.Key("TagList") if err := awsRestjson1_serializeDocumentTagList(v.TagList, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpAssociatePackage struct { } func (*awsRestjson1_serializeOpAssociatePackage) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpAssociatePackage) 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.(*AssociatePackageInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/packages/associate/{PackageID}/{DomainName}") 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_serializeOpHttpBindingsAssociatePackageInput(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_serializeOpHttpBindingsAssociatePackageInput(v *AssociatePackageInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName == nil || len(*v.DomainName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} } if v.DomainName != nil { if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { return err } } if v.PackageID == nil || len(*v.PackageID) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member PackageID must not be empty")} } if v.PackageID != nil { if err := encoder.SetURI("PackageID").String(*v.PackageID); err != nil { return err } } return nil } type awsRestjson1_serializeOpAuthorizeVpcEndpointAccess struct { } func (*awsRestjson1_serializeOpAuthorizeVpcEndpointAccess) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpAuthorizeVpcEndpointAccess) 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.(*AuthorizeVpcEndpointAccessInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain/{DomainName}/authorizeVpcEndpointAccess") 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_serializeOpHttpBindingsAuthorizeVpcEndpointAccessInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentAuthorizeVpcEndpointAccessInput(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_serializeOpHttpBindingsAuthorizeVpcEndpointAccessInput(v *AuthorizeVpcEndpointAccessInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName == nil || len(*v.DomainName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} } if v.DomainName != nil { if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentAuthorizeVpcEndpointAccessInput(v *AuthorizeVpcEndpointAccessInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Account != nil { ok := object.Key("Account") ok.String(*v.Account) } return nil } type awsRestjson1_serializeOpCancelServiceSoftwareUpdate struct { } func (*awsRestjson1_serializeOpCancelServiceSoftwareUpdate) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCancelServiceSoftwareUpdate) 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.(*CancelServiceSoftwareUpdateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/serviceSoftwareUpdate/cancel") 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_serializeOpDocumentCancelServiceSoftwareUpdateInput(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_serializeOpHttpBindingsCancelServiceSoftwareUpdateInput(v *CancelServiceSoftwareUpdateInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCancelServiceSoftwareUpdateInput(v *CancelServiceSoftwareUpdateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } return nil } type awsRestjson1_serializeOpCreateDomain struct { } func (*awsRestjson1_serializeOpCreateDomain) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateDomain) 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.(*CreateDomainInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain") 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_serializeOpDocumentCreateDomainInput(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_serializeOpHttpBindingsCreateDomainInput(v *CreateDomainInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateDomainInput(v *CreateDomainInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccessPolicies != nil { ok := object.Key("AccessPolicies") ok.String(*v.AccessPolicies) } if v.AdvancedOptions != nil { ok := object.Key("AdvancedOptions") if err := awsRestjson1_serializeDocumentAdvancedOptions(v.AdvancedOptions, ok); err != nil { return err } } if v.AdvancedSecurityOptions != nil { ok := object.Key("AdvancedSecurityOptions") if err := awsRestjson1_serializeDocumentAdvancedSecurityOptionsInput(v.AdvancedSecurityOptions, ok); err != nil { return err } } if v.AutoTuneOptions != nil { ok := object.Key("AutoTuneOptions") if err := awsRestjson1_serializeDocumentAutoTuneOptionsInput(v.AutoTuneOptions, ok); err != nil { return err } } if v.ClusterConfig != nil { ok := object.Key("ClusterConfig") if err := awsRestjson1_serializeDocumentClusterConfig(v.ClusterConfig, ok); err != nil { return err } } if v.CognitoOptions != nil { ok := object.Key("CognitoOptions") if err := awsRestjson1_serializeDocumentCognitoOptions(v.CognitoOptions, ok); err != nil { return err } } if v.DomainEndpointOptions != nil { ok := object.Key("DomainEndpointOptions") if err := awsRestjson1_serializeDocumentDomainEndpointOptions(v.DomainEndpointOptions, ok); err != nil { return err } } if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } if v.EBSOptions != nil { ok := object.Key("EBSOptions") if err := awsRestjson1_serializeDocumentEBSOptions(v.EBSOptions, ok); err != nil { return err } } if v.EncryptionAtRestOptions != nil { ok := object.Key("EncryptionAtRestOptions") if err := awsRestjson1_serializeDocumentEncryptionAtRestOptions(v.EncryptionAtRestOptions, ok); err != nil { return err } } if v.EngineVersion != nil { ok := object.Key("EngineVersion") ok.String(*v.EngineVersion) } if v.LogPublishingOptions != nil { ok := object.Key("LogPublishingOptions") if err := awsRestjson1_serializeDocumentLogPublishingOptions(v.LogPublishingOptions, ok); err != nil { return err } } if v.NodeToNodeEncryptionOptions != nil { ok := object.Key("NodeToNodeEncryptionOptions") if err := awsRestjson1_serializeDocumentNodeToNodeEncryptionOptions(v.NodeToNodeEncryptionOptions, ok); err != nil { return err } } if v.OffPeakWindowOptions != nil { ok := object.Key("OffPeakWindowOptions") if err := awsRestjson1_serializeDocumentOffPeakWindowOptions(v.OffPeakWindowOptions, ok); err != nil { return err } } if v.SnapshotOptions != nil { ok := object.Key("SnapshotOptions") if err := awsRestjson1_serializeDocumentSnapshotOptions(v.SnapshotOptions, ok); err != nil { return err } } if v.SoftwareUpdateOptions != nil { ok := object.Key("SoftwareUpdateOptions") if err := awsRestjson1_serializeDocumentSoftwareUpdateOptions(v.SoftwareUpdateOptions, ok); err != nil { return err } } if v.TagList != nil { ok := object.Key("TagList") if err := awsRestjson1_serializeDocumentTagList(v.TagList, ok); err != nil { return err } } if v.VPCOptions != nil { ok := object.Key("VPCOptions") if err := awsRestjson1_serializeDocumentVPCOptions(v.VPCOptions, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateOutboundConnection struct { } func (*awsRestjson1_serializeOpCreateOutboundConnection) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateOutboundConnection) 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.(*CreateOutboundConnectionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/cc/outboundConnection") 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_serializeOpDocumentCreateOutboundConnectionInput(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_serializeOpHttpBindingsCreateOutboundConnectionInput(v *CreateOutboundConnectionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateOutboundConnectionInput(v *CreateOutboundConnectionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ConnectionAlias != nil { ok := object.Key("ConnectionAlias") ok.String(*v.ConnectionAlias) } if len(v.ConnectionMode) > 0 { ok := object.Key("ConnectionMode") ok.String(string(v.ConnectionMode)) } if v.ConnectionProperties != nil { ok := object.Key("ConnectionProperties") if err := awsRestjson1_serializeDocumentConnectionProperties(v.ConnectionProperties, ok); err != nil { return err } } if v.LocalDomainInfo != nil { ok := object.Key("LocalDomainInfo") if err := awsRestjson1_serializeDocumentDomainInformationContainer(v.LocalDomainInfo, ok); err != nil { return err } } if v.RemoteDomainInfo != nil { ok := object.Key("RemoteDomainInfo") if err := awsRestjson1_serializeDocumentDomainInformationContainer(v.RemoteDomainInfo, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreatePackage struct { } func (*awsRestjson1_serializeOpCreatePackage) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreatePackage) 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.(*CreatePackageInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/packages") 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_serializeOpDocumentCreatePackageInput(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_serializeOpHttpBindingsCreatePackageInput(v *CreatePackageInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreatePackageInput(v *CreatePackageInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.PackageDescription != nil { ok := object.Key("PackageDescription") ok.String(*v.PackageDescription) } if v.PackageName != nil { ok := object.Key("PackageName") ok.String(*v.PackageName) } if v.PackageSource != nil { ok := object.Key("PackageSource") if err := awsRestjson1_serializeDocumentPackageSource(v.PackageSource, ok); err != nil { return err } } if len(v.PackageType) > 0 { ok := object.Key("PackageType") ok.String(string(v.PackageType)) } return nil } type awsRestjson1_serializeOpCreateVpcEndpoint struct { } func (*awsRestjson1_serializeOpCreateVpcEndpoint) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateVpcEndpoint) 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.(*CreateVpcEndpointInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/vpcEndpoints") 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_serializeOpDocumentCreateVpcEndpointInput(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_serializeOpHttpBindingsCreateVpcEndpointInput(v *CreateVpcEndpointInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateVpcEndpointInput(v *CreateVpcEndpointInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("ClientToken") ok.String(*v.ClientToken) } if v.DomainArn != nil { ok := object.Key("DomainArn") ok.String(*v.DomainArn) } if v.VpcOptions != nil { ok := object.Key("VpcOptions") if err := awsRestjson1_serializeDocumentVPCOptions(v.VpcOptions, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteDomain struct { } func (*awsRestjson1_serializeOpDeleteDomain) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteDomain) 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.(*DeleteDomainInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain/{DomainName}") 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_serializeOpHttpBindingsDeleteDomainInput(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_serializeOpHttpBindingsDeleteDomainInput(v *DeleteDomainInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName == nil || len(*v.DomainName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} } if v.DomainName != nil { if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteInboundConnection struct { } func (*awsRestjson1_serializeOpDeleteInboundConnection) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteInboundConnection) 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.(*DeleteInboundConnectionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/cc/inboundConnection/{ConnectionId}") 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_serializeOpHttpBindingsDeleteInboundConnectionInput(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_serializeOpHttpBindingsDeleteInboundConnectionInput(v *DeleteInboundConnectionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ConnectionId == nil || len(*v.ConnectionId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ConnectionId must not be empty")} } if v.ConnectionId != nil { if err := encoder.SetURI("ConnectionId").String(*v.ConnectionId); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteOutboundConnection struct { } func (*awsRestjson1_serializeOpDeleteOutboundConnection) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteOutboundConnection) 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.(*DeleteOutboundConnectionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/cc/outboundConnection/{ConnectionId}") 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_serializeOpHttpBindingsDeleteOutboundConnectionInput(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_serializeOpHttpBindingsDeleteOutboundConnectionInput(v *DeleteOutboundConnectionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ConnectionId == nil || len(*v.ConnectionId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ConnectionId must not be empty")} } if v.ConnectionId != nil { if err := encoder.SetURI("ConnectionId").String(*v.ConnectionId); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeletePackage struct { } func (*awsRestjson1_serializeOpDeletePackage) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeletePackage) 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.(*DeletePackageInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/packages/{PackageID}") 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_serializeOpHttpBindingsDeletePackageInput(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_serializeOpHttpBindingsDeletePackageInput(v *DeletePackageInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.PackageID == nil || len(*v.PackageID) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member PackageID must not be empty")} } if v.PackageID != nil { if err := encoder.SetURI("PackageID").String(*v.PackageID); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteVpcEndpoint struct { } func (*awsRestjson1_serializeOpDeleteVpcEndpoint) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteVpcEndpoint) 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.(*DeleteVpcEndpointInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/vpcEndpoints/{VpcEndpointId}") 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_serializeOpHttpBindingsDeleteVpcEndpointInput(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_serializeOpHttpBindingsDeleteVpcEndpointInput(v *DeleteVpcEndpointInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.VpcEndpointId == nil || len(*v.VpcEndpointId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member VpcEndpointId must not be empty")} } if v.VpcEndpointId != nil { if err := encoder.SetURI("VpcEndpointId").String(*v.VpcEndpointId); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeDomain struct { } func (*awsRestjson1_serializeOpDescribeDomain) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeDomain) 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.(*DescribeDomainInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain/{DomainName}") 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_serializeOpHttpBindingsDescribeDomainInput(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_serializeOpHttpBindingsDescribeDomainInput(v *DescribeDomainInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName == nil || len(*v.DomainName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} } if v.DomainName != nil { if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeDomainAutoTunes struct { } func (*awsRestjson1_serializeOpDescribeDomainAutoTunes) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeDomainAutoTunes) 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.(*DescribeDomainAutoTunesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain/{DomainName}/autoTunes") 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_serializeOpHttpBindingsDescribeDomainAutoTunesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDescribeDomainAutoTunesInput(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_serializeOpHttpBindingsDescribeDomainAutoTunesInput(v *DescribeDomainAutoTunesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName == nil || len(*v.DomainName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} } if v.DomainName != nil { if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentDescribeDomainAutoTunesInput(v *DescribeDomainAutoTunesInput, 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) } return nil } type awsRestjson1_serializeOpDescribeDomainChangeProgress struct { } func (*awsRestjson1_serializeOpDescribeDomainChangeProgress) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeDomainChangeProgress) 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.(*DescribeDomainChangeProgressInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain/{DomainName}/progress") 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_serializeOpHttpBindingsDescribeDomainChangeProgressInput(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_serializeOpHttpBindingsDescribeDomainChangeProgressInput(v *DescribeDomainChangeProgressInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ChangeId != nil { encoder.SetQuery("changeid").String(*v.ChangeId) } if v.DomainName == nil || len(*v.DomainName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} } if v.DomainName != nil { if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeDomainConfig struct { } func (*awsRestjson1_serializeOpDescribeDomainConfig) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeDomainConfig) 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.(*DescribeDomainConfigInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain/{DomainName}/config") 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_serializeOpHttpBindingsDescribeDomainConfigInput(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_serializeOpHttpBindingsDescribeDomainConfigInput(v *DescribeDomainConfigInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName == nil || len(*v.DomainName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} } if v.DomainName != nil { if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeDomainHealth struct { } func (*awsRestjson1_serializeOpDescribeDomainHealth) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeDomainHealth) 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.(*DescribeDomainHealthInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain/{DomainName}/health") 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_serializeOpHttpBindingsDescribeDomainHealthInput(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_serializeOpHttpBindingsDescribeDomainHealthInput(v *DescribeDomainHealthInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName == nil || len(*v.DomainName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} } if v.DomainName != nil { if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeDomainNodes struct { } func (*awsRestjson1_serializeOpDescribeDomainNodes) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeDomainNodes) 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.(*DescribeDomainNodesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain/{DomainName}/nodes") 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_serializeOpHttpBindingsDescribeDomainNodesInput(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_serializeOpHttpBindingsDescribeDomainNodesInput(v *DescribeDomainNodesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName == nil || len(*v.DomainName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} } if v.DomainName != nil { if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeDomains struct { } func (*awsRestjson1_serializeOpDescribeDomains) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeDomains) 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.(*DescribeDomainsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain-info") 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_serializeOpDocumentDescribeDomainsInput(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_serializeOpHttpBindingsDescribeDomainsInput(v *DescribeDomainsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeDomainsInput(v *DescribeDomainsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainNames != nil { ok := object.Key("DomainNames") if err := awsRestjson1_serializeDocumentDomainNameList(v.DomainNames, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeDryRunProgress struct { } func (*awsRestjson1_serializeOpDescribeDryRunProgress) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeDryRunProgress) 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.(*DescribeDryRunProgressInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain/{DomainName}/dryRun") 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_serializeOpHttpBindingsDescribeDryRunProgressInput(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_serializeOpHttpBindingsDescribeDryRunProgressInput(v *DescribeDryRunProgressInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName == nil || len(*v.DomainName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} } if v.DomainName != nil { if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { return err } } if v.DryRunId != nil { encoder.SetQuery("dryRunId").String(*v.DryRunId) } if v.LoadDryRunConfig != nil { encoder.SetQuery("loadDryRunConfig").Boolean(*v.LoadDryRunConfig) } return nil } type awsRestjson1_serializeOpDescribeInboundConnections struct { } func (*awsRestjson1_serializeOpDescribeInboundConnections) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeInboundConnections) 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.(*DescribeInboundConnectionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/cc/inboundConnection/search") 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_serializeOpDocumentDescribeInboundConnectionsInput(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_serializeOpHttpBindingsDescribeInboundConnectionsInput(v *DescribeInboundConnectionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeInboundConnectionsInput(v *DescribeInboundConnectionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("Filters") if err := awsRestjson1_serializeDocumentFilterList(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_serializeOpDescribeInstanceTypeLimits struct { } func (*awsRestjson1_serializeOpDescribeInstanceTypeLimits) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeInstanceTypeLimits) 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.(*DescribeInstanceTypeLimitsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/instanceTypeLimits/{EngineVersion}/{InstanceType}") 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_serializeOpHttpBindingsDescribeInstanceTypeLimitsInput(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_serializeOpHttpBindingsDescribeInstanceTypeLimitsInput(v *DescribeInstanceTypeLimitsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName != nil { encoder.SetQuery("domainName").String(*v.DomainName) } if v.EngineVersion == nil || len(*v.EngineVersion) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member EngineVersion must not be empty")} } if v.EngineVersion != nil { if err := encoder.SetURI("EngineVersion").String(*v.EngineVersion); err != nil { return err } } if len(v.InstanceType) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member InstanceType must not be empty")} } if len(v.InstanceType) > 0 { if err := encoder.SetURI("InstanceType").String(string(v.InstanceType)); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeOutboundConnections struct { } func (*awsRestjson1_serializeOpDescribeOutboundConnections) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeOutboundConnections) 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.(*DescribeOutboundConnectionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/cc/outboundConnection/search") 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_serializeOpDocumentDescribeOutboundConnectionsInput(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_serializeOpHttpBindingsDescribeOutboundConnectionsInput(v *DescribeOutboundConnectionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeOutboundConnectionsInput(v *DescribeOutboundConnectionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("Filters") if err := awsRestjson1_serializeDocumentFilterList(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_serializeOpDescribePackages struct { } func (*awsRestjson1_serializeOpDescribePackages) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribePackages) 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.(*DescribePackagesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/packages/describe") 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_serializeOpDocumentDescribePackagesInput(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_serializeOpHttpBindingsDescribePackagesInput(v *DescribePackagesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribePackagesInput(v *DescribePackagesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("Filters") if err := awsRestjson1_serializeDocumentDescribePackagesFilterList(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_serializeOpDescribeReservedInstanceOfferings struct { } func (*awsRestjson1_serializeOpDescribeReservedInstanceOfferings) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeReservedInstanceOfferings) 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.(*DescribeReservedInstanceOfferingsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/reservedInstanceOfferings") 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_serializeOpHttpBindingsDescribeReservedInstanceOfferingsInput(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_serializeOpHttpBindingsDescribeReservedInstanceOfferingsInput(v *DescribeReservedInstanceOfferingsInput, 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) } if v.ReservedInstanceOfferingId != nil { encoder.SetQuery("offeringId").String(*v.ReservedInstanceOfferingId) } return nil } type awsRestjson1_serializeOpDescribeReservedInstances struct { } func (*awsRestjson1_serializeOpDescribeReservedInstances) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeReservedInstances) 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.(*DescribeReservedInstancesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/reservedInstances") 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_serializeOpHttpBindingsDescribeReservedInstancesInput(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_serializeOpHttpBindingsDescribeReservedInstancesInput(v *DescribeReservedInstancesInput, 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) } if v.ReservedInstanceId != nil { encoder.SetQuery("reservationId").String(*v.ReservedInstanceId) } return nil } type awsRestjson1_serializeOpDescribeVpcEndpoints struct { } func (*awsRestjson1_serializeOpDescribeVpcEndpoints) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeVpcEndpoints) 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.(*DescribeVpcEndpointsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/vpcEndpoints/describe") 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_serializeOpDocumentDescribeVpcEndpointsInput(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_serializeOpHttpBindingsDescribeVpcEndpointsInput(v *DescribeVpcEndpointsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeVpcEndpointsInput(v *DescribeVpcEndpointsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.VpcEndpointIds != nil { ok := object.Key("VpcEndpointIds") if err := awsRestjson1_serializeDocumentVpcEndpointIdList(v.VpcEndpointIds, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpDissociatePackage struct { } func (*awsRestjson1_serializeOpDissociatePackage) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDissociatePackage) 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.(*DissociatePackageInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/packages/dissociate/{PackageID}/{DomainName}") 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_serializeOpHttpBindingsDissociatePackageInput(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_serializeOpHttpBindingsDissociatePackageInput(v *DissociatePackageInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName == nil || len(*v.DomainName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} } if v.DomainName != nil { if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { return err } } if v.PackageID == nil || len(*v.PackageID) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member PackageID must not be empty")} } if v.PackageID != nil { if err := encoder.SetURI("PackageID").String(*v.PackageID); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetCompatibleVersions struct { } func (*awsRestjson1_serializeOpGetCompatibleVersions) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetCompatibleVersions) 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.(*GetCompatibleVersionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/compatibleVersions") 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_serializeOpHttpBindingsGetCompatibleVersionsInput(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_serializeOpHttpBindingsGetCompatibleVersionsInput(v *GetCompatibleVersionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName != nil { encoder.SetQuery("domainName").String(*v.DomainName) } return nil } type awsRestjson1_serializeOpGetPackageVersionHistory struct { } func (*awsRestjson1_serializeOpGetPackageVersionHistory) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetPackageVersionHistory) 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.(*GetPackageVersionHistoryInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/packages/{PackageID}/history") 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_serializeOpHttpBindingsGetPackageVersionHistoryInput(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_serializeOpHttpBindingsGetPackageVersionHistoryInput(v *GetPackageVersionHistoryInput, 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) } if v.PackageID == nil || len(*v.PackageID) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member PackageID must not be empty")} } if v.PackageID != nil { if err := encoder.SetURI("PackageID").String(*v.PackageID); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetUpgradeHistory struct { } func (*awsRestjson1_serializeOpGetUpgradeHistory) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetUpgradeHistory) 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.(*GetUpgradeHistoryInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/upgradeDomain/{DomainName}/history") 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_serializeOpHttpBindingsGetUpgradeHistoryInput(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_serializeOpHttpBindingsGetUpgradeHistoryInput(v *GetUpgradeHistoryInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName == nil || len(*v.DomainName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} } if v.DomainName != nil { if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { return err } } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpGetUpgradeStatus struct { } func (*awsRestjson1_serializeOpGetUpgradeStatus) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetUpgradeStatus) 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.(*GetUpgradeStatusInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/upgradeDomain/{DomainName}/status") 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_serializeOpHttpBindingsGetUpgradeStatusInput(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_serializeOpHttpBindingsGetUpgradeStatusInput(v *GetUpgradeStatusInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName == nil || len(*v.DomainName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} } if v.DomainName != nil { if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { return err } } return nil } type awsRestjson1_serializeOpListDomainNames struct { } func (*awsRestjson1_serializeOpListDomainNames) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListDomainNames) 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.(*ListDomainNamesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/domain") 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_serializeOpHttpBindingsListDomainNamesInput(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_serializeOpHttpBindingsListDomainNamesInput(v *ListDomainNamesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if len(v.EngineType) > 0 { encoder.SetQuery("engineType").String(string(v.EngineType)) } return nil } type awsRestjson1_serializeOpListDomainsForPackage struct { } func (*awsRestjson1_serializeOpListDomainsForPackage) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListDomainsForPackage) 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.(*ListDomainsForPackageInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/packages/{PackageID}/domains") 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_serializeOpHttpBindingsListDomainsForPackageInput(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_serializeOpHttpBindingsListDomainsForPackageInput(v *ListDomainsForPackageInput, 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) } if v.PackageID == nil || len(*v.PackageID) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member PackageID must not be empty")} } if v.PackageID != nil { if err := encoder.SetURI("PackageID").String(*v.PackageID); err != nil { return err } } return nil } type awsRestjson1_serializeOpListInstanceTypeDetails struct { } func (*awsRestjson1_serializeOpListInstanceTypeDetails) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListInstanceTypeDetails) 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.(*ListInstanceTypeDetailsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/instanceTypeDetails/{EngineVersion}") 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_serializeOpHttpBindingsListInstanceTypeDetailsInput(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_serializeOpHttpBindingsListInstanceTypeDetailsInput(v *ListInstanceTypeDetailsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName != nil { encoder.SetQuery("domainName").String(*v.DomainName) } if v.EngineVersion == nil || len(*v.EngineVersion) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member EngineVersion must not be empty")} } if v.EngineVersion != nil { if err := encoder.SetURI("EngineVersion").String(*v.EngineVersion); err != nil { return err } } if v.InstanceType != nil { encoder.SetQuery("instanceType").String(*v.InstanceType) } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if v.RetrieveAZs != nil { encoder.SetQuery("retrieveAZs").Boolean(*v.RetrieveAZs) } return nil } type awsRestjson1_serializeOpListPackagesForDomain struct { } func (*awsRestjson1_serializeOpListPackagesForDomain) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListPackagesForDomain) 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.(*ListPackagesForDomainInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/domain/{DomainName}/packages") 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_serializeOpHttpBindingsListPackagesForDomainInput(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_serializeOpHttpBindingsListPackagesForDomainInput(v *ListPackagesForDomainInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName == nil || len(*v.DomainName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} } if v.DomainName != nil { if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { return err } } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListScheduledActions struct { } func (*awsRestjson1_serializeOpListScheduledActions) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListScheduledActions) 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.(*ListScheduledActionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain/{DomainName}/scheduledActions") 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_serializeOpHttpBindingsListScheduledActionsInput(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_serializeOpHttpBindingsListScheduledActionsInput(v *ListScheduledActionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName == nil || len(*v.DomainName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} } if v.DomainName != nil { if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { return err } } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListTags struct { } func (*awsRestjson1_serializeOpListTags) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListTags) 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.(*ListTagsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/tags") 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_serializeOpHttpBindingsListTagsInput(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_serializeOpHttpBindingsListTagsInput(v *ListTagsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ARN != nil { encoder.SetQuery("arn").String(*v.ARN) } return nil } type awsRestjson1_serializeOpListVersions struct { } func (*awsRestjson1_serializeOpListVersions) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListVersions) 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.(*ListVersionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/versions") 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_serializeOpHttpBindingsListVersionsInput(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_serializeOpHttpBindingsListVersionsInput(v *ListVersionsInput, 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_serializeOpListVpcEndpointAccess struct { } func (*awsRestjson1_serializeOpListVpcEndpointAccess) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListVpcEndpointAccess) 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.(*ListVpcEndpointAccessInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain/{DomainName}/listVpcEndpointAccess") 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_serializeOpHttpBindingsListVpcEndpointAccessInput(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_serializeOpHttpBindingsListVpcEndpointAccessInput(v *ListVpcEndpointAccessInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName == nil || len(*v.DomainName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} } if v.DomainName != nil { if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { return err } } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListVpcEndpoints struct { } func (*awsRestjson1_serializeOpListVpcEndpoints) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListVpcEndpoints) 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.(*ListVpcEndpointsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/vpcEndpoints") 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_serializeOpHttpBindingsListVpcEndpointsInput(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_serializeOpHttpBindingsListVpcEndpointsInput(v *ListVpcEndpointsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListVpcEndpointsForDomain struct { } func (*awsRestjson1_serializeOpListVpcEndpointsForDomain) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListVpcEndpointsForDomain) 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.(*ListVpcEndpointsForDomainInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain/{DomainName}/vpcEndpoints") 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_serializeOpHttpBindingsListVpcEndpointsForDomainInput(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_serializeOpHttpBindingsListVpcEndpointsForDomainInput(v *ListVpcEndpointsForDomainInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName == nil || len(*v.DomainName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} } if v.DomainName != nil { if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { return err } } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpPurchaseReservedInstanceOffering struct { } func (*awsRestjson1_serializeOpPurchaseReservedInstanceOffering) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpPurchaseReservedInstanceOffering) 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.(*PurchaseReservedInstanceOfferingInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/purchaseReservedInstanceOffering") 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_serializeOpDocumentPurchaseReservedInstanceOfferingInput(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_serializeOpHttpBindingsPurchaseReservedInstanceOfferingInput(v *PurchaseReservedInstanceOfferingInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentPurchaseReservedInstanceOfferingInput(v *PurchaseReservedInstanceOfferingInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.InstanceCount != 0 { ok := object.Key("InstanceCount") ok.Integer(v.InstanceCount) } if v.ReservationName != nil { ok := object.Key("ReservationName") ok.String(*v.ReservationName) } if v.ReservedInstanceOfferingId != nil { ok := object.Key("ReservedInstanceOfferingId") ok.String(*v.ReservedInstanceOfferingId) } return nil } type awsRestjson1_serializeOpRejectInboundConnection struct { } func (*awsRestjson1_serializeOpRejectInboundConnection) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpRejectInboundConnection) 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.(*RejectInboundConnectionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/cc/inboundConnection/{ConnectionId}/reject") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" 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_serializeOpHttpBindingsRejectInboundConnectionInput(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_serializeOpHttpBindingsRejectInboundConnectionInput(v *RejectInboundConnectionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ConnectionId == nil || len(*v.ConnectionId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ConnectionId must not be empty")} } if v.ConnectionId != nil { if err := encoder.SetURI("ConnectionId").String(*v.ConnectionId); err != nil { return err } } return nil } type awsRestjson1_serializeOpRemoveTags struct { } func (*awsRestjson1_serializeOpRemoveTags) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpRemoveTags) 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.(*RemoveTagsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/tags-removal") 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_serializeOpDocumentRemoveTagsInput(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_serializeOpHttpBindingsRemoveTagsInput(v *RemoveTagsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentRemoveTagsInput(v *RemoveTagsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ARN != nil { ok := object.Key("ARN") ok.String(*v.ARN) } if v.TagKeys != nil { ok := object.Key("TagKeys") if err := awsRestjson1_serializeDocumentStringList(v.TagKeys, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpRevokeVpcEndpointAccess struct { } func (*awsRestjson1_serializeOpRevokeVpcEndpointAccess) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpRevokeVpcEndpointAccess) 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.(*RevokeVpcEndpointAccessInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain/{DomainName}/revokeVpcEndpointAccess") 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_serializeOpHttpBindingsRevokeVpcEndpointAccessInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentRevokeVpcEndpointAccessInput(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_serializeOpHttpBindingsRevokeVpcEndpointAccessInput(v *RevokeVpcEndpointAccessInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName == nil || len(*v.DomainName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} } if v.DomainName != nil { if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentRevokeVpcEndpointAccessInput(v *RevokeVpcEndpointAccessInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Account != nil { ok := object.Key("Account") ok.String(*v.Account) } return nil } type awsRestjson1_serializeOpStartServiceSoftwareUpdate struct { } func (*awsRestjson1_serializeOpStartServiceSoftwareUpdate) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartServiceSoftwareUpdate) 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.(*StartServiceSoftwareUpdateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/serviceSoftwareUpdate/start") 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_serializeOpDocumentStartServiceSoftwareUpdateInput(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_serializeOpHttpBindingsStartServiceSoftwareUpdateInput(v *StartServiceSoftwareUpdateInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentStartServiceSoftwareUpdateInput(v *StartServiceSoftwareUpdateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DesiredStartTime != nil { ok := object.Key("DesiredStartTime") ok.Long(*v.DesiredStartTime) } if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } if len(v.ScheduleAt) > 0 { ok := object.Key("ScheduleAt") ok.String(string(v.ScheduleAt)) } return nil } type awsRestjson1_serializeOpUpdateDomainConfig struct { } func (*awsRestjson1_serializeOpUpdateDomainConfig) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateDomainConfig) 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.(*UpdateDomainConfigInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain/{DomainName}/config") 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_serializeOpHttpBindingsUpdateDomainConfigInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateDomainConfigInput(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_serializeOpHttpBindingsUpdateDomainConfigInput(v *UpdateDomainConfigInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName == nil || len(*v.DomainName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} } if v.DomainName != nil { if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateDomainConfigInput(v *UpdateDomainConfigInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccessPolicies != nil { ok := object.Key("AccessPolicies") ok.String(*v.AccessPolicies) } if v.AdvancedOptions != nil { ok := object.Key("AdvancedOptions") if err := awsRestjson1_serializeDocumentAdvancedOptions(v.AdvancedOptions, ok); err != nil { return err } } if v.AdvancedSecurityOptions != nil { ok := object.Key("AdvancedSecurityOptions") if err := awsRestjson1_serializeDocumentAdvancedSecurityOptionsInput(v.AdvancedSecurityOptions, ok); err != nil { return err } } if v.AutoTuneOptions != nil { ok := object.Key("AutoTuneOptions") if err := awsRestjson1_serializeDocumentAutoTuneOptions(v.AutoTuneOptions, ok); err != nil { return err } } if v.ClusterConfig != nil { ok := object.Key("ClusterConfig") if err := awsRestjson1_serializeDocumentClusterConfig(v.ClusterConfig, ok); err != nil { return err } } if v.CognitoOptions != nil { ok := object.Key("CognitoOptions") if err := awsRestjson1_serializeDocumentCognitoOptions(v.CognitoOptions, ok); err != nil { return err } } if v.DomainEndpointOptions != nil { ok := object.Key("DomainEndpointOptions") if err := awsRestjson1_serializeDocumentDomainEndpointOptions(v.DomainEndpointOptions, ok); err != nil { return err } } if v.DryRun != nil { ok := object.Key("DryRun") ok.Boolean(*v.DryRun) } if len(v.DryRunMode) > 0 { ok := object.Key("DryRunMode") ok.String(string(v.DryRunMode)) } if v.EBSOptions != nil { ok := object.Key("EBSOptions") if err := awsRestjson1_serializeDocumentEBSOptions(v.EBSOptions, ok); err != nil { return err } } if v.EncryptionAtRestOptions != nil { ok := object.Key("EncryptionAtRestOptions") if err := awsRestjson1_serializeDocumentEncryptionAtRestOptions(v.EncryptionAtRestOptions, ok); err != nil { return err } } if v.LogPublishingOptions != nil { ok := object.Key("LogPublishingOptions") if err := awsRestjson1_serializeDocumentLogPublishingOptions(v.LogPublishingOptions, ok); err != nil { return err } } if v.NodeToNodeEncryptionOptions != nil { ok := object.Key("NodeToNodeEncryptionOptions") if err := awsRestjson1_serializeDocumentNodeToNodeEncryptionOptions(v.NodeToNodeEncryptionOptions, ok); err != nil { return err } } if v.OffPeakWindowOptions != nil { ok := object.Key("OffPeakWindowOptions") if err := awsRestjson1_serializeDocumentOffPeakWindowOptions(v.OffPeakWindowOptions, ok); err != nil { return err } } if v.SnapshotOptions != nil { ok := object.Key("SnapshotOptions") if err := awsRestjson1_serializeDocumentSnapshotOptions(v.SnapshotOptions, ok); err != nil { return err } } if v.SoftwareUpdateOptions != nil { ok := object.Key("SoftwareUpdateOptions") if err := awsRestjson1_serializeDocumentSoftwareUpdateOptions(v.SoftwareUpdateOptions, ok); err != nil { return err } } if v.VPCOptions != nil { ok := object.Key("VPCOptions") if err := awsRestjson1_serializeDocumentVPCOptions(v.VPCOptions, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdatePackage struct { } func (*awsRestjson1_serializeOpUpdatePackage) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdatePackage) 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.(*UpdatePackageInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/packages/update") 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_serializeOpDocumentUpdatePackageInput(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_serializeOpHttpBindingsUpdatePackageInput(v *UpdatePackageInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdatePackageInput(v *UpdatePackageInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CommitMessage != nil { ok := object.Key("CommitMessage") ok.String(*v.CommitMessage) } if v.PackageDescription != nil { ok := object.Key("PackageDescription") ok.String(*v.PackageDescription) } if v.PackageID != nil { ok := object.Key("PackageID") ok.String(*v.PackageID) } if v.PackageSource != nil { ok := object.Key("PackageSource") if err := awsRestjson1_serializeDocumentPackageSource(v.PackageSource, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdateScheduledAction struct { } func (*awsRestjson1_serializeOpUpdateScheduledAction) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateScheduledAction) 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.(*UpdateScheduledActionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain/{DomainName}/scheduledAction/update") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" 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_serializeOpHttpBindingsUpdateScheduledActionInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateScheduledActionInput(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_serializeOpHttpBindingsUpdateScheduledActionInput(v *UpdateScheduledActionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DomainName == nil || len(*v.DomainName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} } if v.DomainName != nil { if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateScheduledActionInput(v *UpdateScheduledActionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ActionID != nil { ok := object.Key("ActionID") ok.String(*v.ActionID) } if len(v.ActionType) > 0 { ok := object.Key("ActionType") ok.String(string(v.ActionType)) } if v.DesiredStartTime != nil { ok := object.Key("DesiredStartTime") ok.Long(*v.DesiredStartTime) } if len(v.ScheduleAt) > 0 { ok := object.Key("ScheduleAt") ok.String(string(v.ScheduleAt)) } return nil } type awsRestjson1_serializeOpUpdateVpcEndpoint struct { } func (*awsRestjson1_serializeOpUpdateVpcEndpoint) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateVpcEndpoint) 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.(*UpdateVpcEndpointInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/vpcEndpoints/update") 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_serializeOpDocumentUpdateVpcEndpointInput(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_serializeOpHttpBindingsUpdateVpcEndpointInput(v *UpdateVpcEndpointInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateVpcEndpointInput(v *UpdateVpcEndpointInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.VpcEndpointId != nil { ok := object.Key("VpcEndpointId") ok.String(*v.VpcEndpointId) } if v.VpcOptions != nil { ok := object.Key("VpcOptions") if err := awsRestjson1_serializeDocumentVPCOptions(v.VpcOptions, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpgradeDomain struct { } func (*awsRestjson1_serializeOpUpgradeDomain) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpgradeDomain) 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.(*UpgradeDomainInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/upgradeDomain") 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_serializeOpDocumentUpgradeDomainInput(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_serializeOpHttpBindingsUpgradeDomainInput(v *UpgradeDomainInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpgradeDomainInput(v *UpgradeDomainInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AdvancedOptions != nil { ok := object.Key("AdvancedOptions") if err := awsRestjson1_serializeDocumentAdvancedOptions(v.AdvancedOptions, ok); err != nil { return err } } if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } if v.PerformCheckOnly != nil { ok := object.Key("PerformCheckOnly") ok.Boolean(*v.PerformCheckOnly) } if v.TargetVersion != nil { ok := object.Key("TargetVersion") ok.String(*v.TargetVersion) } return nil } func awsRestjson1_serializeDocumentAdvancedOptions(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_serializeDocumentAdvancedSecurityOptionsInput(v *types.AdvancedSecurityOptionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AnonymousAuthEnabled != nil { ok := object.Key("AnonymousAuthEnabled") ok.Boolean(*v.AnonymousAuthEnabled) } if v.Enabled != nil { ok := object.Key("Enabled") ok.Boolean(*v.Enabled) } if v.InternalUserDatabaseEnabled != nil { ok := object.Key("InternalUserDatabaseEnabled") ok.Boolean(*v.InternalUserDatabaseEnabled) } if v.MasterUserOptions != nil { ok := object.Key("MasterUserOptions") if err := awsRestjson1_serializeDocumentMasterUserOptions(v.MasterUserOptions, ok); err != nil { return err } } if v.SAMLOptions != nil { ok := object.Key("SAMLOptions") if err := awsRestjson1_serializeDocumentSAMLOptionsInput(v.SAMLOptions, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentAutoTuneMaintenanceSchedule(v *types.AutoTuneMaintenanceSchedule, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CronExpressionForRecurrence != nil { ok := object.Key("CronExpressionForRecurrence") ok.String(*v.CronExpressionForRecurrence) } if v.Duration != nil { ok := object.Key("Duration") if err := awsRestjson1_serializeDocumentDuration(v.Duration, ok); err != nil { return err } } if v.StartAt != nil { ok := object.Key("StartAt") ok.Double(smithytime.FormatEpochSeconds(*v.StartAt)) } return nil } func awsRestjson1_serializeDocumentAutoTuneMaintenanceScheduleList(v []types.AutoTuneMaintenanceSchedule, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentAutoTuneMaintenanceSchedule(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentAutoTuneOptions(v *types.AutoTuneOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.DesiredState) > 0 { ok := object.Key("DesiredState") ok.String(string(v.DesiredState)) } if v.MaintenanceSchedules != nil { ok := object.Key("MaintenanceSchedules") if err := awsRestjson1_serializeDocumentAutoTuneMaintenanceScheduleList(v.MaintenanceSchedules, ok); err != nil { return err } } if len(v.RollbackOnDisable) > 0 { ok := object.Key("RollbackOnDisable") ok.String(string(v.RollbackOnDisable)) } if v.UseOffPeakWindow != nil { ok := object.Key("UseOffPeakWindow") ok.Boolean(*v.UseOffPeakWindow) } return nil } func awsRestjson1_serializeDocumentAutoTuneOptionsInput(v *types.AutoTuneOptionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.DesiredState) > 0 { ok := object.Key("DesiredState") ok.String(string(v.DesiredState)) } if v.MaintenanceSchedules != nil { ok := object.Key("MaintenanceSchedules") if err := awsRestjson1_serializeDocumentAutoTuneMaintenanceScheduleList(v.MaintenanceSchedules, ok); err != nil { return err } } if v.UseOffPeakWindow != nil { ok := object.Key("UseOffPeakWindow") ok.Boolean(*v.UseOffPeakWindow) } return nil } func awsRestjson1_serializeDocumentAWSDomainInformation(v *types.AWSDomainInformation, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } if v.OwnerId != nil { ok := object.Key("OwnerId") ok.String(*v.OwnerId) } if v.Region != nil { ok := object.Key("Region") ok.String(*v.Region) } return nil } func awsRestjson1_serializeDocumentClusterConfig(v *types.ClusterConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ColdStorageOptions != nil { ok := object.Key("ColdStorageOptions") if err := awsRestjson1_serializeDocumentColdStorageOptions(v.ColdStorageOptions, ok); err != nil { return err } } if v.DedicatedMasterCount != nil { ok := object.Key("DedicatedMasterCount") ok.Integer(*v.DedicatedMasterCount) } if v.DedicatedMasterEnabled != nil { ok := object.Key("DedicatedMasterEnabled") ok.Boolean(*v.DedicatedMasterEnabled) } if len(v.DedicatedMasterType) > 0 { ok := object.Key("DedicatedMasterType") ok.String(string(v.DedicatedMasterType)) } if v.InstanceCount != nil { ok := object.Key("InstanceCount") ok.Integer(*v.InstanceCount) } if len(v.InstanceType) > 0 { ok := object.Key("InstanceType") ok.String(string(v.InstanceType)) } if v.MultiAZWithStandbyEnabled != nil { ok := object.Key("MultiAZWithStandbyEnabled") ok.Boolean(*v.MultiAZWithStandbyEnabled) } if v.WarmCount != nil { ok := object.Key("WarmCount") ok.Integer(*v.WarmCount) } if v.WarmEnabled != nil { ok := object.Key("WarmEnabled") ok.Boolean(*v.WarmEnabled) } if len(v.WarmType) > 0 { ok := object.Key("WarmType") ok.String(string(v.WarmType)) } if v.ZoneAwarenessConfig != nil { ok := object.Key("ZoneAwarenessConfig") if err := awsRestjson1_serializeDocumentZoneAwarenessConfig(v.ZoneAwarenessConfig, ok); err != nil { return err } } if v.ZoneAwarenessEnabled != nil { ok := object.Key("ZoneAwarenessEnabled") ok.Boolean(*v.ZoneAwarenessEnabled) } return nil } func awsRestjson1_serializeDocumentCognitoOptions(v *types.CognitoOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Enabled != nil { ok := object.Key("Enabled") ok.Boolean(*v.Enabled) } if v.IdentityPoolId != nil { ok := object.Key("IdentityPoolId") ok.String(*v.IdentityPoolId) } if v.RoleArn != nil { ok := object.Key("RoleArn") ok.String(*v.RoleArn) } if v.UserPoolId != nil { ok := object.Key("UserPoolId") ok.String(*v.UserPoolId) } return nil } func awsRestjson1_serializeDocumentColdStorageOptions(v *types.ColdStorageOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Enabled != nil { ok := object.Key("Enabled") ok.Boolean(*v.Enabled) } return nil } func awsRestjson1_serializeDocumentConnectionProperties(v *types.ConnectionProperties, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CrossClusterSearch != nil { ok := object.Key("CrossClusterSearch") if err := awsRestjson1_serializeDocumentCrossClusterSearchConnectionProperties(v.CrossClusterSearch, ok); err != nil { return err } } if v.Endpoint != nil { ok := object.Key("Endpoint") ok.String(*v.Endpoint) } return nil } func awsRestjson1_serializeDocumentCrossClusterSearchConnectionProperties(v *types.CrossClusterSearchConnectionProperties, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.SkipUnavailable) > 0 { ok := object.Key("SkipUnavailable") ok.String(string(v.SkipUnavailable)) } return nil } func awsRestjson1_serializeDocumentDescribePackagesFilter(v *types.DescribePackagesFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Name) > 0 { ok := object.Key("Name") ok.String(string(v.Name)) } if v.Value != nil { ok := object.Key("Value") if err := awsRestjson1_serializeDocumentDescribePackagesFilterValues(v.Value, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentDescribePackagesFilterList(v []types.DescribePackagesFilter, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentDescribePackagesFilter(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentDescribePackagesFilterValues(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_serializeDocumentDomainEndpointOptions(v *types.DomainEndpointOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CustomEndpoint != nil { ok := object.Key("CustomEndpoint") ok.String(*v.CustomEndpoint) } if v.CustomEndpointCertificateArn != nil { ok := object.Key("CustomEndpointCertificateArn") ok.String(*v.CustomEndpointCertificateArn) } if v.CustomEndpointEnabled != nil { ok := object.Key("CustomEndpointEnabled") ok.Boolean(*v.CustomEndpointEnabled) } if v.EnforceHTTPS != nil { ok := object.Key("EnforceHTTPS") ok.Boolean(*v.EnforceHTTPS) } if len(v.TLSSecurityPolicy) > 0 { ok := object.Key("TLSSecurityPolicy") ok.String(string(v.TLSSecurityPolicy)) } return nil } func awsRestjson1_serializeDocumentDomainInformationContainer(v *types.DomainInformationContainer, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AWSDomainInformation != nil { ok := object.Key("AWSDomainInformation") if err := awsRestjson1_serializeDocumentAWSDomainInformation(v.AWSDomainInformation, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentDomainNameList(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_serializeDocumentDuration(v *types.Duration, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Unit) > 0 { ok := object.Key("Unit") ok.String(string(v.Unit)) } if v.Value != 0 { ok := object.Key("Value") ok.Long(v.Value) } return nil } func awsRestjson1_serializeDocumentEBSOptions(v *types.EBSOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.EBSEnabled != nil { ok := object.Key("EBSEnabled") ok.Boolean(*v.EBSEnabled) } if v.Iops != nil { ok := object.Key("Iops") ok.Integer(*v.Iops) } if v.Throughput != nil { ok := object.Key("Throughput") ok.Integer(*v.Throughput) } if v.VolumeSize != nil { ok := object.Key("VolumeSize") ok.Integer(*v.VolumeSize) } if len(v.VolumeType) > 0 { ok := object.Key("VolumeType") ok.String(string(v.VolumeType)) } return nil } func awsRestjson1_serializeDocumentEncryptionAtRestOptions(v *types.EncryptionAtRestOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Enabled != nil { ok := object.Key("Enabled") ok.Boolean(*v.Enabled) } if v.KmsKeyId != nil { ok := object.Key("KmsKeyId") ok.String(*v.KmsKeyId) } return nil } func awsRestjson1_serializeDocumentFilter(v *types.Filter, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.Values != nil { ok := object.Key("Values") if err := awsRestjson1_serializeDocumentValueStringList(v.Values, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentFilterList(v []types.Filter, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentFilter(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentLogPublishingOption(v *types.LogPublishingOption, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CloudWatchLogsLogGroupArn != nil { ok := object.Key("CloudWatchLogsLogGroupArn") ok.String(*v.CloudWatchLogsLogGroupArn) } if v.Enabled != nil { ok := object.Key("Enabled") ok.Boolean(*v.Enabled) } return nil } func awsRestjson1_serializeDocumentLogPublishingOptions(v map[string]types.LogPublishingOption, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) mapVar := v[key] if err := awsRestjson1_serializeDocumentLogPublishingOption(&mapVar, om); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentMasterUserOptions(v *types.MasterUserOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MasterUserARN != nil { ok := object.Key("MasterUserARN") ok.String(*v.MasterUserARN) } if v.MasterUserName != nil { ok := object.Key("MasterUserName") ok.String(*v.MasterUserName) } if v.MasterUserPassword != nil { ok := object.Key("MasterUserPassword") ok.String(*v.MasterUserPassword) } return nil } func awsRestjson1_serializeDocumentNodeToNodeEncryptionOptions(v *types.NodeToNodeEncryptionOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Enabled != nil { ok := object.Key("Enabled") ok.Boolean(*v.Enabled) } return nil } func awsRestjson1_serializeDocumentOffPeakWindow(v *types.OffPeakWindow, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.WindowStartTime != nil { ok := object.Key("WindowStartTime") if err := awsRestjson1_serializeDocumentWindowStartTime(v.WindowStartTime, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentOffPeakWindowOptions(v *types.OffPeakWindowOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Enabled != nil { ok := object.Key("Enabled") ok.Boolean(*v.Enabled) } if v.OffPeakWindow != nil { ok := object.Key("OffPeakWindow") if err := awsRestjson1_serializeDocumentOffPeakWindow(v.OffPeakWindow, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentPackageSource(v *types.PackageSource, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.S3BucketName != nil { ok := object.Key("S3BucketName") ok.String(*v.S3BucketName) } if v.S3Key != nil { ok := object.Key("S3Key") ok.String(*v.S3Key) } return nil } func awsRestjson1_serializeDocumentSAMLIdp(v *types.SAMLIdp, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.EntityId != nil { ok := object.Key("EntityId") ok.String(*v.EntityId) } if v.MetadataContent != nil { ok := object.Key("MetadataContent") ok.String(*v.MetadataContent) } return nil } func awsRestjson1_serializeDocumentSAMLOptionsInput(v *types.SAMLOptionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Enabled != nil { ok := object.Key("Enabled") ok.Boolean(*v.Enabled) } if v.Idp != nil { ok := object.Key("Idp") if err := awsRestjson1_serializeDocumentSAMLIdp(v.Idp, ok); err != nil { return err } } if v.MasterBackendRole != nil { ok := object.Key("MasterBackendRole") ok.String(*v.MasterBackendRole) } if v.MasterUserName != nil { ok := object.Key("MasterUserName") ok.String(*v.MasterUserName) } if v.RolesKey != nil { ok := object.Key("RolesKey") ok.String(*v.RolesKey) } if v.SessionTimeoutMinutes != nil { ok := object.Key("SessionTimeoutMinutes") ok.Integer(*v.SessionTimeoutMinutes) } if v.SubjectKey != nil { ok := object.Key("SubjectKey") ok.String(*v.SubjectKey) } return nil } func awsRestjson1_serializeDocumentSnapshotOptions(v *types.SnapshotOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AutomatedSnapshotStartHour != nil { ok := object.Key("AutomatedSnapshotStartHour") ok.Integer(*v.AutomatedSnapshotStartHour) } return nil } func awsRestjson1_serializeDocumentSoftwareUpdateOptions(v *types.SoftwareUpdateOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AutoSoftwareUpdateEnabled != nil { ok := object.Key("AutoSoftwareUpdateEnabled") ok.Boolean(*v.AutoSoftwareUpdateEnabled) } return nil } func awsRestjson1_serializeDocumentStringList(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_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Key != nil { ok := object.Key("Key") ok.String(*v.Key) } if v.Value != nil { ok := object.Key("Value") ok.String(*v.Value) } return nil } func awsRestjson1_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentTag(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentValueStringList(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_serializeDocumentVpcEndpointIdList(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_serializeDocumentVPCOptions(v *types.VPCOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SecurityGroupIds != nil { ok := object.Key("SecurityGroupIds") if err := awsRestjson1_serializeDocumentStringList(v.SecurityGroupIds, ok); err != nil { return err } } if v.SubnetIds != nil { ok := object.Key("SubnetIds") if err := awsRestjson1_serializeDocumentStringList(v.SubnetIds, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentWindowStartTime(v *types.WindowStartTime, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("Hours") ok.Long(v.Hours) } { ok := object.Key("Minutes") ok.Long(v.Minutes) } return nil } func awsRestjson1_serializeDocumentZoneAwarenessConfig(v *types.ZoneAwarenessConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AvailabilityZoneCount != nil { ok := object.Key("AvailabilityZoneCount") ok.Integer(*v.AvailabilityZoneCount) } return nil }
4,754
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearch import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/opensearch/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpAcceptInboundConnection struct { } func (*validateOpAcceptInboundConnection) ID() string { return "OperationInputValidation" } func (m *validateOpAcceptInboundConnection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AcceptInboundConnectionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAcceptInboundConnectionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpAddTags struct { } func (*validateOpAddTags) ID() string { return "OperationInputValidation" } func (m *validateOpAddTags) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AddTagsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAddTagsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpAssociatePackage struct { } func (*validateOpAssociatePackage) ID() string { return "OperationInputValidation" } func (m *validateOpAssociatePackage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AssociatePackageInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAssociatePackageInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpAuthorizeVpcEndpointAccess struct { } func (*validateOpAuthorizeVpcEndpointAccess) ID() string { return "OperationInputValidation" } func (m *validateOpAuthorizeVpcEndpointAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AuthorizeVpcEndpointAccessInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAuthorizeVpcEndpointAccessInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCancelServiceSoftwareUpdate struct { } func (*validateOpCancelServiceSoftwareUpdate) ID() string { return "OperationInputValidation" } func (m *validateOpCancelServiceSoftwareUpdate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CancelServiceSoftwareUpdateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCancelServiceSoftwareUpdateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateDomain struct { } func (*validateOpCreateDomain) ID() string { return "OperationInputValidation" } func (m *validateOpCreateDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateDomainInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateDomainInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateOutboundConnection struct { } func (*validateOpCreateOutboundConnection) ID() string { return "OperationInputValidation" } func (m *validateOpCreateOutboundConnection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateOutboundConnectionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateOutboundConnectionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreatePackage struct { } func (*validateOpCreatePackage) ID() string { return "OperationInputValidation" } func (m *validateOpCreatePackage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreatePackageInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreatePackageInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateVpcEndpoint struct { } func (*validateOpCreateVpcEndpoint) ID() string { return "OperationInputValidation" } func (m *validateOpCreateVpcEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateVpcEndpointInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateVpcEndpointInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteDomain struct { } func (*validateOpDeleteDomain) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteDomainInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteDomainInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteInboundConnection struct { } func (*validateOpDeleteInboundConnection) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteInboundConnection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteInboundConnectionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteInboundConnectionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteOutboundConnection struct { } func (*validateOpDeleteOutboundConnection) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteOutboundConnection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteOutboundConnectionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteOutboundConnectionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeletePackage struct { } func (*validateOpDeletePackage) ID() string { return "OperationInputValidation" } func (m *validateOpDeletePackage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeletePackageInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeletePackageInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteVpcEndpoint struct { } func (*validateOpDeleteVpcEndpoint) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteVpcEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteVpcEndpointInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteVpcEndpointInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeDomainAutoTunes struct { } func (*validateOpDescribeDomainAutoTunes) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeDomainAutoTunes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeDomainAutoTunesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeDomainAutoTunesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeDomainChangeProgress struct { } func (*validateOpDescribeDomainChangeProgress) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeDomainChangeProgress) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeDomainChangeProgressInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeDomainChangeProgressInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeDomainConfig struct { } func (*validateOpDescribeDomainConfig) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeDomainConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeDomainConfigInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeDomainConfigInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeDomainHealth struct { } func (*validateOpDescribeDomainHealth) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeDomainHealth) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeDomainHealthInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeDomainHealthInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeDomain struct { } func (*validateOpDescribeDomain) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeDomainInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeDomainInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeDomainNodes struct { } func (*validateOpDescribeDomainNodes) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeDomainNodes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeDomainNodesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeDomainNodesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeDomains struct { } func (*validateOpDescribeDomains) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeDomains) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeDomainsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeDomainsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeDryRunProgress struct { } func (*validateOpDescribeDryRunProgress) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeDryRunProgress) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeDryRunProgressInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeDryRunProgressInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeInstanceTypeLimits struct { } func (*validateOpDescribeInstanceTypeLimits) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeInstanceTypeLimits) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeInstanceTypeLimitsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeInstanceTypeLimitsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeVpcEndpoints struct { } func (*validateOpDescribeVpcEndpoints) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeVpcEndpoints) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeVpcEndpointsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeVpcEndpointsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDissociatePackage struct { } func (*validateOpDissociatePackage) ID() string { return "OperationInputValidation" } func (m *validateOpDissociatePackage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DissociatePackageInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDissociatePackageInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetPackageVersionHistory struct { } func (*validateOpGetPackageVersionHistory) ID() string { return "OperationInputValidation" } func (m *validateOpGetPackageVersionHistory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetPackageVersionHistoryInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetPackageVersionHistoryInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetUpgradeHistory struct { } func (*validateOpGetUpgradeHistory) ID() string { return "OperationInputValidation" } func (m *validateOpGetUpgradeHistory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetUpgradeHistoryInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetUpgradeHistoryInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetUpgradeStatus struct { } func (*validateOpGetUpgradeStatus) ID() string { return "OperationInputValidation" } func (m *validateOpGetUpgradeStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetUpgradeStatusInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetUpgradeStatusInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListDomainsForPackage struct { } func (*validateOpListDomainsForPackage) ID() string { return "OperationInputValidation" } func (m *validateOpListDomainsForPackage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListDomainsForPackageInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListDomainsForPackageInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListInstanceTypeDetails struct { } func (*validateOpListInstanceTypeDetails) ID() string { return "OperationInputValidation" } func (m *validateOpListInstanceTypeDetails) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListInstanceTypeDetailsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListInstanceTypeDetailsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListPackagesForDomain struct { } func (*validateOpListPackagesForDomain) ID() string { return "OperationInputValidation" } func (m *validateOpListPackagesForDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListPackagesForDomainInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListPackagesForDomainInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListScheduledActions struct { } func (*validateOpListScheduledActions) ID() string { return "OperationInputValidation" } func (m *validateOpListScheduledActions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListScheduledActionsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListScheduledActionsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListTags struct { } func (*validateOpListTags) ID() string { return "OperationInputValidation" } func (m *validateOpListTags) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListTagsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListTagsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListVpcEndpointAccess struct { } func (*validateOpListVpcEndpointAccess) ID() string { return "OperationInputValidation" } func (m *validateOpListVpcEndpointAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListVpcEndpointAccessInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListVpcEndpointAccessInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListVpcEndpointsForDomain struct { } func (*validateOpListVpcEndpointsForDomain) ID() string { return "OperationInputValidation" } func (m *validateOpListVpcEndpointsForDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListVpcEndpointsForDomainInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListVpcEndpointsForDomainInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpPurchaseReservedInstanceOffering struct { } func (*validateOpPurchaseReservedInstanceOffering) ID() string { return "OperationInputValidation" } func (m *validateOpPurchaseReservedInstanceOffering) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PurchaseReservedInstanceOfferingInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPurchaseReservedInstanceOfferingInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRejectInboundConnection struct { } func (*validateOpRejectInboundConnection) ID() string { return "OperationInputValidation" } func (m *validateOpRejectInboundConnection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RejectInboundConnectionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRejectInboundConnectionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRemoveTags struct { } func (*validateOpRemoveTags) ID() string { return "OperationInputValidation" } func (m *validateOpRemoveTags) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RemoveTagsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRemoveTagsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRevokeVpcEndpointAccess struct { } func (*validateOpRevokeVpcEndpointAccess) ID() string { return "OperationInputValidation" } func (m *validateOpRevokeVpcEndpointAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RevokeVpcEndpointAccessInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRevokeVpcEndpointAccessInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartServiceSoftwareUpdate struct { } func (*validateOpStartServiceSoftwareUpdate) ID() string { return "OperationInputValidation" } func (m *validateOpStartServiceSoftwareUpdate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartServiceSoftwareUpdateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartServiceSoftwareUpdateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateDomainConfig struct { } func (*validateOpUpdateDomainConfig) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateDomainConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateDomainConfigInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateDomainConfigInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdatePackage struct { } func (*validateOpUpdatePackage) ID() string { return "OperationInputValidation" } func (m *validateOpUpdatePackage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdatePackageInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdatePackageInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateScheduledAction struct { } func (*validateOpUpdateScheduledAction) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateScheduledAction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateScheduledActionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateScheduledActionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateVpcEndpoint struct { } func (*validateOpUpdateVpcEndpoint) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateVpcEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateVpcEndpointInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateVpcEndpointInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpgradeDomain struct { } func (*validateOpUpgradeDomain) ID() string { return "OperationInputValidation" } func (m *validateOpUpgradeDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpgradeDomainInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpgradeDomainInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpAcceptInboundConnectionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAcceptInboundConnection{}, middleware.After) } func addOpAddTagsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAddTags{}, middleware.After) } func addOpAssociatePackageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociatePackage{}, middleware.After) } func addOpAuthorizeVpcEndpointAccessValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAuthorizeVpcEndpointAccess{}, middleware.After) } func addOpCancelServiceSoftwareUpdateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCancelServiceSoftwareUpdate{}, middleware.After) } func addOpCreateDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateDomain{}, middleware.After) } func addOpCreateOutboundConnectionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateOutboundConnection{}, middleware.After) } func addOpCreatePackageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreatePackage{}, middleware.After) } func addOpCreateVpcEndpointValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateVpcEndpoint{}, middleware.After) } func addOpDeleteDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteDomain{}, middleware.After) } func addOpDeleteInboundConnectionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteInboundConnection{}, middleware.After) } func addOpDeleteOutboundConnectionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteOutboundConnection{}, middleware.After) } func addOpDeletePackageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeletePackage{}, middleware.After) } func addOpDeleteVpcEndpointValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteVpcEndpoint{}, middleware.After) } func addOpDescribeDomainAutoTunesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeDomainAutoTunes{}, middleware.After) } func addOpDescribeDomainChangeProgressValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeDomainChangeProgress{}, middleware.After) } func addOpDescribeDomainConfigValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeDomainConfig{}, middleware.After) } func addOpDescribeDomainHealthValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeDomainHealth{}, middleware.After) } func addOpDescribeDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeDomain{}, middleware.After) } func addOpDescribeDomainNodesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeDomainNodes{}, middleware.After) } func addOpDescribeDomainsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeDomains{}, middleware.After) } func addOpDescribeDryRunProgressValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeDryRunProgress{}, middleware.After) } func addOpDescribeInstanceTypeLimitsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeInstanceTypeLimits{}, middleware.After) } func addOpDescribeVpcEndpointsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeVpcEndpoints{}, middleware.After) } func addOpDissociatePackageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDissociatePackage{}, middleware.After) } func addOpGetPackageVersionHistoryValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetPackageVersionHistory{}, middleware.After) } func addOpGetUpgradeHistoryValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetUpgradeHistory{}, middleware.After) } func addOpGetUpgradeStatusValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetUpgradeStatus{}, middleware.After) } func addOpListDomainsForPackageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListDomainsForPackage{}, middleware.After) } func addOpListInstanceTypeDetailsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListInstanceTypeDetails{}, middleware.After) } func addOpListPackagesForDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListPackagesForDomain{}, middleware.After) } func addOpListScheduledActionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListScheduledActions{}, middleware.After) } func addOpListTagsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTags{}, middleware.After) } func addOpListVpcEndpointAccessValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListVpcEndpointAccess{}, middleware.After) } func addOpListVpcEndpointsForDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListVpcEndpointsForDomain{}, middleware.After) } func addOpPurchaseReservedInstanceOfferingValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPurchaseReservedInstanceOffering{}, middleware.After) } func addOpRejectInboundConnectionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRejectInboundConnection{}, middleware.After) } func addOpRemoveTagsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRemoveTags{}, middleware.After) } func addOpRevokeVpcEndpointAccessValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRevokeVpcEndpointAccess{}, middleware.After) } func addOpStartServiceSoftwareUpdateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartServiceSoftwareUpdate{}, middleware.After) } func addOpUpdateDomainConfigValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateDomainConfig{}, middleware.After) } func addOpUpdatePackageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdatePackage{}, middleware.After) } func addOpUpdateScheduledActionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateScheduledAction{}, middleware.After) } func addOpUpdateVpcEndpointValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateVpcEndpoint{}, middleware.After) } func addOpUpgradeDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpgradeDomain{}, middleware.After) } func validateAdvancedSecurityOptionsInput(v *types.AdvancedSecurityOptionsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AdvancedSecurityOptionsInput"} if v.SAMLOptions != nil { if err := validateSAMLOptionsInput(v.SAMLOptions); err != nil { invalidParams.AddNested("SAMLOptions", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateAWSDomainInformation(v *types.AWSDomainInformation) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AWSDomainInformation"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateClusterConfig(v *types.ClusterConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ClusterConfig"} if v.ColdStorageOptions != nil { if err := validateColdStorageOptions(v.ColdStorageOptions); err != nil { invalidParams.AddNested("ColdStorageOptions", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateColdStorageOptions(v *types.ColdStorageOptions) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ColdStorageOptions"} if v.Enabled == nil { invalidParams.Add(smithy.NewErrParamRequired("Enabled")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDomainInformationContainer(v *types.DomainInformationContainer) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DomainInformationContainer"} if v.AWSDomainInformation != nil { if err := validateAWSDomainInformation(v.AWSDomainInformation); err != nil { invalidParams.AddNested("AWSDomainInformation", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOffPeakWindow(v *types.OffPeakWindow) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "OffPeakWindow"} if v.WindowStartTime != nil { if err := validateWindowStartTime(v.WindowStartTime); err != nil { invalidParams.AddNested("WindowStartTime", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOffPeakWindowOptions(v *types.OffPeakWindowOptions) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "OffPeakWindowOptions"} if v.OffPeakWindow != nil { if err := validateOffPeakWindow(v.OffPeakWindow); err != nil { invalidParams.AddNested("OffPeakWindow", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateSAMLIdp(v *types.SAMLIdp) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SAMLIdp"} if v.MetadataContent == nil { invalidParams.Add(smithy.NewErrParamRequired("MetadataContent")) } if v.EntityId == nil { invalidParams.Add(smithy.NewErrParamRequired("EntityId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateSAMLOptionsInput(v *types.SAMLOptionsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SAMLOptionsInput"} if v.Idp != nil { if err := validateSAMLIdp(v.Idp); err != nil { invalidParams.AddNested("Idp", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTag(v *types.Tag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Tag"} if v.Key == nil { invalidParams.Add(smithy.NewErrParamRequired("Key")) } if v.Value == nil { invalidParams.Add(smithy.NewErrParamRequired("Value")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTagList(v []types.Tag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagList"} for i := range v { if err := validateTag(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateWindowStartTime(v *types.WindowStartTime) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "WindowStartTime"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAcceptInboundConnectionInput(v *AcceptInboundConnectionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AcceptInboundConnectionInput"} if v.ConnectionId == nil { invalidParams.Add(smithy.NewErrParamRequired("ConnectionId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAddTagsInput(v *AddTagsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AddTagsInput"} if v.ARN == nil { invalidParams.Add(smithy.NewErrParamRequired("ARN")) } if v.TagList == nil { invalidParams.Add(smithy.NewErrParamRequired("TagList")) } else if v.TagList != nil { if err := validateTagList(v.TagList); err != nil { invalidParams.AddNested("TagList", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAssociatePackageInput(v *AssociatePackageInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AssociatePackageInput"} if v.PackageID == nil { invalidParams.Add(smithy.NewErrParamRequired("PackageID")) } if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAuthorizeVpcEndpointAccessInput(v *AuthorizeVpcEndpointAccessInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AuthorizeVpcEndpointAccessInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if v.Account == nil { invalidParams.Add(smithy.NewErrParamRequired("Account")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCancelServiceSoftwareUpdateInput(v *CancelServiceSoftwareUpdateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CancelServiceSoftwareUpdateInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateDomainInput(v *CreateDomainInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateDomainInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if v.ClusterConfig != nil { if err := validateClusterConfig(v.ClusterConfig); err != nil { invalidParams.AddNested("ClusterConfig", err.(smithy.InvalidParamsError)) } } if v.AdvancedSecurityOptions != nil { if err := validateAdvancedSecurityOptionsInput(v.AdvancedSecurityOptions); err != nil { invalidParams.AddNested("AdvancedSecurityOptions", err.(smithy.InvalidParamsError)) } } if v.TagList != nil { if err := validateTagList(v.TagList); err != nil { invalidParams.AddNested("TagList", err.(smithy.InvalidParamsError)) } } if v.OffPeakWindowOptions != nil { if err := validateOffPeakWindowOptions(v.OffPeakWindowOptions); err != nil { invalidParams.AddNested("OffPeakWindowOptions", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateOutboundConnectionInput(v *CreateOutboundConnectionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateOutboundConnectionInput"} if v.LocalDomainInfo == nil { invalidParams.Add(smithy.NewErrParamRequired("LocalDomainInfo")) } else if v.LocalDomainInfo != nil { if err := validateDomainInformationContainer(v.LocalDomainInfo); err != nil { invalidParams.AddNested("LocalDomainInfo", err.(smithy.InvalidParamsError)) } } if v.RemoteDomainInfo == nil { invalidParams.Add(smithy.NewErrParamRequired("RemoteDomainInfo")) } else if v.RemoteDomainInfo != nil { if err := validateDomainInformationContainer(v.RemoteDomainInfo); err != nil { invalidParams.AddNested("RemoteDomainInfo", err.(smithy.InvalidParamsError)) } } if v.ConnectionAlias == nil { invalidParams.Add(smithy.NewErrParamRequired("ConnectionAlias")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreatePackageInput(v *CreatePackageInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreatePackageInput"} if v.PackageName == nil { invalidParams.Add(smithy.NewErrParamRequired("PackageName")) } if len(v.PackageType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("PackageType")) } if v.PackageSource == nil { invalidParams.Add(smithy.NewErrParamRequired("PackageSource")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateVpcEndpointInput(v *CreateVpcEndpointInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateVpcEndpointInput"} if v.DomainArn == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainArn")) } if v.VpcOptions == nil { invalidParams.Add(smithy.NewErrParamRequired("VpcOptions")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteDomainInput(v *DeleteDomainInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteDomainInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteInboundConnectionInput(v *DeleteInboundConnectionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteInboundConnectionInput"} if v.ConnectionId == nil { invalidParams.Add(smithy.NewErrParamRequired("ConnectionId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteOutboundConnectionInput(v *DeleteOutboundConnectionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteOutboundConnectionInput"} if v.ConnectionId == nil { invalidParams.Add(smithy.NewErrParamRequired("ConnectionId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeletePackageInput(v *DeletePackageInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeletePackageInput"} if v.PackageID == nil { invalidParams.Add(smithy.NewErrParamRequired("PackageID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteVpcEndpointInput(v *DeleteVpcEndpointInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteVpcEndpointInput"} if v.VpcEndpointId == nil { invalidParams.Add(smithy.NewErrParamRequired("VpcEndpointId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeDomainAutoTunesInput(v *DescribeDomainAutoTunesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeDomainAutoTunesInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeDomainChangeProgressInput(v *DescribeDomainChangeProgressInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeDomainChangeProgressInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeDomainConfigInput(v *DescribeDomainConfigInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeDomainConfigInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeDomainHealthInput(v *DescribeDomainHealthInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeDomainHealthInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeDomainInput(v *DescribeDomainInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeDomainInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeDomainNodesInput(v *DescribeDomainNodesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeDomainNodesInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeDomainsInput(v *DescribeDomainsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeDomainsInput"} if v.DomainNames == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainNames")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeDryRunProgressInput(v *DescribeDryRunProgressInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeDryRunProgressInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeInstanceTypeLimitsInput(v *DescribeInstanceTypeLimitsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeInstanceTypeLimitsInput"} if len(v.InstanceType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("InstanceType")) } if v.EngineVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("EngineVersion")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeVpcEndpointsInput(v *DescribeVpcEndpointsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeVpcEndpointsInput"} if v.VpcEndpointIds == nil { invalidParams.Add(smithy.NewErrParamRequired("VpcEndpointIds")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDissociatePackageInput(v *DissociatePackageInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DissociatePackageInput"} if v.PackageID == nil { invalidParams.Add(smithy.NewErrParamRequired("PackageID")) } if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetPackageVersionHistoryInput(v *GetPackageVersionHistoryInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetPackageVersionHistoryInput"} if v.PackageID == nil { invalidParams.Add(smithy.NewErrParamRequired("PackageID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetUpgradeHistoryInput(v *GetUpgradeHistoryInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetUpgradeHistoryInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetUpgradeStatusInput(v *GetUpgradeStatusInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetUpgradeStatusInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListDomainsForPackageInput(v *ListDomainsForPackageInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListDomainsForPackageInput"} if v.PackageID == nil { invalidParams.Add(smithy.NewErrParamRequired("PackageID")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListInstanceTypeDetailsInput(v *ListInstanceTypeDetailsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListInstanceTypeDetailsInput"} if v.EngineVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("EngineVersion")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListPackagesForDomainInput(v *ListPackagesForDomainInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListPackagesForDomainInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListScheduledActionsInput(v *ListScheduledActionsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListScheduledActionsInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListTagsInput(v *ListTagsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListTagsInput"} if v.ARN == nil { invalidParams.Add(smithy.NewErrParamRequired("ARN")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListVpcEndpointAccessInput(v *ListVpcEndpointAccessInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListVpcEndpointAccessInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListVpcEndpointsForDomainInput(v *ListVpcEndpointsForDomainInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListVpcEndpointsForDomainInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpPurchaseReservedInstanceOfferingInput(v *PurchaseReservedInstanceOfferingInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PurchaseReservedInstanceOfferingInput"} if v.ReservedInstanceOfferingId == nil { invalidParams.Add(smithy.NewErrParamRequired("ReservedInstanceOfferingId")) } if v.ReservationName == nil { invalidParams.Add(smithy.NewErrParamRequired("ReservationName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRejectInboundConnectionInput(v *RejectInboundConnectionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RejectInboundConnectionInput"} if v.ConnectionId == nil { invalidParams.Add(smithy.NewErrParamRequired("ConnectionId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRemoveTagsInput(v *RemoveTagsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RemoveTagsInput"} if v.ARN == nil { invalidParams.Add(smithy.NewErrParamRequired("ARN")) } if v.TagKeys == nil { invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRevokeVpcEndpointAccessInput(v *RevokeVpcEndpointAccessInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RevokeVpcEndpointAccessInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if v.Account == nil { invalidParams.Add(smithy.NewErrParamRequired("Account")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartServiceSoftwareUpdateInput(v *StartServiceSoftwareUpdateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartServiceSoftwareUpdateInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateDomainConfigInput(v *UpdateDomainConfigInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateDomainConfigInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if v.ClusterConfig != nil { if err := validateClusterConfig(v.ClusterConfig); err != nil { invalidParams.AddNested("ClusterConfig", err.(smithy.InvalidParamsError)) } } if v.AdvancedSecurityOptions != nil { if err := validateAdvancedSecurityOptionsInput(v.AdvancedSecurityOptions); err != nil { invalidParams.AddNested("AdvancedSecurityOptions", err.(smithy.InvalidParamsError)) } } if v.OffPeakWindowOptions != nil { if err := validateOffPeakWindowOptions(v.OffPeakWindowOptions); err != nil { invalidParams.AddNested("OffPeakWindowOptions", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdatePackageInput(v *UpdatePackageInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdatePackageInput"} if v.PackageID == nil { invalidParams.Add(smithy.NewErrParamRequired("PackageID")) } if v.PackageSource == nil { invalidParams.Add(smithy.NewErrParamRequired("PackageSource")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateScheduledActionInput(v *UpdateScheduledActionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateScheduledActionInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if v.ActionID == nil { invalidParams.Add(smithy.NewErrParamRequired("ActionID")) } if len(v.ActionType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("ActionType")) } if len(v.ScheduleAt) == 0 { invalidParams.Add(smithy.NewErrParamRequired("ScheduleAt")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateVpcEndpointInput(v *UpdateVpcEndpointInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateVpcEndpointInput"} if v.VpcEndpointId == nil { invalidParams.Add(smithy.NewErrParamRequired("VpcEndpointId")) } if v.VpcOptions == nil { invalidParams.Add(smithy.NewErrParamRequired("VpcOptions")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpgradeDomainInput(v *UpgradeDomainInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpgradeDomainInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if v.TargetVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("TargetVersion")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
2,068
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 OpenSearch 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: "es.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "es-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "es-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "es.{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", }: endpoints.Endpoint{ Hostname: "es-fips.us-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-1", }, 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: "es-fips.us-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-east-1-fips", }: endpoints.Endpoint{ Hostname: "es-fips.us-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", Variant: endpoints.FIPSVariant, }: { Hostname: "es-fips.us-east-2.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-east-2-fips", }: endpoints.Endpoint{ Hostname: "es-fips.us-east-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-2", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "es-fips.us-west-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-1-fips", }: endpoints.Endpoint{ Hostname: "es-fips.us-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", Variant: endpoints.FIPSVariant, }: { Hostname: "es-fips.us-west-2.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-2-fips", }: endpoints.Endpoint{ Hostname: "es-fips.us-west-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-2", }, Deprecated: aws.TrueTernary, }, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "es.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "es-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "es-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "es.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "cn-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "cn-northwest-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-iso", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "es-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "es.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "us-iso-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-iso-west-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-iso-b", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "es-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "es.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "us-isob-east-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-iso-e", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "es-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "es.{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: "es-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "es.{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: "es.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "es-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "es-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "es.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "fips", }: endpoints.Endpoint{ Hostname: "es-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: "es-fips.us-gov-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-gov-east-1-fips", }: endpoints.Endpoint{ Hostname: "es-fips.us-gov-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-east-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-gov-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "es-fips.us-gov-west-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-gov-west-1-fips", }: endpoints.Endpoint{ Hostname: "es-fips.us-gov-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-west-1", }, Deprecated: aws.TrueTernary, }, }, }, }
517
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 ActionSeverity string // Enum values for ActionSeverity const ( ActionSeverityHigh ActionSeverity = "HIGH" ActionSeverityMedium ActionSeverity = "MEDIUM" ActionSeverityLow ActionSeverity = "LOW" ) // Values returns all known values for ActionSeverity. 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 (ActionSeverity) Values() []ActionSeverity { return []ActionSeverity{ "HIGH", "MEDIUM", "LOW", } } type ActionStatus string // Enum values for ActionStatus const ( ActionStatusPendingUpdate ActionStatus = "PENDING_UPDATE" ActionStatusInProgress ActionStatus = "IN_PROGRESS" ActionStatusFailed ActionStatus = "FAILED" ActionStatusCompleted ActionStatus = "COMPLETED" ActionStatusNotEligible ActionStatus = "NOT_ELIGIBLE" ActionStatusEligible ActionStatus = "ELIGIBLE" ) // Values returns all known values for ActionStatus. 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 (ActionStatus) Values() []ActionStatus { return []ActionStatus{ "PENDING_UPDATE", "IN_PROGRESS", "FAILED", "COMPLETED", "NOT_ELIGIBLE", "ELIGIBLE", } } type ActionType string // Enum values for ActionType const ( ActionTypeServiceSoftwareUpdate ActionType = "SERVICE_SOFTWARE_UPDATE" ActionTypeJvmHeapSizeTuning ActionType = "JVM_HEAP_SIZE_TUNING" ActionTypeJvmYoungGenTuning ActionType = "JVM_YOUNG_GEN_TUNING" ) // Values returns all known values for ActionType. 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 (ActionType) Values() []ActionType { return []ActionType{ "SERVICE_SOFTWARE_UPDATE", "JVM_HEAP_SIZE_TUNING", "JVM_YOUNG_GEN_TUNING", } } type AutoTuneDesiredState string // Enum values for AutoTuneDesiredState const ( AutoTuneDesiredStateEnabled AutoTuneDesiredState = "ENABLED" AutoTuneDesiredStateDisabled AutoTuneDesiredState = "DISABLED" ) // Values returns all known values for AutoTuneDesiredState. 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 (AutoTuneDesiredState) Values() []AutoTuneDesiredState { return []AutoTuneDesiredState{ "ENABLED", "DISABLED", } } type AutoTuneState string // Enum values for AutoTuneState const ( AutoTuneStateEnabled AutoTuneState = "ENABLED" AutoTuneStateDisabled AutoTuneState = "DISABLED" AutoTuneStateEnableInProgress AutoTuneState = "ENABLE_IN_PROGRESS" AutoTuneStateDisableInProgress AutoTuneState = "DISABLE_IN_PROGRESS" AutoTuneStateDisabledAndRollbackScheduled AutoTuneState = "DISABLED_AND_ROLLBACK_SCHEDULED" AutoTuneStateDisabledAndRollbackInProgress AutoTuneState = "DISABLED_AND_ROLLBACK_IN_PROGRESS" AutoTuneStateDisabledAndRollbackComplete AutoTuneState = "DISABLED_AND_ROLLBACK_COMPLETE" AutoTuneStateDisabledAndRollbackError AutoTuneState = "DISABLED_AND_ROLLBACK_ERROR" AutoTuneStateError AutoTuneState = "ERROR" ) // Values returns all known values for AutoTuneState. 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 (AutoTuneState) Values() []AutoTuneState { return []AutoTuneState{ "ENABLED", "DISABLED", "ENABLE_IN_PROGRESS", "DISABLE_IN_PROGRESS", "DISABLED_AND_ROLLBACK_SCHEDULED", "DISABLED_AND_ROLLBACK_IN_PROGRESS", "DISABLED_AND_ROLLBACK_COMPLETE", "DISABLED_AND_ROLLBACK_ERROR", "ERROR", } } type AutoTuneType string // Enum values for AutoTuneType const ( AutoTuneTypeScheduledAction AutoTuneType = "SCHEDULED_ACTION" ) // Values returns all known values for AutoTuneType. 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 (AutoTuneType) Values() []AutoTuneType { return []AutoTuneType{ "SCHEDULED_ACTION", } } type ConnectionMode string // Enum values for ConnectionMode const ( ConnectionModeDirect ConnectionMode = "DIRECT" ConnectionModeVpcEndpoint ConnectionMode = "VPC_ENDPOINT" ) // Values returns all known values for ConnectionMode. 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 (ConnectionMode) Values() []ConnectionMode { return []ConnectionMode{ "DIRECT", "VPC_ENDPOINT", } } type DeploymentStatus string // Enum values for DeploymentStatus const ( DeploymentStatusPendingUpdate DeploymentStatus = "PENDING_UPDATE" DeploymentStatusInProgress DeploymentStatus = "IN_PROGRESS" DeploymentStatusCompleted DeploymentStatus = "COMPLETED" DeploymentStatusNotEligible DeploymentStatus = "NOT_ELIGIBLE" DeploymentStatusEligible DeploymentStatus = "ELIGIBLE" ) // Values returns all known values for DeploymentStatus. 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 (DeploymentStatus) Values() []DeploymentStatus { return []DeploymentStatus{ "PENDING_UPDATE", "IN_PROGRESS", "COMPLETED", "NOT_ELIGIBLE", "ELIGIBLE", } } type DescribePackagesFilterName string // Enum values for DescribePackagesFilterName const ( DescribePackagesFilterNamePackageID DescribePackagesFilterName = "PackageID" DescribePackagesFilterNamePackageName DescribePackagesFilterName = "PackageName" DescribePackagesFilterNamePackageStatus DescribePackagesFilterName = "PackageStatus" ) // Values returns all known values for DescribePackagesFilterName. 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 (DescribePackagesFilterName) Values() []DescribePackagesFilterName { return []DescribePackagesFilterName{ "PackageID", "PackageName", "PackageStatus", } } type DomainHealth string // Enum values for DomainHealth const ( DomainHealthRed DomainHealth = "Red" DomainHealthYellow DomainHealth = "Yellow" DomainHealthGreen DomainHealth = "Green" DomainHealthNotAvailable DomainHealth = "NotAvailable" ) // Values returns all known values for DomainHealth. 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 (DomainHealth) Values() []DomainHealth { return []DomainHealth{ "Red", "Yellow", "Green", "NotAvailable", } } type DomainPackageStatus string // Enum values for DomainPackageStatus const ( DomainPackageStatusAssociating DomainPackageStatus = "ASSOCIATING" DomainPackageStatusAssociationFailed DomainPackageStatus = "ASSOCIATION_FAILED" DomainPackageStatusActive DomainPackageStatus = "ACTIVE" DomainPackageStatusDissociating DomainPackageStatus = "DISSOCIATING" DomainPackageStatusDissociationFailed DomainPackageStatus = "DISSOCIATION_FAILED" ) // Values returns all known values for DomainPackageStatus. 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 (DomainPackageStatus) Values() []DomainPackageStatus { return []DomainPackageStatus{ "ASSOCIATING", "ASSOCIATION_FAILED", "ACTIVE", "DISSOCIATING", "DISSOCIATION_FAILED", } } type DomainState string // Enum values for DomainState const ( DomainStateActive DomainState = "Active" DomainStateProcessing DomainState = "Processing" DomainStateNotAvailable DomainState = "NotAvailable" ) // Values returns all known values for DomainState. 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 (DomainState) Values() []DomainState { return []DomainState{ "Active", "Processing", "NotAvailable", } } type DryRunMode string // Enum values for DryRunMode const ( DryRunModeBasic DryRunMode = "Basic" DryRunModeVerbose DryRunMode = "Verbose" ) // Values returns all known values for DryRunMode. 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 (DryRunMode) Values() []DryRunMode { return []DryRunMode{ "Basic", "Verbose", } } type EngineType string // Enum values for EngineType const ( EngineTypeOpenSearch EngineType = "OpenSearch" EngineTypeElasticsearch EngineType = "Elasticsearch" ) // Values returns all known values for EngineType. 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 (EngineType) Values() []EngineType { return []EngineType{ "OpenSearch", "Elasticsearch", } } type InboundConnectionStatusCode string // Enum values for InboundConnectionStatusCode const ( InboundConnectionStatusCodePendingAcceptance InboundConnectionStatusCode = "PENDING_ACCEPTANCE" InboundConnectionStatusCodeApproved InboundConnectionStatusCode = "APPROVED" InboundConnectionStatusCodeProvisioning InboundConnectionStatusCode = "PROVISIONING" InboundConnectionStatusCodeActive InboundConnectionStatusCode = "ACTIVE" InboundConnectionStatusCodeRejecting InboundConnectionStatusCode = "REJECTING" InboundConnectionStatusCodeRejected InboundConnectionStatusCode = "REJECTED" InboundConnectionStatusCodeDeleting InboundConnectionStatusCode = "DELETING" InboundConnectionStatusCodeDeleted InboundConnectionStatusCode = "DELETED" ) // Values returns all known values for InboundConnectionStatusCode. 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 (InboundConnectionStatusCode) Values() []InboundConnectionStatusCode { return []InboundConnectionStatusCode{ "PENDING_ACCEPTANCE", "APPROVED", "PROVISIONING", "ACTIVE", "REJECTING", "REJECTED", "DELETING", "DELETED", } } type LogType string // Enum values for LogType const ( LogTypeIndexSlowLogs LogType = "INDEX_SLOW_LOGS" LogTypeSearchSlowLogs LogType = "SEARCH_SLOW_LOGS" LogTypeEsApplicationLogs LogType = "ES_APPLICATION_LOGS" LogTypeAuditLogs LogType = "AUDIT_LOGS" ) // Values returns all known values for LogType. 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 (LogType) Values() []LogType { return []LogType{ "INDEX_SLOW_LOGS", "SEARCH_SLOW_LOGS", "ES_APPLICATION_LOGS", "AUDIT_LOGS", } } type MasterNodeStatus string // Enum values for MasterNodeStatus const ( MasterNodeStatusAvailable MasterNodeStatus = "Available" MasterNodeStatusUnAvailable MasterNodeStatus = "UnAvailable" ) // Values returns all known values for MasterNodeStatus. 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 (MasterNodeStatus) Values() []MasterNodeStatus { return []MasterNodeStatus{ "Available", "UnAvailable", } } type NodeStatus string // Enum values for NodeStatus const ( NodeStatusActive NodeStatus = "Active" NodeStatusStandBy NodeStatus = "StandBy" NodeStatusNotAvailable NodeStatus = "NotAvailable" ) // Values returns all known values for NodeStatus. 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 (NodeStatus) Values() []NodeStatus { return []NodeStatus{ "Active", "StandBy", "NotAvailable", } } type NodeType string // Enum values for NodeType const ( NodeTypeData NodeType = "Data" NodeTypeUltrawarm NodeType = "Ultrawarm" NodeTypeMaster NodeType = "Master" ) // Values returns all known values for NodeType. 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 (NodeType) Values() []NodeType { return []NodeType{ "Data", "Ultrawarm", "Master", } } type OpenSearchPartitionInstanceType string // Enum values for OpenSearchPartitionInstanceType const ( OpenSearchPartitionInstanceTypeM3MediumSearch OpenSearchPartitionInstanceType = "m3.medium.search" OpenSearchPartitionInstanceTypeM3LargeSearch OpenSearchPartitionInstanceType = "m3.large.search" OpenSearchPartitionInstanceTypeM3XlargeSearch OpenSearchPartitionInstanceType = "m3.xlarge.search" OpenSearchPartitionInstanceTypeM32xlargeSearch OpenSearchPartitionInstanceType = "m3.2xlarge.search" OpenSearchPartitionInstanceTypeM4LargeSearch OpenSearchPartitionInstanceType = "m4.large.search" OpenSearchPartitionInstanceTypeM4XlargeSearch OpenSearchPartitionInstanceType = "m4.xlarge.search" OpenSearchPartitionInstanceTypeM42xlargeSearch OpenSearchPartitionInstanceType = "m4.2xlarge.search" OpenSearchPartitionInstanceTypeM44xlargeSearch OpenSearchPartitionInstanceType = "m4.4xlarge.search" OpenSearchPartitionInstanceTypeM410xlargeSearch OpenSearchPartitionInstanceType = "m4.10xlarge.search" OpenSearchPartitionInstanceTypeM5LargeSearch OpenSearchPartitionInstanceType = "m5.large.search" OpenSearchPartitionInstanceTypeM5XlargeSearch OpenSearchPartitionInstanceType = "m5.xlarge.search" OpenSearchPartitionInstanceTypeM52xlargeSearch OpenSearchPartitionInstanceType = "m5.2xlarge.search" OpenSearchPartitionInstanceTypeM54xlargeSearch OpenSearchPartitionInstanceType = "m5.4xlarge.search" OpenSearchPartitionInstanceTypeM512xlargeSearch OpenSearchPartitionInstanceType = "m5.12xlarge.search" OpenSearchPartitionInstanceTypeM524xlargeSearch OpenSearchPartitionInstanceType = "m5.24xlarge.search" OpenSearchPartitionInstanceTypeR5LargeSearch OpenSearchPartitionInstanceType = "r5.large.search" OpenSearchPartitionInstanceTypeR5XlargeSearch OpenSearchPartitionInstanceType = "r5.xlarge.search" OpenSearchPartitionInstanceTypeR52xlargeSearch OpenSearchPartitionInstanceType = "r5.2xlarge.search" OpenSearchPartitionInstanceTypeR54xlargeSearch OpenSearchPartitionInstanceType = "r5.4xlarge.search" OpenSearchPartitionInstanceTypeR512xlargeSearch OpenSearchPartitionInstanceType = "r5.12xlarge.search" OpenSearchPartitionInstanceTypeR524xlargeSearch OpenSearchPartitionInstanceType = "r5.24xlarge.search" OpenSearchPartitionInstanceTypeC5LargeSearch OpenSearchPartitionInstanceType = "c5.large.search" OpenSearchPartitionInstanceTypeC5XlargeSearch OpenSearchPartitionInstanceType = "c5.xlarge.search" OpenSearchPartitionInstanceTypeC52xlargeSearch OpenSearchPartitionInstanceType = "c5.2xlarge.search" OpenSearchPartitionInstanceTypeC54xlargeSearch OpenSearchPartitionInstanceType = "c5.4xlarge.search" OpenSearchPartitionInstanceTypeC59xlargeSearch OpenSearchPartitionInstanceType = "c5.9xlarge.search" OpenSearchPartitionInstanceTypeC518xlargeSearch OpenSearchPartitionInstanceType = "c5.18xlarge.search" OpenSearchPartitionInstanceTypeT3NanoSearch OpenSearchPartitionInstanceType = "t3.nano.search" OpenSearchPartitionInstanceTypeT3MicroSearch OpenSearchPartitionInstanceType = "t3.micro.search" OpenSearchPartitionInstanceTypeT3SmallSearch OpenSearchPartitionInstanceType = "t3.small.search" OpenSearchPartitionInstanceTypeT3MediumSearch OpenSearchPartitionInstanceType = "t3.medium.search" OpenSearchPartitionInstanceTypeT3LargeSearch OpenSearchPartitionInstanceType = "t3.large.search" OpenSearchPartitionInstanceTypeT3XlargeSearch OpenSearchPartitionInstanceType = "t3.xlarge.search" OpenSearchPartitionInstanceTypeT32xlargeSearch OpenSearchPartitionInstanceType = "t3.2xlarge.search" OpenSearchPartitionInstanceTypeUltrawarm1MediumSearch OpenSearchPartitionInstanceType = "ultrawarm1.medium.search" OpenSearchPartitionInstanceTypeUltrawarm1LargeSearch OpenSearchPartitionInstanceType = "ultrawarm1.large.search" OpenSearchPartitionInstanceTypeUltrawarm1XlargeSearch OpenSearchPartitionInstanceType = "ultrawarm1.xlarge.search" OpenSearchPartitionInstanceTypeT2MicroSearch OpenSearchPartitionInstanceType = "t2.micro.search" OpenSearchPartitionInstanceTypeT2SmallSearch OpenSearchPartitionInstanceType = "t2.small.search" OpenSearchPartitionInstanceTypeT2MediumSearch OpenSearchPartitionInstanceType = "t2.medium.search" OpenSearchPartitionInstanceTypeR3LargeSearch OpenSearchPartitionInstanceType = "r3.large.search" OpenSearchPartitionInstanceTypeR3XlargeSearch OpenSearchPartitionInstanceType = "r3.xlarge.search" OpenSearchPartitionInstanceTypeR32xlargeSearch OpenSearchPartitionInstanceType = "r3.2xlarge.search" OpenSearchPartitionInstanceTypeR34xlargeSearch OpenSearchPartitionInstanceType = "r3.4xlarge.search" OpenSearchPartitionInstanceTypeR38xlargeSearch OpenSearchPartitionInstanceType = "r3.8xlarge.search" OpenSearchPartitionInstanceTypeI2XlargeSearch OpenSearchPartitionInstanceType = "i2.xlarge.search" OpenSearchPartitionInstanceTypeI22xlargeSearch OpenSearchPartitionInstanceType = "i2.2xlarge.search" OpenSearchPartitionInstanceTypeD2XlargeSearch OpenSearchPartitionInstanceType = "d2.xlarge.search" OpenSearchPartitionInstanceTypeD22xlargeSearch OpenSearchPartitionInstanceType = "d2.2xlarge.search" OpenSearchPartitionInstanceTypeD24xlargeSearch OpenSearchPartitionInstanceType = "d2.4xlarge.search" OpenSearchPartitionInstanceTypeD28xlargeSearch OpenSearchPartitionInstanceType = "d2.8xlarge.search" OpenSearchPartitionInstanceTypeC4LargeSearch OpenSearchPartitionInstanceType = "c4.large.search" OpenSearchPartitionInstanceTypeC4XlargeSearch OpenSearchPartitionInstanceType = "c4.xlarge.search" OpenSearchPartitionInstanceTypeC42xlargeSearch OpenSearchPartitionInstanceType = "c4.2xlarge.search" OpenSearchPartitionInstanceTypeC44xlargeSearch OpenSearchPartitionInstanceType = "c4.4xlarge.search" OpenSearchPartitionInstanceTypeC48xlargeSearch OpenSearchPartitionInstanceType = "c4.8xlarge.search" OpenSearchPartitionInstanceTypeR4LargeSearch OpenSearchPartitionInstanceType = "r4.large.search" OpenSearchPartitionInstanceTypeR4XlargeSearch OpenSearchPartitionInstanceType = "r4.xlarge.search" OpenSearchPartitionInstanceTypeR42xlargeSearch OpenSearchPartitionInstanceType = "r4.2xlarge.search" OpenSearchPartitionInstanceTypeR44xlargeSearch OpenSearchPartitionInstanceType = "r4.4xlarge.search" OpenSearchPartitionInstanceTypeR48xlargeSearch OpenSearchPartitionInstanceType = "r4.8xlarge.search" OpenSearchPartitionInstanceTypeR416xlargeSearch OpenSearchPartitionInstanceType = "r4.16xlarge.search" OpenSearchPartitionInstanceTypeI3LargeSearch OpenSearchPartitionInstanceType = "i3.large.search" OpenSearchPartitionInstanceTypeI3XlargeSearch OpenSearchPartitionInstanceType = "i3.xlarge.search" OpenSearchPartitionInstanceTypeI32xlargeSearch OpenSearchPartitionInstanceType = "i3.2xlarge.search" OpenSearchPartitionInstanceTypeI34xlargeSearch OpenSearchPartitionInstanceType = "i3.4xlarge.search" OpenSearchPartitionInstanceTypeI38xlargeSearch OpenSearchPartitionInstanceType = "i3.8xlarge.search" OpenSearchPartitionInstanceTypeI316xlargeSearch OpenSearchPartitionInstanceType = "i3.16xlarge.search" OpenSearchPartitionInstanceTypeR6gLargeSearch OpenSearchPartitionInstanceType = "r6g.large.search" OpenSearchPartitionInstanceTypeR6gXlargeSearch OpenSearchPartitionInstanceType = "r6g.xlarge.search" OpenSearchPartitionInstanceTypeR6g2xlargeSearch OpenSearchPartitionInstanceType = "r6g.2xlarge.search" OpenSearchPartitionInstanceTypeR6g4xlargeSearch OpenSearchPartitionInstanceType = "r6g.4xlarge.search" OpenSearchPartitionInstanceTypeR6g8xlargeSearch OpenSearchPartitionInstanceType = "r6g.8xlarge.search" OpenSearchPartitionInstanceTypeR6g12xlargeSearch OpenSearchPartitionInstanceType = "r6g.12xlarge.search" OpenSearchPartitionInstanceTypeM6gLargeSearch OpenSearchPartitionInstanceType = "m6g.large.search" OpenSearchPartitionInstanceTypeM6gXlargeSearch OpenSearchPartitionInstanceType = "m6g.xlarge.search" OpenSearchPartitionInstanceTypeM6g2xlargeSearch OpenSearchPartitionInstanceType = "m6g.2xlarge.search" OpenSearchPartitionInstanceTypeM6g4xlargeSearch OpenSearchPartitionInstanceType = "m6g.4xlarge.search" OpenSearchPartitionInstanceTypeM6g8xlargeSearch OpenSearchPartitionInstanceType = "m6g.8xlarge.search" OpenSearchPartitionInstanceTypeM6g12xlargeSearch OpenSearchPartitionInstanceType = "m6g.12xlarge.search" OpenSearchPartitionInstanceTypeC6gLargeSearch OpenSearchPartitionInstanceType = "c6g.large.search" OpenSearchPartitionInstanceTypeC6gXlargeSearch OpenSearchPartitionInstanceType = "c6g.xlarge.search" OpenSearchPartitionInstanceTypeC6g2xlargeSearch OpenSearchPartitionInstanceType = "c6g.2xlarge.search" OpenSearchPartitionInstanceTypeC6g4xlargeSearch OpenSearchPartitionInstanceType = "c6g.4xlarge.search" OpenSearchPartitionInstanceTypeC6g8xlargeSearch OpenSearchPartitionInstanceType = "c6g.8xlarge.search" OpenSearchPartitionInstanceTypeC6g12xlargeSearch OpenSearchPartitionInstanceType = "c6g.12xlarge.search" OpenSearchPartitionInstanceTypeR6gdLargeSearch OpenSearchPartitionInstanceType = "r6gd.large.search" OpenSearchPartitionInstanceTypeR6gdXlargeSearch OpenSearchPartitionInstanceType = "r6gd.xlarge.search" OpenSearchPartitionInstanceTypeR6gd2xlargeSearch OpenSearchPartitionInstanceType = "r6gd.2xlarge.search" OpenSearchPartitionInstanceTypeR6gd4xlargeSearch OpenSearchPartitionInstanceType = "r6gd.4xlarge.search" OpenSearchPartitionInstanceTypeR6gd8xlargeSearch OpenSearchPartitionInstanceType = "r6gd.8xlarge.search" OpenSearchPartitionInstanceTypeR6gd12xlargeSearch OpenSearchPartitionInstanceType = "r6gd.12xlarge.search" OpenSearchPartitionInstanceTypeR6gd16xlargeSearch OpenSearchPartitionInstanceType = "r6gd.16xlarge.search" OpenSearchPartitionInstanceTypeT4gSmallSearch OpenSearchPartitionInstanceType = "t4g.small.search" OpenSearchPartitionInstanceTypeT4gMediumSearch OpenSearchPartitionInstanceType = "t4g.medium.search" ) // Values returns all known values for OpenSearchPartitionInstanceType. 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 (OpenSearchPartitionInstanceType) Values() []OpenSearchPartitionInstanceType { return []OpenSearchPartitionInstanceType{ "m3.medium.search", "m3.large.search", "m3.xlarge.search", "m3.2xlarge.search", "m4.large.search", "m4.xlarge.search", "m4.2xlarge.search", "m4.4xlarge.search", "m4.10xlarge.search", "m5.large.search", "m5.xlarge.search", "m5.2xlarge.search", "m5.4xlarge.search", "m5.12xlarge.search", "m5.24xlarge.search", "r5.large.search", "r5.xlarge.search", "r5.2xlarge.search", "r5.4xlarge.search", "r5.12xlarge.search", "r5.24xlarge.search", "c5.large.search", "c5.xlarge.search", "c5.2xlarge.search", "c5.4xlarge.search", "c5.9xlarge.search", "c5.18xlarge.search", "t3.nano.search", "t3.micro.search", "t3.small.search", "t3.medium.search", "t3.large.search", "t3.xlarge.search", "t3.2xlarge.search", "ultrawarm1.medium.search", "ultrawarm1.large.search", "ultrawarm1.xlarge.search", "t2.micro.search", "t2.small.search", "t2.medium.search", "r3.large.search", "r3.xlarge.search", "r3.2xlarge.search", "r3.4xlarge.search", "r3.8xlarge.search", "i2.xlarge.search", "i2.2xlarge.search", "d2.xlarge.search", "d2.2xlarge.search", "d2.4xlarge.search", "d2.8xlarge.search", "c4.large.search", "c4.xlarge.search", "c4.2xlarge.search", "c4.4xlarge.search", "c4.8xlarge.search", "r4.large.search", "r4.xlarge.search", "r4.2xlarge.search", "r4.4xlarge.search", "r4.8xlarge.search", "r4.16xlarge.search", "i3.large.search", "i3.xlarge.search", "i3.2xlarge.search", "i3.4xlarge.search", "i3.8xlarge.search", "i3.16xlarge.search", "r6g.large.search", "r6g.xlarge.search", "r6g.2xlarge.search", "r6g.4xlarge.search", "r6g.8xlarge.search", "r6g.12xlarge.search", "m6g.large.search", "m6g.xlarge.search", "m6g.2xlarge.search", "m6g.4xlarge.search", "m6g.8xlarge.search", "m6g.12xlarge.search", "c6g.large.search", "c6g.xlarge.search", "c6g.2xlarge.search", "c6g.4xlarge.search", "c6g.8xlarge.search", "c6g.12xlarge.search", "r6gd.large.search", "r6gd.xlarge.search", "r6gd.2xlarge.search", "r6gd.4xlarge.search", "r6gd.8xlarge.search", "r6gd.12xlarge.search", "r6gd.16xlarge.search", "t4g.small.search", "t4g.medium.search", } } type OpenSearchWarmPartitionInstanceType string // Enum values for OpenSearchWarmPartitionInstanceType const ( OpenSearchWarmPartitionInstanceTypeUltrawarm1MediumSearch OpenSearchWarmPartitionInstanceType = "ultrawarm1.medium.search" OpenSearchWarmPartitionInstanceTypeUltrawarm1LargeSearch OpenSearchWarmPartitionInstanceType = "ultrawarm1.large.search" OpenSearchWarmPartitionInstanceTypeUltrawarm1XlargeSearch OpenSearchWarmPartitionInstanceType = "ultrawarm1.xlarge.search" ) // Values returns all known values for OpenSearchWarmPartitionInstanceType. 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 (OpenSearchWarmPartitionInstanceType) Values() []OpenSearchWarmPartitionInstanceType { return []OpenSearchWarmPartitionInstanceType{ "ultrawarm1.medium.search", "ultrawarm1.large.search", "ultrawarm1.xlarge.search", } } type OptionState string // Enum values for OptionState const ( OptionStateRequiresIndexDocuments OptionState = "RequiresIndexDocuments" OptionStateProcessing OptionState = "Processing" OptionStateActive OptionState = "Active" ) // Values returns all known values for OptionState. 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 (OptionState) Values() []OptionState { return []OptionState{ "RequiresIndexDocuments", "Processing", "Active", } } type OutboundConnectionStatusCode string // Enum values for OutboundConnectionStatusCode const ( OutboundConnectionStatusCodeValidating OutboundConnectionStatusCode = "VALIDATING" OutboundConnectionStatusCodeValidationFailed OutboundConnectionStatusCode = "VALIDATION_FAILED" OutboundConnectionStatusCodePendingAcceptance OutboundConnectionStatusCode = "PENDING_ACCEPTANCE" OutboundConnectionStatusCodeApproved OutboundConnectionStatusCode = "APPROVED" OutboundConnectionStatusCodeProvisioning OutboundConnectionStatusCode = "PROVISIONING" OutboundConnectionStatusCodeActive OutboundConnectionStatusCode = "ACTIVE" OutboundConnectionStatusCodeRejecting OutboundConnectionStatusCode = "REJECTING" OutboundConnectionStatusCodeRejected OutboundConnectionStatusCode = "REJECTED" OutboundConnectionStatusCodeDeleting OutboundConnectionStatusCode = "DELETING" OutboundConnectionStatusCodeDeleted OutboundConnectionStatusCode = "DELETED" ) // Values returns all known values for OutboundConnectionStatusCode. 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 (OutboundConnectionStatusCode) Values() []OutboundConnectionStatusCode { return []OutboundConnectionStatusCode{ "VALIDATING", "VALIDATION_FAILED", "PENDING_ACCEPTANCE", "APPROVED", "PROVISIONING", "ACTIVE", "REJECTING", "REJECTED", "DELETING", "DELETED", } } type OverallChangeStatus string // Enum values for OverallChangeStatus const ( OverallChangeStatusPending OverallChangeStatus = "PENDING" OverallChangeStatusProcessing OverallChangeStatus = "PROCESSING" OverallChangeStatusCompleted OverallChangeStatus = "COMPLETED" OverallChangeStatusFailed OverallChangeStatus = "FAILED" ) // Values returns all known values for OverallChangeStatus. 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 (OverallChangeStatus) Values() []OverallChangeStatus { return []OverallChangeStatus{ "PENDING", "PROCESSING", "COMPLETED", "FAILED", } } type PackageStatus string // Enum values for PackageStatus const ( PackageStatusCopying PackageStatus = "COPYING" PackageStatusCopyFailed PackageStatus = "COPY_FAILED" PackageStatusValidating PackageStatus = "VALIDATING" PackageStatusValidationFailed PackageStatus = "VALIDATION_FAILED" PackageStatusAvailable PackageStatus = "AVAILABLE" PackageStatusDeleting PackageStatus = "DELETING" PackageStatusDeleted PackageStatus = "DELETED" PackageStatusDeleteFailed PackageStatus = "DELETE_FAILED" ) // Values returns all known values for PackageStatus. 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 (PackageStatus) Values() []PackageStatus { return []PackageStatus{ "COPYING", "COPY_FAILED", "VALIDATING", "VALIDATION_FAILED", "AVAILABLE", "DELETING", "DELETED", "DELETE_FAILED", } } type PackageType string // Enum values for PackageType const ( PackageTypeTxtDictionary PackageType = "TXT-DICTIONARY" ) // Values returns all known values for PackageType. 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 (PackageType) Values() []PackageType { return []PackageType{ "TXT-DICTIONARY", } } type PrincipalType string // Enum values for PrincipalType const ( PrincipalTypeAwsAccount PrincipalType = "AWS_ACCOUNT" PrincipalTypeAwsService PrincipalType = "AWS_SERVICE" ) // Values returns all known values for PrincipalType. 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 (PrincipalType) Values() []PrincipalType { return []PrincipalType{ "AWS_ACCOUNT", "AWS_SERVICE", } } type ReservedInstancePaymentOption string // Enum values for ReservedInstancePaymentOption const ( ReservedInstancePaymentOptionAllUpfront ReservedInstancePaymentOption = "ALL_UPFRONT" ReservedInstancePaymentOptionPartialUpfront ReservedInstancePaymentOption = "PARTIAL_UPFRONT" ReservedInstancePaymentOptionNoUpfront ReservedInstancePaymentOption = "NO_UPFRONT" ) // Values returns all known values for ReservedInstancePaymentOption. 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 (ReservedInstancePaymentOption) Values() []ReservedInstancePaymentOption { return []ReservedInstancePaymentOption{ "ALL_UPFRONT", "PARTIAL_UPFRONT", "NO_UPFRONT", } } type RollbackOnDisable string // Enum values for RollbackOnDisable const ( RollbackOnDisableNoRollback RollbackOnDisable = "NO_ROLLBACK" RollbackOnDisableDefaultRollback RollbackOnDisable = "DEFAULT_ROLLBACK" ) // Values returns all known values for RollbackOnDisable. 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 (RollbackOnDisable) Values() []RollbackOnDisable { return []RollbackOnDisable{ "NO_ROLLBACK", "DEFAULT_ROLLBACK", } } type ScheduleAt string // Enum values for ScheduleAt const ( ScheduleAtNow ScheduleAt = "NOW" ScheduleAtTimestamp ScheduleAt = "TIMESTAMP" ScheduleAtOffPeakWindow ScheduleAt = "OFF_PEAK_WINDOW" ) // Values returns all known values for ScheduleAt. 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 (ScheduleAt) Values() []ScheduleAt { return []ScheduleAt{ "NOW", "TIMESTAMP", "OFF_PEAK_WINDOW", } } type ScheduledAutoTuneActionType string // Enum values for ScheduledAutoTuneActionType const ( ScheduledAutoTuneActionTypeJvmHeapSizeTuning ScheduledAutoTuneActionType = "JVM_HEAP_SIZE_TUNING" ScheduledAutoTuneActionTypeJvmYoungGenTuning ScheduledAutoTuneActionType = "JVM_YOUNG_GEN_TUNING" ) // Values returns all known values for ScheduledAutoTuneActionType. 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 (ScheduledAutoTuneActionType) Values() []ScheduledAutoTuneActionType { return []ScheduledAutoTuneActionType{ "JVM_HEAP_SIZE_TUNING", "JVM_YOUNG_GEN_TUNING", } } type ScheduledAutoTuneSeverityType string // Enum values for ScheduledAutoTuneSeverityType const ( ScheduledAutoTuneSeverityTypeLow ScheduledAutoTuneSeverityType = "LOW" ScheduledAutoTuneSeverityTypeMedium ScheduledAutoTuneSeverityType = "MEDIUM" ScheduledAutoTuneSeverityTypeHigh ScheduledAutoTuneSeverityType = "HIGH" ) // Values returns all known values for ScheduledAutoTuneSeverityType. 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 (ScheduledAutoTuneSeverityType) Values() []ScheduledAutoTuneSeverityType { return []ScheduledAutoTuneSeverityType{ "LOW", "MEDIUM", "HIGH", } } type ScheduledBy string // Enum values for ScheduledBy const ( ScheduledByCustomer ScheduledBy = "CUSTOMER" ScheduledBySystem ScheduledBy = "SYSTEM" ) // Values returns all known values for ScheduledBy. 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 (ScheduledBy) Values() []ScheduledBy { return []ScheduledBy{ "CUSTOMER", "SYSTEM", } } type SkipUnavailableStatus string // Enum values for SkipUnavailableStatus const ( SkipUnavailableStatusEnabled SkipUnavailableStatus = "ENABLED" SkipUnavailableStatusDisabled SkipUnavailableStatus = "DISABLED" ) // Values returns all known values for SkipUnavailableStatus. 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 (SkipUnavailableStatus) Values() []SkipUnavailableStatus { return []SkipUnavailableStatus{ "ENABLED", "DISABLED", } } type TimeUnit string // Enum values for TimeUnit const ( TimeUnitHours TimeUnit = "HOURS" ) // Values returns all known values for TimeUnit. 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 (TimeUnit) Values() []TimeUnit { return []TimeUnit{ "HOURS", } } type TLSSecurityPolicy string // Enum values for TLSSecurityPolicy const ( TLSSecurityPolicyPolicyMinTls10201907 TLSSecurityPolicy = "Policy-Min-TLS-1-0-2019-07" TLSSecurityPolicyPolicyMinTls12201907 TLSSecurityPolicy = "Policy-Min-TLS-1-2-2019-07" ) // Values returns all known values for TLSSecurityPolicy. 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 (TLSSecurityPolicy) Values() []TLSSecurityPolicy { return []TLSSecurityPolicy{ "Policy-Min-TLS-1-0-2019-07", "Policy-Min-TLS-1-2-2019-07", } } type UpgradeStatus string // Enum values for UpgradeStatus const ( UpgradeStatusInProgress UpgradeStatus = "IN_PROGRESS" UpgradeStatusSucceeded UpgradeStatus = "SUCCEEDED" UpgradeStatusSucceededWithIssues UpgradeStatus = "SUCCEEDED_WITH_ISSUES" UpgradeStatusFailed UpgradeStatus = "FAILED" ) // Values returns all known values for UpgradeStatus. 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 (UpgradeStatus) Values() []UpgradeStatus { return []UpgradeStatus{ "IN_PROGRESS", "SUCCEEDED", "SUCCEEDED_WITH_ISSUES", "FAILED", } } type UpgradeStep string // Enum values for UpgradeStep const ( UpgradeStepPreUpgradeCheck UpgradeStep = "PRE_UPGRADE_CHECK" UpgradeStepSnapshot UpgradeStep = "SNAPSHOT" UpgradeStepUpgrade UpgradeStep = "UPGRADE" ) // Values returns all known values for UpgradeStep. 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 (UpgradeStep) Values() []UpgradeStep { return []UpgradeStep{ "PRE_UPGRADE_CHECK", "SNAPSHOT", "UPGRADE", } } type VolumeType string // Enum values for VolumeType const ( VolumeTypeStandard VolumeType = "standard" VolumeTypeGp2 VolumeType = "gp2" VolumeTypeIo1 VolumeType = "io1" VolumeTypeGp3 VolumeType = "gp3" ) // 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{ "standard", "gp2", "io1", "gp3", } } type VpcEndpointErrorCode string // Enum values for VpcEndpointErrorCode const ( VpcEndpointErrorCodeEndpointNotFound VpcEndpointErrorCode = "ENDPOINT_NOT_FOUND" VpcEndpointErrorCodeServerError VpcEndpointErrorCode = "SERVER_ERROR" ) // Values returns all known values for VpcEndpointErrorCode. 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 (VpcEndpointErrorCode) Values() []VpcEndpointErrorCode { return []VpcEndpointErrorCode{ "ENDPOINT_NOT_FOUND", "SERVER_ERROR", } } type VpcEndpointStatus string // Enum values for VpcEndpointStatus const ( VpcEndpointStatusCreating VpcEndpointStatus = "CREATING" VpcEndpointStatusCreateFailed VpcEndpointStatus = "CREATE_FAILED" VpcEndpointStatusActive VpcEndpointStatus = "ACTIVE" VpcEndpointStatusUpdating VpcEndpointStatus = "UPDATING" VpcEndpointStatusUpdateFailed VpcEndpointStatus = "UPDATE_FAILED" VpcEndpointStatusDeleting VpcEndpointStatus = "DELETING" VpcEndpointStatusDeleteFailed VpcEndpointStatus = "DELETE_FAILED" ) // Values returns all known values for VpcEndpointStatus. 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 (VpcEndpointStatus) Values() []VpcEndpointStatus { return []VpcEndpointStatus{ "CREATING", "CREATE_FAILED", "ACTIVE", "UPDATING", "UPDATE_FAILED", "DELETING", "DELETE_FAILED", } } type ZoneStatus string // Enum values for ZoneStatus const ( ZoneStatusActive ZoneStatus = "Active" ZoneStatusStandBy ZoneStatus = "StandBy" ZoneStatusNotAvailable ZoneStatus = "NotAvailable" ) // Values returns all known values for ZoneStatus. 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 (ZoneStatus) Values() []ZoneStatus { return []ZoneStatus{ "Active", "StandBy", "NotAvailable", } }
1,075
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" ) // An error occurred because you don't have permissions to access the resource. 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 } // An error occurred while processing the request. type BaseException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *BaseException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *BaseException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *BaseException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "BaseException" } return *e.ErrorCodeOverride } func (e *BaseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // An error occurred because the client attempts to remove a resource that is // currently in use. type ConflictException struct { Message *string ErrorCodeOverride *string 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 } // An exception for when a failure in one of the dependencies results in the // service being unable to fetch details about the resource. type DependencyFailureException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *DependencyFailureException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *DependencyFailureException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *DependencyFailureException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "DependencyFailureException" } return *e.ErrorCodeOverride } func (e *DependencyFailureException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // An error occured because the client wanted to access an unsupported operation. type DisabledOperationException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *DisabledOperationException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *DisabledOperationException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *DisabledOperationException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "DisabledOperationException" } return *e.ErrorCodeOverride } func (e *DisabledOperationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Request processing failed because of an unknown error, exception, or internal // failure. type InternalException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InternalException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalException" } return *e.ErrorCodeOverride } func (e *InternalException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // Request processing failed because you provided an invalid pagination token. type InvalidPaginationTokenException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidPaginationTokenException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidPaginationTokenException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidPaginationTokenException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidPaginationTokenException" } return *e.ErrorCodeOverride } func (e *InvalidPaginationTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // An exception for trying to create or access a sub-resource that's either // invalid or not supported. type InvalidTypeException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidTypeException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidTypeException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidTypeException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidTypeException" } return *e.ErrorCodeOverride } func (e *InvalidTypeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // An exception for trying to create more than the allowed number of resources or // sub-resources. type LimitExceededException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *LimitExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *LimitExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *LimitExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "LimitExceededException" } return *e.ErrorCodeOverride } func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // An exception for creating a resource that already exists. type ResourceAlreadyExistsException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ResourceAlreadyExistsException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceAlreadyExistsException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceAlreadyExistsException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceAlreadyExistsException" } return *e.ErrorCodeOverride } func (e *ResourceAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // An exception for accessing or deleting a resource that doesn't exist. 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 } // An exception for attempting to schedule a domain action during an unavailable // time slot. type SlotNotAvailableException struct { Message *string ErrorCodeOverride *string SlotSuggestions []int64 noSmithyDocumentSerde } func (e *SlotNotAvailableException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *SlotNotAvailableException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *SlotNotAvailableException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "SlotNotAvailableException" } return *e.ErrorCodeOverride } func (e *SlotNotAvailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // An exception for accessing or deleting a resource that doesn't exist. type ValidationException struct { Message *string ErrorCodeOverride *string 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 }
355
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 configured access rules for the domain's search endpoint, and the current // status of those rules. type AccessPoliciesStatus struct { // The access policy configured for the domain. Access policies can be // resource-based, IP-based, or IAM-based. For more information, see Configuring // access policies (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-access-policies) // . // // This member is required. Options *string // The status of the access policy for the domain. // // This member is required. Status *OptionStatus noSmithyDocumentSerde } // List of limits that are specific to a given instance type. type AdditionalLimit struct { // - MaximumNumberOfDataNodesSupported - This attribute only applies to master // nodes and specifies the maximum number of data nodes of a given instance type a // master node can support. // - MaximumNumberOfDataNodesWithoutMasterNode - This attribute only applies to // data nodes and specifies the maximum number of data nodes of a given instance // type can exist without a master node governing them. LimitName *string // The values of the additional instance type limits. LimitValues []string noSmithyDocumentSerde } // Status of the advanced options for the specified domain. The following options // are available: // - "rest.action.multi.allow_explicit_index": "true" | "false" - Note the use of // a string rather than a boolean. Specifies whether explicit references to indexes // are allowed inside the body of HTTP requests. If you want to configure access // policies for domain sub-resources, such as specific indexes and domain APIs, you // must disable this property. Default is true. // - "indices.fielddata.cache.size": "80" - Note the use of a string rather than // a boolean. Specifies the percentage of heap space allocated to field data. // Default is unbounded. // - "indices.query.bool.max_clause_count": "1024" - Note the use of a string // rather than a boolean. Specifies the maximum number of clauses allowed in a // Lucene boolean query. Default is 1,024. Queries with more than the permitted // number of clauses result in a TooManyClauses error. // - "override_main_response_version": "true" | "false" - Note the use of a // string rather than a boolean. Specifies whether the domain reports its version // as 7.10 to allow Elasticsearch OSS clients and plugins to continue working with // it. Default is false when creating a domain and true when upgrading a domain. // // For more information, see Advanced cluster parameters (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options) // . type AdvancedOptionsStatus struct { // The status of advanced options for the specified domain. // // This member is required. Options map[string]string // The status of advanced options for the specified domain. // // This member is required. Status *OptionStatus noSmithyDocumentSerde } // Container for fine-grained access control settings. type AdvancedSecurityOptions struct { // Date and time when the migration period will be disabled. Only necessary when // enabling fine-grained access control on an existing domain (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/fgac.html#fgac-enabling-existing) // . AnonymousAuthDisableDate *time.Time // True if a 30-day migration period is enabled, during which administrators can // create role mappings. Only necessary when enabling fine-grained access control // on an existing domain (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/fgac.html#fgac-enabling-existing) // . AnonymousAuthEnabled *bool // True if fine-grained access control is enabled. Enabled *bool // True if the internal user database is enabled. InternalUserDatabaseEnabled *bool // Container for information about the SAML configuration for OpenSearch // Dashboards. SAMLOptions *SAMLOptionsOutput noSmithyDocumentSerde } // Options for enabling and configuring fine-grained access control. For more // information, see Fine-grained access control in Amazon OpenSearch Service (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/fgac.html) // . type AdvancedSecurityOptionsInput struct { // True to enable a 30-day migration period during which administrators can create // role mappings. Only necessary when enabling fine-grained access control on an // existing domain (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/fgac.html#fgac-enabling-existing) // . AnonymousAuthEnabled *bool // True to enable fine-grained access control. Enabled *bool // True to enable the internal user database. InternalUserDatabaseEnabled *bool // Container for information about the master user. MasterUserOptions *MasterUserOptions // Container for information about the SAML configuration for OpenSearch // Dashboards. SAMLOptions *SAMLOptionsInput noSmithyDocumentSerde } // The status of fine-grained access control settings for a domain. type AdvancedSecurityOptionsStatus struct { // Container for fine-grained access control settings. // // This member is required. Options *AdvancedSecurityOptions // Status of the fine-grained access control settings for a domain. // // This member is required. Status *OptionStatus noSmithyDocumentSerde } // Information about an Amazon Web Services account or service that has access to // an Amazon OpenSearch Service domain through the use of an interface VPC // endpoint. type AuthorizedPrincipal struct { // The IAM principal (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html) // that is allowed access to the domain. Principal *string // The type of principal. PrincipalType PrincipalType noSmithyDocumentSerde } // Information about an Auto-Tune action. For more information, see Auto-Tune for // Amazon OpenSearch Service (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) // . type AutoTune struct { // Details about an Auto-Tune action. AutoTuneDetails *AutoTuneDetails // The type of Auto-Tune action. AutoTuneType AutoTuneType noSmithyDocumentSerde } // Specifies details about a scheduled Auto-Tune action. For more information, see // Auto-Tune for Amazon OpenSearch Service (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) // . type AutoTuneDetails struct { // Container for details about a scheduled Auto-Tune action. ScheduledAutoTuneDetails *ScheduledAutoTuneDetails noSmithyDocumentSerde } // This object is deprecated. Use the domain's off-peak window (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/off-peak.html) // to schedule Auto-Tune optimizations. For migration instructions, see Migrating // from Auto-Tune maintenance windows (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/off-peak.html#off-peak-migrate) // . The Auto-Tune maintenance schedule. For more information, see Auto-Tune for // Amazon OpenSearch Service (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) // . type AutoTuneMaintenanceSchedule struct { // A cron expression for a recurring maintenance schedule during which Auto-Tune // can deploy changes. CronExpressionForRecurrence *string // The duration of the maintenance schedule. For example, "Duration": {"Value": 2, // "Unit": "HOURS"} . Duration *Duration // The Epoch timestamp at which the Auto-Tune maintenance schedule starts. StartAt *time.Time noSmithyDocumentSerde } // Auto-Tune settings when updating a domain. For more information, see Auto-Tune // for Amazon OpenSearch Service (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) // . type AutoTuneOptions struct { // Whether Auto-Tune is enabled or disabled. DesiredState AutoTuneDesiredState // DEPRECATED. Use off-peak window (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/off-peak.html) // instead. A list of maintenance schedules during which Auto-Tune can deploy // changes. MaintenanceSchedules []AutoTuneMaintenanceSchedule // When disabling Auto-Tune, specify NO_ROLLBACK to retain all prior Auto-Tune // settings or DEFAULT_ROLLBACK to revert to the OpenSearch Service defaults. If // you specify DEFAULT_ROLLBACK , you must include a MaintenanceSchedule in the // request. Otherwise, OpenSearch Service is unable to perform the rollback. RollbackOnDisable RollbackOnDisable // Whether to use the domain's off-peak window (https://docs.aws.amazon.com/opensearch-service/latest/APIReference/API_OffPeakWindow.html) // to deploy configuration changes on the domain rather than a maintenance // schedule. UseOffPeakWindow *bool noSmithyDocumentSerde } // Options for configuring Auto-Tune. For more information, see Auto-Tune for // Amazon OpenSearch Service (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) type AutoTuneOptionsInput struct { // Whether Auto-Tune is enabled or disabled. DesiredState AutoTuneDesiredState // A list of maintenance schedules during which Auto-Tune can deploy changes. // Maintenance windows are deprecated and have been replaced with off-peak windows (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/off-peak.html) // . MaintenanceSchedules []AutoTuneMaintenanceSchedule // Whether to schedule Auto-Tune optimizations that require blue/green deployments // during the domain's configured daily off-peak window. UseOffPeakWindow *bool noSmithyDocumentSerde } // The Auto-Tune settings for a domain, displayed when enabling or disabling // Auto-Tune. type AutoTuneOptionsOutput struct { // Any errors that occurred while enabling or disabling Auto-Tune. ErrorMessage *string // The current state of Auto-Tune on the domain. State AutoTuneState // Whether the domain's off-peak window will be used to deploy Auto-Tune changes // rather than a maintenance schedule. UseOffPeakWindow *bool noSmithyDocumentSerde } // The Auto-Tune status for the domain. type AutoTuneOptionsStatus struct { // Auto-Tune settings for updating a domain. Options *AutoTuneOptions // The current status of Auto-Tune for a domain. Status *AutoTuneStatus noSmithyDocumentSerde } // The current status of Auto-Tune for the domain. For more information, see // Auto-Tune for Amazon OpenSearch Service (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) // . type AutoTuneStatus struct { // Date and time when Auto-Tune was enabled for the domain. // // This member is required. CreationDate *time.Time // The current state of Auto-Tune on the domain. // // This member is required. State AutoTuneState // Date and time when the Auto-Tune options were last updated for the domain. // // This member is required. UpdateDate *time.Time // Any errors that occurred while enabling or disabling Auto-Tune. ErrorMessage *string // Indicates whether the domain is being deleted. PendingDeletion *bool // The latest version of the Auto-Tune options. UpdateVersion int32 noSmithyDocumentSerde } // Information about an Availability Zone on a domain. type AvailabilityZoneInfo struct { // The name of the Availability Zone. AvailabilityZoneName *string // The number of data nodes active in the Availability Zone. AvailableDataNodeCount *string // The total number of data nodes configured in the Availability Zone. ConfiguredDataNodeCount *string // The total number of primary and replica shards in the Availability Zone. TotalShards *string // The total number of primary and replica shards that aren't allocated to any of // the nodes in the Availability Zone. TotalUnAssignedShards *string // The current state of the Availability Zone. Current options are Active and // StandBy . // - Active - Data nodes in the Availability Zone are in use. // - StandBy - Data nodes in the Availability Zone are in a standby state. // - NotAvailable - Unable to retrieve information. ZoneStatus ZoneStatus noSmithyDocumentSerde } // Information about an Amazon OpenSearch Service domain. type AWSDomainInformation struct { // Name of the domain. // // This member is required. DomainName *string // The Amazon Web Services account ID of the domain owner. OwnerId *string // The Amazon Web Services Region in which the domain is located. Region *string noSmithyDocumentSerde } // Container for information about a configuration change happening on a domain. type ChangeProgressDetails struct { // The ID of the configuration change. ChangeId *string // A message corresponding to the status of the configuration change. Message *string noSmithyDocumentSerde } // Progress details for each stage of a domain update. type ChangeProgressStage struct { // The description of the stage. Description *string // The most recent updated timestamp of the stage. LastUpdated *time.Time // The name of the stage. Name *string // The status of the stage. Status *string noSmithyDocumentSerde } // The progress details of a specific domain configuration change. type ChangeProgressStatusDetails struct { // The unique change identifier associated with a specific domain configuration // change. ChangeId *string // The specific stages that the domain is going through to perform the // configuration change. ChangeProgressStages []ChangeProgressStage // The list of properties in the domain configuration change that have completed. CompletedProperties []string // The list of properties in the domain configuration change that are still // pending. PendingProperties []string // The time at which the configuration change is made on the domain. StartTime *time.Time // The overall status of the domain configuration change. Status OverallChangeStatus // The total number of stages required for the configuration change. TotalNumberOfStages int32 noSmithyDocumentSerde } // Container for the cluster configuration of an OpenSearch Service domain. For // more information, see Creating and managing Amazon OpenSearch Service domains (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html) // . type ClusterConfig struct { // Container for cold storage configuration options. ColdStorageOptions *ColdStorageOptions // Number of dedicated master nodes in the cluster. This number must be greater // than 2 and not 4, otherwise you receive a validation exception. DedicatedMasterCount *int32 // Indicates whether dedicated master nodes are enabled for the cluster. True if // the cluster will use a dedicated master node. False if the cluster will not. DedicatedMasterEnabled *bool // OpenSearch Service instance type of the dedicated master nodes in the cluster. DedicatedMasterType OpenSearchPartitionInstanceType // Number of dedicated master nodes in the cluster. This number must be greater // than 1, otherwise you receive a validation exception. InstanceCount *int32 // Instance type of data nodes in the cluster. InstanceType OpenSearchPartitionInstanceType // A boolean that indicates whether a multi-AZ domain is turned on with a standby // AZ. For more information, see Configuring a multi-AZ domain in Amazon // OpenSearch Service (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-multiaz.html) // . MultiAZWithStandbyEnabled *bool // The number of warm nodes in the cluster. WarmCount *int32 // Whether to enable warm storage for the cluster. WarmEnabled *bool // The instance type for the cluster's warm nodes. WarmType OpenSearchWarmPartitionInstanceType // Container for zone awareness configuration options. Only required if // ZoneAwarenessEnabled is true . ZoneAwarenessConfig *ZoneAwarenessConfig // Indicates whether multiple Availability Zones are enabled. For more // information, see Configuring a multi-AZ domain in Amazon OpenSearch Service (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-multiaz.html) // . ZoneAwarenessEnabled *bool noSmithyDocumentSerde } // The cluster configuration status for a domain. type ClusterConfigStatus struct { // Cluster configuration options for the specified domain. // // This member is required. Options *ClusterConfig // The status of cluster configuration options for the specified domain. // // This member is required. Status *OptionStatus noSmithyDocumentSerde } // Container for the parameters required to enable Cognito authentication for an // OpenSearch Service domain. For more information, see Configuring Amazon Cognito // authentication for OpenSearch Dashboards (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/cognito-auth.html) // . type CognitoOptions struct { // Whether to enable or disable Amazon Cognito authentication for OpenSearch // Dashboards. Enabled *bool // The Amazon Cognito identity pool ID that you want OpenSearch Service to use for // OpenSearch Dashboards authentication. IdentityPoolId *string // The AmazonOpenSearchServiceCognitoAccess role that allows OpenSearch Service to // configure your user pool and identity pool. RoleArn *string // The Amazon Cognito user pool ID that you want OpenSearch Service to use for // OpenSearch Dashboards authentication. UserPoolId *string noSmithyDocumentSerde } // The status of the Cognito options for the specified domain. type CognitoOptionsStatus struct { // Cognito options for the specified domain. // // This member is required. Options *CognitoOptions // The status of the Cognito options for the specified domain. // // This member is required. Status *OptionStatus noSmithyDocumentSerde } // Container for the parameters required to enable cold storage for an OpenSearch // Service domain. For more information, see Cold storage for Amazon OpenSearch // Service (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/cold-storage.html) // . type ColdStorageOptions struct { // Whether to enable or disable cold storage on the domain. // // This member is required. Enabled *bool noSmithyDocumentSerde } // A map of OpenSearch or Elasticsearch versions and the versions you can upgrade // them to. type CompatibleVersionsMap struct { // The current version that the OpenSearch Service domain is running. SourceVersion *string // The possible versions that you can upgrade the domain to. TargetVersions []string noSmithyDocumentSerde } // The connection properties of an outbound connection. type ConnectionProperties struct { // The connection properties for cross cluster search. CrossClusterSearch *CrossClusterSearchConnectionProperties // The Endpoint attribute cannot be modified. The endpoint of the remote domain. // Applicable for VPC_ENDPOINT connection mode. Endpoint *string noSmithyDocumentSerde } // Cross cluster search specific connection properties. type CrossClusterSearchConnectionProperties struct { // Status of SkipUnavailable param for outbound connection. SkipUnavailable SkipUnavailableStatus noSmithyDocumentSerde } // A filter to apply to the DescribePackage response. type DescribePackagesFilter struct { // Any field from PackageDetails . Name DescribePackagesFilterName // A non-empty list of values for the specified filter field. Value []string noSmithyDocumentSerde } // Container for the configuration of an OpenSearch Service domain. type DomainConfig struct { // Specifies the access policies for the domain. AccessPolicies *AccessPoliciesStatus // Key-value pairs to specify advanced configuration options. For more // information, see Advanced options (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options) // . AdvancedOptions *AdvancedOptionsStatus // Container for fine-grained access control settings for the domain. AdvancedSecurityOptions *AdvancedSecurityOptionsStatus // Container for Auto-Tune settings for the domain. AutoTuneOptions *AutoTuneOptionsStatus // Container for information about the progress of an existing configuration // change. ChangeProgressDetails *ChangeProgressDetails // Container for the cluster configuration of a the domain. ClusterConfig *ClusterConfigStatus // Container for Amazon Cognito options for the domain. CognitoOptions *CognitoOptionsStatus // Additional options for the domain endpoint, such as whether to require HTTPS // for all traffic. DomainEndpointOptions *DomainEndpointOptionsStatus // Container for EBS options configured for the domain. EBSOptions *EBSOptionsStatus // Key-value pairs to enable encryption at rest. EncryptionAtRestOptions *EncryptionAtRestOptionsStatus // The OpenSearch or Elasticsearch version that the domain is running. EngineVersion *VersionStatus // Key-value pairs to configure log publishing. LogPublishingOptions *LogPublishingOptionsStatus // Whether node-to-node encryption is enabled or disabled. NodeToNodeEncryptionOptions *NodeToNodeEncryptionOptionsStatus // Container for off-peak window options for the domain. OffPeakWindowOptions *OffPeakWindowOptionsStatus // DEPRECATED. Container for parameters required to configure automated snapshots // of domain indexes. SnapshotOptions *SnapshotOptionsStatus // Software update options for the domain. SoftwareUpdateOptions *SoftwareUpdateOptionsStatus // The current VPC options for the domain and the status of any updates to their // configuration. VPCOptions *VPCDerivedInfoStatus noSmithyDocumentSerde } // Options to configure a custom endpoint for an OpenSearch Service domain. type DomainEndpointOptions struct { // The fully qualified URL for the custom endpoint. CustomEndpoint *string // The ARN for your security certificate, managed in Amazon Web Services // Certificate Manager (ACM). CustomEndpointCertificateArn *string // Whether to enable a custom endpoint for the domain. CustomEndpointEnabled *bool // True to require that all traffic to the domain arrive over HTTPS. EnforceHTTPS *bool // Specify the TLS security policy to apply to the HTTPS endpoint of the domain. // Can be one of the following values: // - Policy-Min-TLS-1-0-2019-07: TLS security policy which supports TLS version // 1.0 and higher. // - Policy-Min-TLS-1-2-2019-07: TLS security policy which supports only TLS // version 1.2 TLSSecurityPolicy TLSSecurityPolicy noSmithyDocumentSerde } // The configured endpoint options for a domain and their current status. type DomainEndpointOptionsStatus struct { // Options to configure the endpoint for a domain. // // This member is required. Options *DomainEndpointOptions // The status of the endpoint options for a domain. // // This member is required. Status *OptionStatus noSmithyDocumentSerde } // Information about an OpenSearch Service domain. type DomainInfo struct { // Name of the domain. DomainName *string // The type of search engine that the domain is running. OpenSearch for an // OpenSearch engine, or Elasticsearch for a legacy Elasticsearch OSS engine. EngineType EngineType noSmithyDocumentSerde } // Container for information about an OpenSearch Service domain. type DomainInformationContainer struct { // Information about an Amazon OpenSearch Service domain. AWSDomainInformation *AWSDomainInformation noSmithyDocumentSerde } // Container for information about nodes on the domain. type DomainNodesStatus struct { // The Availability Zone of the node. AvailabilityZone *string // The instance type information of the node. InstanceType OpenSearchPartitionInstanceType // The ID of the node. NodeId *string // Indicates if the node is active or in standby. NodeStatus NodeStatus // Indicates whether the nodes is a data, master, or ultrawarm node. NodeType NodeType // The storage size of the node, in GiB. StorageSize *string // Indicates if the node has EBS or instance storage. StorageType *string // If the nodes has EBS storage, indicates if the volume type is GP2 or GP3. Only // applicable for data nodes. StorageVolumeType VolumeType noSmithyDocumentSerde } // Information about a package that is associated with a domain. For more // information, see Custom packages for Amazon OpenSearch Service (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/custom-packages.html) // . type DomainPackageDetails struct { // Name of the domain that the package is associated with. DomainName *string // State of the association. DomainPackageStatus DomainPackageStatus // Additional information if the package is in an error state. Null otherwise. ErrorDetails *ErrorDetails // Timestamp of the most recent update to the package association status. LastUpdated *time.Time // Internal ID of the package. PackageID *string // User-specified name of the package. PackageName *string // The type of package. PackageType PackageType // The current version of the package. PackageVersion *string // The relative path of the package on the OpenSearch Service cluster nodes. This // is synonym_path when the package is for synonym files. ReferencePath *string noSmithyDocumentSerde } // The current status of an OpenSearch Service domain. type DomainStatus struct { // The Amazon Resource Name (ARN) of the domain. For more information, see IAM // identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) // in the AWS Identity and Access Management User Guide. // // This member is required. ARN *string // Container for the cluster configuration of the domain. // // This member is required. ClusterConfig *ClusterConfig // Unique identifier for the domain. // // This member is required. DomainId *string // Name of the domain. Domain names are unique across all domains owned by the // same account within an Amazon Web Services Region. // // This member is required. DomainName *string // Identity and Access Management (IAM) policy document specifying the access // policies for the domain. AccessPolicies *string // Key-value pairs that specify advanced configuration options. AdvancedOptions map[string]string // Settings for fine-grained access control. AdvancedSecurityOptions *AdvancedSecurityOptions // Auto-Tune settings for the domain. AutoTuneOptions *AutoTuneOptionsOutput // Information about a configuration change happening on the domain. ChangeProgressDetails *ChangeProgressDetails // Key-value pairs to configure Amazon Cognito authentication for OpenSearch // Dashboards. CognitoOptions *CognitoOptions // Creation status of an OpenSearch Service domain. True if domain creation is // complete. False if domain creation is still in progress. Created *bool // Deletion status of an OpenSearch Service domain. True if domain deletion is // complete. False if domain deletion is still in progress. Once deletion is // complete, the status of the domain is no longer returned. Deleted *bool // Additional options for the domain endpoint, such as whether to require HTTPS // for all traffic. DomainEndpointOptions *DomainEndpointOptions // Container for EBS-based storage settings for the domain. EBSOptions *EBSOptions // Encryption at rest settings for the domain. EncryptionAtRestOptions *EncryptionAtRestOptions // Domain-specific endpoint used to submit index, search, and data upload requests // to the domain. Endpoint *string // The key-value pair that exists if the OpenSearch Service domain uses VPC // endpoints.. Example key, value : // 'vpc','vpc-endpoint-h2dsd34efgyghrtguk5gt6j2foh4.us-east-1.es.amazonaws.com' . Endpoints map[string]string // Version of OpenSearch or Elasticsearch that the domain is running, in the // format Elasticsearch_X.Y or OpenSearch_X.Y . EngineVersion *string // Log publishing options for the domain. LogPublishingOptions map[string]LogPublishingOption // Whether node-to-node encryption is enabled or disabled. NodeToNodeEncryptionOptions *NodeToNodeEncryptionOptions // Options that specify a custom 10-hour window during which OpenSearch Service // can perform configuration changes on the domain. OffPeakWindowOptions *OffPeakWindowOptions // The status of the domain configuration. True if OpenSearch Service is // processing configuration changes. False if the configuration is active. Processing *bool // The current status of the domain's service software. ServiceSoftwareOptions *ServiceSoftwareOptions // DEPRECATED. Container for parameters required to configure automated snapshots // of domain indexes. SnapshotOptions *SnapshotOptions // Service software update options for the domain. SoftwareUpdateOptions *SoftwareUpdateOptions // The status of a domain version upgrade to a new version of OpenSearch or // Elasticsearch. True if OpenSearch Service is in the process of a version // upgrade. False if the configuration is active. UpgradeProcessing *bool // The VPC configuration for the domain. VPCOptions *VPCDerivedInfo noSmithyDocumentSerde } // Information about the progress of a pre-upgrade dry run analysis. type DryRunProgressStatus struct { // The timestamp when the dry run was initiated. // // This member is required. CreationDate *string // The unique identifier of the dry run. // // This member is required. DryRunId *string // The current status of the dry run. // // This member is required. DryRunStatus *string // The timestamp when the dry run was last updated. // // This member is required. UpdateDate *string // Any validation failures that occurred as a result of the dry run. ValidationFailures []ValidationFailure noSmithyDocumentSerde } // Results of a dry run performed in an update domain request. type DryRunResults struct { // Specifies the way in which OpenSearch Service will apply an update. Possible // values are: // - Blue/Green - The update requires a blue/green deployment. // - DynamicUpdate - No blue/green deployment required // - Undetermined - The domain is in the middle of an update and can't predict // the deployment type. Try again after the update is complete. // - None - The request doesn't include any configuration changes. DeploymentType *string // A message corresponding to the deployment type. Message *string noSmithyDocumentSerde } // The duration of a maintenance schedule. For more information, see Auto-Tune for // Amazon OpenSearch Service (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) // . type Duration struct { // The unit of measurement for the duration of a maintenance schedule. Unit TimeUnit // Integer to specify the value of a maintenance schedule duration. Value int64 noSmithyDocumentSerde } // Container for the parameters required to enable EBS-based storage for an // OpenSearch Service domain. type EBSOptions struct { // Indicates whether EBS volumes are attached to data nodes in an OpenSearch // Service domain. EBSEnabled *bool // Specifies the baseline input/output (I/O) performance of EBS volumes attached // to data nodes. Applicable only for the gp3 and provisioned IOPS EBS volume // types. Iops *int32 // Specifies the throughput (in MiB/s) of the EBS volumes attached to data nodes. // Applicable only for the gp3 volume type. Throughput *int32 // Specifies the size (in GiB) of EBS volumes attached to data nodes. VolumeSize *int32 // Specifies the type of EBS volumes attached to data nodes. VolumeType VolumeType noSmithyDocumentSerde } // The status of the EBS options for the specified OpenSearch Service domain. type EBSOptionsStatus struct { // The configured EBS options for the specified domain. // // This member is required. Options *EBSOptions // The status of the EBS options for the specified domain. // // This member is required. Status *OptionStatus noSmithyDocumentSerde } // Specifies whether the domain should encrypt data at rest, and if so, the Key // Management Service (KMS) key to use. Can be used only to create a new domain, // not update an existing one. type EncryptionAtRestOptions struct { // True to enable encryption at rest. Enabled *bool // The KMS key ID. Takes the form 1a2a3a4-1a2a-3a4a-5a6a-1a2a3a4a5a6a . KmsKeyId *string noSmithyDocumentSerde } // Status of the encryption at rest options for the specified OpenSearch Service // domain. type EncryptionAtRestOptionsStatus struct { // Encryption at rest options for the specified domain. // // This member is required. Options *EncryptionAtRestOptions // The status of the encryption at rest options for the specified domain. // // This member is required. Status *OptionStatus noSmithyDocumentSerde } // Information about the active domain environment. type EnvironmentInfo struct { // A list of AvailabilityZoneInfo for the domain. AvailabilityZoneInformation []AvailabilityZoneInfo noSmithyDocumentSerde } // Additional information if the package is in an error state. Null otherwise. type ErrorDetails struct { // A message describing the error. ErrorMessage *string // The type of error that occurred. ErrorType *string noSmithyDocumentSerde } // A filter used to limit results when describing inbound or outbound // cross-cluster connections. You can specify multiple values per filter. A // cross-cluster connection must match at least one of the specified values for it // to be returned from an operation. type Filter struct { // The name of the filter. Name *string // One or more values for the filter. Values []string noSmithyDocumentSerde } // Describes an inbound cross-cluster connection for Amazon OpenSearch Service. // For more information, see Cross-cluster search for Amazon OpenSearch Service (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/cross-cluster-search.html) // . type InboundConnection struct { // The unique identifier of the connection. ConnectionId *string // The connection mode. ConnectionMode ConnectionMode // The current status of the connection. ConnectionStatus *InboundConnectionStatus // Information about the source (local) domain. LocalDomainInfo *DomainInformationContainer // Information about the destination (remote) domain. RemoteDomainInfo *DomainInformationContainer noSmithyDocumentSerde } // The status of an inbound cross-cluster connection for OpenSearch Service. type InboundConnectionStatus struct { // Information about the connection. Message *string // The status code for the connection. Can be one of the following: // - PENDING_ACCEPTANCE - Inbound connection is not yet accepted by the remote // domain owner. // - APPROVED: Inbound connection is pending acceptance by the remote domain // owner. // - PROVISIONING: Inbound connection is being provisioned. // - ACTIVE: Inbound connection is active and ready to use. // - REJECTING: Inbound connection rejection is in process. // - REJECTED: Inbound connection is rejected. // - DELETING: Inbound connection deletion is in progress. // - DELETED: Inbound connection is deleted and can no longer be used. StatusCode InboundConnectionStatusCode noSmithyDocumentSerde } // Limits on the number of instances that can be created in OpenSearch Service for // a given instance type. type InstanceCountLimits struct { // The minimum allowed number of instances. MaximumInstanceCount int32 // The maximum allowed number of instances. MinimumInstanceCount int32 noSmithyDocumentSerde } // Instance-related attributes that are available for a given instance type. type InstanceLimits struct { // Limits on the number of instances that can be created for a given instance type. InstanceCountLimits *InstanceCountLimits noSmithyDocumentSerde } // Lists all instance types and available features for a given OpenSearch or // Elasticsearch version. type InstanceTypeDetails struct { // Whether fine-grained access control is supported for the instance type. AdvancedSecurityEnabled *bool // Whether logging is supported for the instance type. AppLogsEnabled *bool // The supported Availability Zones for the instance type. AvailabilityZones []string // Whether Amazon Cognito access is supported for the instance type. CognitoEnabled *bool // Whether encryption at rest and node-to-node encryption are supported for the // instance type. EncryptionEnabled *bool // Whether the instance acts as a data node, a dedicated master node, or an // UltraWarm node. InstanceRole []string // The instance type. InstanceType OpenSearchPartitionInstanceType // Whether UltraWarm is supported for the instance type. WarmEnabled *bool noSmithyDocumentSerde } // Limits for a given instance type and for each of its roles. type Limits struct { // List of additional limits that are specific to a given instance type for each // of its instance roles. AdditionalLimits []AdditionalLimit // The limits for a given instance type. InstanceLimits *InstanceLimits // Storage-related attributes that are available for a given instance type. StorageTypes []StorageType noSmithyDocumentSerde } // Specifies whether the Amazon OpenSearch Service domain publishes the OpenSearch // application and slow logs to Amazon CloudWatch. For more information, see // Monitoring OpenSearch logs with Amazon CloudWatch Logs (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/createdomain-configure-slow-logs.html) // . After you enable log publishing, you still have to enable the collection of // slow logs using the OpenSearch REST API. type LogPublishingOption struct { // The Amazon Resource Name (ARN) of the CloudWatch Logs group to publish logs to. CloudWatchLogsLogGroupArn *string // Whether the log should be published. Enabled *bool noSmithyDocumentSerde } // The configured log publishing options for the domain and their current status. type LogPublishingOptionsStatus struct { // The log publishing options configured for the domain. Options map[string]LogPublishingOption // The status of the log publishing options for the domain. Status *OptionStatus noSmithyDocumentSerde } // Credentials for the master user for a domain. type MasterUserOptions struct { // Amazon Resource Name (ARN) for the master user. Only specify if // InternalUserDatabaseEnabled is false . MasterUserARN *string // User name for the master user. Only specify if InternalUserDatabaseEnabled is // true . MasterUserName *string // Password for the master user. Only specify if InternalUserDatabaseEnabled is // true . MasterUserPassword *string noSmithyDocumentSerde } // Enables or disables node-to-node encryption. For more information, see // Node-to-node encryption for Amazon OpenSearch Service (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/ntn.html) // . type NodeToNodeEncryptionOptions struct { // True to enable node-to-node encryption. Enabled *bool noSmithyDocumentSerde } // Status of the node-to-node encryption options for the specified domain. type NodeToNodeEncryptionOptionsStatus struct { // The node-to-node encryption options for the specified domain. // // This member is required. Options *NodeToNodeEncryptionOptions // The status of the node-to-node encryption options for the specified domain. // // This member is required. Status *OptionStatus noSmithyDocumentSerde } // A custom 10-hour, low-traffic window during which OpenSearch Service can // perform mandatory configuration changes on the domain. These actions can include // scheduled service software updates and blue/green Auto-Tune enhancements. // OpenSearch Service will schedule these actions during the window that you // specify. If you don't specify a window start time, it defaults to 10:00 P.M. // local time. For more information, see Defining off-peak maintenance windows for // Amazon OpenSearch Service (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/off-peak.html) // . type OffPeakWindow struct { // A custom start time for the off-peak window, in Coordinated Universal Time // (UTC). The window length will always be 10 hours, so you can't specify an end // time. For example, if you specify 11:00 P.M. UTC as a start time, the end time // will automatically be set to 9:00 A.M. WindowStartTime *WindowStartTime noSmithyDocumentSerde } // Options for a domain's off-peak window (https://docs.aws.amazon.com/opensearch-service/latest/APIReference/API_OffPeakWindow.html) // , during which OpenSearch Service can perform mandatory configuration changes on // the domain. type OffPeakWindowOptions struct { // Whether to enable an off-peak window. This option is only available when // modifying a domain created prior to February 16, 2023, not when creating a new // domain. All domains created after this date have the off-peak window enabled by // default. You can't disable the off-peak window after it's enabled for a domain. Enabled *bool // Off-peak window settings for the domain. OffPeakWindow *OffPeakWindow noSmithyDocumentSerde } // The status of off-peak window (https://docs.aws.amazon.com/opensearch-service/latest/APIReference/API_OffPeakWindow.html) // options for a domain. type OffPeakWindowOptionsStatus struct { // The domain's off-peak window configuration. Options *OffPeakWindowOptions // The current status of off-peak window options. Status *OptionStatus noSmithyDocumentSerde } // Provides the current status of an entity. type OptionStatus struct { // The timestamp when the entity was created. // // This member is required. CreationDate *time.Time // The state of the entity. // // This member is required. State OptionState // The timestamp of the last time the entity was updated. // // This member is required. UpdateDate *time.Time // Indicates whether the entity is being deleted. PendingDeletion *bool // The latest version of the entity. UpdateVersion int32 noSmithyDocumentSerde } // Specifies details about an outbound cross-cluster connection. type OutboundConnection struct { // Name of the connection. ConnectionAlias *string // Unique identifier of the connection. ConnectionId *string // The connection mode. ConnectionMode ConnectionMode // Properties for the outbound connection. ConnectionProperties *ConnectionProperties // Status of the connection. ConnectionStatus *OutboundConnectionStatus // Information about the source (local) domain. LocalDomainInfo *DomainInformationContainer // Information about the destination (remote) domain. RemoteDomainInfo *DomainInformationContainer noSmithyDocumentSerde } // The status of an outbound cross-cluster connection. type OutboundConnectionStatus struct { // Verbose information for the outbound connection. Message *string // The status code for the outbound connection. Can be one of the following: // - VALIDATING - The outbound connection request is being validated. // - VALIDATION_FAILED - Validation failed for the connection request. // - PENDING_ACCEPTANCE: Outbound connection request is validated and is not yet // accepted by the remote domain owner. // - APPROVED - Outbound connection has been approved by the remote domain owner // for getting provisioned. // - PROVISIONING - Outbound connection request is in process. // - ACTIVE - Outbound connection is active and ready to use. // - REJECTING - Outbound connection rejection by remote domain owner is in // progress. // - REJECTED - Outbound connection request is rejected by remote domain owner. // - DELETING - Outbound connection deletion is in progress. // - DELETED - Outbound connection is deleted and can no longer be used. StatusCode OutboundConnectionStatusCode noSmithyDocumentSerde } // Basic information about a package. type PackageDetails struct { // The package version. AvailablePackageVersion *string // The timestamp when the package was created. CreatedAt *time.Time // Additional information if the package is in an error state. Null otherwise. ErrorDetails *ErrorDetails // Date and time when the package was last updated. LastUpdatedAt *time.Time // User-specified description of the package. PackageDescription *string // The unique identifier of the package. PackageID *string // The user-specified name of the package. PackageName *string // The current status of the package. The available options are AVAILABLE , COPYING // , COPY_FAILED , VALIDATNG , VALIDATION_FAILED , DELETING , and DELETE_FAILED . PackageStatus PackageStatus // The type of package. PackageType PackageType noSmithyDocumentSerde } // The Amazon S3 location to import the package from. type PackageSource struct { // The name of the Amazon S3 bucket containing the package. S3BucketName *string // Key (file name) of the package. S3Key *string noSmithyDocumentSerde } // Details about a package version. type PackageVersionHistory struct { // A message associated with the package version when it was uploaded. CommitMessage *string // The date and time when the package was created. CreatedAt *time.Time // The package version. PackageVersion *string noSmithyDocumentSerde } // Contains the specific price and frequency of a recurring charges for an // OpenSearch Reserved Instance, or for a Reserved Instance offering. type RecurringCharge struct { // The monetary amount of the recurring charge. RecurringChargeAmount *float64 // The frequency of the recurring charge. RecurringChargeFrequency *string noSmithyDocumentSerde } // Details of an OpenSearch Reserved Instance. type ReservedInstance struct { // The unique identifier of the billing subscription. BillingSubscriptionId *int64 // The currency code for the offering. CurrencyCode *string // The duration, in seconds, for which the OpenSearch instance is reserved. Duration int32 // The upfront fixed charge you will paid to purchase the specific Reserved // Instance offering. FixedPrice *float64 // The number of OpenSearch instances that have been reserved. InstanceCount int32 // The OpenSearch instance type offered by theReserved Instance offering. InstanceType OpenSearchPartitionInstanceType // The payment option as defined in the Reserved Instance offering. PaymentOption ReservedInstancePaymentOption // The recurring charge to your account, regardless of whether you create any // domains using the Reserved Instance offering. RecurringCharges []RecurringCharge // The customer-specified identifier to track this reservation. ReservationName *string // The unique identifier for the reservation. ReservedInstanceId *string // The unique identifier of the Reserved Instance offering. ReservedInstanceOfferingId *string // The date and time when the reservation was purchased. StartTime *time.Time // The state of the Reserved Instance. State *string // The hourly rate at which you're charged for the domain using this Reserved // Instance. UsagePrice *float64 noSmithyDocumentSerde } // Details of an OpenSearch Reserved Instance offering. type ReservedInstanceOffering struct { // The currency code for the Reserved Instance offering. CurrencyCode *string // The duration, in seconds, for which the offering will reserve the OpenSearch // instance. Duration int32 // The upfront fixed charge you will pay to purchase the specific Reserved // Instance offering. FixedPrice *float64 // The OpenSearch instance type offered by the Reserved Instance offering. InstanceType OpenSearchPartitionInstanceType // Payment option for the Reserved Instance offering PaymentOption ReservedInstancePaymentOption // The recurring charge to your account, regardless of whether you creates any // domains using the offering. RecurringCharges []RecurringCharge // The unique identifier of the Reserved Instance offering. ReservedInstanceOfferingId *string // The hourly rate at which you're charged for the domain using this Reserved // Instance. UsagePrice *float64 noSmithyDocumentSerde } // The SAML identity povider information. type SAMLIdp struct { // The unique entity ID of the application in the SAML identity provider. // // This member is required. EntityId *string // The metadata of the SAML application, in XML format. // // This member is required. MetadataContent *string noSmithyDocumentSerde } // The SAML authentication configuration for an Amazon OpenSearch Service domain. type SAMLOptionsInput struct { // True to enable SAML authentication for a domain. Enabled *bool // The SAML Identity Provider's information. Idp *SAMLIdp // The backend role that the SAML master user is mapped to. MasterBackendRole *string // The SAML master user name, which is stored in the domain's internal user // database. MasterUserName *string // Element of the SAML assertion to use for backend roles. Default is roles . RolesKey *string // The duration, in minutes, after which a user session becomes inactive. // Acceptable values are between 1 and 1440, and the default value is 60. SessionTimeoutMinutes *int32 // Element of the SAML assertion to use for the user name. Default is NameID . SubjectKey *string noSmithyDocumentSerde } // Describes the SAML application configured for the domain. type SAMLOptionsOutput struct { // True if SAML is enabled. Enabled *bool // Describes the SAML identity provider's information. Idp *SAMLIdp // The key used for matching the SAML roles attribute. RolesKey *string // The duration, in minutes, after which a user session becomes inactive. SessionTimeoutMinutes *int32 // The key used for matching the SAML subject attribute. SubjectKey *string noSmithyDocumentSerde } // Information about a scheduled configuration change for an OpenSearch Service // domain. This actions can be a service software update (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/service-software.html) // or a blue/green Auto-Tune enhancement (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html#auto-tune-types) // . type ScheduledAction struct { // The unique identifier of the scheduled action. // // This member is required. Id *string // The time when the change is scheduled to happen. // // This member is required. ScheduledTime *int64 // The severity of the action. // // This member is required. Severity ActionSeverity // The type of action that will be taken on the domain. // // This member is required. Type ActionType // Whether or not the scheduled action is cancellable. Cancellable *bool // A description of the action to be taken. Description *string // Whether the action is required or optional. Mandatory *bool // Whether the action was scheduled manually ( CUSTOMER , or by OpenSearch Service // automatically ( SYSTEM ). ScheduledBy ScheduledBy // The current status of the scheduled action. Status ActionStatus noSmithyDocumentSerde } // Specifies details about a scheduled Auto-Tune action. For more information, see // Auto-Tune for Amazon OpenSearch Service (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) // . type ScheduledAutoTuneDetails struct { // A description of the Auto-Tune action. Action *string // The type of Auto-Tune action. ActionType ScheduledAutoTuneActionType // The date and time when the Auto-Tune action is scheduled for the domain. Date *time.Time // The severity of the Auto-Tune action. Valid values are LOW , MEDIUM , and HIGH . Severity ScheduledAutoTuneSeverityType noSmithyDocumentSerde } // The current status of the service software for an Amazon OpenSearch Service // domain. For more information, see Service software updates in Amazon OpenSearch // Service (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/service-software.html) // . type ServiceSoftwareOptions struct { // The timestamp, in Epoch time, until which you can manually request a service // software update. After this date, we automatically update your service software. AutomatedUpdateDate *time.Time // True if you're able to cancel your service software version update. False if // you can't cancel your service software update. Cancellable *bool // The current service software version present on the domain. CurrentVersion *string // A description of the service software update status. Description *string // The new service software version, if one is available. NewVersion *string // True if a service software is never automatically updated. False if a service // software is automatically updated after the automated update date. OptionalDeployment *bool // True if you're able to update your service software version. False if you can't // update your service software version. UpdateAvailable *bool // The status of your service software update. UpdateStatus DeploymentStatus noSmithyDocumentSerde } // The time, in UTC format, when OpenSearch Service takes a daily automated // snapshot of the specified domain. Default is 0 hours. type SnapshotOptions struct { // The time, in UTC format, when OpenSearch Service takes a daily automated // snapshot of the specified domain. Default is 0 hours. AutomatedSnapshotStartHour *int32 noSmithyDocumentSerde } // Container for information about a daily automated snapshot for an OpenSearch // Service domain. type SnapshotOptionsStatus struct { // The daily snapshot options specified for the domain. // // This member is required. Options *SnapshotOptions // The status of a daily automated snapshot. // // This member is required. Status *OptionStatus noSmithyDocumentSerde } // Options for configuring service software updates for a domain. type SoftwareUpdateOptions struct { // Whether automatic service software updates are enabled for the domain. AutoSoftwareUpdateEnabled *bool noSmithyDocumentSerde } // The status of the service software options for a domain. type SoftwareUpdateOptionsStatus struct { // The service software update options for a domain. Options *SoftwareUpdateOptions // The status of service software update options, including creation date and last // updated date. Status *OptionStatus noSmithyDocumentSerde } // A list of storage types for an Amazon OpenSearch Service domain that are // available for a given intance type. type StorageType struct { // The storage sub-type, such as gp3 or io1 . StorageSubTypeName *string // Limits that are applicable for the given storage type. StorageTypeLimits []StorageTypeLimit // The name of the storage type. StorageTypeName *string noSmithyDocumentSerde } // Limits that are applicable for the given Amazon OpenSearch Service storage type. type StorageTypeLimit struct { // Name of storage limits that are applicable for the given storage type. If // StorageType is ebs , the following options are available: // - MinimumVolumeSize - Minimum volume size that is available for the given // storage type. Can be empty if not applicable. // - MaximumVolumeSize - Maximum volume size that is available for the given // storage type. Can be empty if not applicable. // - MaximumIops - Maximum amount of IOPS that is available for the given the // storage type. Can be empty if not applicable. // - MinimumIops - Minimum amount of IOPS that is available for the given the // storage type. Can be empty if not applicable. // - MaximumThroughput - Maximum amount of throughput that is available for the // given the storage type. Can be empty if not applicable. // - MinimumThroughput - Minimum amount of throughput that is available for the // given the storage type. Can be empty if not applicable. LimitName *string // The limit values. LimitValues []string noSmithyDocumentSerde } // A tag (key-value pair) for an Amazon OpenSearch Service resource. type Tag struct { // The tag key. Tag keys must be unique for the domain to which they are attached. // // This member is required. Key *string // The value assigned to the corresponding tag key. Tag values can be null and // don't have to be unique in a tag set. For example, you can have a key value pair // in a tag set of project : Trinity and cost-center : Trinity // // This member is required. Value *string noSmithyDocumentSerde } // History of the last 10 upgrades and upgrade eligibility checks for an Amazon // OpenSearch Service domain. type UpgradeHistory struct { // UTC timestamp at which the upgrade API call was made, in the format // yyyy-MM-ddTHH:mm:ssZ . StartTimestamp *time.Time // A list of each step performed as part of a specific upgrade or upgrade // eligibility check. StepsList []UpgradeStepItem // A string that describes the upgrade. UpgradeName *string // The current status of the upgrade. The status can take one of the following // values: // - In Progress // - Succeeded // - Succeeded with Issues // - Failed UpgradeStatus UpgradeStatus noSmithyDocumentSerde } // Represents a single step of an upgrade or upgrade eligibility check workflow. type UpgradeStepItem struct { // A list of strings containing detailed information about the errors encountered // in a particular step. Issues []string // The floating point value representing the progress percentage of a particular // step. ProgressPercent *float64 // One of three steps that an upgrade or upgrade eligibility check goes through: // - PreUpgradeCheck // - Snapshot // - Upgrade UpgradeStep UpgradeStep // The current status of the upgrade. The status can take one of the following // values: // - In Progress // - Succeeded // - Succeeded with Issues // - Failed UpgradeStepStatus UpgradeStatus noSmithyDocumentSerde } // A validation failure that occurred as the result of a pre-update validation // check (verbose dry run) on a domain. type ValidationFailure struct { // The error code of the failure. Code *string // A message corresponding to the failure. Message *string noSmithyDocumentSerde } // The status of the the OpenSearch or Elasticsearch version options for the // specified Amazon OpenSearch Service domain. type VersionStatus struct { // The OpenSearch or Elasticsearch version for the specified domain. // // This member is required. Options *string // The status of the version options for the specified domain. // // This member is required. Status *OptionStatus noSmithyDocumentSerde } // Information about the subnets and security groups for an Amazon OpenSearch // Service domain provisioned within a virtual private cloud (VPC). For more // information, see Launching your Amazon OpenSearch Service domains using a VPC (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/vpc.html) // . This information only exists if the domain was created with VPCOptions . type VPCDerivedInfo struct { // The list of Availability Zones associated with the VPC subnets. AvailabilityZones []string // The list of security group IDs associated with the VPC endpoints for the domain. SecurityGroupIds []string // A list of subnet IDs associated with the VPC endpoints for the domain. SubnetIds []string // The ID for your VPC. Amazon VPC generates this value when you create a VPC. VPCId *string noSmithyDocumentSerde } // Status of the VPC options for a specified domain. type VPCDerivedInfoStatus struct { // The VPC options for the specified domain. // // This member is required. Options *VPCDerivedInfo // The status of the VPC options for the specified domain. // // This member is required. Status *OptionStatus noSmithyDocumentSerde } // The connection endpoint for connecting to an Amazon OpenSearch Service domain // through a proxy. type VpcEndpoint struct { // The Amazon Resource Name (ARN) of the domain associated with the endpoint. DomainArn *string // The connection endpoint ID for connecting to the domain. Endpoint *string // The current status of the endpoint. Status VpcEndpointStatus // The unique identifier of the endpoint. VpcEndpointId *string // The creator of the endpoint. VpcEndpointOwner *string // Options to specify the subnets and security groups for an Amazon OpenSearch // Service VPC endpoint. VpcOptions *VPCDerivedInfo noSmithyDocumentSerde } // Error information when attempting to describe an Amazon OpenSearch // Service-managed VPC endpoint. type VpcEndpointError struct { // The code associated with the error. ErrorCode VpcEndpointErrorCode // A message describing the error. ErrorMessage *string // The unique identifier of the endpoint. VpcEndpointId *string noSmithyDocumentSerde } // Summary information for an Amazon OpenSearch Service-managed VPC endpoint. type VpcEndpointSummary struct { // The Amazon Resource Name (ARN) of the domain associated with the endpoint. DomainArn *string // The current status of the endpoint. Status VpcEndpointStatus // The unique identifier of the endpoint. VpcEndpointId *string // The creator of the endpoint. VpcEndpointOwner *string noSmithyDocumentSerde } // Options to specify the subnets and security groups for an Amazon OpenSearch // Service VPC endpoint. For more information, see Launching your Amazon // OpenSearch Service domains using a VPC (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/vpc.html) // . type VPCOptions struct { // The list of security group IDs associated with the VPC endpoints for the // domain. If you do not provide a security group ID, OpenSearch Service uses the // default security group for the VPC. SecurityGroupIds []string // A list of subnet IDs associated with the VPC endpoints for the domain. If your // domain uses multiple Availability Zones, you need to provide two subnet IDs, one // per zone. Otherwise, provide only one. SubnetIds []string noSmithyDocumentSerde } // The desired start time for an off-peak maintenance window (https://docs.aws.amazon.com/opensearch-service/latest/APIReference/API_OffPeakWindow.html) // . type WindowStartTime struct { // The start hour of the window in Coordinated Universal Time (UTC), using 24-hour // time. For example, 17 refers to 5:00 P.M. UTC. // // This member is required. Hours int64 // The start minute of the window, in UTC. // // This member is required. Minutes int64 noSmithyDocumentSerde } // The zone awareness configuration for an Amazon OpenSearch Service domain. type ZoneAwarenessConfig struct { // If you enabled multiple Availability Zones, this value is the number of zones // that you want the domain to use. Valid values are 2 and 3 . If your domain is // provisioned within a VPC, this value be equal to number of subnets. AvailabilityZoneCount *int32 noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
2,060
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless import ( "context" cryptorand "crypto/rand" "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" smithyrand "github.com/aws/smithy-go/rand" smithyhttp "github.com/aws/smithy-go/transport/http" "net" "net/http" "time" ) const ServiceID = "OpenSearchServerless" const ServiceAPIVersion = "2021-11-01" // Client provides the API client to make operations call for OpenSearch Service // Serverless. 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) resolveIdempotencyTokenProvider(&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 // Provides idempotency tokens values that will be automatically populated into // idempotent API operations. IdempotencyTokenProvider IdempotencyTokenProvider // The logger writer interface to write logging messages to. Logger logging.Logger // 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, "opensearchserverless", 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 resolveIdempotencyTokenProvider(o *Options) { if o.IdempotencyTokenProvider != nil { return } o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, 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 } // IdempotencyTokenProvider interface for providing idempotency token type IdempotencyTokenProvider interface { GetIdempotencyToken() (string, error) } 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) }
455
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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 opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns attributes for one or more collections, including the collection // endpoint and the OpenSearch Dashboards endpoint. For more information, see // Creating and managing Amazon OpenSearch Serverless collections (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-manage.html) // . func (c *Client) BatchGetCollection(ctx context.Context, params *BatchGetCollectionInput, optFns ...func(*Options)) (*BatchGetCollectionOutput, error) { if params == nil { params = &BatchGetCollectionInput{} } result, metadata, err := c.invokeOperation(ctx, "BatchGetCollection", params, optFns, c.addOperationBatchGetCollectionMiddlewares) if err != nil { return nil, err } out := result.(*BatchGetCollectionOutput) out.ResultMetadata = metadata return out, nil } type BatchGetCollectionInput struct { // A list of collection IDs. You can't provide names and IDs in the same request. // The ID is part of the collection endpoint. You can also retrieve it using the // ListCollections (https://docs.aws.amazon.com/opensearch-service/latest/ServerlessAPIReference/API_ListCollections.html) // API. Ids []string // A list of collection names. You can't provide names and IDs in the same request. Names []string noSmithyDocumentSerde } type BatchGetCollectionOutput struct { // Details about each collection. CollectionDetails []types.CollectionDetail // Error information for the request. CollectionErrorDetails []types.CollectionErrorDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationBatchGetCollectionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpBatchGetCollection{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpBatchGetCollection{}, 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_opBatchGetCollection(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_opBatchGetCollection(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "BatchGetCollection", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns attributes for one or more VPC endpoints associated with the current // account. For more information, see Access Amazon OpenSearch Serverless using an // interface endpoint (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-vpc.html) // . func (c *Client) BatchGetVpcEndpoint(ctx context.Context, params *BatchGetVpcEndpointInput, optFns ...func(*Options)) (*BatchGetVpcEndpointOutput, error) { if params == nil { params = &BatchGetVpcEndpointInput{} } result, metadata, err := c.invokeOperation(ctx, "BatchGetVpcEndpoint", params, optFns, c.addOperationBatchGetVpcEndpointMiddlewares) if err != nil { return nil, err } out := result.(*BatchGetVpcEndpointOutput) out.ResultMetadata = metadata return out, nil } type BatchGetVpcEndpointInput struct { // A list of VPC endpoint identifiers. // // This member is required. Ids []string noSmithyDocumentSerde } type BatchGetVpcEndpointOutput struct { // Details about the specified VPC endpoint. VpcEndpointDetails []types.VpcEndpointDetail // Error information for a failed request. VpcEndpointErrorDetails []types.VpcEndpointErrorDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationBatchGetVpcEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpBatchGetVpcEndpoint{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpBatchGetVpcEndpoint{}, 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 = addOpBatchGetVpcEndpointValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetVpcEndpoint(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_opBatchGetVpcEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "BatchGetVpcEndpoint", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a data access policy for OpenSearch Serverless. Access policies limit // access to collections and the resources within them, and allow a user to access // that data irrespective of the access mechanism or network source. For more // information, see Data access control for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-data-access.html) // . func (c *Client) CreateAccessPolicy(ctx context.Context, params *CreateAccessPolicyInput, optFns ...func(*Options)) (*CreateAccessPolicyOutput, error) { if params == nil { params = &CreateAccessPolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateAccessPolicy", params, optFns, c.addOperationCreateAccessPolicyMiddlewares) if err != nil { return nil, err } out := result.(*CreateAccessPolicyOutput) out.ResultMetadata = metadata return out, nil } type CreateAccessPolicyInput struct { // The name of the policy. // // This member is required. Name *string // The JSON policy document to use as the content for the policy. // // This member is required. Policy *string // The type of policy. // // This member is required. Type types.AccessPolicyType // Unique, case-sensitive identifier to ensure idempotency of the request. ClientToken *string // A description of the policy. Typically used to store information about the // permissions defined in the policy. Description *string noSmithyDocumentSerde } type CreateAccessPolicyOutput struct { // Details about the created access policy. AccessPolicyDetail *types.AccessPolicyDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateAccessPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateAccessPolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateAccessPolicy{}, 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_opCreateAccessPolicyMiddleware(stack, options); err != nil { return err } if err = addOpCreateAccessPolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAccessPolicy(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_initializeOpCreateAccessPolicy struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateAccessPolicy) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateAccessPolicy) 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.(*CreateAccessPolicyInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateAccessPolicyInput ") } 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_opCreateAccessPolicyMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateAccessPolicy{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateAccessPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "CreateAccessPolicy", } }
183
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new OpenSearch Serverless collection. For more information, see // Creating and managing Amazon OpenSearch Serverless collections (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-manage.html) // . func (c *Client) CreateCollection(ctx context.Context, params *CreateCollectionInput, optFns ...func(*Options)) (*CreateCollectionOutput, error) { if params == nil { params = &CreateCollectionInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateCollection", params, optFns, c.addOperationCreateCollectionMiddlewares) if err != nil { return nil, err } out := result.(*CreateCollectionOutput) out.ResultMetadata = metadata return out, nil } type CreateCollectionInput struct { // Name of the collection. // // This member is required. Name *string // Unique, case-sensitive identifier to ensure idempotency of the request. ClientToken *string // Description of the collection. Description *string // An arbitrary set of tags (key–value pairs) to associate with the OpenSearch // Serverless collection. Tags []types.Tag // The type of collection. Type types.CollectionType noSmithyDocumentSerde } type CreateCollectionOutput struct { // Details about the collection. CreateCollectionDetail *types.CreateCollectionDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateCollectionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateCollection{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateCollection{}, 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_opCreateCollectionMiddleware(stack, options); err != nil { return err } if err = addOpCreateCollectionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCollection(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_initializeOpCreateCollection struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateCollection) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateCollection) 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.(*CreateCollectionInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateCollectionInput ") } 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_opCreateCollectionMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateCollection{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateCollection(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "CreateCollection", } }
177
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Specifies a security configuration for OpenSearch Serverless. For more // information, see SAML authentication for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-saml.html) // . func (c *Client) CreateSecurityConfig(ctx context.Context, params *CreateSecurityConfigInput, optFns ...func(*Options)) (*CreateSecurityConfigOutput, error) { if params == nil { params = &CreateSecurityConfigInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateSecurityConfig", params, optFns, c.addOperationCreateSecurityConfigMiddlewares) if err != nil { return nil, err } out := result.(*CreateSecurityConfigOutput) out.ResultMetadata = metadata return out, nil } type CreateSecurityConfigInput struct { // The name of the security configuration. // // This member is required. Name *string // The type of security configuration. // // This member is required. Type types.SecurityConfigType // Unique, case-sensitive identifier to ensure idempotency of the request. ClientToken *string // A description of the security configuration. Description *string // Describes SAML options in in the form of a key-value map. This field is // required if you specify saml for the type parameter. SamlOptions *types.SamlConfigOptions noSmithyDocumentSerde } type CreateSecurityConfigOutput struct { // Details about the created security configuration. SecurityConfigDetail *types.SecurityConfigDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateSecurityConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateSecurityConfig{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateSecurityConfig{}, 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_opCreateSecurityConfigMiddleware(stack, options); err != nil { return err } if err = addOpCreateSecurityConfigValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSecurityConfig(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_initializeOpCreateSecurityConfig struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateSecurityConfig) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateSecurityConfig) 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.(*CreateSecurityConfigInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateSecurityConfigInput ") } 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_opCreateSecurityConfigMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateSecurityConfig{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateSecurityConfig(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "CreateSecurityConfig", } }
179
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a security policy to be used by one or more OpenSearch Serverless // collections. Security policies provide access to a collection and its OpenSearch // Dashboards endpoint from public networks or specific VPC endpoints. They also // allow you to secure a collection with a KMS encryption key. For more // information, see Network access for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-network.html) // and Encryption at rest for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-encryption.html) // . func (c *Client) CreateSecurityPolicy(ctx context.Context, params *CreateSecurityPolicyInput, optFns ...func(*Options)) (*CreateSecurityPolicyOutput, error) { if params == nil { params = &CreateSecurityPolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateSecurityPolicy", params, optFns, c.addOperationCreateSecurityPolicyMiddlewares) if err != nil { return nil, err } out := result.(*CreateSecurityPolicyOutput) out.ResultMetadata = metadata return out, nil } type CreateSecurityPolicyInput struct { // The name of the policy. // // This member is required. Name *string // The JSON policy document to use as the content for the new policy. // // This member is required. Policy *string // The type of security policy. // // This member is required. Type types.SecurityPolicyType // Unique, case-sensitive identifier to ensure idempotency of the request. ClientToken *string // A description of the policy. Typically used to store information about the // permissions defined in the policy. Description *string noSmithyDocumentSerde } type CreateSecurityPolicyOutput struct { // Details about the created security policy. SecurityPolicyDetail *types.SecurityPolicyDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateSecurityPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateSecurityPolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateSecurityPolicy{}, 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_opCreateSecurityPolicyMiddleware(stack, options); err != nil { return err } if err = addOpCreateSecurityPolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSecurityPolicy(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_initializeOpCreateSecurityPolicy struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateSecurityPolicy) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateSecurityPolicy) 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.(*CreateSecurityPolicyInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateSecurityPolicyInput ") } 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_opCreateSecurityPolicyMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateSecurityPolicy{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateSecurityPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "CreateSecurityPolicy", } }
185
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates an OpenSearch Serverless-managed interface VPC endpoint. For more // information, see Access Amazon OpenSearch Serverless using an interface endpoint (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-vpc.html) // . func (c *Client) CreateVpcEndpoint(ctx context.Context, params *CreateVpcEndpointInput, optFns ...func(*Options)) (*CreateVpcEndpointOutput, error) { if params == nil { params = &CreateVpcEndpointInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateVpcEndpoint", params, optFns, c.addOperationCreateVpcEndpointMiddlewares) if err != nil { return nil, err } out := result.(*CreateVpcEndpointOutput) out.ResultMetadata = metadata return out, nil } type CreateVpcEndpointInput struct { // The name of the interface endpoint. // // This member is required. Name *string // The ID of one or more subnets from which you'll access OpenSearch Serverless. // // This member is required. SubnetIds []string // The ID of the VPC from which you'll access OpenSearch Serverless. // // This member is required. VpcId *string // Unique, case-sensitive identifier to ensure idempotency of the request. ClientToken *string // The unique identifiers of the security groups that define the ports, protocols, // and sources for inbound traffic that you are authorizing into your endpoint. SecurityGroupIds []string noSmithyDocumentSerde } type CreateVpcEndpointOutput struct { // Details about the created interface VPC endpoint. CreateVpcEndpointDetail *types.CreateVpcEndpointDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateVpcEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateVpcEndpoint{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateVpcEndpoint{}, 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_opCreateVpcEndpointMiddleware(stack, options); err != nil { return err } if err = addOpCreateVpcEndpointValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVpcEndpoint(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_initializeOpCreateVpcEndpoint struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateVpcEndpoint) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateVpcEndpoint) 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.(*CreateVpcEndpointInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateVpcEndpointInput ") } 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_opCreateVpcEndpointMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateVpcEndpoint{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateVpcEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "CreateVpcEndpoint", } }
181
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes an OpenSearch Serverless access policy. For more information, see Data // access control for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-data-access.html) // . func (c *Client) DeleteAccessPolicy(ctx context.Context, params *DeleteAccessPolicyInput, optFns ...func(*Options)) (*DeleteAccessPolicyOutput, error) { if params == nil { params = &DeleteAccessPolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteAccessPolicy", params, optFns, c.addOperationDeleteAccessPolicyMiddlewares) if err != nil { return nil, err } out := result.(*DeleteAccessPolicyOutput) out.ResultMetadata = metadata return out, nil } type DeleteAccessPolicyInput struct { // The name of the policy to delete. // // This member is required. Name *string // The type of policy. // // This member is required. Type types.AccessPolicyType // Unique, case-sensitive identifier to ensure idempotency of the request. ClientToken *string noSmithyDocumentSerde } type DeleteAccessPolicyOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteAccessPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteAccessPolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteAccessPolicy{}, 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_opDeleteAccessPolicyMiddleware(stack, options); err != nil { return err } if err = addOpDeleteAccessPolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAccessPolicy(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_initializeOpDeleteAccessPolicy struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpDeleteAccessPolicy) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpDeleteAccessPolicy) 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.(*DeleteAccessPolicyInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteAccessPolicyInput ") } 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_opDeleteAccessPolicyMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteAccessPolicy{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opDeleteAccessPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "DeleteAccessPolicy", } }
168
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes an OpenSearch Serverless collection. For more information, see Creating // and managing Amazon OpenSearch Serverless collections (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-manage.html) // . func (c *Client) DeleteCollection(ctx context.Context, params *DeleteCollectionInput, optFns ...func(*Options)) (*DeleteCollectionOutput, error) { if params == nil { params = &DeleteCollectionInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteCollection", params, optFns, c.addOperationDeleteCollectionMiddlewares) if err != nil { return nil, err } out := result.(*DeleteCollectionOutput) out.ResultMetadata = metadata return out, nil } type DeleteCollectionInput struct { // The unique identifier of the collection. For example, 1iu5usc406kd . The ID is // part of the collection endpoint. You can also retrieve it using the // ListCollections (https://docs.aws.amazon.com/opensearch-service/latest/ServerlessAPIReference/API_ListCollections.html) // API. // // This member is required. Id *string // A unique, case-sensitive identifier to ensure idempotency of the request. ClientToken *string noSmithyDocumentSerde } type DeleteCollectionOutput struct { // Details of the deleted collection. DeleteCollectionDetail *types.DeleteCollectionDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteCollectionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteCollection{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteCollection{}, 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_opDeleteCollectionMiddleware(stack, options); err != nil { return err } if err = addOpDeleteCollectionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCollection(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_initializeOpDeleteCollection struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpDeleteCollection) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpDeleteCollection) 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.(*DeleteCollectionInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteCollectionInput ") } 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_opDeleteCollectionMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteCollection{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opDeleteCollection(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "DeleteCollection", } }
170
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a security configuration for OpenSearch Serverless. For more // information, see SAML authentication for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-saml.html) // . func (c *Client) DeleteSecurityConfig(ctx context.Context, params *DeleteSecurityConfigInput, optFns ...func(*Options)) (*DeleteSecurityConfigOutput, error) { if params == nil { params = &DeleteSecurityConfigInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteSecurityConfig", params, optFns, c.addOperationDeleteSecurityConfigMiddlewares) if err != nil { return nil, err } out := result.(*DeleteSecurityConfigOutput) out.ResultMetadata = metadata return out, nil } type DeleteSecurityConfigInput struct { // The security configuration identifier. For SAML the ID will be // saml/<accountId>/<idpProviderName> . For example, saml/123456789123/OKTADev . // // This member is required. Id *string // Unique, case-sensitive identifier to ensure idempotency of the request. ClientToken *string noSmithyDocumentSerde } type DeleteSecurityConfigOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteSecurityConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteSecurityConfig{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteSecurityConfig{}, 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_opDeleteSecurityConfigMiddleware(stack, options); err != nil { return err } if err = addOpDeleteSecurityConfigValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSecurityConfig(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_initializeOpDeleteSecurityConfig struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpDeleteSecurityConfig) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpDeleteSecurityConfig) 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.(*DeleteSecurityConfigInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteSecurityConfigInput ") } 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_opDeleteSecurityConfigMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteSecurityConfig{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opDeleteSecurityConfig(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "DeleteSecurityConfig", } }
163
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes an OpenSearch Serverless security policy. func (c *Client) DeleteSecurityPolicy(ctx context.Context, params *DeleteSecurityPolicyInput, optFns ...func(*Options)) (*DeleteSecurityPolicyOutput, error) { if params == nil { params = &DeleteSecurityPolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteSecurityPolicy", params, optFns, c.addOperationDeleteSecurityPolicyMiddlewares) if err != nil { return nil, err } out := result.(*DeleteSecurityPolicyOutput) out.ResultMetadata = metadata return out, nil } type DeleteSecurityPolicyInput struct { // The name of the policy to delete. // // This member is required. Name *string // The type of policy. // // This member is required. Type types.SecurityPolicyType // Unique, case-sensitive identifier to ensure idempotency of the request. ClientToken *string noSmithyDocumentSerde } type DeleteSecurityPolicyOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteSecurityPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteSecurityPolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteSecurityPolicy{}, 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_opDeleteSecurityPolicyMiddleware(stack, options); err != nil { return err } if err = addOpDeleteSecurityPolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSecurityPolicy(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_initializeOpDeleteSecurityPolicy struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpDeleteSecurityPolicy) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpDeleteSecurityPolicy) 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.(*DeleteSecurityPolicyInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteSecurityPolicyInput ") } 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_opDeleteSecurityPolicyMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteSecurityPolicy{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opDeleteSecurityPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "DeleteSecurityPolicy", } }
166
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes an OpenSearch Serverless-managed interface endpoint. For more // information, see Access Amazon OpenSearch Serverless using an interface endpoint (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-vpc.html) // . func (c *Client) DeleteVpcEndpoint(ctx context.Context, params *DeleteVpcEndpointInput, optFns ...func(*Options)) (*DeleteVpcEndpointOutput, error) { if params == nil { params = &DeleteVpcEndpointInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteVpcEndpoint", params, optFns, c.addOperationDeleteVpcEndpointMiddlewares) if err != nil { return nil, err } out := result.(*DeleteVpcEndpointOutput) out.ResultMetadata = metadata return out, nil } type DeleteVpcEndpointInput struct { // The VPC endpoint identifier. // // This member is required. Id *string // Unique, case-sensitive identifier to ensure idempotency of the request. ClientToken *string noSmithyDocumentSerde } type DeleteVpcEndpointOutput struct { // Details about the deleted endpoint. DeleteVpcEndpointDetail *types.DeleteVpcEndpointDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteVpcEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteVpcEndpoint{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteVpcEndpoint{}, 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_opDeleteVpcEndpointMiddleware(stack, options); err != nil { return err } if err = addOpDeleteVpcEndpointValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVpcEndpoint(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_initializeOpDeleteVpcEndpoint struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpDeleteVpcEndpoint) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpDeleteVpcEndpoint) 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.(*DeleteVpcEndpointInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteVpcEndpointInput ") } 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_opDeleteVpcEndpointMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteVpcEndpoint{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opDeleteVpcEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "DeleteVpcEndpoint", } }
167
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns an OpenSearch Serverless access policy. For more information, see Data // access control for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-data-access.html) // . func (c *Client) GetAccessPolicy(ctx context.Context, params *GetAccessPolicyInput, optFns ...func(*Options)) (*GetAccessPolicyOutput, error) { if params == nil { params = &GetAccessPolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "GetAccessPolicy", params, optFns, c.addOperationGetAccessPolicyMiddlewares) if err != nil { return nil, err } out := result.(*GetAccessPolicyOutput) out.ResultMetadata = metadata return out, nil } type GetAccessPolicyInput struct { // The name of the access policy. // // This member is required. Name *string // Tye type of policy. Currently the only supported value is data . // // This member is required. Type types.AccessPolicyType noSmithyDocumentSerde } type GetAccessPolicyOutput struct { // Details about the requested access policy. AccessPolicyDetail *types.AccessPolicyDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetAccessPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetAccessPolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetAccessPolicy{}, 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 = addOpGetAccessPolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAccessPolicy(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_opGetAccessPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "GetAccessPolicy", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns account-level settings related to OpenSearch Serverless. func (c *Client) GetAccountSettings(ctx context.Context, params *GetAccountSettingsInput, optFns ...func(*Options)) (*GetAccountSettingsOutput, error) { if params == nil { params = &GetAccountSettingsInput{} } result, metadata, err := c.invokeOperation(ctx, "GetAccountSettings", params, optFns, c.addOperationGetAccountSettingsMiddlewares) if err != nil { return nil, err } out := result.(*GetAccountSettingsOutput) out.ResultMetadata = metadata return out, nil } type GetAccountSettingsInput struct { noSmithyDocumentSerde } type GetAccountSettingsOutput struct { // OpenSearch Serverless-related details for the current account. AccountSettingsDetail *types.AccountSettingsDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetAccountSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetAccountSettings{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetAccountSettings{}, 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_opGetAccountSettings(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_opGetAccountSettings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "GetAccountSettings", } }
116
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns statistical information about your OpenSearch Serverless access // policies, security configurations, and security policies. func (c *Client) GetPoliciesStats(ctx context.Context, params *GetPoliciesStatsInput, optFns ...func(*Options)) (*GetPoliciesStatsOutput, error) { if params == nil { params = &GetPoliciesStatsInput{} } result, metadata, err := c.invokeOperation(ctx, "GetPoliciesStats", params, optFns, c.addOperationGetPoliciesStatsMiddlewares) if err != nil { return nil, err } out := result.(*GetPoliciesStatsOutput) out.ResultMetadata = metadata return out, nil } type GetPoliciesStatsInput struct { noSmithyDocumentSerde } type GetPoliciesStatsOutput struct { // Information about the data access policies in your account. AccessPolicyStats *types.AccessPolicyStats // Information about the security configurations in your account. SecurityConfigStats *types.SecurityConfigStats // Information about the security policies in your account. SecurityPolicyStats *types.SecurityPolicyStats // The total number of OpenSearch Serverless security policies and configurations // in your account. TotalPolicyCount *int64 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetPoliciesStatsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetPoliciesStats{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetPoliciesStats{}, 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_opGetPoliciesStats(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_opGetPoliciesStats(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "GetPoliciesStats", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns information about an OpenSearch Serverless security configuration. For // more information, see SAML authentication for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-saml.html) // . func (c *Client) GetSecurityConfig(ctx context.Context, params *GetSecurityConfigInput, optFns ...func(*Options)) (*GetSecurityConfigOutput, error) { if params == nil { params = &GetSecurityConfigInput{} } result, metadata, err := c.invokeOperation(ctx, "GetSecurityConfig", params, optFns, c.addOperationGetSecurityConfigMiddlewares) if err != nil { return nil, err } out := result.(*GetSecurityConfigOutput) out.ResultMetadata = metadata return out, nil } type GetSecurityConfigInput struct { // The unique identifier of the security configuration. // // This member is required. Id *string noSmithyDocumentSerde } type GetSecurityConfigOutput struct { // Details of the requested security configuration. SecurityConfigDetail *types.SecurityConfigDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetSecurityConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetSecurityConfig{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetSecurityConfig{}, 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 = addOpGetSecurityConfigValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSecurityConfig(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_opGetSecurityConfig(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "GetSecurityConfig", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns information about a configured OpenSearch Serverless security policy. // For more information, see Network access for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-network.html) // and Encryption at rest for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-encryption.html) // . func (c *Client) GetSecurityPolicy(ctx context.Context, params *GetSecurityPolicyInput, optFns ...func(*Options)) (*GetSecurityPolicyOutput, error) { if params == nil { params = &GetSecurityPolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "GetSecurityPolicy", params, optFns, c.addOperationGetSecurityPolicyMiddlewares) if err != nil { return nil, err } out := result.(*GetSecurityPolicyOutput) out.ResultMetadata = metadata return out, nil } type GetSecurityPolicyInput struct { // The name of the security policy. // // This member is required. Name *string // The type of security policy. // // This member is required. Type types.SecurityPolicyType noSmithyDocumentSerde } type GetSecurityPolicyOutput struct { // Details about the requested security policy. SecurityPolicyDetail *types.SecurityPolicyDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetSecurityPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetSecurityPolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetSecurityPolicy{}, 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 = addOpGetSecurityPolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSecurityPolicy(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_opGetSecurityPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "GetSecurityPolicy", } }
133
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns information about a list of OpenSearch Serverless access policies. func (c *Client) ListAccessPolicies(ctx context.Context, params *ListAccessPoliciesInput, optFns ...func(*Options)) (*ListAccessPoliciesOutput, error) { if params == nil { params = &ListAccessPoliciesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListAccessPolicies", params, optFns, c.addOperationListAccessPoliciesMiddlewares) if err != nil { return nil, err } out := result.(*ListAccessPoliciesOutput) out.ResultMetadata = metadata return out, nil } type ListAccessPoliciesInput struct { // The type of access policy. // // This member is required. Type types.AccessPolicyType // An optional parameter that specifies the maximum number of results to return. // You can use nextToken to get the next page of results. The default is 20. MaxResults *int32 // If your initial ListAccessPolicies operation returns a nextToken , you can // include the returned nextToken in subsequent ListAccessPolicies operations, // which returns results in the next page. NextToken *string // Resource filters (can be collections or indexes) that policies can apply to. Resource []string noSmithyDocumentSerde } type ListAccessPoliciesOutput struct { // Details about the requested access policies. AccessPolicySummaries []types.AccessPolicySummary // When nextToken is returned, there are more results available. The value of // nextToken is a unique pagination token for each page. Make the call again using // the returned token to retrieve the next page. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListAccessPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpListAccessPolicies{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListAccessPolicies{}, 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 = addOpListAccessPoliciesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccessPolicies(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 } // ListAccessPoliciesAPIClient is a client that implements the ListAccessPolicies // operation. type ListAccessPoliciesAPIClient interface { ListAccessPolicies(context.Context, *ListAccessPoliciesInput, ...func(*Options)) (*ListAccessPoliciesOutput, error) } var _ ListAccessPoliciesAPIClient = (*Client)(nil) // ListAccessPoliciesPaginatorOptions is the paginator options for // ListAccessPolicies type ListAccessPoliciesPaginatorOptions struct { // 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 } // ListAccessPoliciesPaginator is a paginator for ListAccessPolicies type ListAccessPoliciesPaginator struct { options ListAccessPoliciesPaginatorOptions client ListAccessPoliciesAPIClient params *ListAccessPoliciesInput nextToken *string firstPage bool } // NewListAccessPoliciesPaginator returns a new ListAccessPoliciesPaginator func NewListAccessPoliciesPaginator(client ListAccessPoliciesAPIClient, params *ListAccessPoliciesInput, optFns ...func(*ListAccessPoliciesPaginatorOptions)) *ListAccessPoliciesPaginator { if params == nil { params = &ListAccessPoliciesInput{} } options := ListAccessPoliciesPaginatorOptions{} for _, fn := range optFns { fn(&options) } return &ListAccessPoliciesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListAccessPoliciesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListAccessPolicies page. func (p *ListAccessPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccessPoliciesOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken result, err := p.client.ListAccessPolicies(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_opListAccessPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "ListAccessPolicies", } }
222
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all OpenSearch Serverless collections. For more information, see Creating // and managing Amazon OpenSearch Serverless collections (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-manage.html) // . Make sure to include an empty request body {} if you don't include any // collection filters in the request. func (c *Client) ListCollections(ctx context.Context, params *ListCollectionsInput, optFns ...func(*Options)) (*ListCollectionsOutput, error) { if params == nil { params = &ListCollectionsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListCollections", params, optFns, c.addOperationListCollectionsMiddlewares) if err != nil { return nil, err } out := result.(*ListCollectionsOutput) out.ResultMetadata = metadata return out, nil } type ListCollectionsInput struct { // List of filter names and values that you can use for requests. CollectionFilters *types.CollectionFilters // The maximum number of results to return. Default is 20. You can use nextToken // to get the next page of results. MaxResults *int32 // If your initial ListCollections operation returns a nextToken , you can include // the returned nextToken in subsequent ListCollections operations, which returns // results in the next page. NextToken *string noSmithyDocumentSerde } type ListCollectionsOutput struct { // Details about each collection. CollectionSummaries []types.CollectionSummary // When nextToken is returned, there are more results available. The value of // nextToken is a unique pagination token for each page. Make the call again using // the returned token to retrieve the next page. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListCollectionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpListCollections{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListCollections{}, 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_opListCollections(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 } // ListCollectionsAPIClient is a client that implements the ListCollections // operation. type ListCollectionsAPIClient interface { ListCollections(context.Context, *ListCollectionsInput, ...func(*Options)) (*ListCollectionsOutput, error) } var _ ListCollectionsAPIClient = (*Client)(nil) // ListCollectionsPaginatorOptions is the paginator options for ListCollections type ListCollectionsPaginatorOptions struct { // 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 } // ListCollectionsPaginator is a paginator for ListCollections type ListCollectionsPaginator struct { options ListCollectionsPaginatorOptions client ListCollectionsAPIClient params *ListCollectionsInput nextToken *string firstPage bool } // NewListCollectionsPaginator returns a new ListCollectionsPaginator func NewListCollectionsPaginator(client ListCollectionsAPIClient, params *ListCollectionsInput, optFns ...func(*ListCollectionsPaginatorOptions)) *ListCollectionsPaginator { if params == nil { params = &ListCollectionsInput{} } options := ListCollectionsPaginatorOptions{} for _, fn := range optFns { fn(&options) } return &ListCollectionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListCollectionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListCollections page. func (p *ListCollectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCollectionsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken result, err := p.client.ListCollections(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_opListCollections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "ListCollections", } }
216
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns information about configured OpenSearch Serverless security // configurations. For more information, see SAML authentication for Amazon // OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-saml.html) // . func (c *Client) ListSecurityConfigs(ctx context.Context, params *ListSecurityConfigsInput, optFns ...func(*Options)) (*ListSecurityConfigsOutput, error) { if params == nil { params = &ListSecurityConfigsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListSecurityConfigs", params, optFns, c.addOperationListSecurityConfigsMiddlewares) if err != nil { return nil, err } out := result.(*ListSecurityConfigsOutput) out.ResultMetadata = metadata return out, nil } type ListSecurityConfigsInput struct { // The type of security configuration. // // This member is required. Type types.SecurityConfigType // An optional parameter that specifies the maximum number of results to return. // You can use nextToken to get the next page of results. The default is 20. MaxResults *int32 // If your initial ListSecurityConfigs operation returns a nextToken , you can // include the returned nextToken in subsequent ListSecurityConfigs operations, // which returns results in the next page. NextToken *string noSmithyDocumentSerde } type ListSecurityConfigsOutput struct { // When nextToken is returned, there are more results available. The value of // nextToken is a unique pagination token for each page. Make the call again using // the returned token to retrieve the next page. NextToken *string // Details about the security configurations in your account. SecurityConfigSummaries []types.SecurityConfigSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListSecurityConfigsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpListSecurityConfigs{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListSecurityConfigs{}, 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 = addOpListSecurityConfigsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSecurityConfigs(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 } // ListSecurityConfigsAPIClient is a client that implements the // ListSecurityConfigs operation. type ListSecurityConfigsAPIClient interface { ListSecurityConfigs(context.Context, *ListSecurityConfigsInput, ...func(*Options)) (*ListSecurityConfigsOutput, error) } var _ ListSecurityConfigsAPIClient = (*Client)(nil) // ListSecurityConfigsPaginatorOptions is the paginator options for // ListSecurityConfigs type ListSecurityConfigsPaginatorOptions struct { // 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 } // ListSecurityConfigsPaginator is a paginator for ListSecurityConfigs type ListSecurityConfigsPaginator struct { options ListSecurityConfigsPaginatorOptions client ListSecurityConfigsAPIClient params *ListSecurityConfigsInput nextToken *string firstPage bool } // NewListSecurityConfigsPaginator returns a new ListSecurityConfigsPaginator func NewListSecurityConfigsPaginator(client ListSecurityConfigsAPIClient, params *ListSecurityConfigsInput, optFns ...func(*ListSecurityConfigsPaginatorOptions)) *ListSecurityConfigsPaginator { if params == nil { params = &ListSecurityConfigsInput{} } options := ListSecurityConfigsPaginatorOptions{} for _, fn := range optFns { fn(&options) } return &ListSecurityConfigsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListSecurityConfigsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListSecurityConfigs page. func (p *ListSecurityConfigsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecurityConfigsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken result, err := p.client.ListSecurityConfigs(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_opListSecurityConfigs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "ListSecurityConfigs", } }
222
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns information about configured OpenSearch Serverless security policies. func (c *Client) ListSecurityPolicies(ctx context.Context, params *ListSecurityPoliciesInput, optFns ...func(*Options)) (*ListSecurityPoliciesOutput, error) { if params == nil { params = &ListSecurityPoliciesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListSecurityPolicies", params, optFns, c.addOperationListSecurityPoliciesMiddlewares) if err != nil { return nil, err } out := result.(*ListSecurityPoliciesOutput) out.ResultMetadata = metadata return out, nil } type ListSecurityPoliciesInput struct { // The type of policy. // // This member is required. Type types.SecurityPolicyType // An optional parameter that specifies the maximum number of results to return. // You can use nextToken to get the next page of results. The default is 20. MaxResults *int32 // If your initial ListSecurityPolicies operation returns a nextToken , you can // include the returned nextToken in subsequent ListSecurityPolicies operations, // which returns results in the next page. NextToken *string // Resource filters (can be collection or indexes) that policies can apply to. Resource []string noSmithyDocumentSerde } type ListSecurityPoliciesOutput struct { // When nextToken is returned, there are more results available. The value of // nextToken is a unique pagination token for each page. Make the call again using // the returned token to retrieve the next page. NextToken *string // Details about the security policies in your account. SecurityPolicySummaries []types.SecurityPolicySummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListSecurityPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpListSecurityPolicies{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListSecurityPolicies{}, 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 = addOpListSecurityPoliciesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSecurityPolicies(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 } // ListSecurityPoliciesAPIClient is a client that implements the // ListSecurityPolicies operation. type ListSecurityPoliciesAPIClient interface { ListSecurityPolicies(context.Context, *ListSecurityPoliciesInput, ...func(*Options)) (*ListSecurityPoliciesOutput, error) } var _ ListSecurityPoliciesAPIClient = (*Client)(nil) // ListSecurityPoliciesPaginatorOptions is the paginator options for // ListSecurityPolicies type ListSecurityPoliciesPaginatorOptions struct { // 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 } // ListSecurityPoliciesPaginator is a paginator for ListSecurityPolicies type ListSecurityPoliciesPaginator struct { options ListSecurityPoliciesPaginatorOptions client ListSecurityPoliciesAPIClient params *ListSecurityPoliciesInput nextToken *string firstPage bool } // NewListSecurityPoliciesPaginator returns a new ListSecurityPoliciesPaginator func NewListSecurityPoliciesPaginator(client ListSecurityPoliciesAPIClient, params *ListSecurityPoliciesInput, optFns ...func(*ListSecurityPoliciesPaginatorOptions)) *ListSecurityPoliciesPaginator { if params == nil { params = &ListSecurityPoliciesInput{} } options := ListSecurityPoliciesPaginatorOptions{} for _, fn := range optFns { fn(&options) } return &ListSecurityPoliciesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListSecurityPoliciesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListSecurityPolicies page. func (p *ListSecurityPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecurityPoliciesOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken result, err := p.client.ListSecurityPolicies(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_opListSecurityPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "ListSecurityPolicies", } }
222
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the tags for an OpenSearch Serverless resource. For more information, // see Tagging Amazon OpenSearch Serverless collections (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/tag-collection.html) // . 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 { // The Amazon Resource Name (ARN) of the resource. The resource must be active // (not in the DELETING state), and must be owned by the account ID included in // the request. // // This member is required. ResourceArn *string noSmithyDocumentSerde } type ListTagsForResourceOutput struct { // The tags associated with the resource. Tags []types.Tag // 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(&awsAwsjson10_serializeOpListTagsForResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_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: "aoss", OperationName: "ListTagsForResource", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the OpenSearch Serverless-managed interface VPC endpoints associated // with the current account. For more information, see Access Amazon OpenSearch // Serverless using an interface endpoint (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-vpc.html) // . func (c *Client) ListVpcEndpoints(ctx context.Context, params *ListVpcEndpointsInput, optFns ...func(*Options)) (*ListVpcEndpointsOutput, error) { if params == nil { params = &ListVpcEndpointsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListVpcEndpoints", params, optFns, c.addOperationListVpcEndpointsMiddlewares) if err != nil { return nil, err } out := result.(*ListVpcEndpointsOutput) out.ResultMetadata = metadata return out, nil } type ListVpcEndpointsInput struct { // An optional parameter that specifies the maximum number of results to return. // You can use nextToken to get the next page of results. The default is 20. MaxResults *int32 // If your initial ListVpcEndpoints operation returns a nextToken , you can include // the returned nextToken in subsequent ListVpcEndpoints operations, which returns // results in the next page. NextToken *string // Filter the results according to the current status of the VPC endpoint. // Possible statuses are CREATING , DELETING , UPDATING , ACTIVE , and FAILED . VpcEndpointFilters *types.VpcEndpointFilters noSmithyDocumentSerde } type ListVpcEndpointsOutput struct { // When nextToken is returned, there are more results available. The value of // nextToken is a unique pagination token for each page. Make the call again using // the returned token to retrieve the next page. NextToken *string // Details about each VPC endpoint, including the name and current status. VpcEndpointSummaries []types.VpcEndpointSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListVpcEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpListVpcEndpoints{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListVpcEndpoints{}, 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_opListVpcEndpoints(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 } // ListVpcEndpointsAPIClient is a client that implements the ListVpcEndpoints // operation. type ListVpcEndpointsAPIClient interface { ListVpcEndpoints(context.Context, *ListVpcEndpointsInput, ...func(*Options)) (*ListVpcEndpointsOutput, error) } var _ ListVpcEndpointsAPIClient = (*Client)(nil) // ListVpcEndpointsPaginatorOptions is the paginator options for ListVpcEndpoints type ListVpcEndpointsPaginatorOptions struct { // 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 } // ListVpcEndpointsPaginator is a paginator for ListVpcEndpoints type ListVpcEndpointsPaginator struct { options ListVpcEndpointsPaginatorOptions client ListVpcEndpointsAPIClient params *ListVpcEndpointsInput nextToken *string firstPage bool } // NewListVpcEndpointsPaginator returns a new ListVpcEndpointsPaginator func NewListVpcEndpointsPaginator(client ListVpcEndpointsAPIClient, params *ListVpcEndpointsInput, optFns ...func(*ListVpcEndpointsPaginatorOptions)) *ListVpcEndpointsPaginator { if params == nil { params = &ListVpcEndpointsInput{} } options := ListVpcEndpointsPaginatorOptions{} for _, fn := range optFns { fn(&options) } return &ListVpcEndpointsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListVpcEndpointsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListVpcEndpoints page. func (p *ListVpcEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVpcEndpointsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken result, err := p.client.ListVpcEndpoints(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_opListVpcEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "ListVpcEndpoints", } }
217
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Associates tags with an OpenSearch Serverless resource. For more information, // see Tagging Amazon OpenSearch Serverless collections (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/tag-collection.html) // . 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 { // The Amazon Resource Name (ARN) of the resource. The resource must be active // (not in the DELETING state), and must be owned by the account ID included in // the request. // // This member is required. ResourceArn *string // A list of tags (key-value pairs) to add to the resource. All tag keys in the // request must be unique. // // This member is required. Tags []types.Tag 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(&awsAwsjson10_serializeOpTagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_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: "aoss", OperationName: "TagResource", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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" ) // Removes a tag or set of tags from an OpenSearch Serverless resource. For more // information, see Tagging Amazon OpenSearch Serverless collections (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/tag-collection.html) // . 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 { // The Amazon Resource Name (ARN) of the resource to remove tags from. The // resource must be active (not in the DELETING state), and must be owned by the // account ID included in the request. // // This member is required. ResourceArn *string // The tag or set of tags to remove from the resource. All tag keys in the request // must be unique. // // 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(&awsAwsjson10_serializeOpUntagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_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: "aoss", OperationName: "UntagResource", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates an OpenSearch Serverless access policy. For more information, see Data // access control for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-data-access.html) // . func (c *Client) UpdateAccessPolicy(ctx context.Context, params *UpdateAccessPolicyInput, optFns ...func(*Options)) (*UpdateAccessPolicyOutput, error) { if params == nil { params = &UpdateAccessPolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateAccessPolicy", params, optFns, c.addOperationUpdateAccessPolicyMiddlewares) if err != nil { return nil, err } out := result.(*UpdateAccessPolicyOutput) out.ResultMetadata = metadata return out, nil } type UpdateAccessPolicyInput struct { // The name of the policy. // // This member is required. Name *string // The version of the policy being updated. // // This member is required. PolicyVersion *string // The type of policy. // // This member is required. Type types.AccessPolicyType // Unique, case-sensitive identifier to ensure idempotency of the request. ClientToken *string // A description of the policy. Typically used to store information about the // permissions defined in the policy. Description *string // The JSON policy document to use as the content for the policy. Policy *string noSmithyDocumentSerde } type UpdateAccessPolicyOutput struct { // Details about the updated access policy. AccessPolicyDetail *types.AccessPolicyDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateAccessPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateAccessPolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateAccessPolicy{}, 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_opUpdateAccessPolicyMiddleware(stack, options); err != nil { return err } if err = addOpUpdateAccessPolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAccessPolicy(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_initializeOpUpdateAccessPolicy struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpUpdateAccessPolicy) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpUpdateAccessPolicy) 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.(*UpdateAccessPolicyInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateAccessPolicyInput ") } 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_opUpdateAccessPolicyMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateAccessPolicy{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opUpdateAccessPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "UpdateAccessPolicy", } }
184
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Update the OpenSearch Serverless settings for the current Amazon Web Services // account. For more information, see Managing capacity limits for Amazon // OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-scaling.html) // . func (c *Client) UpdateAccountSettings(ctx context.Context, params *UpdateAccountSettingsInput, optFns ...func(*Options)) (*UpdateAccountSettingsOutput, error) { if params == nil { params = &UpdateAccountSettingsInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateAccountSettings", params, optFns, c.addOperationUpdateAccountSettingsMiddlewares) if err != nil { return nil, err } out := result.(*UpdateAccountSettingsOutput) out.ResultMetadata = metadata return out, nil } type UpdateAccountSettingsInput struct { // The maximum capacity limits for all OpenSearch Serverless collections, in // OpenSearch Compute Units (OCUs). These limits are used to scale your collections // based on the current workload. For more information, see Managing capacity // limits for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-scaling.html) // . CapacityLimits *types.CapacityLimits noSmithyDocumentSerde } type UpdateAccountSettingsOutput struct { // OpenSearch Serverless-related settings for the current Amazon Web Services // account. AccountSettingsDetail *types.AccountSettingsDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateAccountSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateAccountSettings{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateAccountSettings{}, 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_opUpdateAccountSettings(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_opUpdateAccountSettings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "UpdateAccountSettings", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates an OpenSearch Serverless collection. func (c *Client) UpdateCollection(ctx context.Context, params *UpdateCollectionInput, optFns ...func(*Options)) (*UpdateCollectionOutput, error) { if params == nil { params = &UpdateCollectionInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateCollection", params, optFns, c.addOperationUpdateCollectionMiddlewares) if err != nil { return nil, err } out := result.(*UpdateCollectionOutput) out.ResultMetadata = metadata return out, nil } type UpdateCollectionInput struct { // The unique identifier of the collection. // // This member is required. Id *string // Unique, case-sensitive identifier to ensure idempotency of the request. ClientToken *string // A description of the collection. Description *string noSmithyDocumentSerde } type UpdateCollectionOutput struct { // Details about the updated collection. UpdateCollectionDetail *types.UpdateCollectionDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateCollectionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateCollection{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateCollection{}, 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_opUpdateCollectionMiddleware(stack, options); err != nil { return err } if err = addOpUpdateCollectionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCollection(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_initializeOpUpdateCollection struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpUpdateCollection) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpUpdateCollection) 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.(*UpdateCollectionInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateCollectionInput ") } 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_opUpdateCollectionMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateCollection{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opUpdateCollection(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "UpdateCollection", } }
168
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates a security configuration for OpenSearch Serverless. For more // information, see SAML authentication for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-saml.html) // . func (c *Client) UpdateSecurityConfig(ctx context.Context, params *UpdateSecurityConfigInput, optFns ...func(*Options)) (*UpdateSecurityConfigOutput, error) { if params == nil { params = &UpdateSecurityConfigInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateSecurityConfig", params, optFns, c.addOperationUpdateSecurityConfigMiddlewares) if err != nil { return nil, err } out := result.(*UpdateSecurityConfigOutput) out.ResultMetadata = metadata return out, nil } type UpdateSecurityConfigInput struct { // The version of the security configuration to be updated. You can find the most // recent version of a security configuration using the GetSecurityPolicy command. // // This member is required. ConfigVersion *string // The security configuration identifier. For SAML the ID will be // saml/<accountId>/<idpProviderName> . For example, saml/123456789123/OKTADev . // // This member is required. Id *string // Unique, case-sensitive identifier to ensure idempotency of the request. ClientToken *string // A description of the security configuration. Description *string // SAML options in in the form of a key-value map. SamlOptions *types.SamlConfigOptions noSmithyDocumentSerde } type UpdateSecurityConfigOutput struct { // Details about the updated security configuration. SecurityConfigDetail *types.SecurityConfigDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateSecurityConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateSecurityConfig{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateSecurityConfig{}, 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_opUpdateSecurityConfigMiddleware(stack, options); err != nil { return err } if err = addOpUpdateSecurityConfigValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSecurityConfig(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_initializeOpUpdateSecurityConfig struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpUpdateSecurityConfig) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpUpdateSecurityConfig) 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.(*UpdateSecurityConfigInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateSecurityConfigInput ") } 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_opUpdateSecurityConfigMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateSecurityConfig{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opUpdateSecurityConfig(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "UpdateSecurityConfig", } }
180
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates an OpenSearch Serverless security policy. For more information, see // Network access for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-network.html) // and Encryption at rest for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-encryption.html) // . func (c *Client) UpdateSecurityPolicy(ctx context.Context, params *UpdateSecurityPolicyInput, optFns ...func(*Options)) (*UpdateSecurityPolicyOutput, error) { if params == nil { params = &UpdateSecurityPolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateSecurityPolicy", params, optFns, c.addOperationUpdateSecurityPolicyMiddlewares) if err != nil { return nil, err } out := result.(*UpdateSecurityPolicyOutput) out.ResultMetadata = metadata return out, nil } type UpdateSecurityPolicyInput struct { // The name of the policy. // // This member is required. Name *string // The version of the policy being updated. // // This member is required. PolicyVersion *string // The type of access policy. // // This member is required. Type types.SecurityPolicyType // Unique, case-sensitive identifier to ensure idempotency of the request. ClientToken *string // A description of the policy. Typically used to store information about the // permissions defined in the policy. Description *string // The JSON policy document to use as the content for the new policy. Policy *string noSmithyDocumentSerde } type UpdateSecurityPolicyOutput struct { // Details about the updated security policy. SecurityPolicyDetail *types.SecurityPolicyDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateSecurityPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateSecurityPolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateSecurityPolicy{}, 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_opUpdateSecurityPolicyMiddleware(stack, options); err != nil { return err } if err = addOpUpdateSecurityPolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSecurityPolicy(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_initializeOpUpdateSecurityPolicy struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpUpdateSecurityPolicy) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpUpdateSecurityPolicy) 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.(*UpdateSecurityPolicyInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateSecurityPolicyInput ") } 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_opUpdateSecurityPolicyMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateSecurityPolicy{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opUpdateSecurityPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "UpdateSecurityPolicy", } }
185
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates an OpenSearch Serverless-managed interface endpoint. For more // information, see Access Amazon OpenSearch Serverless using an interface endpoint (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-vpc.html) // . func (c *Client) UpdateVpcEndpoint(ctx context.Context, params *UpdateVpcEndpointInput, optFns ...func(*Options)) (*UpdateVpcEndpointOutput, error) { if params == nil { params = &UpdateVpcEndpointInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateVpcEndpoint", params, optFns, c.addOperationUpdateVpcEndpointMiddlewares) if err != nil { return nil, err } out := result.(*UpdateVpcEndpointOutput) out.ResultMetadata = metadata return out, nil } type UpdateVpcEndpointInput struct { // The unique identifier of the interface endpoint to update. // // This member is required. Id *string // The unique identifiers of the security groups to add to the endpoint. Security // groups define the ports, protocols, and sources for inbound traffic that you are // authorizing into your endpoint. AddSecurityGroupIds []string // The ID of one or more subnets to add to the endpoint. AddSubnetIds []string // Unique, case-sensitive identifier to ensure idempotency of the request. ClientToken *string // The unique identifiers of the security groups to remove from the endpoint. RemoveSecurityGroupIds []string // The unique identifiers of the subnets to remove from the endpoint. RemoveSubnetIds []string noSmithyDocumentSerde } type UpdateVpcEndpointOutput struct { // Details about the updated VPC endpoint. UpdateVpcEndpointDetail *types.UpdateVpcEndpointDetail // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateVpcEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateVpcEndpoint{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateVpcEndpoint{}, 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_opUpdateVpcEndpointMiddleware(stack, options); err != nil { return err } if err = addOpUpdateVpcEndpointValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateVpcEndpoint(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_initializeOpUpdateVpcEndpoint struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpUpdateVpcEndpoint) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpUpdateVpcEndpoint) 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.(*UpdateVpcEndpointInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateVpcEndpointInput ") } 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_opUpdateVpcEndpointMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateVpcEndpoint{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opUpdateVpcEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aoss", OperationName: "UpdateVpcEndpoint", } }
181
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/opensearchserverless/document" internaldocument "github.com/aws/aws-sdk-go-v2/service/opensearchserverless/internal/document" "github.com/aws/aws-sdk-go-v2/service/opensearchserverless/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" "strings" ) type awsAwsjson10_deserializeOpBatchGetCollection struct { } func (*awsAwsjson10_deserializeOpBatchGetCollection) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpBatchGetCollection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorBatchGetCollection(response, &metadata) } output := &BatchGetCollectionOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentBatchGetCollectionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorBatchGetCollection(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpBatchGetVpcEndpoint struct { } func (*awsAwsjson10_deserializeOpBatchGetVpcEndpoint) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpBatchGetVpcEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorBatchGetVpcEndpoint(response, &metadata) } output := &BatchGetVpcEndpointOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentBatchGetVpcEndpointOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorBatchGetVpcEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpCreateAccessPolicy struct { } func (*awsAwsjson10_deserializeOpCreateAccessPolicy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpCreateAccessPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorCreateAccessPolicy(response, &metadata) } output := &CreateAccessPolicyOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentCreateAccessPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorCreateAccessPolicy(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpCreateCollection struct { } func (*awsAwsjson10_deserializeOpCreateCollection) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpCreateCollection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorCreateCollection(response, &metadata) } output := &CreateCollectionOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentCreateCollectionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorCreateCollection(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("OcuLimitExceededException", errorCode): return awsAwsjson10_deserializeErrorOcuLimitExceededException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpCreateSecurityConfig struct { } func (*awsAwsjson10_deserializeOpCreateSecurityConfig) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpCreateSecurityConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorCreateSecurityConfig(response, &metadata) } output := &CreateSecurityConfigOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentCreateSecurityConfigOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorCreateSecurityConfig(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpCreateSecurityPolicy struct { } func (*awsAwsjson10_deserializeOpCreateSecurityPolicy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpCreateSecurityPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorCreateSecurityPolicy(response, &metadata) } output := &CreateSecurityPolicyOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentCreateSecurityPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorCreateSecurityPolicy(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpCreateVpcEndpoint struct { } func (*awsAwsjson10_deserializeOpCreateVpcEndpoint) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpCreateVpcEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorCreateVpcEndpoint(response, &metadata) } output := &CreateVpcEndpointOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentCreateVpcEndpointOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorCreateVpcEndpoint(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpDeleteAccessPolicy struct { } func (*awsAwsjson10_deserializeOpDeleteAccessPolicy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpDeleteAccessPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorDeleteAccessPolicy(response, &metadata) } output := &DeleteAccessPolicyOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentDeleteAccessPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorDeleteAccessPolicy(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpDeleteCollection struct { } func (*awsAwsjson10_deserializeOpDeleteCollection) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpDeleteCollection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorDeleteCollection(response, &metadata) } output := &DeleteCollectionOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentDeleteCollectionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorDeleteCollection(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpDeleteSecurityConfig struct { } func (*awsAwsjson10_deserializeOpDeleteSecurityConfig) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpDeleteSecurityConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorDeleteSecurityConfig(response, &metadata) } output := &DeleteSecurityConfigOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentDeleteSecurityConfigOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorDeleteSecurityConfig(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpDeleteSecurityPolicy struct { } func (*awsAwsjson10_deserializeOpDeleteSecurityPolicy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpDeleteSecurityPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorDeleteSecurityPolicy(response, &metadata) } output := &DeleteSecurityPolicyOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentDeleteSecurityPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorDeleteSecurityPolicy(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpDeleteVpcEndpoint struct { } func (*awsAwsjson10_deserializeOpDeleteVpcEndpoint) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpDeleteVpcEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorDeleteVpcEndpoint(response, &metadata) } output := &DeleteVpcEndpointOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentDeleteVpcEndpointOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorDeleteVpcEndpoint(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpGetAccessPolicy struct { } func (*awsAwsjson10_deserializeOpGetAccessPolicy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpGetAccessPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorGetAccessPolicy(response, &metadata) } output := &GetAccessPolicyOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentGetAccessPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorGetAccessPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpGetAccountSettings struct { } func (*awsAwsjson10_deserializeOpGetAccountSettings) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpGetAccountSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorGetAccountSettings(response, &metadata) } output := &GetAccountSettingsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentGetAccountSettingsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorGetAccountSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpGetPoliciesStats struct { } func (*awsAwsjson10_deserializeOpGetPoliciesStats) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpGetPoliciesStats) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorGetPoliciesStats(response, &metadata) } output := &GetPoliciesStatsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentGetPoliciesStatsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorGetPoliciesStats(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpGetSecurityConfig struct { } func (*awsAwsjson10_deserializeOpGetSecurityConfig) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpGetSecurityConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorGetSecurityConfig(response, &metadata) } output := &GetSecurityConfigOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentGetSecurityConfigOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorGetSecurityConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpGetSecurityPolicy struct { } func (*awsAwsjson10_deserializeOpGetSecurityPolicy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpGetSecurityPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorGetSecurityPolicy(response, &metadata) } output := &GetSecurityPolicyOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentGetSecurityPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorGetSecurityPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpListAccessPolicies struct { } func (*awsAwsjson10_deserializeOpListAccessPolicies) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpListAccessPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorListAccessPolicies(response, &metadata) } output := &ListAccessPoliciesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentListAccessPoliciesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorListAccessPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpListCollections struct { } func (*awsAwsjson10_deserializeOpListCollections) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpListCollections) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorListCollections(response, &metadata) } output := &ListCollectionsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentListCollectionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorListCollections(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpListSecurityConfigs struct { } func (*awsAwsjson10_deserializeOpListSecurityConfigs) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpListSecurityConfigs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorListSecurityConfigs(response, &metadata) } output := &ListSecurityConfigsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentListSecurityConfigsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorListSecurityConfigs(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpListSecurityPolicies struct { } func (*awsAwsjson10_deserializeOpListSecurityPolicies) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpListSecurityPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorListSecurityPolicies(response, &metadata) } output := &ListSecurityPoliciesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentListSecurityPoliciesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorListSecurityPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpListTagsForResource struct { } func (*awsAwsjson10_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_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, awsAwsjson10_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 = awsAwsjson10_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpListVpcEndpoints struct { } func (*awsAwsjson10_deserializeOpListVpcEndpoints) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpListVpcEndpoints) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorListVpcEndpoints(response, &metadata) } output := &ListVpcEndpointsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentListVpcEndpointsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorListVpcEndpoints(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpTagResource struct { } func (*awsAwsjson10_deserializeOpTagResource) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_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, awsAwsjson10_deserializeOpErrorTagResource(response, &metadata) } output := &TagResourceOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentTagResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_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("ConflictException", errorCode): return awsAwsjson10_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpUntagResource struct { } func (*awsAwsjson10_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_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, awsAwsjson10_deserializeOpErrorUntagResource(response, &metadata) } output := &UntagResourceOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentUntagResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_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("ConflictException", errorCode): return awsAwsjson10_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpUpdateAccessPolicy struct { } func (*awsAwsjson10_deserializeOpUpdateAccessPolicy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpUpdateAccessPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorUpdateAccessPolicy(response, &metadata) } output := &UpdateAccessPolicyOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentUpdateAccessPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorUpdateAccessPolicy(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpUpdateAccountSettings struct { } func (*awsAwsjson10_deserializeOpUpdateAccountSettings) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpUpdateAccountSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorUpdateAccountSettings(response, &metadata) } output := &UpdateAccountSettingsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentUpdateAccountSettingsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorUpdateAccountSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpUpdateCollection struct { } func (*awsAwsjson10_deserializeOpUpdateCollection) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpUpdateCollection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorUpdateCollection(response, &metadata) } output := &UpdateCollectionOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentUpdateCollectionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorUpdateCollection(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpUpdateSecurityConfig struct { } func (*awsAwsjson10_deserializeOpUpdateSecurityConfig) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpUpdateSecurityConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorUpdateSecurityConfig(response, &metadata) } output := &UpdateSecurityConfigOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentUpdateSecurityConfigOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorUpdateSecurityConfig(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpUpdateSecurityPolicy struct { } func (*awsAwsjson10_deserializeOpUpdateSecurityPolicy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpUpdateSecurityPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorUpdateSecurityPolicy(response, &metadata) } output := &UpdateSecurityPolicyOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentUpdateSecurityPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorUpdateSecurityPolicy(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 awsAwsjson10_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpUpdateVpcEndpoint struct { } func (*awsAwsjson10_deserializeOpUpdateVpcEndpoint) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpUpdateVpcEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorUpdateVpcEndpoint(response, &metadata) } output := &UpdateVpcEndpointOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentUpdateVpcEndpointOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorUpdateVpcEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ConflictException", errorCode): return awsAwsjson10_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsAwsjson10_deserializeErrorConflictException(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.ConflictException{} err := awsAwsjson10_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 awsAwsjson10_deserializeErrorInternalServerException(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.InternalServerException{} err := awsAwsjson10_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) return output } func awsAwsjson10_deserializeErrorOcuLimitExceededException(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.OcuLimitExceededException{} err := awsAwsjson10_deserializeDocumentOcuLimitExceededException(&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 awsAwsjson10_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 := awsAwsjson10_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 awsAwsjson10_deserializeErrorServiceQuotaExceededException(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.ServiceQuotaExceededException{} err := awsAwsjson10_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 awsAwsjson10_deserializeErrorValidationException(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.ValidationException{} err := awsAwsjson10_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 awsAwsjson10_deserializeDocumentAccessPolicyDetail(v **types.AccessPolicyDetail, 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.AccessPolicyDetail if *v == nil { sv = &types.AccessPolicyDetail{} } else { sv = *v } for key, value := range shape { switch key { case "createdDate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.CreatedDate = ptr.Int64(i64) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "lastModifiedDate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.LastModifiedDate = ptr.Int64(i64) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "policy": if err := awsAwsjson10_deserializeDocumentDocument(&sv.Policy, value); err != nil { return err } case "policyVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyVersion to be of type string, got %T instead", value) } sv.PolicyVersion = ptr.String(jtv) } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccessPolicyType to be of type string, got %T instead", value) } sv.Type = types.AccessPolicyType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentAccessPolicyStats(v **types.AccessPolicyStats, 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.AccessPolicyStats if *v == nil { sv = &types.AccessPolicyStats{} } else { sv = *v } for key, value := range shape { switch key { case "DataPolicyCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DataPolicyCount = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentAccessPolicySummaries(v *[]types.AccessPolicySummary, 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.AccessPolicySummary if *v == nil { cv = []types.AccessPolicySummary{} } else { cv = *v } for _, value := range shape { var col types.AccessPolicySummary destAddr := &col if err := awsAwsjson10_deserializeDocumentAccessPolicySummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson10_deserializeDocumentAccessPolicySummary(v **types.AccessPolicySummary, 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.AccessPolicySummary if *v == nil { sv = &types.AccessPolicySummary{} } else { sv = *v } for key, value := range shape { switch key { case "createdDate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.CreatedDate = ptr.Int64(i64) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "lastModifiedDate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.LastModifiedDate = ptr.Int64(i64) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "policyVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyVersion to be of type string, got %T instead", value) } sv.PolicyVersion = ptr.String(jtv) } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccessPolicyType to be of type string, got %T instead", value) } sv.Type = types.AccessPolicyType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentAccountSettingsDetail(v **types.AccountSettingsDetail, 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.AccountSettingsDetail if *v == nil { sv = &types.AccountSettingsDetail{} } else { sv = *v } for key, value := range shape { switch key { case "capacityLimits": if err := awsAwsjson10_deserializeDocumentCapacityLimits(&sv.CapacityLimits, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentCapacityLimits(v **types.CapacityLimits, 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.CapacityLimits if *v == nil { sv = &types.CapacityLimits{} } else { sv = *v } for key, value := range shape { switch key { case "maxIndexingCapacityInOCU": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected IndexingCapacityValue to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaxIndexingCapacityInOCU = ptr.Int32(int32(i64)) } case "maxSearchCapacityInOCU": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected SearchCapacityValue to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaxSearchCapacityInOCU = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentCollectionDetail(v **types.CollectionDetail, 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.CollectionDetail if *v == nil { sv = &types.CollectionDetail{} } 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 String to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "collectionEndpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.CollectionEndpoint = ptr.String(jtv) } case "createdDate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.CreatedDate = ptr.Int64(i64) } case "dashboardEndpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.DashboardEndpoint = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CollectionId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "kmsKeyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.KmsKeyArn = ptr.String(jtv) } case "lastModifiedDate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.LastModifiedDate = ptr.Int64(i64) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CollectionName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CollectionStatus to be of type string, got %T instead", value) } sv.Status = types.CollectionStatus(jtv) } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CollectionType to be of type string, got %T instead", value) } sv.Type = types.CollectionType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentCollectionDetails(v *[]types.CollectionDetail, 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.CollectionDetail if *v == nil { cv = []types.CollectionDetail{} } else { cv = *v } for _, value := range shape { var col types.CollectionDetail destAddr := &col if err := awsAwsjson10_deserializeDocumentCollectionDetail(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson10_deserializeDocumentCollectionErrorDetail(v **types.CollectionErrorDetail, 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.CollectionErrorDetail if *v == nil { sv = &types.CollectionErrorDetail{} } else { sv = *v } for key, value := range shape { switch key { case "errorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ErrorCode = ptr.String(jtv) } case "errorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CollectionId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CollectionName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentCollectionErrorDetails(v *[]types.CollectionErrorDetail, 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.CollectionErrorDetail if *v == nil { cv = []types.CollectionErrorDetail{} } else { cv = *v } for _, value := range shape { var col types.CollectionErrorDetail destAddr := &col if err := awsAwsjson10_deserializeDocumentCollectionErrorDetail(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson10_deserializeDocumentCollectionSummaries(v *[]types.CollectionSummary, 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.CollectionSummary if *v == nil { cv = []types.CollectionSummary{} } else { cv = *v } for _, value := range shape { var col types.CollectionSummary destAddr := &col if err := awsAwsjson10_deserializeDocumentCollectionSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson10_deserializeDocumentCollectionSummary(v **types.CollectionSummary, 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.CollectionSummary if *v == nil { sv = &types.CollectionSummary{} } 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 String to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CollectionId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CollectionName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CollectionStatus to be of type string, got %T instead", value) } sv.Status = types.CollectionStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_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 "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentCreateCollectionDetail(v **types.CreateCollectionDetail, 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.CreateCollectionDetail if *v == nil { sv = &types.CreateCollectionDetail{} } 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 String to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "createdDate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.CreatedDate = ptr.Int64(i64) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CollectionId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "kmsKeyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.KmsKeyArn = ptr.String(jtv) } case "lastModifiedDate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.LastModifiedDate = ptr.Int64(i64) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CollectionName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CollectionStatus to be of type string, got %T instead", value) } sv.Status = types.CollectionStatus(jtv) } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CollectionType to be of type string, got %T instead", value) } sv.Type = types.CollectionType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentCreateVpcEndpointDetail(v **types.CreateVpcEndpointDetail, 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.CreateVpcEndpointDetail if *v == nil { sv = &types.CreateVpcEndpointDetail{} } 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 VpcEndpointId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcEndpointName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcEndpointStatus to be of type string, got %T instead", value) } sv.Status = types.VpcEndpointStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentDeleteCollectionDetail(v **types.DeleteCollectionDetail, 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.DeleteCollectionDetail if *v == nil { sv = &types.DeleteCollectionDetail{} } 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 CollectionId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CollectionName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CollectionStatus to be of type string, got %T instead", value) } sv.Status = types.CollectionStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentDeleteVpcEndpointDetail(v **types.DeleteVpcEndpointDetail, 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.DeleteVpcEndpointDetail if *v == nil { sv = &types.DeleteVpcEndpointDetail{} } 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 VpcEndpointId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcEndpointName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcEndpointStatus to be of type string, got %T instead", value) } sv.Status = types.VpcEndpointStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_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 String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentOcuLimitExceededException(v **types.OcuLimitExceededException, 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.OcuLimitExceededException if *v == nil { sv = &types.OcuLimitExceededException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_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 String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentSamlConfigOptions(v **types.SamlConfigOptions, 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.SamlConfigOptions if *v == nil { sv = &types.SamlConfigOptions{} } else { sv = *v } for key, value := range shape { switch key { case "groupAttribute": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected samlGroupAttribute to be of type string, got %T instead", value) } sv.GroupAttribute = ptr.String(jtv) } case "metadata": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected samlMetadata to be of type string, got %T instead", value) } sv.Metadata = ptr.String(jtv) } case "sessionTimeout": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SessionTimeout = ptr.Int32(int32(i64)) } case "userAttribute": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected samlUserAttribute to be of type string, got %T instead", value) } sv.UserAttribute = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentSecurityConfigDetail(v **types.SecurityConfigDetail, 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.SecurityConfigDetail if *v == nil { sv = &types.SecurityConfigDetail{} } else { sv = *v } for key, value := range shape { switch key { case "configVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyVersion to be of type string, got %T instead", value) } sv.ConfigVersion = ptr.String(jtv) } case "createdDate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.CreatedDate = ptr.Int64(i64) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConfigDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecurityConfigId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "lastModifiedDate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.LastModifiedDate = ptr.Int64(i64) } case "samlOptions": if err := awsAwsjson10_deserializeDocumentSamlConfigOptions(&sv.SamlOptions, value); err != nil { return err } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecurityConfigType to be of type string, got %T instead", value) } sv.Type = types.SecurityConfigType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentSecurityConfigStats(v **types.SecurityConfigStats, 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.SecurityConfigStats if *v == nil { sv = &types.SecurityConfigStats{} } else { sv = *v } for key, value := range shape { switch key { case "SamlConfigCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SamlConfigCount = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentSecurityConfigSummaries(v *[]types.SecurityConfigSummary, 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.SecurityConfigSummary if *v == nil { cv = []types.SecurityConfigSummary{} } else { cv = *v } for _, value := range shape { var col types.SecurityConfigSummary destAddr := &col if err := awsAwsjson10_deserializeDocumentSecurityConfigSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson10_deserializeDocumentSecurityConfigSummary(v **types.SecurityConfigSummary, 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.SecurityConfigSummary if *v == nil { sv = &types.SecurityConfigSummary{} } else { sv = *v } for key, value := range shape { switch key { case "configVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyVersion to be of type string, got %T instead", value) } sv.ConfigVersion = ptr.String(jtv) } case "createdDate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.CreatedDate = ptr.Int64(i64) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConfigDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecurityConfigId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "lastModifiedDate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.LastModifiedDate = ptr.Int64(i64) } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecurityConfigType to be of type string, got %T instead", value) } sv.Type = types.SecurityConfigType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentSecurityGroupIds(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 awsAwsjson10_deserializeDocumentSecurityPolicyDetail(v **types.SecurityPolicyDetail, 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.SecurityPolicyDetail if *v == nil { sv = &types.SecurityPolicyDetail{} } else { sv = *v } for key, value := range shape { switch key { case "createdDate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.CreatedDate = ptr.Int64(i64) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "lastModifiedDate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.LastModifiedDate = ptr.Int64(i64) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "policy": if err := awsAwsjson10_deserializeDocumentDocument(&sv.Policy, value); err != nil { return err } case "policyVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyVersion to be of type string, got %T instead", value) } sv.PolicyVersion = ptr.String(jtv) } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecurityPolicyType to be of type string, got %T instead", value) } sv.Type = types.SecurityPolicyType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentSecurityPolicyStats(v **types.SecurityPolicyStats, 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.SecurityPolicyStats if *v == nil { sv = &types.SecurityPolicyStats{} } else { sv = *v } for key, value := range shape { switch key { case "EncryptionPolicyCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.EncryptionPolicyCount = ptr.Int64(i64) } case "NetworkPolicyCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.NetworkPolicyCount = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentSecurityPolicySummaries(v *[]types.SecurityPolicySummary, 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.SecurityPolicySummary if *v == nil { cv = []types.SecurityPolicySummary{} } else { cv = *v } for _, value := range shape { var col types.SecurityPolicySummary destAddr := &col if err := awsAwsjson10_deserializeDocumentSecurityPolicySummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson10_deserializeDocumentSecurityPolicySummary(v **types.SecurityPolicySummary, 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.SecurityPolicySummary if *v == nil { sv = &types.SecurityPolicySummary{} } else { sv = *v } for key, value := range shape { switch key { case "createdDate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.CreatedDate = ptr.Int64(i64) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "lastModifiedDate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.LastModifiedDate = ptr.Int64(i64) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "policyVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyVersion to be of type string, got %T instead", value) } sv.PolicyVersion = ptr.String(jtv) } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecurityPolicyType to be of type string, got %T instead", value) } sv.Type = types.SecurityPolicyType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_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 "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "quotaCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.QuotaCode = ptr.String(jtv) } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String 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 String 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 String to be of type string, got %T instead", value) } sv.ServiceCode = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentSubnetIds(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 SubnetId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson10_deserializeDocumentTag(v **types.Tag, 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.Tag if *v == nil { sv = &types.Tag{} } else { sv = *v } for key, value := range shape { switch key { case "key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) } sv.Key = ptr.String(jtv) } case "value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentTags(v *[]types.Tag, 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.Tag if *v == nil { cv = []types.Tag{} } else { cv = *v } for _, value := range shape { var col types.Tag destAddr := &col if err := awsAwsjson10_deserializeDocumentTag(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson10_deserializeDocumentUpdateCollectionDetail(v **types.UpdateCollectionDetail, 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.UpdateCollectionDetail if *v == nil { sv = &types.UpdateCollectionDetail{} } 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 String to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "createdDate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.CreatedDate = ptr.Int64(i64) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CollectionId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "lastModifiedDate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.LastModifiedDate = ptr.Int64(i64) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CollectionName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CollectionStatus to be of type string, got %T instead", value) } sv.Status = types.CollectionStatus(jtv) } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CollectionType to be of type string, got %T instead", value) } sv.Type = types.CollectionType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentUpdateVpcEndpointDetail(v **types.UpdateVpcEndpointDetail, 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.UpdateVpcEndpointDetail if *v == nil { sv = &types.UpdateVpcEndpointDetail{} } 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 VpcEndpointId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "lastModifiedDate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.LastModifiedDate = ptr.Int64(i64) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcEndpointName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "securityGroupIds": if err := awsAwsjson10_deserializeDocumentSecurityGroupIds(&sv.SecurityGroupIds, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcEndpointStatus to be of type string, got %T instead", value) } sv.Status = types.VpcEndpointStatus(jtv) } case "subnetIds": if err := awsAwsjson10_deserializeDocumentSubnetIds(&sv.SubnetIds, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_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 "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentVpcEndpointDetail(v **types.VpcEndpointDetail, 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.VpcEndpointDetail if *v == nil { sv = &types.VpcEndpointDetail{} } else { sv = *v } for key, value := range shape { switch key { case "createdDate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.CreatedDate = ptr.Int64(i64) } case "id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcEndpointId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcEndpointName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "securityGroupIds": if err := awsAwsjson10_deserializeDocumentSecurityGroupIds(&sv.SecurityGroupIds, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcEndpointStatus to be of type string, got %T instead", value) } sv.Status = types.VpcEndpointStatus(jtv) } case "subnetIds": if err := awsAwsjson10_deserializeDocumentSubnetIds(&sv.SubnetIds, value); err != nil { return err } case "vpcId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcId to be of type string, got %T instead", value) } sv.VpcId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentVpcEndpointDetails(v *[]types.VpcEndpointDetail, 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.VpcEndpointDetail if *v == nil { cv = []types.VpcEndpointDetail{} } else { cv = *v } for _, value := range shape { var col types.VpcEndpointDetail destAddr := &col if err := awsAwsjson10_deserializeDocumentVpcEndpointDetail(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson10_deserializeDocumentVpcEndpointErrorDetail(v **types.VpcEndpointErrorDetail, 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.VpcEndpointErrorDetail if *v == nil { sv = &types.VpcEndpointErrorDetail{} } else { sv = *v } for key, value := range shape { switch key { case "errorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ErrorCode = ptr.String(jtv) } case "errorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcEndpointId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentVpcEndpointErrorDetails(v *[]types.VpcEndpointErrorDetail, 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.VpcEndpointErrorDetail if *v == nil { cv = []types.VpcEndpointErrorDetail{} } else { cv = *v } for _, value := range shape { var col types.VpcEndpointErrorDetail destAddr := &col if err := awsAwsjson10_deserializeDocumentVpcEndpointErrorDetail(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson10_deserializeDocumentVpcEndpointSummaries(v *[]types.VpcEndpointSummary, 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.VpcEndpointSummary if *v == nil { cv = []types.VpcEndpointSummary{} } else { cv = *v } for _, value := range shape { var col types.VpcEndpointSummary destAddr := &col if err := awsAwsjson10_deserializeDocumentVpcEndpointSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson10_deserializeDocumentVpcEndpointSummary(v **types.VpcEndpointSummary, 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.VpcEndpointSummary if *v == nil { sv = &types.VpcEndpointSummary{} } 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 VpcEndpointId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcEndpointName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcEndpointStatus to be of type string, got %T instead", value) } sv.Status = types.VpcEndpointStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentDocument(v *document.Interface, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } *v = internaldocument.NewDocumentUnmarshaler(value) return nil } func awsAwsjson10_deserializeOpDocumentBatchGetCollectionOutput(v **BatchGetCollectionOutput, 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 *BatchGetCollectionOutput if *v == nil { sv = &BatchGetCollectionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "collectionDetails": if err := awsAwsjson10_deserializeDocumentCollectionDetails(&sv.CollectionDetails, value); err != nil { return err } case "collectionErrorDetails": if err := awsAwsjson10_deserializeDocumentCollectionErrorDetails(&sv.CollectionErrorDetails, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentBatchGetVpcEndpointOutput(v **BatchGetVpcEndpointOutput, 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 *BatchGetVpcEndpointOutput if *v == nil { sv = &BatchGetVpcEndpointOutput{} } else { sv = *v } for key, value := range shape { switch key { case "vpcEndpointDetails": if err := awsAwsjson10_deserializeDocumentVpcEndpointDetails(&sv.VpcEndpointDetails, value); err != nil { return err } case "vpcEndpointErrorDetails": if err := awsAwsjson10_deserializeDocumentVpcEndpointErrorDetails(&sv.VpcEndpointErrorDetails, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentCreateAccessPolicyOutput(v **CreateAccessPolicyOutput, 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 *CreateAccessPolicyOutput if *v == nil { sv = &CreateAccessPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "accessPolicyDetail": if err := awsAwsjson10_deserializeDocumentAccessPolicyDetail(&sv.AccessPolicyDetail, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentCreateCollectionOutput(v **CreateCollectionOutput, 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 *CreateCollectionOutput if *v == nil { sv = &CreateCollectionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "createCollectionDetail": if err := awsAwsjson10_deserializeDocumentCreateCollectionDetail(&sv.CreateCollectionDetail, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentCreateSecurityConfigOutput(v **CreateSecurityConfigOutput, 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 *CreateSecurityConfigOutput if *v == nil { sv = &CreateSecurityConfigOutput{} } else { sv = *v } for key, value := range shape { switch key { case "securityConfigDetail": if err := awsAwsjson10_deserializeDocumentSecurityConfigDetail(&sv.SecurityConfigDetail, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentCreateSecurityPolicyOutput(v **CreateSecurityPolicyOutput, 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 *CreateSecurityPolicyOutput if *v == nil { sv = &CreateSecurityPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "securityPolicyDetail": if err := awsAwsjson10_deserializeDocumentSecurityPolicyDetail(&sv.SecurityPolicyDetail, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentCreateVpcEndpointOutput(v **CreateVpcEndpointOutput, 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 *CreateVpcEndpointOutput if *v == nil { sv = &CreateVpcEndpointOutput{} } else { sv = *v } for key, value := range shape { switch key { case "createVpcEndpointDetail": if err := awsAwsjson10_deserializeDocumentCreateVpcEndpointDetail(&sv.CreateVpcEndpointDetail, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentDeleteAccessPolicyOutput(v **DeleteAccessPolicyOutput, 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 *DeleteAccessPolicyOutput if *v == nil { sv = &DeleteAccessPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentDeleteCollectionOutput(v **DeleteCollectionOutput, 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 *DeleteCollectionOutput if *v == nil { sv = &DeleteCollectionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "deleteCollectionDetail": if err := awsAwsjson10_deserializeDocumentDeleteCollectionDetail(&sv.DeleteCollectionDetail, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentDeleteSecurityConfigOutput(v **DeleteSecurityConfigOutput, 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 *DeleteSecurityConfigOutput if *v == nil { sv = &DeleteSecurityConfigOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentDeleteSecurityPolicyOutput(v **DeleteSecurityPolicyOutput, 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 *DeleteSecurityPolicyOutput if *v == nil { sv = &DeleteSecurityPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentDeleteVpcEndpointOutput(v **DeleteVpcEndpointOutput, 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 *DeleteVpcEndpointOutput if *v == nil { sv = &DeleteVpcEndpointOutput{} } else { sv = *v } for key, value := range shape { switch key { case "deleteVpcEndpointDetail": if err := awsAwsjson10_deserializeDocumentDeleteVpcEndpointDetail(&sv.DeleteVpcEndpointDetail, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentGetAccessPolicyOutput(v **GetAccessPolicyOutput, 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 *GetAccessPolicyOutput if *v == nil { sv = &GetAccessPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "accessPolicyDetail": if err := awsAwsjson10_deserializeDocumentAccessPolicyDetail(&sv.AccessPolicyDetail, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentGetAccountSettingsOutput(v **GetAccountSettingsOutput, 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 *GetAccountSettingsOutput if *v == nil { sv = &GetAccountSettingsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "accountSettingsDetail": if err := awsAwsjson10_deserializeDocumentAccountSettingsDetail(&sv.AccountSettingsDetail, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentGetPoliciesStatsOutput(v **GetPoliciesStatsOutput, 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 *GetPoliciesStatsOutput if *v == nil { sv = &GetPoliciesStatsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AccessPolicyStats": if err := awsAwsjson10_deserializeDocumentAccessPolicyStats(&sv.AccessPolicyStats, value); err != nil { return err } case "SecurityConfigStats": if err := awsAwsjson10_deserializeDocumentSecurityConfigStats(&sv.SecurityConfigStats, value); err != nil { return err } case "SecurityPolicyStats": if err := awsAwsjson10_deserializeDocumentSecurityPolicyStats(&sv.SecurityPolicyStats, value); err != nil { return err } case "TotalPolicyCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalPolicyCount = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentGetSecurityConfigOutput(v **GetSecurityConfigOutput, 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 *GetSecurityConfigOutput if *v == nil { sv = &GetSecurityConfigOutput{} } else { sv = *v } for key, value := range shape { switch key { case "securityConfigDetail": if err := awsAwsjson10_deserializeDocumentSecurityConfigDetail(&sv.SecurityConfigDetail, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentGetSecurityPolicyOutput(v **GetSecurityPolicyOutput, 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 *GetSecurityPolicyOutput if *v == nil { sv = &GetSecurityPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "securityPolicyDetail": if err := awsAwsjson10_deserializeDocumentSecurityPolicyDetail(&sv.SecurityPolicyDetail, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentListAccessPoliciesOutput(v **ListAccessPoliciesOutput, 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 *ListAccessPoliciesOutput if *v == nil { sv = &ListAccessPoliciesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "accessPolicySummaries": if err := awsAwsjson10_deserializeDocumentAccessPolicySummaries(&sv.AccessPolicySummaries, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentListCollectionsOutput(v **ListCollectionsOutput, 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 *ListCollectionsOutput if *v == nil { sv = &ListCollectionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "collectionSummaries": if err := awsAwsjson10_deserializeDocumentCollectionSummaries(&sv.CollectionSummaries, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentListSecurityConfigsOutput(v **ListSecurityConfigsOutput, 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 *ListSecurityConfigsOutput if *v == nil { sv = &ListSecurityConfigsOutput{} } 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 String to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "securityConfigSummaries": if err := awsAwsjson10_deserializeDocumentSecurityConfigSummaries(&sv.SecurityConfigSummaries, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentListSecurityPoliciesOutput(v **ListSecurityPoliciesOutput, 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 *ListSecurityPoliciesOutput if *v == nil { sv = &ListSecurityPoliciesOutput{} } 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 String to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "securityPolicySummaries": if err := awsAwsjson10_deserializeDocumentSecurityPolicySummaries(&sv.SecurityPolicySummaries, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_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 := awsAwsjson10_deserializeDocumentTags(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentListVpcEndpointsOutput(v **ListVpcEndpointsOutput, 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 *ListVpcEndpointsOutput if *v == nil { sv = &ListVpcEndpointsOutput{} } 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 String to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "vpcEndpointSummaries": if err := awsAwsjson10_deserializeDocumentVpcEndpointSummaries(&sv.VpcEndpointSummaries, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, 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 *TagResourceOutput if *v == nil { sv = &TagResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, 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 *UntagResourceOutput if *v == nil { sv = &UntagResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentUpdateAccessPolicyOutput(v **UpdateAccessPolicyOutput, 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 *UpdateAccessPolicyOutput if *v == nil { sv = &UpdateAccessPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "accessPolicyDetail": if err := awsAwsjson10_deserializeDocumentAccessPolicyDetail(&sv.AccessPolicyDetail, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentUpdateAccountSettingsOutput(v **UpdateAccountSettingsOutput, 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 *UpdateAccountSettingsOutput if *v == nil { sv = &UpdateAccountSettingsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "accountSettingsDetail": if err := awsAwsjson10_deserializeDocumentAccountSettingsDetail(&sv.AccountSettingsDetail, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentUpdateCollectionOutput(v **UpdateCollectionOutput, 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 *UpdateCollectionOutput if *v == nil { sv = &UpdateCollectionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "updateCollectionDetail": if err := awsAwsjson10_deserializeDocumentUpdateCollectionDetail(&sv.UpdateCollectionDetail, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentUpdateSecurityConfigOutput(v **UpdateSecurityConfigOutput, 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 *UpdateSecurityConfigOutput if *v == nil { sv = &UpdateSecurityConfigOutput{} } else { sv = *v } for key, value := range shape { switch key { case "securityConfigDetail": if err := awsAwsjson10_deserializeDocumentSecurityConfigDetail(&sv.SecurityConfigDetail, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentUpdateSecurityPolicyOutput(v **UpdateSecurityPolicyOutput, 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 *UpdateSecurityPolicyOutput if *v == nil { sv = &UpdateSecurityPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "securityPolicyDetail": if err := awsAwsjson10_deserializeDocumentSecurityPolicyDetail(&sv.SecurityPolicyDetail, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentUpdateVpcEndpointOutput(v **UpdateVpcEndpointOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateVpcEndpointOutput if *v == nil { sv = &UpdateVpcEndpointOutput{} } else { sv = *v } for key, value := range shape { switch key { case "UpdateVpcEndpointDetail": if err := awsAwsjson10_deserializeDocumentUpdateVpcEndpointDetail(&sv.UpdateVpcEndpointDetail, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil }
7,640
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package opensearchserverless provides the API client, operations, and parameter // types for OpenSearch Service Serverless. // // Use the Amazon OpenSearch Serverless API to create, configure, and manage // OpenSearch Serverless collections and security policies. OpenSearch Serverless // is an on-demand, pre-provisioned serverless configuration for Amazon OpenSearch // Service. OpenSearch Serverless removes the operational complexities of // provisioning, configuring, and tuning your OpenSearch clusters. It enables you // to easily search and analyze petabytes of data without having to worry about the // underlying infrastructure and data management. To learn more about OpenSearch // Serverless, see What is Amazon OpenSearch Serverless? (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-overview.html) package opensearchserverless
15
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless 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/opensearchserverless/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 = "aoss" } 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 opensearchserverless // goModuleVersion is the tagged release for this module const goModuleVersion = "1.2.6"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/opensearchserverless/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 awsAwsjson10_serializeOpBatchGetCollection struct { } func (*awsAwsjson10_serializeOpBatchGetCollection) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpBatchGetCollection) 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.(*BatchGetCollectionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.BatchGetCollection") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentBatchGetCollectionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpBatchGetVpcEndpoint struct { } func (*awsAwsjson10_serializeOpBatchGetVpcEndpoint) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpBatchGetVpcEndpoint) 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.(*BatchGetVpcEndpointInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.BatchGetVpcEndpoint") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentBatchGetVpcEndpointInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpCreateAccessPolicy struct { } func (*awsAwsjson10_serializeOpCreateAccessPolicy) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpCreateAccessPolicy) 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.(*CreateAccessPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.CreateAccessPolicy") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentCreateAccessPolicyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpCreateCollection struct { } func (*awsAwsjson10_serializeOpCreateCollection) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpCreateCollection) 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.(*CreateCollectionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.CreateCollection") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentCreateCollectionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpCreateSecurityConfig struct { } func (*awsAwsjson10_serializeOpCreateSecurityConfig) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpCreateSecurityConfig) 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.(*CreateSecurityConfigInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.CreateSecurityConfig") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentCreateSecurityConfigInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpCreateSecurityPolicy struct { } func (*awsAwsjson10_serializeOpCreateSecurityPolicy) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpCreateSecurityPolicy) 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.(*CreateSecurityPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.CreateSecurityPolicy") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentCreateSecurityPolicyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpCreateVpcEndpoint struct { } func (*awsAwsjson10_serializeOpCreateVpcEndpoint) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpCreateVpcEndpoint) 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.(*CreateVpcEndpointInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.CreateVpcEndpoint") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentCreateVpcEndpointInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpDeleteAccessPolicy struct { } func (*awsAwsjson10_serializeOpDeleteAccessPolicy) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpDeleteAccessPolicy) 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.(*DeleteAccessPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.DeleteAccessPolicy") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentDeleteAccessPolicyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpDeleteCollection struct { } func (*awsAwsjson10_serializeOpDeleteCollection) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpDeleteCollection) 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.(*DeleteCollectionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.DeleteCollection") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentDeleteCollectionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpDeleteSecurityConfig struct { } func (*awsAwsjson10_serializeOpDeleteSecurityConfig) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpDeleteSecurityConfig) 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.(*DeleteSecurityConfigInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.DeleteSecurityConfig") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentDeleteSecurityConfigInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpDeleteSecurityPolicy struct { } func (*awsAwsjson10_serializeOpDeleteSecurityPolicy) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpDeleteSecurityPolicy) 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.(*DeleteSecurityPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.DeleteSecurityPolicy") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentDeleteSecurityPolicyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpDeleteVpcEndpoint struct { } func (*awsAwsjson10_serializeOpDeleteVpcEndpoint) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpDeleteVpcEndpoint) 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.(*DeleteVpcEndpointInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.DeleteVpcEndpoint") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentDeleteVpcEndpointInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpGetAccessPolicy struct { } func (*awsAwsjson10_serializeOpGetAccessPolicy) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpGetAccessPolicy) 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.(*GetAccessPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.GetAccessPolicy") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentGetAccessPolicyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpGetAccountSettings struct { } func (*awsAwsjson10_serializeOpGetAccountSettings) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpGetAccountSettings) 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.(*GetAccountSettingsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.GetAccountSettings") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentGetAccountSettingsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpGetPoliciesStats struct { } func (*awsAwsjson10_serializeOpGetPoliciesStats) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpGetPoliciesStats) 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.(*GetPoliciesStatsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.GetPoliciesStats") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentGetPoliciesStatsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpGetSecurityConfig struct { } func (*awsAwsjson10_serializeOpGetSecurityConfig) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpGetSecurityConfig) 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.(*GetSecurityConfigInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.GetSecurityConfig") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentGetSecurityConfigInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpGetSecurityPolicy struct { } func (*awsAwsjson10_serializeOpGetSecurityPolicy) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpGetSecurityPolicy) 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.(*GetSecurityPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.GetSecurityPolicy") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentGetSecurityPolicyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpListAccessPolicies struct { } func (*awsAwsjson10_serializeOpListAccessPolicies) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpListAccessPolicies) 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.(*ListAccessPoliciesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.ListAccessPolicies") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentListAccessPoliciesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpListCollections struct { } func (*awsAwsjson10_serializeOpListCollections) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpListCollections) 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.(*ListCollectionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.ListCollections") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentListCollectionsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpListSecurityConfigs struct { } func (*awsAwsjson10_serializeOpListSecurityConfigs) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpListSecurityConfigs) 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.(*ListSecurityConfigsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.ListSecurityConfigs") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentListSecurityConfigsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpListSecurityPolicies struct { } func (*awsAwsjson10_serializeOpListSecurityPolicies) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpListSecurityPolicies) 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.(*ListSecurityPoliciesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.ListSecurityPolicies") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentListSecurityPoliciesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpListTagsForResource struct { } func (*awsAwsjson10_serializeOpListTagsForResource) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_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)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.ListTagsForResource") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpListVpcEndpoints struct { } func (*awsAwsjson10_serializeOpListVpcEndpoints) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpListVpcEndpoints) 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.(*ListVpcEndpointsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.ListVpcEndpoints") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentListVpcEndpointsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpTagResource struct { } func (*awsAwsjson10_serializeOpTagResource) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_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)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.TagResource") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpUntagResource struct { } func (*awsAwsjson10_serializeOpUntagResource) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_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)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.UntagResource") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpUpdateAccessPolicy struct { } func (*awsAwsjson10_serializeOpUpdateAccessPolicy) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpUpdateAccessPolicy) 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.(*UpdateAccessPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.UpdateAccessPolicy") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentUpdateAccessPolicyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpUpdateAccountSettings struct { } func (*awsAwsjson10_serializeOpUpdateAccountSettings) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpUpdateAccountSettings) 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.(*UpdateAccountSettingsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.UpdateAccountSettings") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentUpdateAccountSettingsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpUpdateCollection struct { } func (*awsAwsjson10_serializeOpUpdateCollection) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpUpdateCollection) 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.(*UpdateCollectionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.UpdateCollection") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentUpdateCollectionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpUpdateSecurityConfig struct { } func (*awsAwsjson10_serializeOpUpdateSecurityConfig) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpUpdateSecurityConfig) 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.(*UpdateSecurityConfigInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.UpdateSecurityConfig") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentUpdateSecurityConfigInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpUpdateSecurityPolicy struct { } func (*awsAwsjson10_serializeOpUpdateSecurityPolicy) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpUpdateSecurityPolicy) 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.(*UpdateSecurityPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.UpdateSecurityPolicy") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentUpdateSecurityPolicyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpUpdateVpcEndpoint struct { } func (*awsAwsjson10_serializeOpUpdateVpcEndpoint) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpUpdateVpcEndpoint) 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.(*UpdateVpcEndpointInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("OpenSearchServerless.UpdateVpcEndpoint") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentUpdateVpcEndpointInput(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 awsAwsjson10_serializeDocumentCapacityLimits(v *types.CapacityLimits, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxIndexingCapacityInOCU != nil { ok := object.Key("maxIndexingCapacityInOCU") ok.Integer(*v.MaxIndexingCapacityInOCU) } if v.MaxSearchCapacityInOCU != nil { ok := object.Key("maxSearchCapacityInOCU") ok.Integer(*v.MaxSearchCapacityInOCU) } return nil } func awsAwsjson10_serializeDocumentCollectionFilters(v *types.CollectionFilters, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if len(v.Status) > 0 { ok := object.Key("status") ok.String(string(v.Status)) } return nil } func awsAwsjson10_serializeDocumentCollectionIds(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 awsAwsjson10_serializeDocumentCollectionNames(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 awsAwsjson10_serializeDocumentResourceFilter(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 awsAwsjson10_serializeDocumentSamlConfigOptions(v *types.SamlConfigOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.GroupAttribute != nil { ok := object.Key("groupAttribute") ok.String(*v.GroupAttribute) } if v.Metadata != nil { ok := object.Key("metadata") ok.String(*v.Metadata) } if v.SessionTimeout != nil { ok := object.Key("sessionTimeout") ok.Integer(*v.SessionTimeout) } if v.UserAttribute != nil { ok := object.Key("userAttribute") ok.String(*v.UserAttribute) } return nil } func awsAwsjson10_serializeDocumentSecurityGroupIds(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 awsAwsjson10_serializeDocumentSubnetIds(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 awsAwsjson10_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Key != nil { ok := object.Key("key") ok.String(*v.Key) } if v.Value != nil { ok := object.Key("value") ok.String(*v.Value) } return nil } func awsAwsjson10_serializeDocumentTagKeys(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 awsAwsjson10_serializeDocumentTags(v []types.Tag, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson10_serializeDocumentTag(&v[i], av); err != nil { return err } } return nil } func awsAwsjson10_serializeDocumentVpcEndpointFilters(v *types.VpcEndpointFilters, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Status) > 0 { ok := object.Key("status") ok.String(string(v.Status)) } return nil } func awsAwsjson10_serializeDocumentVpcEndpointIds(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 awsAwsjson10_serializeOpDocumentBatchGetCollectionInput(v *BatchGetCollectionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Ids != nil { ok := object.Key("ids") if err := awsAwsjson10_serializeDocumentCollectionIds(v.Ids, ok); err != nil { return err } } if v.Names != nil { ok := object.Key("names") if err := awsAwsjson10_serializeDocumentCollectionNames(v.Names, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeOpDocumentBatchGetVpcEndpointInput(v *BatchGetVpcEndpointInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Ids != nil { ok := object.Key("ids") if err := awsAwsjson10_serializeDocumentVpcEndpointIds(v.Ids, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeOpDocumentCreateAccessPolicyInput(v *CreateAccessPolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } 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.Policy != nil { ok := object.Key("policy") ok.String(*v.Policy) } if len(v.Type) > 0 { ok := object.Key("type") ok.String(string(v.Type)) } return nil } func awsAwsjson10_serializeOpDocumentCreateCollectionInput(v *CreateCollectionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } 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 := awsAwsjson10_serializeDocumentTags(v.Tags, ok); err != nil { return err } } if len(v.Type) > 0 { ok := object.Key("type") ok.String(string(v.Type)) } return nil } func awsAwsjson10_serializeOpDocumentCreateSecurityConfigInput(v *CreateSecurityConfigInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } 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.SamlOptions != nil { ok := object.Key("samlOptions") if err := awsAwsjson10_serializeDocumentSamlConfigOptions(v.SamlOptions, ok); err != nil { return err } } if len(v.Type) > 0 { ok := object.Key("type") ok.String(string(v.Type)) } return nil } func awsAwsjson10_serializeOpDocumentCreateSecurityPolicyInput(v *CreateSecurityPolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } 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.Policy != nil { ok := object.Key("policy") ok.String(*v.Policy) } if len(v.Type) > 0 { ok := object.Key("type") ok.String(string(v.Type)) } return nil } func awsAwsjson10_serializeOpDocumentCreateVpcEndpointInput(v *CreateVpcEndpointInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.SecurityGroupIds != nil { ok := object.Key("securityGroupIds") if err := awsAwsjson10_serializeDocumentSecurityGroupIds(v.SecurityGroupIds, ok); err != nil { return err } } if v.SubnetIds != nil { ok := object.Key("subnetIds") if err := awsAwsjson10_serializeDocumentSubnetIds(v.SubnetIds, ok); err != nil { return err } } if v.VpcId != nil { ok := object.Key("vpcId") ok.String(*v.VpcId) } return nil } func awsAwsjson10_serializeOpDocumentDeleteAccessPolicyInput(v *DeleteAccessPolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if len(v.Type) > 0 { ok := object.Key("type") ok.String(string(v.Type)) } return nil } func awsAwsjson10_serializeOpDocumentDeleteCollectionInput(v *DeleteCollectionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.Id != nil { ok := object.Key("id") ok.String(*v.Id) } return nil } func awsAwsjson10_serializeOpDocumentDeleteSecurityConfigInput(v *DeleteSecurityConfigInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.Id != nil { ok := object.Key("id") ok.String(*v.Id) } return nil } func awsAwsjson10_serializeOpDocumentDeleteSecurityPolicyInput(v *DeleteSecurityPolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if len(v.Type) > 0 { ok := object.Key("type") ok.String(string(v.Type)) } return nil } func awsAwsjson10_serializeOpDocumentDeleteVpcEndpointInput(v *DeleteVpcEndpointInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.Id != nil { ok := object.Key("id") ok.String(*v.Id) } return nil } func awsAwsjson10_serializeOpDocumentGetAccessPolicyInput(v *GetAccessPolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if len(v.Type) > 0 { ok := object.Key("type") ok.String(string(v.Type)) } return nil } func awsAwsjson10_serializeOpDocumentGetAccountSettingsInput(v *GetAccountSettingsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() return nil } func awsAwsjson10_serializeOpDocumentGetPoliciesStatsInput(v *GetPoliciesStatsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() return nil } func awsAwsjson10_serializeOpDocumentGetSecurityConfigInput(v *GetSecurityConfigInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Id != nil { ok := object.Key("id") ok.String(*v.Id) } return nil } func awsAwsjson10_serializeOpDocumentGetSecurityPolicyInput(v *GetSecurityPolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if len(v.Type) > 0 { ok := object.Key("type") ok.String(string(v.Type)) } return nil } func awsAwsjson10_serializeOpDocumentListAccessPoliciesInput(v *ListAccessPoliciesInput, 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.Resource != nil { ok := object.Key("resource") if err := awsAwsjson10_serializeDocumentResourceFilter(v.Resource, ok); err != nil { return err } } if len(v.Type) > 0 { ok := object.Key("type") ok.String(string(v.Type)) } return nil } func awsAwsjson10_serializeOpDocumentListCollectionsInput(v *ListCollectionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CollectionFilters != nil { ok := object.Key("collectionFilters") if err := awsAwsjson10_serializeDocumentCollectionFilters(v.CollectionFilters, 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 awsAwsjson10_serializeOpDocumentListSecurityConfigsInput(v *ListSecurityConfigsInput, 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 len(v.Type) > 0 { ok := object.Key("type") ok.String(string(v.Type)) } return nil } func awsAwsjson10_serializeOpDocumentListSecurityPoliciesInput(v *ListSecurityPoliciesInput, 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.Resource != nil { ok := object.Key("resource") if err := awsAwsjson10_serializeDocumentResourceFilter(v.Resource, ok); err != nil { return err } } if len(v.Type) > 0 { ok := object.Key("type") ok.String(string(v.Type)) } return nil } func awsAwsjson10_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ResourceArn != nil { ok := object.Key("resourceArn") ok.String(*v.ResourceArn) } return nil } func awsAwsjson10_serializeOpDocumentListVpcEndpointsInput(v *ListVpcEndpointsInput, 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.VpcEndpointFilters != nil { ok := object.Key("vpcEndpointFilters") if err := awsAwsjson10_serializeDocumentVpcEndpointFilters(v.VpcEndpointFilters, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ResourceArn != nil { ok := object.Key("resourceArn") ok.String(*v.ResourceArn) } if v.Tags != nil { ok := object.Key("tags") if err := awsAwsjson10_serializeDocumentTags(v.Tags, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ResourceArn != nil { ok := object.Key("resourceArn") ok.String(*v.ResourceArn) } if v.TagKeys != nil { ok := object.Key("tagKeys") if err := awsAwsjson10_serializeDocumentTagKeys(v.TagKeys, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeOpDocumentUpdateAccessPolicyInput(v *UpdateAccessPolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } 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.Policy != nil { ok := object.Key("policy") ok.String(*v.Policy) } if v.PolicyVersion != nil { ok := object.Key("policyVersion") ok.String(*v.PolicyVersion) } if len(v.Type) > 0 { ok := object.Key("type") ok.String(string(v.Type)) } return nil } func awsAwsjson10_serializeOpDocumentUpdateAccountSettingsInput(v *UpdateAccountSettingsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CapacityLimits != nil { ok := object.Key("capacityLimits") if err := awsAwsjson10_serializeDocumentCapacityLimits(v.CapacityLimits, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeOpDocumentUpdateCollectionInput(v *UpdateCollectionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Id != nil { ok := object.Key("id") ok.String(*v.Id) } return nil } func awsAwsjson10_serializeOpDocumentUpdateSecurityConfigInput(v *UpdateSecurityConfigInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.ConfigVersion != nil { ok := object.Key("configVersion") ok.String(*v.ConfigVersion) } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Id != nil { ok := object.Key("id") ok.String(*v.Id) } if v.SamlOptions != nil { ok := object.Key("samlOptions") if err := awsAwsjson10_serializeDocumentSamlConfigOptions(v.SamlOptions, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeOpDocumentUpdateSecurityPolicyInput(v *UpdateSecurityPolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } 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.Policy != nil { ok := object.Key("policy") ok.String(*v.Policy) } if v.PolicyVersion != nil { ok := object.Key("policyVersion") ok.String(*v.PolicyVersion) } if len(v.Type) > 0 { ok := object.Key("type") ok.String(string(v.Type)) } return nil } func awsAwsjson10_serializeOpDocumentUpdateVpcEndpointInput(v *UpdateVpcEndpointInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AddSecurityGroupIds != nil { ok := object.Key("addSecurityGroupIds") if err := awsAwsjson10_serializeDocumentSecurityGroupIds(v.AddSecurityGroupIds, ok); err != nil { return err } } if v.AddSubnetIds != nil { ok := object.Key("addSubnetIds") if err := awsAwsjson10_serializeDocumentSubnetIds(v.AddSubnetIds, ok); err != nil { return err } } if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.Id != nil { ok := object.Key("id") ok.String(*v.Id) } if v.RemoveSecurityGroupIds != nil { ok := object.Key("removeSecurityGroupIds") if err := awsAwsjson10_serializeDocumentSecurityGroupIds(v.RemoveSecurityGroupIds, ok); err != nil { return err } } if v.RemoveSubnetIds != nil { ok := object.Key("removeSubnetIds") if err := awsAwsjson10_serializeDocumentSubnetIds(v.RemoveSubnetIds, ok); err != nil { return err } } return nil }
2,626
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opensearchserverless import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/opensearchserverless/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpBatchGetVpcEndpoint struct { } func (*validateOpBatchGetVpcEndpoint) ID() string { return "OperationInputValidation" } func (m *validateOpBatchGetVpcEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*BatchGetVpcEndpointInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpBatchGetVpcEndpointInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateAccessPolicy struct { } func (*validateOpCreateAccessPolicy) ID() string { return "OperationInputValidation" } func (m *validateOpCreateAccessPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateAccessPolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateAccessPolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateCollection struct { } func (*validateOpCreateCollection) ID() string { return "OperationInputValidation" } func (m *validateOpCreateCollection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateCollectionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateCollectionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateSecurityConfig struct { } func (*validateOpCreateSecurityConfig) ID() string { return "OperationInputValidation" } func (m *validateOpCreateSecurityConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateSecurityConfigInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateSecurityConfigInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateSecurityPolicy struct { } func (*validateOpCreateSecurityPolicy) ID() string { return "OperationInputValidation" } func (m *validateOpCreateSecurityPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateSecurityPolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateSecurityPolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateVpcEndpoint struct { } func (*validateOpCreateVpcEndpoint) ID() string { return "OperationInputValidation" } func (m *validateOpCreateVpcEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateVpcEndpointInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateVpcEndpointInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteAccessPolicy struct { } func (*validateOpDeleteAccessPolicy) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteAccessPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteAccessPolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteAccessPolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteCollection struct { } func (*validateOpDeleteCollection) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteCollection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteCollectionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteCollectionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteSecurityConfig struct { } func (*validateOpDeleteSecurityConfig) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteSecurityConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteSecurityConfigInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteSecurityConfigInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteSecurityPolicy struct { } func (*validateOpDeleteSecurityPolicy) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteSecurityPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteSecurityPolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteSecurityPolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteVpcEndpoint struct { } func (*validateOpDeleteVpcEndpoint) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteVpcEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteVpcEndpointInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteVpcEndpointInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetAccessPolicy struct { } func (*validateOpGetAccessPolicy) ID() string { return "OperationInputValidation" } func (m *validateOpGetAccessPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetAccessPolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetAccessPolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetSecurityConfig struct { } func (*validateOpGetSecurityConfig) ID() string { return "OperationInputValidation" } func (m *validateOpGetSecurityConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetSecurityConfigInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetSecurityConfigInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetSecurityPolicy struct { } func (*validateOpGetSecurityPolicy) ID() string { return "OperationInputValidation" } func (m *validateOpGetSecurityPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetSecurityPolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetSecurityPolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListAccessPolicies struct { } func (*validateOpListAccessPolicies) ID() string { return "OperationInputValidation" } func (m *validateOpListAccessPolicies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListAccessPoliciesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListAccessPoliciesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListSecurityConfigs struct { } func (*validateOpListSecurityConfigs) ID() string { return "OperationInputValidation" } func (m *validateOpListSecurityConfigs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListSecurityConfigsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListSecurityConfigsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListSecurityPolicies struct { } func (*validateOpListSecurityPolicies) ID() string { return "OperationInputValidation" } func (m *validateOpListSecurityPolicies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListSecurityPoliciesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListSecurityPoliciesInput(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 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 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 validateOpUpdateAccessPolicy struct { } func (*validateOpUpdateAccessPolicy) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateAccessPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateAccessPolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateAccessPolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateCollection struct { } func (*validateOpUpdateCollection) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateCollection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateCollectionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateCollectionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateSecurityConfig struct { } func (*validateOpUpdateSecurityConfig) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateSecurityConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateSecurityConfigInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateSecurityConfigInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateSecurityPolicy struct { } func (*validateOpUpdateSecurityPolicy) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateSecurityPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateSecurityPolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateSecurityPolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateVpcEndpoint struct { } func (*validateOpUpdateVpcEndpoint) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateVpcEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateVpcEndpointInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateVpcEndpointInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpBatchGetVpcEndpointValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpBatchGetVpcEndpoint{}, middleware.After) } func addOpCreateAccessPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateAccessPolicy{}, middleware.After) } func addOpCreateCollectionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateCollection{}, middleware.After) } func addOpCreateSecurityConfigValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateSecurityConfig{}, middleware.After) } func addOpCreateSecurityPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateSecurityPolicy{}, middleware.After) } func addOpCreateVpcEndpointValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateVpcEndpoint{}, middleware.After) } func addOpDeleteAccessPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteAccessPolicy{}, middleware.After) } func addOpDeleteCollectionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteCollection{}, middleware.After) } func addOpDeleteSecurityConfigValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteSecurityConfig{}, middleware.After) } func addOpDeleteSecurityPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteSecurityPolicy{}, middleware.After) } func addOpDeleteVpcEndpointValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteVpcEndpoint{}, middleware.After) } func addOpGetAccessPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetAccessPolicy{}, middleware.After) } func addOpGetSecurityConfigValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetSecurityConfig{}, middleware.After) } func addOpGetSecurityPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetSecurityPolicy{}, middleware.After) } func addOpListAccessPoliciesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListAccessPolicies{}, middleware.After) } func addOpListSecurityConfigsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListSecurityConfigs{}, middleware.After) } func addOpListSecurityPoliciesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListSecurityPolicies{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } func addOpUpdateAccessPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateAccessPolicy{}, middleware.After) } func addOpUpdateCollectionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateCollection{}, middleware.After) } func addOpUpdateSecurityConfigValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateSecurityConfig{}, middleware.After) } func addOpUpdateSecurityPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateSecurityPolicy{}, middleware.After) } func addOpUpdateVpcEndpointValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateVpcEndpoint{}, middleware.After) } func validateSamlConfigOptions(v *types.SamlConfigOptions) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SamlConfigOptions"} if v.Metadata == nil { invalidParams.Add(smithy.NewErrParamRequired("Metadata")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTag(v *types.Tag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Tag"} if v.Key == nil { invalidParams.Add(smithy.NewErrParamRequired("Key")) } if v.Value == nil { invalidParams.Add(smithy.NewErrParamRequired("Value")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTags(v []types.Tag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Tags"} for i := range v { if err := validateTag(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpBatchGetVpcEndpointInput(v *BatchGetVpcEndpointInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "BatchGetVpcEndpointInput"} if v.Ids == nil { invalidParams.Add(smithy.NewErrParamRequired("Ids")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateAccessPolicyInput(v *CreateAccessPolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateAccessPolicyInput"} if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Policy == nil { invalidParams.Add(smithy.NewErrParamRequired("Policy")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateCollectionInput(v *CreateCollectionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateCollectionInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Tags != nil { if err := validateTags(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateSecurityConfigInput(v *CreateSecurityConfigInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateSecurityConfigInput"} if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.SamlOptions != nil { if err := validateSamlConfigOptions(v.SamlOptions); err != nil { invalidParams.AddNested("SamlOptions", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateSecurityPolicyInput(v *CreateSecurityPolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateSecurityPolicyInput"} if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Policy == nil { invalidParams.Add(smithy.NewErrParamRequired("Policy")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateVpcEndpointInput(v *CreateVpcEndpointInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateVpcEndpointInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.VpcId == nil { invalidParams.Add(smithy.NewErrParamRequired("VpcId")) } if v.SubnetIds == nil { invalidParams.Add(smithy.NewErrParamRequired("SubnetIds")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteAccessPolicyInput(v *DeleteAccessPolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteAccessPolicyInput"} if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteCollectionInput(v *DeleteCollectionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteCollectionInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteSecurityConfigInput(v *DeleteSecurityConfigInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteSecurityConfigInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteSecurityPolicyInput(v *DeleteSecurityPolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteSecurityPolicyInput"} if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteVpcEndpointInput(v *DeleteVpcEndpointInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteVpcEndpointInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetAccessPolicyInput(v *GetAccessPolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetAccessPolicyInput"} if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetSecurityConfigInput(v *GetSecurityConfigInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetSecurityConfigInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetSecurityPolicyInput(v *GetSecurityPolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetSecurityPolicyInput"} if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListAccessPoliciesInput(v *ListAccessPoliciesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListAccessPoliciesInput"} if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListSecurityConfigsInput(v *ListSecurityConfigsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListSecurityConfigsInput"} if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListSecurityPoliciesInput(v *ListSecurityPoliciesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListSecurityPoliciesInput"} if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } 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 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")) } else if v.Tags != nil { if err := validateTags(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } 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 validateOpUpdateAccessPolicyInput(v *UpdateAccessPolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateAccessPolicyInput"} if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.PolicyVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("PolicyVersion")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateCollectionInput(v *UpdateCollectionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateCollectionInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateSecurityConfigInput(v *UpdateSecurityConfigInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateSecurityConfigInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if v.ConfigVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("ConfigVersion")) } if v.SamlOptions != nil { if err := validateSamlConfigOptions(v.SamlOptions); err != nil { invalidParams.AddNested("SamlOptions", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateSecurityPolicyInput(v *UpdateSecurityPolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateSecurityPolicyInput"} if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.PolicyVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("PolicyVersion")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateVpcEndpointInput(v *UpdateVpcEndpointInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateVpcEndpointInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
1,110
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package document implements encoding and decoding of open-content that has a JSON-like data model. // This data-model allows for UTF-8 strings, arbitrary precision numbers, booleans, nulls, a list of these values, and a // map of UTF-8 strings to these values. // // Interface defines the semantics for how a document type is marshalled and unmarshalled for requests and responses // for the service. To send a document as input to the service you use NewLazyDocument and pass it the Go type to be // sent to the service. NewLazyDocument returns a document Interface type that encodes the provided Go type during // the request serialization step after you have invoked an API client operation that uses the document type. // // The following examples show how you can create document types using basic Go types. // // NewLazyDocument(map[string]interface{}{ // "favoriteNumber": 42, // "fruits": []string{"apple", "orange"}, // "capitals": map[string]interface{}{ // "Washington": "Olympia", // "Oregon": "Salem", // }, // "skyIsBlue": true, // }) // // NewLazyDocument(3.14159) // // NewLazyDocument([]interface{"One", 2, 3, 3.5, "four"}) // // NewLazyDocument(true) // // Services can send document types as part of their API responses. To retrieve the content of a response document // you use the UnmarshalSmithyDocument method on the response document. When calling UnmarshalSmithyDocument you pass // a reference to the Go type that you want to unmarshal and map the response to. // // For example, if you expect to receive key/value map from the service response: // // var kv map[string]interface{} // if err := outputDocument.UnmarshalSmithyDocument(&kv); err != nil { // // handle error // } // // If a service can return one or more data-types in the response, you can use an empty interface and type switch to // dynamically handle the response type. // // var v interface{} // if err := outputDocument.UnmarshalSmithyDocument(&v); err != nil { // // handle error // } // // switch vv := v.(type) { // case map[string]interface{}: // // handle key/value map // case []interface{}: // // handle array of values // case bool: // // handle boolean // case document.Number: // // handle an arbitrary precision number // case string: // // handle string // default: // // handle unknown case // } // // The mapping of Go types to document types is covered in more depth in https://pkg.go.dev/github.com/aws/smithy-go/document // including more in depth examples that cover user-defined structure types. package document
67
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package document import ( internaldocument "github.com/aws/aws-sdk-go-v2/service/opensearchserverless/internal/document" ) // Interface defines a document which is a protocol-agnostic type which supports a // JSON-like data-model. You can use this type to send UTF-8 strings, arbitrary // precision numbers, booleans, nulls, a list of these values, and a map of UTF-8 // strings to these values. // // You create a document type using the NewLazyDocument function and passing it // the Go type to marshal. When receiving a document in an API response, you use // the document's UnmarshalSmithyDocument function to decode the response to your // desired Go type. Unless documented specifically generated structure types in // client packages or client types packages are not supported at this time. Such // types embed a noSmithyDocumentSerde and will cause an error to be returned when // attempting to send an API request. // // For more information see the accompanying package documentation and linked // references. type Interface = internaldocument.Interface // You create document type using the NewLazyDocument function and passing it the // Go type to be marshaled and sent to the service. The document marshaler supports // semantics similar to the encoding/json Go standard library. // // For more information see the accompanying package documentation and linked // references. func NewLazyDocument(v interface{}) Interface { return internaldocument.NewDocumentMarshaler(v) }
35
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package document import ( "bytes" "encoding/json" smithydocument "github.com/aws/smithy-go/document" smithydocumentjson "github.com/aws/smithy-go/document/json" ) // github.com/aws/aws-sdk-go-v2/service/opensearchserverless/internal/document.smithyDocument // is an interface which is used to bind a document type to its service client. type smithyDocument interface { isSmithyDocument() } // github.com/aws/aws-sdk-go-v2/service/opensearchserverless/internal/document.Interface // is a JSON-like data model type that is protocol agnostic and is usedto send // open-content to a service. type Interface interface { smithyDocument smithydocument.Marshaler smithydocument.Unmarshaler } type documentMarshaler struct { value interface{} } func (m *documentMarshaler) UnmarshalSmithyDocument(v interface{}) error { mBytes, err := m.MarshalSmithyDocument() if err != nil { return err } jDecoder := json.NewDecoder(bytes.NewReader(mBytes)) jDecoder.UseNumber() var jv interface{} if err := jDecoder.Decode(&v); err != nil { return err } return NewDocumentUnmarshaler(v).UnmarshalSmithyDocument(&jv) } func (m *documentMarshaler) MarshalSmithyDocument() ([]byte, error) { return smithydocumentjson.NewEncoder().Encode(m.value) } func (m *documentMarshaler) isSmithyDocument() {} var _ Interface = (*documentMarshaler)(nil) type documentUnmarshaler struct { value interface{} } func (m *documentUnmarshaler) UnmarshalSmithyDocument(v interface{}) error { decoder := smithydocumentjson.NewDecoder() return decoder.DecodeJSONInterface(m.value, v) } func (m *documentUnmarshaler) MarshalSmithyDocument() ([]byte, error) { return json.Marshal(m.value) } func (m *documentUnmarshaler) isSmithyDocument() {} var _ Interface = (*documentUnmarshaler)(nil) // NewDocumentMarshaler creates a new document marshaler for the given input type func NewDocumentMarshaler(v interface{}) Interface { return &documentMarshaler{ value: v, } } // NewDocumentUnmarshaler creates a new document unmarshaler for the given service // response func NewDocumentUnmarshaler(v interface{}) Interface { return &documentUnmarshaler{ value: v, } } // github.com/aws/aws-sdk-go-v2/service/opensearchserverless/internal/document.IsInterface // returns whether the given Interface implementation is a valid client // implementation func IsInterface(v Interface) (ok bool) { defer func() { if err := recover(); err != nil { ok = false } }() v.isSmithyDocument() return true }
100
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package document import ( smithydocument "github.com/aws/smithy-go/document" ) var _ smithyDocument = (Interface)(nil) var _ smithydocument.Marshaler = (Interface)(nil) var _ smithydocument.Unmarshaler = (Interface)(nil)
12
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 OpenSearchServerless 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: "aoss.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "aoss-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "aoss-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "aoss.{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-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: "us-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "aoss.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "aoss-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "aoss-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "aoss.{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: "aoss-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "aoss.{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: "aoss-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "aoss.{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: "aoss-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "aoss.{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: "aoss-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "aoss.{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: "aoss.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "aoss-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "aoss-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "aoss.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, }, }
323
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 AccessPolicyType string // Enum values for AccessPolicyType const ( // data policy type AccessPolicyTypeData AccessPolicyType = "data" ) // Values returns all known values for AccessPolicyType. 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 (AccessPolicyType) Values() []AccessPolicyType { return []AccessPolicyType{ "data", } } type CollectionStatus string // Enum values for CollectionStatus const ( // Creating collection resource CollectionStatusCreating CollectionStatus = "CREATING" // Deleting collection resource CollectionStatusDeleting CollectionStatus = "DELETING" // Collection resource is ready to use CollectionStatusActive CollectionStatus = "ACTIVE" // Collection resource create or delete failed CollectionStatusFailed CollectionStatus = "FAILED" ) // Values returns all known values for CollectionStatus. 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 (CollectionStatus) Values() []CollectionStatus { return []CollectionStatus{ "CREATING", "DELETING", "ACTIVE", "FAILED", } } type CollectionType string // Enum values for CollectionType const ( // Search collection type CollectionTypeSearch CollectionType = "SEARCH" // Timeseries collection type CollectionTypeTimeseries CollectionType = "TIMESERIES" ) // Values returns all known values for CollectionType. 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 (CollectionType) Values() []CollectionType { return []CollectionType{ "SEARCH", "TIMESERIES", } } type SecurityConfigType string // Enum values for SecurityConfigType const ( // saml provider SecurityConfigTypeSaml SecurityConfigType = "saml" ) // Values returns all known values for SecurityConfigType. 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 (SecurityConfigType) Values() []SecurityConfigType { return []SecurityConfigType{ "saml", } } type SecurityPolicyType string // Enum values for SecurityPolicyType const ( // encryption policy type SecurityPolicyTypeEncryption SecurityPolicyType = "encryption" // network policy type SecurityPolicyTypeNetwork SecurityPolicyType = "network" ) // Values returns all known values for SecurityPolicyType. 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 (SecurityPolicyType) Values() []SecurityPolicyType { return []SecurityPolicyType{ "encryption", "network", } } type VpcEndpointStatus string // Enum values for VpcEndpointStatus const ( // Pending VPCEndpoint resource VpcEndpointStatusPending VpcEndpointStatus = "PENDING" // Deleting VPCEndpoint resource VpcEndpointStatusDeleting VpcEndpointStatus = "DELETING" // VPCEndpoint resource is ready to use VpcEndpointStatusActive VpcEndpointStatus = "ACTIVE" // VPCEndpoint resource create or delete failed VpcEndpointStatusFailed VpcEndpointStatus = "FAILED" ) // Values returns all known values for VpcEndpointStatus. 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 (VpcEndpointStatus) Values() []VpcEndpointStatus { return []VpcEndpointStatus{ "PENDING", "DELETING", "ACTIVE", "FAILED", } }
130
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" ) // When creating a resource, thrown when a resource with the same name already // exists or is being created. When deleting a resource, thrown when the resource // is not in the ACTIVE or FAILED state. type ConflictException struct { Message *string ErrorCodeOverride *string 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 } // Thrown when an error internal to the service occurs while processing a request. type InternalServerException struct { Message *string ErrorCodeOverride *string 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 } // OCU Limit Exceeded for service limits type OcuLimitExceededException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *OcuLimitExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *OcuLimitExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *OcuLimitExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "OcuLimitExceededException" } return *e.ErrorCodeOverride } func (e *OcuLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Thrown when accessing or deleting a resource that does not exist. 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 } // Thrown when you attempt to create more resources than the service allows based // on service quotas. type ServiceQuotaExceededException struct { Message *string ErrorCodeOverride *string ResourceId *string ResourceType *string ServiceCode *string QuotaCode *string 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 } // Thrown when the HTTP request contains invalid input or is missing required // input. type ValidationException struct { Message *string ErrorCodeOverride *string 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 }
174
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( "github.com/aws/aws-sdk-go-v2/service/opensearchserverless/document" smithydocument "github.com/aws/smithy-go/document" ) // Details about an OpenSearch Serverless access policy. type AccessPolicyDetail struct { // The date the policy was created. CreatedDate *int64 // The description of the policy. Description *string // The timestamp of when the policy was last modified. LastModifiedDate *int64 // The name of the policy. Name *string // The JSON policy document without any whitespaces. Policy document.Interface // The version of the policy. PolicyVersion *string // The type of access policy. Type AccessPolicyType noSmithyDocumentSerde } // Statistics for an OpenSearch Serverless access policy. type AccessPolicyStats struct { // The number of data access policies in the current account. DataPolicyCount *int64 noSmithyDocumentSerde } // A summary of the data access policy. type AccessPolicySummary struct { // The Epoch time when the access policy was created. CreatedDate *int64 // The description of the access policy. Description *string // The date and time when the collection was last modified. LastModifiedDate *int64 // The name of the access policy. Name *string // The version of the policy. PolicyVersion *string // The type of access policy. Currently the only available type is data . Type AccessPolicyType noSmithyDocumentSerde } // OpenSearch Serverless-related information for the current account. type AccountSettingsDetail struct { // The maximum capacity limits for all OpenSearch Serverless collections, in // OpenSearch Compute Units (OCUs). These limits are used to scale your collections // based on the current workload. For more information, see Managing capacity // limits for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-scaling.html) // . CapacityLimits *CapacityLimits noSmithyDocumentSerde } // The maximum capacity limits for all OpenSearch Serverless collections, in // OpenSearch Compute Units (OCUs). These limits are used to scale your collections // based on the current workload. For more information, see Managing capacity // limits for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-scaling.html) // . type CapacityLimits struct { // The maximum indexing capacity for collections. MaxIndexingCapacityInOCU *int32 // The maximum search capacity for collections. MaxSearchCapacityInOCU *int32 noSmithyDocumentSerde } // Details about each OpenSearch Serverless collection, including the collection // endpoint and the OpenSearch Dashboards endpoint. type CollectionDetail struct { // The Amazon Resource Name (ARN) of the collection. Arn *string // Collection-specific endpoint used to submit index, search, and data upload // requests to an OpenSearch Serverless collection. CollectionEndpoint *string // The Epoch time when the collection was created. CreatedDate *int64 // Collection-specific endpoint used to access OpenSearch Dashboards. DashboardEndpoint *string // A description of the collection. Description *string // A unique identifier for the collection. Id *string // The ARN of the Amazon Web Services KMS key used to encrypt the collection. KmsKeyArn *string // The date and time when the collection was last modified. LastModifiedDate *int64 // The name of the collection. Name *string // The current status of the collection. Status CollectionStatus // The type of collection. Type CollectionType noSmithyDocumentSerde } // Error information for an OpenSearch Serverless request. type CollectionErrorDetail struct { // The error code for the request. For example, NOT_FOUND . ErrorCode *string // A description of the error. For example, The specified Collection is not found. ErrorMessage *string // If the request contains collection IDs, the response includes the IDs provided // in the request. Id *string // If the request contains collection names, the response includes the names // provided in the request. Name *string noSmithyDocumentSerde } // List of filter keys that you can use for LIST, UPDATE, and DELETE requests to // OpenSearch Serverless collections. type CollectionFilters struct { // The name of the collection. Name *string // The current status of the collection. Status CollectionStatus noSmithyDocumentSerde } // Details about each OpenSearch Serverless collection. type CollectionSummary struct { // The Amazon Resource Name (ARN) of the collection. Arn *string // The unique identifier of the collection. Id *string // The name of the collection. Name *string // The current status of the collection. Status CollectionStatus noSmithyDocumentSerde } // Details about the created OpenSearch Serverless collection. type CreateCollectionDetail struct { // The Amazon Resource Name (ARN) of the collection. Arn *string // The Epoch time when the collection was created. CreatedDate *int64 // A description of the collection. Description *string // The unique identifier of the collection. Id *string // The Amazon Resource Name (ARN) of the KMS key with which to encrypt the // collection. KmsKeyArn *string // The date and time when the collection was last modified. LastModifiedDate *int64 // The name of the collection. Name *string // The current status of the collection. Status CollectionStatus // The type of collection. Type CollectionType noSmithyDocumentSerde } // Creation details for an OpenSearch Serverless-managed interface endpoint. For // more information, see Access Amazon OpenSearch Serverless using an interface // endpoint (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-vpc.html) // . type CreateVpcEndpointDetail struct { // The unique identifier of the endpoint. Id *string // The name of the endpoint. Name *string // The current status in the endpoint creation process. Status VpcEndpointStatus noSmithyDocumentSerde } // Details about a deleted OpenSearch Serverless collection. type DeleteCollectionDetail struct { // The unique identifier of the collection. Id *string // The name of the collection. Name *string // The current status of the collection. Status CollectionStatus noSmithyDocumentSerde } // Deletion details for an OpenSearch Serverless-managed interface endpoint. type DeleteVpcEndpointDetail struct { // The unique identifier of the endpoint. Id *string // The name of the endpoint. Name *string // The current status of the endpoint deletion process. Status VpcEndpointStatus noSmithyDocumentSerde } // Describes SAML options for an OpenSearch Serverless security configuration in // the form of a key-value map. type SamlConfigOptions struct { // The XML IdP metadata file generated from your identity provider. // // This member is required. Metadata *string // The group attribute for this SAML integration. GroupAttribute *string // The session timeout, in minutes. Default is 60 minutes (12 hours). SessionTimeout *int32 // A user attribute for this SAML integration. UserAttribute *string noSmithyDocumentSerde } // Details about a security configuration for OpenSearch Serverless. type SecurityConfigDetail struct { // The version of the security configuration. ConfigVersion *string // The date the configuration was created. CreatedDate *int64 // The description of the security configuration. Description *string // The unique identifier of the security configuration. Id *string // The timestamp of when the configuration was last modified. LastModifiedDate *int64 // SAML options for the security configuration in the form of a key-value map. SamlOptions *SamlConfigOptions // The type of security configuration. Type SecurityConfigType noSmithyDocumentSerde } // Statistics for an OpenSearch Serverless security configuration. type SecurityConfigStats struct { // The number of security configurations in the current account. SamlConfigCount *int64 noSmithyDocumentSerde } // A summary of a security configuration for OpenSearch Serverless. type SecurityConfigSummary struct { // The version of the security configuration. ConfigVersion *string // The Epoch time when the security configuration was created. CreatedDate *int64 // The description of the security configuration. Description *string // The unique identifier of the security configuration. Id *string // The timestamp of when the configuration was last modified. LastModifiedDate *int64 // The type of security configuration. Type SecurityConfigType noSmithyDocumentSerde } // Details about an OpenSearch Serverless security policy. type SecurityPolicyDetail struct { // The date the policy was created. CreatedDate *int64 // The description of the security policy. Description *string // The timestamp of when the policy was last modified. LastModifiedDate *int64 // The name of the policy. Name *string // The JSON policy document without any whitespaces. Policy document.Interface // The version of the policy. PolicyVersion *string // The type of security policy. Type SecurityPolicyType noSmithyDocumentSerde } // Statistics for an OpenSearch Serverless security policy. type SecurityPolicyStats struct { // The number of encryption policies in the current account. EncryptionPolicyCount *int64 // The number of network policies in the current account. NetworkPolicyCount *int64 noSmithyDocumentSerde } // A summary of a security policy for OpenSearch Serverless. type SecurityPolicySummary struct { // The date the policy was created. CreatedDate *int64 // The description of the security policy. Description *string // The timestamp of when the policy was last modified. LastModifiedDate *int64 // The name of the policy. Name *string // The version of the policy. PolicyVersion *string // The type of security policy. Type SecurityPolicyType noSmithyDocumentSerde } // A map of key-value pairs associated to an OpenSearch Serverless resource. type Tag struct { // The key to use in the tag. // // This member is required. Key *string // The value of the tag. // // This member is required. Value *string noSmithyDocumentSerde } // Details about an updated OpenSearch Serverless collection. type UpdateCollectionDetail struct { // The Amazon Resource Name (ARN) of the collection. Arn *string // The date and time when the collection was created. CreatedDate *int64 // The description of the collection. Description *string // The unique identifier of the collection. Id *string // The date and time when the collection was last modified. LastModifiedDate *int64 // The name of the collection. Name *string // The current status of the collection. Status CollectionStatus // The collection type. Type CollectionType noSmithyDocumentSerde } // Update details for an OpenSearch Serverless-managed interface endpoint. type UpdateVpcEndpointDetail struct { // The unique identifier of the endpoint. Id *string // The timestamp of when the endpoint was last modified. LastModifiedDate *int64 // The name of the endpoint. Name *string // The unique identifiers of the security groups that define the ports, protocols, // and sources for inbound traffic that you are authorizing into your endpoint. SecurityGroupIds []string // The current status of the endpoint update process. Status VpcEndpointStatus // The ID of the subnets from which you access OpenSearch Serverless. SubnetIds []string noSmithyDocumentSerde } // Details about an OpenSearch Serverless-managed interface endpoint. type VpcEndpointDetail struct { // The date the endpoint was created. CreatedDate *int64 // The unique identifier of the endpoint. Id *string // The name of the endpoint. Name *string // The unique identifiers of the security groups that define the ports, protocols, // and sources for inbound traffic that you are authorizing into your endpoint. SecurityGroupIds []string // The current status of the endpoint. Status VpcEndpointStatus // The ID of the subnets from which you access OpenSearch Serverless. SubnetIds []string // The ID of the VPC from which you access OpenSearch Serverless. VpcId *string noSmithyDocumentSerde } // Error information for a failed BatchGetVpcEndpoint request. type VpcEndpointErrorDetail struct { // The error code for the failed request. ErrorCode *string // An error message describing the reason for the failure. ErrorMessage *string // The unique identifier of the VPC endpoint. Id *string noSmithyDocumentSerde } // Filter the results of a ListVpcEndpoints request. type VpcEndpointFilters struct { // The current status of the endpoint. Status VpcEndpointStatus noSmithyDocumentSerde } // The VPC endpoint object. type VpcEndpointSummary struct { // The unique identifier of the endpoint. Id *string // The name of the endpoint. Name *string // The current status of the endpoint. Status VpcEndpointStatus noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
556
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opsworks 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 = "OpsWorks" const ServiceAPIVersion = "2013-02-18" // Client provides the API client to make operations call for AWS OpsWorks. 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, "opsworks", 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 opsworks 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 opsworks 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" ) // Assign a registered instance to a layer. // - You can assign registered on-premises instances to any layer type. // - You can assign registered Amazon EC2 instances only to custom layers. // - You cannot use this action with instances that were created with AWS // OpsWorks Stacks. // // Required Permissions: To use this action, an AWS Identity and Access Management // (IAM) user must have a Manage permissions level for the stack or an attached // policy that explicitly grants permissions. For more information on user // permissions, see Managing User Permissions (https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) // . func (c *Client) AssignInstance(ctx context.Context, params *AssignInstanceInput, optFns ...func(*Options)) (*AssignInstanceOutput, error) { if params == nil { params = &AssignInstanceInput{} } result, metadata, err := c.invokeOperation(ctx, "AssignInstance", params, optFns, c.addOperationAssignInstanceMiddlewares) if err != nil { return nil, err } out := result.(*AssignInstanceOutput) out.ResultMetadata = metadata return out, nil } type AssignInstanceInput struct { // The instance ID. // // This member is required. InstanceId *string // The layer ID, which must correspond to a custom layer. You cannot assign a // registered instance to a built-in layer. // // This member is required. LayerIds []string noSmithyDocumentSerde } type AssignInstanceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAssignInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssignInstance{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssignInstance{}, 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 = addOpAssignInstanceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssignInstance(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_opAssignInstance(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "opsworks", OperationName: "AssignInstance", } }
136
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opsworks 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" ) // Assigns one of the stack's registered Amazon EBS volumes to a specified // instance. The volume must first be registered with the stack by calling // RegisterVolume . After you register the volume, you must call UpdateVolume to // specify a mount point before calling AssignVolume . For more information, see // Resource Management (https://docs.aws.amazon.com/opsworks/latest/userguide/resources.html) // . Required Permissions: To use this action, an IAM user must have a Manage // permissions level for the stack, or an attached policy that explicitly grants // permissions. For more information on user permissions, see Managing User // Permissions (https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) // . func (c *Client) AssignVolume(ctx context.Context, params *AssignVolumeInput, optFns ...func(*Options)) (*AssignVolumeOutput, error) { if params == nil { params = &AssignVolumeInput{} } result, metadata, err := c.invokeOperation(ctx, "AssignVolume", params, optFns, c.addOperationAssignVolumeMiddlewares) if err != nil { return nil, err } out := result.(*AssignVolumeOutput) out.ResultMetadata = metadata return out, nil } type AssignVolumeInput struct { // The volume ID. // // This member is required. VolumeId *string // The instance ID. InstanceId *string noSmithyDocumentSerde } type AssignVolumeOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAssignVolumeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssignVolume{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssignVolume{}, 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 = addOpAssignVolumeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssignVolume(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_opAssignVolume(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "opsworks", OperationName: "AssignVolume", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opsworks 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" ) // Associates one of the stack's registered Elastic IP addresses with a specified // instance. The address must first be registered with the stack by calling // RegisterElasticIp . For more information, see Resource Management (https://docs.aws.amazon.com/opsworks/latest/userguide/resources.html) // . Required Permissions: To use this action, an IAM user must have a Manage // permissions level for the stack, or an attached policy that explicitly grants // permissions. For more information on user permissions, see Managing User // Permissions (https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) // . func (c *Client) AssociateElasticIp(ctx context.Context, params *AssociateElasticIpInput, optFns ...func(*Options)) (*AssociateElasticIpOutput, error) { if params == nil { params = &AssociateElasticIpInput{} } result, metadata, err := c.invokeOperation(ctx, "AssociateElasticIp", params, optFns, c.addOperationAssociateElasticIpMiddlewares) if err != nil { return nil, err } out := result.(*AssociateElasticIpOutput) out.ResultMetadata = metadata return out, nil } type AssociateElasticIpInput struct { // The Elastic IP address. // // This member is required. ElasticIp *string // The instance ID. InstanceId *string noSmithyDocumentSerde } type AssociateElasticIpOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAssociateElasticIpMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateElasticIp{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateElasticIp{}, 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 = addOpAssociateElasticIpValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateElasticIp(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_opAssociateElasticIp(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "opsworks", OperationName: "AssociateElasticIp", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opsworks 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" ) // Attaches an Elastic Load Balancing load balancer to a specified layer. AWS // OpsWorks Stacks does not support Application Load Balancer. You can only use // Classic Load Balancer with AWS OpsWorks Stacks. For more information, see // Elastic Load Balancing (https://docs.aws.amazon.com/opsworks/latest/userguide/layers-elb.html) // . You must create the Elastic Load Balancing instance separately, by using the // Elastic Load Balancing console, API, or CLI. For more information, see Elastic // Load Balancing Developer Guide (https://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/Welcome.html) // . Required Permissions: To use this action, an IAM user must have a Manage // permissions level for the stack, or an attached policy that explicitly grants // permissions. For more information on user permissions, see Managing User // Permissions (https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) // . func (c *Client) AttachElasticLoadBalancer(ctx context.Context, params *AttachElasticLoadBalancerInput, optFns ...func(*Options)) (*AttachElasticLoadBalancerOutput, error) { if params == nil { params = &AttachElasticLoadBalancerInput{} } result, metadata, err := c.invokeOperation(ctx, "AttachElasticLoadBalancer", params, optFns, c.addOperationAttachElasticLoadBalancerMiddlewares) if err != nil { return nil, err } out := result.(*AttachElasticLoadBalancerOutput) out.ResultMetadata = metadata return out, nil } type AttachElasticLoadBalancerInput struct { // The Elastic Load Balancing instance's name. // // This member is required. ElasticLoadBalancerName *string // The ID of the layer to which the Elastic Load Balancing instance is to be // attached. // // This member is required. LayerId *string noSmithyDocumentSerde } type AttachElasticLoadBalancerOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAttachElasticLoadBalancerMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpAttachElasticLoadBalancer{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAttachElasticLoadBalancer{}, 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 = addOpAttachElasticLoadBalancerValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAttachElasticLoadBalancer(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_opAttachElasticLoadBalancer(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "opsworks", OperationName: "AttachElasticLoadBalancer", } }
137
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opsworks 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/opsworks/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a clone of a specified stack. For more information, see Clone a Stack (https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-cloning.html) // . By default, all parameters are set to the values used by the parent stack. // Required Permissions: To use this action, an IAM user must have an attached // policy that explicitly grants permissions. For more information about user // permissions, see Managing User Permissions (https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) // . func (c *Client) CloneStack(ctx context.Context, params *CloneStackInput, optFns ...func(*Options)) (*CloneStackOutput, error) { if params == nil { params = &CloneStackInput{} } result, metadata, err := c.invokeOperation(ctx, "CloneStack", params, optFns, c.addOperationCloneStackMiddlewares) if err != nil { return nil, err } out := result.(*CloneStackOutput) out.ResultMetadata = metadata return out, nil } type CloneStackInput struct { // The stack AWS Identity and Access Management (IAM) role, which allows AWS // OpsWorks Stacks to work with AWS resources on your behalf. You must set this // parameter to the Amazon Resource Name (ARN) for an existing IAM role. If you // create a stack by using the AWS OpsWorks Stacks console, it creates the role for // you. You can obtain an existing stack's IAM ARN programmatically by calling // DescribePermissions . For more information about IAM ARNs, see Using Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) // . You must set this parameter to a valid service role ARN or the action will // fail; there is no default value. You can specify the source stack's service role // ARN, if you prefer, but you must do so explicitly. // // This member is required. ServiceRoleArn *string // The source stack ID. // // This member is required. SourceStackId *string // The default AWS OpsWorks Stacks agent version. You have the following options: // - Auto-update - Set this parameter to LATEST . AWS OpsWorks Stacks // automatically installs new agent versions on the stack's instances as soon as // they are available. // - Fixed version - Set this parameter to your preferred agent version. To // update the agent version, you must edit the stack configuration and specify a // new version. AWS OpsWorks Stacks then automatically installs that version on the // stack's instances. // The default setting is LATEST . To specify an agent version, you must use the // complete version number, not the abbreviated number shown on the console. For a // list of available agent version numbers, call DescribeAgentVersions . // AgentVersion cannot be set to Chef 12.2. You can also specify an agent version // when you create or update an instance, which overrides the stack's default // setting. AgentVersion *string // A list of stack attributes and values as key/value pairs to be added to the // cloned stack. Attributes map[string]string // A ChefConfiguration object that specifies whether to enable Berkshelf and the // Berkshelf version on Chef 11.10 stacks. For more information, see Create a New // Stack (https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html) // . ChefConfiguration *types.ChefConfiguration // A list of source stack app IDs to be included in the cloned stack. CloneAppIds []string // Whether to clone the source stack's permissions. ClonePermissions *bool // The configuration manager. When you clone a stack we recommend that you use the // configuration manager to specify the Chef version: 12, 11.10, or 11.4 for Linux // stacks, or 12.2 for Windows stacks. The default value for Linux stacks is // currently 12. ConfigurationManager *types.StackConfigurationManager // Contains the information required to retrieve an app or cookbook from a // repository. For more information, see Adding Apps (https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html) // or Cookbooks and Recipes (https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook.html) // . CustomCookbooksSource *types.Source // A string that contains user-defined, custom JSON. It is used to override the // corresponding default stack configuration JSON values. The string should be in // the following format: "{\"key1\": \"value1\", \"key2\": \"value2\",...}" For // more information about custom JSON, see Use Custom JSON to Modify the Stack // Configuration Attributes (https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html) CustomJson *string // The cloned stack's default Availability Zone, which must be in the specified // region. For more information, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html) // . If you also specify a value for DefaultSubnetId , the subnet must be in the // same zone. For more information, see the VpcId parameter description. DefaultAvailabilityZone *string // The Amazon Resource Name (ARN) of an IAM profile that is the default profile // for all of the stack's EC2 instances. For more information about IAM ARNs, see // Using Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) // . DefaultInstanceProfileArn *string // The stack's operating system, which must be set to one of the following. // - A supported Linux operating system: An Amazon Linux version, such as Amazon // Linux 2018.03 , Amazon Linux 2017.09 , Amazon Linux 2017.03 , Amazon Linux // 2016.09 , Amazon Linux 2016.03 , Amazon Linux 2015.09 , or Amazon Linux // 2015.03 . // - A supported Ubuntu operating system, such as Ubuntu 16.04 LTS , Ubuntu // 14.04 LTS , or Ubuntu 12.04 LTS . // - CentOS Linux 7 // - Red Hat Enterprise Linux 7 // - Microsoft Windows Server 2012 R2 Base , Microsoft Windows Server 2012 R2 // with SQL Server Express , Microsoft Windows Server 2012 R2 with SQL Server // Standard , or Microsoft Windows Server 2012 R2 with SQL Server Web . // - A custom AMI: Custom . You specify the custom AMI you want to use when you // create instances. For more information about how to use custom AMIs with // OpsWorks, see Using Custom AMIs (https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html) // . // The default option is the parent stack's operating system. For more information // about supported operating systems, see AWS OpsWorks Stacks Operating Systems (https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html) // . You can specify a different Linux operating system for the cloned stack, but // you cannot change from Linux to Windows or Windows to Linux. DefaultOs *string // The default root device type. This value is used by default for all instances // in the cloned stack, but you can override it when you create an instance. For // more information, see Storage for the Root Device (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device) // . DefaultRootDeviceType types.RootDeviceType // A default Amazon EC2 key pair name. The default value is none. If you specify a // key pair name, AWS OpsWorks installs the public key on the instance and you can // use the private key with an SSH client to log in to the instance. For more // information, see Using SSH to Communicate with an Instance (https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-ssh.html) // and Managing SSH Access (https://docs.aws.amazon.com/opsworks/latest/userguide/security-ssh-access.html) // . You can override this setting by specifying a different key pair, or no key // pair, when you create an instance (https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-add.html) // . DefaultSshKeyName *string // The stack's default VPC subnet ID. This parameter is required if you specify a // value for the VpcId parameter. All instances are launched into this subnet // unless you specify otherwise when you create the instance. If you also specify a // value for DefaultAvailabilityZone , the subnet must be in that zone. For // information on default values and when this parameter is required, see the VpcId // parameter description. DefaultSubnetId *string // The stack's host name theme, with spaces are replaced by underscores. The theme // is used to generate host names for the stack's instances. By default, // HostnameTheme is set to Layer_Dependent , which creates host names by appending // integers to the layer's short name. The other themes are: // - Baked_Goods // - Clouds // - Europe_Cities // - Fruits // - Greek_Deities_and_Titans // - Legendary_creatures_from_Japan // - Planets_and_Moons // - Roman_Deities // - Scottish_Islands // - US_Cities // - Wild_Cats // To obtain a generated host name, call GetHostNameSuggestion , which returns a // host name based on the current theme. HostnameTheme *string // The cloned stack name. Name *string // The cloned stack AWS region, such as "ap-northeast-2". For more information // about AWS regions, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html) // . Region *string // Whether to use custom cookbooks. UseCustomCookbooks *bool // Whether to associate the AWS OpsWorks Stacks built-in security groups with the // stack's layers. AWS OpsWorks Stacks provides a standard set of built-in security // groups, one for each layer, which are associated with layers by default. With // UseOpsworksSecurityGroups you can instead provide your own custom security // groups. UseOpsworksSecurityGroups has the following settings: // - True - AWS OpsWorks Stacks automatically associates the appropriate // built-in security group with each layer (default setting). You can associate // additional security groups with a layer after you create it but you cannot // delete the built-in security group. // - False - AWS OpsWorks Stacks does not associate built-in security groups // with layers. You must create appropriate Amazon Elastic Compute Cloud (Amazon // EC2) security groups and associate a security group with each layer that you // create. However, you can still manually associate a built-in security group with // a layer on creation; custom security groups are required only for those layers // that need custom settings. // For more information, see Create a New Stack (https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html) // . UseOpsworksSecurityGroups *bool // The ID of the VPC that the cloned stack is to be launched into. It must be in // the specified region. All instances are launched into this VPC, and you cannot // change the ID later. // - If your account supports EC2 Classic, the default value is no VPC. // - If your account does not support EC2 Classic, the default value is the // default VPC for the specified region. // If the VPC ID corresponds to a default VPC and you have specified either the // DefaultAvailabilityZone or the DefaultSubnetId parameter only, AWS OpsWorks // Stacks infers the value of the other parameter. If you specify neither // parameter, AWS OpsWorks Stacks sets these parameters to the first valid // Availability Zone for the specified region and the corresponding default VPC // subnet ID, respectively. If you specify a nondefault VPC ID, note the following: // // - It must belong to a VPC in your account that is in the specified region. // - You must specify a value for DefaultSubnetId . // For more information about how to use AWS OpsWorks Stacks with a VPC, see // Running a Stack in a VPC (https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-vpc.html) // . For more information about default VPC and EC2 Classic, see Supported // Platforms (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html) // . VpcId *string noSmithyDocumentSerde } // Contains the response to a CloneStack request. type CloneStackOutput struct { // The cloned stack ID. StackId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCloneStackMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCloneStack{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCloneStack{}, 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 = addOpCloneStackValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCloneStack(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_opCloneStack(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "opsworks", OperationName: "CloneStack", } }
324
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opsworks 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/opsworks/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates an app for a specified stack. For more information, see Creating Apps (https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html) // . Required Permissions: To use this action, an IAM user must have a Manage // permissions level for the stack, or an attached policy that explicitly grants // permissions. For more information on user permissions, see Managing User // Permissions (https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) // . func (c *Client) CreateApp(ctx context.Context, params *CreateAppInput, optFns ...func(*Options)) (*CreateAppOutput, error) { if params == nil { params = &CreateAppInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateApp", params, optFns, c.addOperationCreateAppMiddlewares) if err != nil { return nil, err } out := result.(*CreateAppOutput) out.ResultMetadata = metadata return out, nil } type CreateAppInput struct { // The app name. // // This member is required. Name *string // The stack ID. // // This member is required. StackId *string // The app type. Each supported type is associated with a particular layer. For // example, PHP applications are associated with a PHP layer. AWS OpsWorks Stacks // deploys an application to those instances that are members of the corresponding // layer. If your app isn't one of the standard types, or you prefer to implement // your own Deploy recipes, specify other . // // This member is required. Type types.AppType // A Source object that specifies the app repository. AppSource *types.Source // One or more user-defined key/value pairs to be added to the stack attributes. Attributes map[string]string // The app's data source. DataSources []types.DataSource // A description of the app. Description *string // The app virtual host settings, with multiple domains separated by commas. For // example: 'www.example.com, example.com' Domains []string // Whether to enable SSL for the app. EnableSsl *bool // An array of EnvironmentVariable objects that specify environment variables to // be associated with the app. After you deploy the app, these variables are // defined on the associated app server instance. For more information, see // Environment Variables (https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html#workingapps-creating-environment) // . There is no specific limit on the number of environment variables. However, // the size of the associated data structure - which includes the variables' names, // values, and protected flag values - cannot exceed 20 KB. This limit should // accommodate most if not all use cases. Exceeding it will cause an exception with // the message, "Environment: is too large (maximum is 20KB)." If you have // specified one or more environment variables, you cannot modify the stack's Chef // version. Environment []types.EnvironmentVariable // The app's short name. Shortname *string // An SslConfiguration object with the SSL configuration. SslConfiguration *types.SslConfiguration noSmithyDocumentSerde } // Contains the response to a CreateApp request. type CreateAppOutput struct { // The app ID. AppId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateAppMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateApp{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateApp{}, 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 = addOpCreateAppValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateApp(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_opCreateApp(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "opsworks", OperationName: "CreateApp", } }
183
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opsworks 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/opsworks/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Runs deployment or stack commands. For more information, see Deploying Apps (https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-deploying.html) // and Run Stack Commands (https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-commands.html) // . Required Permissions: To use this action, an IAM user must have a Deploy or // Manage permissions level for the stack, or an attached policy that explicitly // grants permissions. For more information on user permissions, see Managing User // Permissions (https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) // . func (c *Client) CreateDeployment(ctx context.Context, params *CreateDeploymentInput, optFns ...func(*Options)) (*CreateDeploymentOutput, error) { if params == nil { params = &CreateDeploymentInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateDeployment", params, optFns, c.addOperationCreateDeploymentMiddlewares) if err != nil { return nil, err } out := result.(*CreateDeploymentOutput) out.ResultMetadata = metadata return out, nil } type CreateDeploymentInput struct { // A DeploymentCommand object that specifies the deployment command and any // associated arguments. // // This member is required. Command *types.DeploymentCommand // The stack ID. // // This member is required. StackId *string // The app ID. This parameter is required for app deployments, but not for other // deployment commands. AppId *string // A user-defined comment. Comment *string // A string that contains user-defined, custom JSON. You can use this parameter to // override some corresponding default stack configuration JSON values. The string // should be in the following format: "{\"key1\": \"value1\", \"key2\": // \"value2\",...}" For more information about custom JSON, see Use Custom JSON to // Modify the Stack Configuration Attributes (https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html) // and Overriding Attributes With Custom JSON (https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-json-override.html) // . CustomJson *string // The instance IDs for the deployment targets. InstanceIds []string // The layer IDs for the deployment targets. LayerIds []string noSmithyDocumentSerde } // Contains the response to a CreateDeployment request. type CreateDeploymentOutput struct { // The deployment ID, which can be used with other requests to identify the // deployment. DeploymentId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateDeploymentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateDeployment{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateDeployment{}, 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 = addOpCreateDeploymentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDeployment(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_opCreateDeployment(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "opsworks", OperationName: "CreateDeployment", } }
161
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opsworks 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/opsworks/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates an instance in a specified stack. For more information, see Adding an // Instance to a Layer (https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-add.html) // . Required Permissions: To use this action, an IAM user must have a Manage // permissions level for the stack, or an attached policy that explicitly grants // permissions. For more information on user permissions, see Managing User // Permissions (https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) // . func (c *Client) CreateInstance(ctx context.Context, params *CreateInstanceInput, optFns ...func(*Options)) (*CreateInstanceOutput, error) { if params == nil { params = &CreateInstanceInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateInstance", params, optFns, c.addOperationCreateInstanceMiddlewares) if err != nil { return nil, err } out := result.(*CreateInstanceOutput) out.ResultMetadata = metadata return out, nil } type CreateInstanceInput struct { // The instance type, such as t2.micro . For a list of supported instance types, // open the stack in the console, choose Instances, and choose + Instance. The Size // list contains the currently supported types. For more information, see Instance // Families and Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) // . The parameter values that you use to specify the various types are in the API // Name column of the Available Instance Types table. // // This member is required. InstanceType *string // An array that contains the instance's layer IDs. // // This member is required. LayerIds []string // The stack ID. // // This member is required. StackId *string // The default AWS OpsWorks Stacks agent version. You have the following options: // - INHERIT - Use the stack's default agent version setting. // - version_number - Use the specified agent version. This value overrides the // stack's default setting. To update the agent version, edit the instance // configuration and specify a new version. AWS OpsWorks Stacks then automatically // installs that version on the instance. // The default setting is INHERIT . To specify an agent version, you must use the // complete version number, not the abbreviated number shown on the console. For a // list of available agent version numbers, call DescribeAgentVersions . // AgentVersion cannot be set to Chef 12.2. AgentVersion *string // A custom AMI ID to be used to create the instance. The AMI should be based on // one of the supported operating systems. For more information, see Using Custom // AMIs (https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html) // . If you specify a custom AMI, you must set Os to Custom . AmiId *string // The instance architecture. The default option is x86_64 . Instance types do not // necessarily support both architectures. For a list of the architectures that are // supported by the different instance types, see Instance Families and Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) // . Architecture types.Architecture // For load-based or time-based instances, the type. Windows stacks can use only // time-based instances. AutoScalingType types.AutoScalingType // The instance Availability Zone. For more information, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html) // . AvailabilityZone *string // An array of BlockDeviceMapping objects that specify the instance's block // devices. For more information, see Block Device Mapping (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html) // . Note that block device mappings are not supported for custom AMIs. BlockDeviceMappings []types.BlockDeviceMapping // Whether to create an Amazon EBS-optimized instance. EbsOptimized *bool // The instance host name. Hostname *string // Whether to install operating system and package updates when the instance // boots. The default value is true . To control when updates are installed, set // this value to false . You must then update your instances manually by using // CreateDeployment to run the update_dependencies stack command or by manually // running yum (Amazon Linux) or apt-get (Ubuntu) on the instances. We strongly // recommend using the default value of true to ensure that your instances have // the latest security updates. InstallUpdatesOnBoot *bool // The instance's operating system, which must be set to one of the following. // - A supported Linux operating system: An Amazon Linux version, such as Amazon // Linux 2018.03 , Amazon Linux 2017.09 , Amazon Linux 2017.03 , Amazon Linux // 2016.09 , Amazon Linux 2016.03 , Amazon Linux 2015.09 , or Amazon Linux // 2015.03 . // - A supported Ubuntu operating system, such as Ubuntu 16.04 LTS , Ubuntu // 14.04 LTS , or Ubuntu 12.04 LTS . // - CentOS Linux 7 // - Red Hat Enterprise Linux 7 // - A supported Windows operating system, such as Microsoft Windows Server 2012 // R2 Base , Microsoft Windows Server 2012 R2 with SQL Server Express , // Microsoft Windows Server 2012 R2 with SQL Server Standard , or Microsoft // Windows Server 2012 R2 with SQL Server Web . // - A custom AMI: Custom . // For more information about the supported operating systems, see AWS OpsWorks // Stacks Operating Systems (https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html) // . The default option is the current Amazon Linux version. If you set this // parameter to Custom , you must use the CreateInstance action's AmiId parameter // to specify the custom AMI that you want to use. Block device mappings are not // supported if the value is Custom . For more information about supported // operating systems, see Operating Systems (https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html) // For more information about how to use custom AMIs with AWS OpsWorks Stacks, see // Using Custom AMIs (https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html) // . Os *string // The instance root device type. For more information, see Storage for the Root // Device (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device) // . RootDeviceType types.RootDeviceType // The instance's Amazon EC2 key-pair name. SshKeyName *string // The ID of the instance's subnet. If the stack is running in a VPC, you can use // this parameter to override the stack's default subnet ID value and direct AWS // OpsWorks Stacks to launch the instance in a different subnet. SubnetId *string // The instance's tenancy option. The default option is no tenancy, or if the // instance is running in a VPC, inherit tenancy settings from the VPC. The // following are valid values for this parameter: dedicated , default , or host . // Because there are costs associated with changes in tenancy options, we recommend // that you research tenancy options before choosing them for your instances. For // more information about dedicated hosts, see Dedicated Hosts Overview (http://aws.amazon.com/ec2/dedicated-hosts/) // and Amazon EC2 Dedicated Hosts (http://aws.amazon.com/ec2/dedicated-hosts/) . // For more information about dedicated instances, see Dedicated Instances (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/dedicated-instance.html) // and Amazon EC2 Dedicated Instances (http://aws.amazon.com/ec2/purchasing-options/dedicated-instances/) // . Tenancy *string // The instance's virtualization type, paravirtual or hvm . VirtualizationType *string noSmithyDocumentSerde } // Contains the response to a CreateInstance request. type CreateInstanceOutput struct { // The instance ID. InstanceId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateInstance{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateInstance{}, 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 = addOpCreateInstanceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateInstance(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_opCreateInstance(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "opsworks", OperationName: "CreateInstance", } }
253
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opsworks 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/opsworks/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a layer. For more information, see How to Create a Layer (https://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-create.html) // . You should use CreateLayer for noncustom layer types such as PHP App Server // only if the stack does not have an existing layer of that type. A stack can have // at most one instance of each noncustom layer; if you attempt to create a second // instance, CreateLayer fails. A stack can have an arbitrary number of custom // layers, so you can call CreateLayer as many times as you like for that layer // type. Required Permissions: To use this action, an IAM user must have a Manage // permissions level for the stack, or an attached policy that explicitly grants // permissions. For more information on user permissions, see Managing User // Permissions (https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) // . func (c *Client) CreateLayer(ctx context.Context, params *CreateLayerInput, optFns ...func(*Options)) (*CreateLayerOutput, error) { if params == nil { params = &CreateLayerInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateLayer", params, optFns, c.addOperationCreateLayerMiddlewares) if err != nil { return nil, err } out := result.(*CreateLayerOutput) out.ResultMetadata = metadata return out, nil } type CreateLayerInput struct { // The layer name, which is used by the console. // // This member is required. Name *string // For custom layers only, use this parameter to specify the layer's short name, // which is used internally by AWS OpsWorks Stacks and by Chef recipes. The short // name is also used as the name for the directory where your app files are // installed. It can have a maximum of 200 characters, which are limited to the // alphanumeric characters, '-', '_', and '.'. The built-in layers' short names are // defined by AWS OpsWorks Stacks. For more information, see the Layer Reference (https://docs.aws.amazon.com/opsworks/latest/userguide/layers.html) // . // // This member is required. Shortname *string // The layer stack ID. // // This member is required. StackId *string // The layer type. A stack cannot have more than one built-in layer of the same // type. It can have any number of custom layers. Built-in layers are not available // in Chef 12 stacks. // // This member is required. Type types.LayerType // One or more user-defined key-value pairs to be added to the stack attributes. // To create a cluster layer, set the EcsClusterArn attribute to the cluster's ARN. Attributes map[string]string // Whether to automatically assign an Elastic IP address (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) // to the layer's instances. For more information, see How to Edit a Layer (https://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html) // . AutoAssignElasticIps *bool // For stacks that are running in a VPC, whether to automatically assign a public // IP address to the layer's instances. For more information, see How to Edit a // Layer (https://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html) // . AutoAssignPublicIps *bool // Specifies CloudWatch Logs configuration options for the layer. For more // information, see CloudWatchLogsLogStream . CloudWatchLogsConfiguration *types.CloudWatchLogsConfiguration // The ARN of an IAM profile to be used for the layer's EC2 instances. For more // information about IAM ARNs, see Using Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) // . CustomInstanceProfileArn *string // A JSON-formatted string containing custom stack configuration and deployment // attributes to be installed on the layer's instances. For more information, see // Using Custom JSON (https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-json-override.html) // . This feature is supported as of version 1.7.42 of the AWS CLI. CustomJson *string // A LayerCustomRecipes object that specifies the layer custom recipes. CustomRecipes *types.Recipes // An array containing the layer custom security group IDs. CustomSecurityGroupIds []string // Whether to disable auto healing for the layer. EnableAutoHealing *bool // Whether to install operating system and package updates when the instance // boots. The default value is true . To control when updates are installed, set // this value to false . You must then update your instances manually by using // CreateDeployment to run the update_dependencies stack command or by manually // running yum (Amazon Linux) or apt-get (Ubuntu) on the instances. To ensure that // your instances have the latest security updates, we strongly recommend using the // default value of true . InstallUpdatesOnBoot *bool // A LifeCycleEventConfiguration object that you can use to configure the Shutdown // event to specify an execution timeout and enable or disable Elastic Load // Balancer connection draining. LifecycleEventConfiguration *types.LifecycleEventConfiguration // An array of Package objects that describes the layer packages. Packages []string // Whether to use Amazon EBS-optimized instances. UseEbsOptimizedInstances *bool // A VolumeConfigurations object that describes the layer's Amazon EBS volumes. VolumeConfigurations []types.VolumeConfiguration noSmithyDocumentSerde } // Contains the response to a CreateLayer request. type CreateLayerOutput struct { // The layer ID. LayerId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateLayerMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateLayer{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateLayer{}, 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 = addOpCreateLayerValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLayer(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_opCreateLayer(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "opsworks", OperationName: "CreateLayer", } }
221
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opsworks 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/opsworks/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new stack. For more information, see Create a New Stack (https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-edit.html) // . Required Permissions: To use this action, an IAM user must have an attached // policy that explicitly grants permissions. For more information about user // permissions, see Managing User Permissions (https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) // . func (c *Client) CreateStack(ctx context.Context, params *CreateStackInput, optFns ...func(*Options)) (*CreateStackOutput, error) { if params == nil { params = &CreateStackInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateStack", params, optFns, c.addOperationCreateStackMiddlewares) if err != nil { return nil, err } out := result.(*CreateStackOutput) out.ResultMetadata = metadata return out, nil } type CreateStackInput struct { // The Amazon Resource Name (ARN) of an IAM profile that is the default profile // for all of the stack's EC2 instances. For more information about IAM ARNs, see // Using Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) // . // // This member is required. DefaultInstanceProfileArn *string // The stack name. // // This member is required. Name *string // The stack's AWS region, such as ap-south-1 . For more information about Amazon // regions, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html) // . In the AWS CLI, this API maps to the --stack-region parameter. If the // --stack-region parameter and the AWS CLI common parameter --region are set to // the same value, the stack uses a regional endpoint. If the --stack-region // parameter is not set, but the AWS CLI --region parameter is, this also results // in a stack with a regional endpoint. However, if the --region parameter is set // to us-east-1 , and the --stack-region parameter is set to one of the following, // then the stack uses a legacy or classic region: us-west-1, us-west-2, // sa-east-1, eu-central-1, eu-west-1, ap-northeast-1, ap-southeast-1, // ap-southeast-2 . In this case, the actual API endpoint of the stack is in // us-east-1 . Only the preceding regions are supported as classic regions in the // us-east-1 API endpoint. Because it is a best practice to choose the regional // endpoint that is closest to where you manage AWS, we recommend that you use // regional endpoints for new stacks. The AWS CLI common --region parameter always // specifies a regional API endpoint; it cannot be used to specify a classic AWS // OpsWorks Stacks region. // // This member is required. Region *string // The stack's AWS Identity and Access Management (IAM) role, which allows AWS // OpsWorks Stacks to work with AWS resources on your behalf. You must set this // parameter to the Amazon Resource Name (ARN) for an existing IAM role. For more // information about IAM ARNs, see Using Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) // . // // This member is required. ServiceRoleArn *string // The default AWS OpsWorks Stacks agent version. You have the following options: // - Auto-update - Set this parameter to LATEST . AWS OpsWorks Stacks // automatically installs new agent versions on the stack's instances as soon as // they are available. // - Fixed version - Set this parameter to your preferred agent version. To // update the agent version, you must edit the stack configuration and specify a // new version. AWS OpsWorks Stacks then automatically installs that version on the // stack's instances. // The default setting is the most recent release of the agent. To specify an // agent version, you must use the complete version number, not the abbreviated // number shown on the console. For a list of available agent version numbers, call // DescribeAgentVersions . AgentVersion cannot be set to Chef 12.2. You can also // specify an agent version when you create or update an instance, which overrides // the stack's default setting. AgentVersion *string // One or more user-defined key-value pairs to be added to the stack attributes. Attributes map[string]string // A ChefConfiguration object that specifies whether to enable Berkshelf and the // Berkshelf version on Chef 11.10 stacks. For more information, see Create a New // Stack (https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html) // . ChefConfiguration *types.ChefConfiguration // The configuration manager. When you create a stack we recommend that you use // the configuration manager to specify the Chef version: 12, 11.10, or 11.4 for // Linux stacks, or 12.2 for Windows stacks. The default value for Linux stacks is // currently 12. ConfigurationManager *types.StackConfigurationManager // Contains the information required to retrieve an app or cookbook from a // repository. For more information, see Adding Apps (https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html) // or Cookbooks and Recipes (https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook.html) // . CustomCookbooksSource *types.Source // A string that contains user-defined, custom JSON. It can be used to override // the corresponding default stack configuration attribute values or to pass data // to recipes. The string should be in the following format: "{\"key1\": // \"value1\", \"key2\": \"value2\",...}" For more information about custom JSON, // see Use Custom JSON to Modify the Stack Configuration Attributes (https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html) // . CustomJson *string // The stack's default Availability Zone, which must be in the specified region. // For more information, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html) // . If you also specify a value for DefaultSubnetId , the subnet must be in the // same zone. For more information, see the VpcId parameter description. DefaultAvailabilityZone *string // The stack's default operating system, which is installed on every instance // unless you specify a different operating system when you create the instance. // You can specify one of the following. // - A supported Linux operating system: An Amazon Linux version, such as Amazon // Linux 2018.03 , Amazon Linux 2017.09 , Amazon Linux 2017.03 , Amazon Linux // 2016.09 , Amazon Linux 2016.03 , Amazon Linux 2015.09 , or Amazon Linux // 2015.03 . // - A supported Ubuntu operating system, such as Ubuntu 16.04 LTS , Ubuntu // 14.04 LTS , or Ubuntu 12.04 LTS . // - CentOS Linux 7 // - Red Hat Enterprise Linux 7 // - A supported Windows operating system, such as Microsoft Windows Server 2012 // R2 Base , Microsoft Windows Server 2012 R2 with SQL Server Express , // Microsoft Windows Server 2012 R2 with SQL Server Standard , or Microsoft // Windows Server 2012 R2 with SQL Server Web . // - A custom AMI: Custom . You specify the custom AMI you want to use when you // create instances. For more information, see Using Custom AMIs (https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html) // . // The default option is the current Amazon Linux version. For more information // about supported operating systems, see AWS OpsWorks Stacks Operating Systems (https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html) // . DefaultOs *string // The default root device type. This value is the default for all instances in // the stack, but you can override it when you create an instance. The default // option is instance-store . For more information, see Storage for the Root Device (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device) // . DefaultRootDeviceType types.RootDeviceType // A default Amazon EC2 key pair name. The default value is none. If you specify a // key pair name, AWS OpsWorks installs the public key on the instance and you can // use the private key with an SSH client to log in to the instance. For more // information, see Using SSH to Communicate with an Instance (https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-ssh.html) // and Managing SSH Access (https://docs.aws.amazon.com/opsworks/latest/userguide/security-ssh-access.html) // . You can override this setting by specifying a different key pair, or no key // pair, when you create an instance (https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-add.html) // . DefaultSshKeyName *string // The stack's default VPC subnet ID. This parameter is required if you specify a // value for the VpcId parameter. All instances are launched into this subnet // unless you specify otherwise when you create the instance. If you also specify a // value for DefaultAvailabilityZone , the subnet must be in that zone. For // information on default values and when this parameter is required, see the VpcId // parameter description. DefaultSubnetId *string // The stack's host name theme, with spaces replaced by underscores. The theme is // used to generate host names for the stack's instances. By default, HostnameTheme // is set to Layer_Dependent , which creates host names by appending integers to // the layer's short name. The other themes are: // - Baked_Goods // - Clouds // - Europe_Cities // - Fruits // - Greek_Deities_and_Titans // - Legendary_creatures_from_Japan // - Planets_and_Moons // - Roman_Deities // - Scottish_Islands // - US_Cities // - Wild_Cats // To obtain a generated host name, call GetHostNameSuggestion , which returns a // host name based on the current theme. HostnameTheme *string // Whether the stack uses custom cookbooks. UseCustomCookbooks *bool // Whether to associate the AWS OpsWorks Stacks built-in security groups with the // stack's layers. AWS OpsWorks Stacks provides a standard set of built-in security // groups, one for each layer, which are associated with layers by default. With // UseOpsworksSecurityGroups you can instead provide your own custom security // groups. UseOpsworksSecurityGroups has the following settings: // - True - AWS OpsWorks Stacks automatically associates the appropriate // built-in security group with each layer (default setting). You can associate // additional security groups with a layer after you create it, but you cannot // delete the built-in security group. // - False - AWS OpsWorks Stacks does not associate built-in security groups // with layers. You must create appropriate EC2 security groups and associate a // security group with each layer that you create. However, you can still manually // associate a built-in security group with a layer on creation; custom security // groups are required only for those layers that need custom settings. // For more information, see Create a New Stack (https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html) // . UseOpsworksSecurityGroups *bool // The ID of the VPC that the stack is to be launched into. The VPC must be in the // stack's region. All instances are launched into this VPC. You cannot change the // ID later. // - If your account supports EC2-Classic, the default value is no VPC . // - If your account does not support EC2-Classic, the default value is the // default VPC for the specified region. // If the VPC ID corresponds to a default VPC and you have specified either the // DefaultAvailabilityZone or the DefaultSubnetId parameter only, AWS OpsWorks // Stacks infers the value of the other parameter. If you specify neither // parameter, AWS OpsWorks Stacks sets these parameters to the first valid // Availability Zone for the specified region and the corresponding default VPC // subnet ID, respectively. If you specify a nondefault VPC ID, note the following: // // - It must belong to a VPC in your account that is in the specified region. // - You must specify a value for DefaultSubnetId . // For more information about how to use AWS OpsWorks Stacks with a VPC, see // Running a Stack in a VPC (https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-vpc.html) // . For more information about default VPC and EC2-Classic, see Supported // Platforms (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html) // . VpcId *string noSmithyDocumentSerde } // Contains the response to a CreateStack request. type CreateStackOutput struct { // The stack ID, which is an opaque string that you use to identify the stack when // performing actions such as DescribeStacks . StackId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateStackMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateStack{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateStack{}, 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 = addOpCreateStackValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateStack(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_opCreateStack(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "opsworks", OperationName: "CreateStack", } }
329
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opsworks 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 new user profile. Required Permissions: To use this action, an IAM // user must have an attached policy that explicitly grants permissions. For more // information about user permissions, see Managing User Permissions (https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) // . func (c *Client) CreateUserProfile(ctx context.Context, params *CreateUserProfileInput, optFns ...func(*Options)) (*CreateUserProfileOutput, error) { if params == nil { params = &CreateUserProfileInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateUserProfile", params, optFns, c.addOperationCreateUserProfileMiddlewares) if err != nil { return nil, err } out := result.(*CreateUserProfileOutput) out.ResultMetadata = metadata return out, nil } type CreateUserProfileInput struct { // The user's IAM ARN; this can also be a federated user's ARN. // // This member is required. IamUserArn *string // Whether users can specify their own SSH public key through the My Settings // page. For more information, see Setting an IAM User's Public SSH Key (https://docs.aws.amazon.com/opsworks/latest/userguide/security-settingsshkey.html) // . AllowSelfManagement *bool // The user's public SSH key. SshPublicKey *string // The user's SSH user name. The allowable characters are [a-z], [A-Z], [0-9], // '-', and '_'. If the specified name includes other punctuation marks, AWS // OpsWorks Stacks removes them. For example, my.name will be changed to myname . // If you do not specify an SSH user name, AWS OpsWorks Stacks generates one from // the IAM user name. SshUsername *string noSmithyDocumentSerde } // Contains the response to a CreateUserProfile request. type CreateUserProfileOutput struct { // The user's IAM ARN. IamUserArn *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateUserProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateUserProfile{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateUserProfile{}, 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 = addOpCreateUserProfileValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateUserProfile(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_opCreateUserProfile(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "opsworks", OperationName: "CreateUserProfile", } }
143
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opsworks 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 specified app. Required Permissions: To use this action, an IAM user // must have a Manage permissions level for the stack, or an attached policy that // explicitly grants permissions. For more information on user permissions, see // Managing User Permissions (https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) // . func (c *Client) DeleteApp(ctx context.Context, params *DeleteAppInput, optFns ...func(*Options)) (*DeleteAppOutput, error) { if params == nil { params = &DeleteAppInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteApp", params, optFns, c.addOperationDeleteAppMiddlewares) if err != nil { return nil, err } out := result.(*DeleteAppOutput) out.ResultMetadata = metadata return out, nil } type DeleteAppInput struct { // The app ID. // // This member is required. AppId *string noSmithyDocumentSerde } type DeleteAppOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteAppMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteApp{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteApp{}, 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 = addOpDeleteAppValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApp(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_opDeleteApp(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "opsworks", OperationName: "DeleteApp", } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opsworks 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 specified instance, which terminates the associated Amazon EC2 // instance. You must stop an instance before you can delete it. For more // information, see Deleting Instances (https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-delete.html) // . Required Permissions: To use this action, an IAM user must have a Manage // permissions level for the stack, or an attached policy that explicitly grants // permissions. For more information on user permissions, see Managing User // Permissions (https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) // . func (c *Client) DeleteInstance(ctx context.Context, params *DeleteInstanceInput, optFns ...func(*Options)) (*DeleteInstanceOutput, error) { if params == nil { params = &DeleteInstanceInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteInstance", params, optFns, c.addOperationDeleteInstanceMiddlewares) if err != nil { return nil, err } out := result.(*DeleteInstanceOutput) out.ResultMetadata = metadata return out, nil } type DeleteInstanceInput struct { // The instance ID. // // This member is required. InstanceId *string // Whether to delete the instance Elastic IP address. DeleteElasticIp *bool // Whether to delete the instance's Amazon EBS volumes. DeleteVolumes *bool noSmithyDocumentSerde } type DeleteInstanceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteInstance{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteInstance{}, 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 = addOpDeleteInstanceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteInstance(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_opDeleteInstance(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "opsworks", OperationName: "DeleteInstance", } }
133
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opsworks 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 specified layer. You must first stop and then delete all associated // instances or unassign registered instances. For more information, see How to // Delete a Layer (https://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-delete.html) // . Required Permissions: To use this action, an IAM user must have a Manage // permissions level for the stack, or an attached policy that explicitly grants // permissions. For more information on user permissions, see Managing User // Permissions (https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) // . func (c *Client) DeleteLayer(ctx context.Context, params *DeleteLayerInput, optFns ...func(*Options)) (*DeleteLayerOutput, error) { if params == nil { params = &DeleteLayerInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteLayer", params, optFns, c.addOperationDeleteLayerMiddlewares) if err != nil { return nil, err } out := result.(*DeleteLayerOutput) out.ResultMetadata = metadata return out, nil } type DeleteLayerInput struct { // The layer ID. // // This member is required. LayerId *string noSmithyDocumentSerde } type DeleteLayerOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteLayerMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteLayer{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteLayer{}, 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 = addOpDeleteLayerValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLayer(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_opDeleteLayer(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "opsworks", OperationName: "DeleteLayer", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opsworks 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 specified stack. You must first delete all instances, layers, and // apps or deregister registered instances. For more information, see Shut Down a // Stack (https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-shutting.html) // . Required Permissions: To use this action, an IAM user must have a Manage // permissions level for the stack, or an attached policy that explicitly grants // permissions. For more information on user permissions, see Managing User // Permissions (https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) // . func (c *Client) DeleteStack(ctx context.Context, params *DeleteStackInput, optFns ...func(*Options)) (*DeleteStackOutput, error) { if params == nil { params = &DeleteStackInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteStack", params, optFns, c.addOperationDeleteStackMiddlewares) if err != nil { return nil, err } out := result.(*DeleteStackOutput) out.ResultMetadata = metadata return out, nil } type DeleteStackInput struct { // The stack ID. // // This member is required. StackId *string noSmithyDocumentSerde } type DeleteStackOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteStackMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteStack{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteStack{}, 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 = addOpDeleteStackValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteStack(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_opDeleteStack(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "opsworks", OperationName: "DeleteStack", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opsworks 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 user profile. Required Permissions: To use this action, an IAM user // must have an attached policy that explicitly grants permissions. For more // information about user permissions, see Managing User Permissions (https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) // . func (c *Client) DeleteUserProfile(ctx context.Context, params *DeleteUserProfileInput, optFns ...func(*Options)) (*DeleteUserProfileOutput, error) { if params == nil { params = &DeleteUserProfileInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteUserProfile", params, optFns, c.addOperationDeleteUserProfileMiddlewares) if err != nil { return nil, err } out := result.(*DeleteUserProfileOutput) out.ResultMetadata = metadata return out, nil } type DeleteUserProfileInput struct { // The user's IAM ARN. This can also be a federated user's ARN. // // This member is required. IamUserArn *string noSmithyDocumentSerde } type DeleteUserProfileOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteUserProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteUserProfile{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteUserProfile{}, 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 = addOpDeleteUserProfileValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteUserProfile(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_opDeleteUserProfile(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "opsworks", OperationName: "DeleteUserProfile", } }
123
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opsworks 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" ) // Deregisters a specified Amazon ECS cluster from a stack. For more information, // see Resource Management (https://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-ecscluster.html#workinglayers-ecscluster-delete) // . Required Permissions: To use this action, an IAM user must have a Manage // permissions level for the stack or an attached policy that explicitly grants // permissions. For more information on user permissions, see // https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html (https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) // . func (c *Client) DeregisterEcsCluster(ctx context.Context, params *DeregisterEcsClusterInput, optFns ...func(*Options)) (*DeregisterEcsClusterOutput, error) { if params == nil { params = &DeregisterEcsClusterInput{} } result, metadata, err := c.invokeOperation(ctx, "DeregisterEcsCluster", params, optFns, c.addOperationDeregisterEcsClusterMiddlewares) if err != nil { return nil, err } out := result.(*DeregisterEcsClusterOutput) out.ResultMetadata = metadata return out, nil } type DeregisterEcsClusterInput struct { // The cluster's Amazon Resource Number (ARN). // // This member is required. EcsClusterArn *string noSmithyDocumentSerde } type DeregisterEcsClusterOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeregisterEcsClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeregisterEcsCluster{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeregisterEcsCluster{}, 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 = addOpDeregisterEcsClusterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterEcsCluster(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_opDeregisterEcsCluster(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "opsworks", OperationName: "DeregisterEcsCluster", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opsworks 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" ) // Deregisters a specified Elastic IP address. The address can then be registered // by another stack. For more information, see Resource Management (https://docs.aws.amazon.com/opsworks/latest/userguide/resources.html) // . Required Permissions: To use this action, an IAM user must have a Manage // permissions level for the stack, or an attached policy that explicitly grants // permissions. For more information on user permissions, see Managing User // Permissions (https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) // . func (c *Client) DeregisterElasticIp(ctx context.Context, params *DeregisterElasticIpInput, optFns ...func(*Options)) (*DeregisterElasticIpOutput, error) { if params == nil { params = &DeregisterElasticIpInput{} } result, metadata, err := c.invokeOperation(ctx, "DeregisterElasticIp", params, optFns, c.addOperationDeregisterElasticIpMiddlewares) if err != nil { return nil, err } out := result.(*DeregisterElasticIpOutput) out.ResultMetadata = metadata return out, nil } type DeregisterElasticIpInput struct { // The Elastic IP address. // // This member is required. ElasticIp *string noSmithyDocumentSerde } type DeregisterElasticIpOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeregisterElasticIpMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeregisterElasticIp{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeregisterElasticIp{}, 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 = addOpDeregisterElasticIpValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterElasticIp(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_opDeregisterElasticIp(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "opsworks", OperationName: "DeregisterElasticIp", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opsworks 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" ) // Deregister a registered Amazon EC2 or on-premises instance. This action removes // the instance from the stack and returns it to your control. This action cannot // be used with instances that were created with AWS OpsWorks Stacks. Required // Permissions: To use this action, an IAM user must have a Manage permissions // level for the stack or an attached policy that explicitly grants permissions. // For more information on user permissions, see Managing User Permissions (https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) // . func (c *Client) DeregisterInstance(ctx context.Context, params *DeregisterInstanceInput, optFns ...func(*Options)) (*DeregisterInstanceOutput, error) { if params == nil { params = &DeregisterInstanceInput{} } result, metadata, err := c.invokeOperation(ctx, "DeregisterInstance", params, optFns, c.addOperationDeregisterInstanceMiddlewares) if err != nil { return nil, err } out := result.(*DeregisterInstanceOutput) out.ResultMetadata = metadata return out, nil } type DeregisterInstanceInput struct { // The instance ID. // // This member is required. InstanceId *string noSmithyDocumentSerde } type DeregisterInstanceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeregisterInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeregisterInstance{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeregisterInstance{}, 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 = addOpDeregisterInstanceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterInstance(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_opDeregisterInstance(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "opsworks", OperationName: "DeregisterInstance", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package opsworks 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" ) // Deregisters an Amazon RDS instance. Required Permissions: To use this action, // an IAM user must have a Manage permissions level for the stack, or an attached // policy that explicitly grants permissions. For more information on user // permissions, see Managing User Permissions (https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html) // . func (c *Client) DeregisterRdsDbInstance(ctx context.Context, params *DeregisterRdsDbInstanceInput, optFns ...func(*Options)) (*DeregisterRdsDbInstanceOutput, error) { if params == nil { params = &DeregisterRdsDbInstanceInput{} } result, metadata, err := c.invokeOperation(ctx, "DeregisterRdsDbInstance", params, optFns, c.addOperationDeregisterRdsDbInstanceMiddlewares) if err != nil { return nil, err } out := result.(*DeregisterRdsDbInstanceOutput) out.ResultMetadata = metadata return out, nil } type DeregisterRdsDbInstanceInput struct { // The Amazon RDS instance's ARN. // // This member is required. RdsDbInstanceArn *string noSmithyDocumentSerde } type DeregisterRdsDbInstanceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeregisterRdsDbInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeregisterRdsDbInstance{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeregisterRdsDbInstance{}, 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 = addOpDeregisterRdsDbInstanceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterRdsDbInstance(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_opDeregisterRdsDbInstance(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "opsworks", OperationName: "DeregisterRdsDbInstance", } }
124