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 s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Indicates whether the specified Multi-Region Access Point has an access control
// policy that allows public access. This action will always be routed to the US
// West (Oregon) Region. For more information about the restrictions around
// managing Multi-Region Access Points, see Managing Multi-Region Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/ManagingMultiRegionAccessPoints.html)
// in the Amazon S3 User Guide. The following actions are related to
// GetMultiRegionAccessPointPolicyStatus :
// - GetMultiRegionAccessPointPolicy (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetMultiRegionAccessPointPolicy.html)
// - PutMultiRegionAccessPointPolicy (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutMultiRegionAccessPointPolicy.html)
func (c *Client) GetMultiRegionAccessPointPolicyStatus(ctx context.Context, params *GetMultiRegionAccessPointPolicyStatusInput, optFns ...func(*Options)) (*GetMultiRegionAccessPointPolicyStatusOutput, error) {
if params == nil {
params = &GetMultiRegionAccessPointPolicyStatusInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetMultiRegionAccessPointPolicyStatus", params, optFns, c.addOperationGetMultiRegionAccessPointPolicyStatusMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetMultiRegionAccessPointPolicyStatusOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetMultiRegionAccessPointPolicyStatusInput struct {
// The Amazon Web Services account ID for the owner of the Multi-Region Access
// Point.
//
// This member is required.
AccountId *string
// Specifies the Multi-Region Access Point. The name of the Multi-Region Access
// Point is different from the alias. For more information about the distinction
// between the name and the alias of an Multi-Region Access Point, see Managing
// Multi-Region Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/CreatingMultiRegionAccessPoints.html#multi-region-access-point-naming)
// in the Amazon S3 User Guide.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
type GetMultiRegionAccessPointPolicyStatusOutput struct {
// Indicates whether this access point policy is public. For more information
// about how Amazon S3 evaluates policies to determine whether they are public, see
// The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status)
// in the Amazon S3 User Guide.
Established *types.PolicyStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetMultiRegionAccessPointPolicyStatusMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpGetMultiRegionAccessPointPolicyStatus{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetMultiRegionAccessPointPolicyStatus{}, 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 = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opGetMultiRegionAccessPointPolicyStatusMiddleware(stack); err != nil {
return err
}
if err = addOpGetMultiRegionAccessPointPolicyStatusValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMultiRegionAccessPointPolicyStatus(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addGetMultiRegionAccessPointPolicyStatusUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opGetMultiRegionAccessPointPolicyStatusMiddleware struct {
}
func (*endpointPrefix_opGetMultiRegionAccessPointPolicyStatusMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opGetMultiRegionAccessPointPolicyStatusMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*GetMultiRegionAccessPointPolicyStatusInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opGetMultiRegionAccessPointPolicyStatusMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opGetMultiRegionAccessPointPolicyStatusMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opGetMultiRegionAccessPointPolicyStatus(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "GetMultiRegionAccessPointPolicyStatus",
}
}
func copyGetMultiRegionAccessPointPolicyStatusInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*GetMultiRegionAccessPointPolicyStatusInput)
if !ok {
return nil, fmt.Errorf("expect *GetMultiRegionAccessPointPolicyStatusInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func backFillGetMultiRegionAccessPointPolicyStatusAccountID(input interface{}, v string) error {
in := input.(*GetMultiRegionAccessPointPolicyStatusInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addGetMultiRegionAccessPointPolicyStatusUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor,
BackfillAccountID: nopBackfillAccountIDAccessor,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: nopSetARNAccessor,
CopyInput: copyGetMultiRegionAccessPointPolicyStatusInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 235 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Returns the routing configuration for a Multi-Region Access Point, indicating
// which Regions are active or passive. To obtain routing control changes and
// failover requests, use the Amazon S3 failover control infrastructure endpoints
// in these five Amazon Web Services Regions:
// - us-east-1
// - us-west-2
// - ap-southeast-2
// - ap-northeast-1
// - eu-west-1
//
// Your Amazon S3 bucket does not need to be in these five Regions.
func (c *Client) GetMultiRegionAccessPointRoutes(ctx context.Context, params *GetMultiRegionAccessPointRoutesInput, optFns ...func(*Options)) (*GetMultiRegionAccessPointRoutesOutput, error) {
if params == nil {
params = &GetMultiRegionAccessPointRoutesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetMultiRegionAccessPointRoutes", params, optFns, c.addOperationGetMultiRegionAccessPointRoutesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetMultiRegionAccessPointRoutesOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetMultiRegionAccessPointRoutesInput struct {
// The Amazon Web Services account ID for the owner of the Multi-Region Access
// Point.
//
// This member is required.
AccountId *string
// The Multi-Region Access Point ARN.
//
// This member is required.
Mrap *string
noSmithyDocumentSerde
}
type GetMultiRegionAccessPointRoutesOutput struct {
// The Multi-Region Access Point ARN.
Mrap *string
// The different routes that make up the route configuration. Active routes return
// a value of 100 , and passive routes return a value of 0 .
Routes []types.MultiRegionAccessPointRoute
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetMultiRegionAccessPointRoutesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpGetMultiRegionAccessPointRoutes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetMultiRegionAccessPointRoutes{}, 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 = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opGetMultiRegionAccessPointRoutesMiddleware(stack); err != nil {
return err
}
if err = addOpGetMultiRegionAccessPointRoutesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMultiRegionAccessPointRoutes(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addGetMultiRegionAccessPointRoutesUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opGetMultiRegionAccessPointRoutesMiddleware struct {
}
func (*endpointPrefix_opGetMultiRegionAccessPointRoutesMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opGetMultiRegionAccessPointRoutesMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*GetMultiRegionAccessPointRoutesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opGetMultiRegionAccessPointRoutesMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opGetMultiRegionAccessPointRoutesMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opGetMultiRegionAccessPointRoutes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "GetMultiRegionAccessPointRoutes",
}
}
func copyGetMultiRegionAccessPointRoutesInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*GetMultiRegionAccessPointRoutesInput)
if !ok {
return nil, fmt.Errorf("expect *GetMultiRegionAccessPointRoutesInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func backFillGetMultiRegionAccessPointRoutesAccountID(input interface{}, v string) error {
in := input.(*GetMultiRegionAccessPointRoutesInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addGetMultiRegionAccessPointRoutesUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor,
BackfillAccountID: nopBackfillAccountIDAccessor,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: nopSetARNAccessor,
CopyInput: copyGetMultiRegionAccessPointRoutesInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 235 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Retrieves the PublicAccessBlock configuration for an Amazon Web Services
// account. For more information, see Using Amazon S3 block public access (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html)
// . Related actions include:
// - DeletePublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeletePublicAccessBlock.html)
// - PutPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutPublicAccessBlock.html)
func (c *Client) GetPublicAccessBlock(ctx context.Context, params *GetPublicAccessBlockInput, optFns ...func(*Options)) (*GetPublicAccessBlockOutput, error) {
if params == nil {
params = &GetPublicAccessBlockInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetPublicAccessBlock", params, optFns, c.addOperationGetPublicAccessBlockMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetPublicAccessBlockOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetPublicAccessBlockInput struct {
// The account ID for the Amazon Web Services account whose PublicAccessBlock
// configuration you want to retrieve.
//
// This member is required.
AccountId *string
noSmithyDocumentSerde
}
type GetPublicAccessBlockOutput struct {
// The PublicAccessBlock configuration currently in effect for this Amazon Web
// Services account.
PublicAccessBlockConfiguration *types.PublicAccessBlockConfiguration
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetPublicAccessBlockMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpGetPublicAccessBlock{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetPublicAccessBlock{}, 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 = addEndpointPrefix_opGetPublicAccessBlockMiddleware(stack); err != nil {
return err
}
if err = addOpGetPublicAccessBlockValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPublicAccessBlock(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addGetPublicAccessBlockUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opGetPublicAccessBlockMiddleware struct {
}
func (*endpointPrefix_opGetPublicAccessBlockMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opGetPublicAccessBlockMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*GetPublicAccessBlockInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opGetPublicAccessBlockMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opGetPublicAccessBlockMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opGetPublicAccessBlock(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "GetPublicAccessBlock",
}
}
func copyGetPublicAccessBlockInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*GetPublicAccessBlockInput)
if !ok {
return nil, fmt.Errorf("expect *GetPublicAccessBlockInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func backFillGetPublicAccessBlockAccountID(input interface{}, v string) error {
in := input.(*GetPublicAccessBlockInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addGetPublicAccessBlockUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor,
BackfillAccountID: nopBackfillAccountIDAccessor,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: nopSetARNAccessor,
CopyInput: copyGetPublicAccessBlockInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 218 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Gets the Amazon S3 Storage Lens configuration. For more information, see
// Assessing your storage activity and usage with Amazon S3 Storage Lens (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html)
// in the Amazon S3 User Guide. For a complete list of S3 Storage Lens metrics, see
// S3 Storage Lens metrics glossary (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens_metrics_glossary.html)
// in the Amazon S3 User Guide. To use this action, you must have permission to
// perform the s3:GetStorageLensConfiguration action. For more information, see
// Setting permissions to use Amazon S3 Storage Lens (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html)
// in the Amazon S3 User Guide.
func (c *Client) GetStorageLensConfiguration(ctx context.Context, params *GetStorageLensConfigurationInput, optFns ...func(*Options)) (*GetStorageLensConfigurationOutput, error) {
if params == nil {
params = &GetStorageLensConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetStorageLensConfiguration", params, optFns, c.addOperationGetStorageLensConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetStorageLensConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetStorageLensConfigurationInput struct {
// The account ID of the requester.
//
// This member is required.
AccountId *string
// The ID of the Amazon S3 Storage Lens configuration.
//
// This member is required.
ConfigId *string
noSmithyDocumentSerde
}
type GetStorageLensConfigurationOutput struct {
// The S3 Storage Lens configuration requested.
StorageLensConfiguration *types.StorageLensConfiguration
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetStorageLensConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpGetStorageLensConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetStorageLensConfiguration{}, 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 = addEndpointPrefix_opGetStorageLensConfigurationMiddleware(stack); err != nil {
return err
}
if err = addOpGetStorageLensConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetStorageLensConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addGetStorageLensConfigurationUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opGetStorageLensConfigurationMiddleware struct {
}
func (*endpointPrefix_opGetStorageLensConfigurationMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opGetStorageLensConfigurationMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*GetStorageLensConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opGetStorageLensConfigurationMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opGetStorageLensConfigurationMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opGetStorageLensConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "GetStorageLensConfiguration",
}
}
func copyGetStorageLensConfigurationInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*GetStorageLensConfigurationInput)
if !ok {
return nil, fmt.Errorf("expect *GetStorageLensConfigurationInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func backFillGetStorageLensConfigurationAccountID(input interface{}, v string) error {
in := input.(*GetStorageLensConfigurationInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addGetStorageLensConfigurationUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor,
BackfillAccountID: nopBackfillAccountIDAccessor,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: nopSetARNAccessor,
CopyInput: copyGetStorageLensConfigurationInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 224 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Gets the tags of Amazon S3 Storage Lens configuration. For more information
// about S3 Storage Lens, see Assessing your storage activity and usage with
// Amazon S3 Storage Lens (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html)
// in the Amazon S3 User Guide. To use this action, you must have permission to
// perform the s3:GetStorageLensConfigurationTagging action. For more information,
// see Setting permissions to use Amazon S3 Storage Lens (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html)
// in the Amazon S3 User Guide.
func (c *Client) GetStorageLensConfigurationTagging(ctx context.Context, params *GetStorageLensConfigurationTaggingInput, optFns ...func(*Options)) (*GetStorageLensConfigurationTaggingOutput, error) {
if params == nil {
params = &GetStorageLensConfigurationTaggingInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetStorageLensConfigurationTagging", params, optFns, c.addOperationGetStorageLensConfigurationTaggingMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetStorageLensConfigurationTaggingOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetStorageLensConfigurationTaggingInput struct {
// The account ID of the requester.
//
// This member is required.
AccountId *string
// The ID of the Amazon S3 Storage Lens configuration.
//
// This member is required.
ConfigId *string
noSmithyDocumentSerde
}
type GetStorageLensConfigurationTaggingOutput struct {
// The tags of S3 Storage Lens configuration requested.
Tags []types.StorageLensTag
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetStorageLensConfigurationTaggingMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpGetStorageLensConfigurationTagging{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetStorageLensConfigurationTagging{}, 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 = addEndpointPrefix_opGetStorageLensConfigurationTaggingMiddleware(stack); err != nil {
return err
}
if err = addOpGetStorageLensConfigurationTaggingValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetStorageLensConfigurationTagging(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addGetStorageLensConfigurationTaggingUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opGetStorageLensConfigurationTaggingMiddleware struct {
}
func (*endpointPrefix_opGetStorageLensConfigurationTaggingMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opGetStorageLensConfigurationTaggingMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*GetStorageLensConfigurationTaggingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opGetStorageLensConfigurationTaggingMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opGetStorageLensConfigurationTaggingMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opGetStorageLensConfigurationTagging(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "GetStorageLensConfigurationTagging",
}
}
func copyGetStorageLensConfigurationTaggingInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*GetStorageLensConfigurationTaggingInput)
if !ok {
return nil, fmt.Errorf("expect *GetStorageLensConfigurationTaggingInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func backFillGetStorageLensConfigurationTaggingAccountID(input interface{}, v string) error {
in := input.(*GetStorageLensConfigurationTaggingInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addGetStorageLensConfigurationTaggingUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor,
BackfillAccountID: nopBackfillAccountIDAccessor,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: nopSetARNAccessor,
CopyInput: copyGetStorageLensConfigurationTaggingInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 223 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Returns a list of the access points that are owned by the current account
// that's associated with the specified bucket. You can retrieve up to 1000 access
// points per call. If the specified bucket has more than 1,000 access points (or
// the number specified in maxResults , whichever is less), the response will
// include a continuation token that you can use to list the additional access
// points. All Amazon S3 on Outposts REST API requests for this action require an
// additional parameter of x-amz-outpost-id to be passed with the request. In
// addition, you must use an S3 on Outposts endpoint hostname prefix instead of
// s3-control . For an example of the request syntax for Amazon S3 on Outposts that
// uses the S3 on Outposts endpoint hostname prefix and the x-amz-outpost-id
// derived by using the access point ARN, see the Examples (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPoint.html#API_control_GetAccessPoint_Examples)
// section. The following actions are related to ListAccessPoints :
// - CreateAccessPoint (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPoint.html)
// - DeleteAccessPoint (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPoint.html)
// - GetAccessPoint (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPoint.html)
func (c *Client) ListAccessPoints(ctx context.Context, params *ListAccessPointsInput, optFns ...func(*Options)) (*ListAccessPointsOutput, error) {
if params == nil {
params = &ListAccessPointsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAccessPoints", params, optFns, c.addOperationListAccessPointsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAccessPointsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAccessPointsInput struct {
// The Amazon Web Services account ID for the account that owns the specified
// access points.
//
// This member is required.
AccountId *string
// The name of the bucket whose associated access points you want to list. For
// using this parameter with Amazon S3 on Outposts with the REST API, you must
// specify the name and the x-amz-outpost-id as well. For using this parameter with
// S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the
// ARN of the bucket accessed in the format arn:aws:s3-outposts:::outpost//bucket/
// . For example, to access the bucket reports through Outpost my-outpost owned by
// account 123456789012 in Region us-west-2 , use the URL encoding of
// arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports .
// The value must be URL encoded.
Bucket *string
// The maximum number of access points that you want to include in the list. If
// the specified bucket has more than this number of access points, then the
// response will include a continuation token in the NextToken field that you can
// use to retrieve the next page of access points.
MaxResults int32
// A continuation token. If a previous call to ListAccessPoints returned a
// continuation token in the NextToken field, then providing that value here
// causes Amazon S3 to retrieve the next page of results.
NextToken *string
noSmithyDocumentSerde
}
type ListAccessPointsOutput struct {
// Contains identification and configuration information for one or more access
// points associated with the specified bucket.
AccessPointList []types.AccessPoint
// If the specified bucket has more access points than can be returned in one call
// to this API, this field contains a continuation token that you can provide in
// subsequent calls to this API to retrieve additional access points.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAccessPointsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpListAccessPoints{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpListAccessPoints{}, 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 = addEndpointPrefix_opListAccessPointsMiddleware(stack); err != nil {
return err
}
if err = addOpListAccessPointsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccessPoints(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addListAccessPointsUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opListAccessPointsMiddleware struct {
}
func (*endpointPrefix_opListAccessPointsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListAccessPointsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*ListAccessPointsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListAccessPointsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListAccessPointsMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListAccessPointsAPIClient is a client that implements the ListAccessPoints
// operation.
type ListAccessPointsAPIClient interface {
ListAccessPoints(context.Context, *ListAccessPointsInput, ...func(*Options)) (*ListAccessPointsOutput, error)
}
var _ ListAccessPointsAPIClient = (*Client)(nil)
// ListAccessPointsPaginatorOptions is the paginator options for ListAccessPoints
type ListAccessPointsPaginatorOptions struct {
// The maximum number of access points that you want to include in the list. If
// the specified bucket has more than this number of access points, then the
// response will include a continuation token in the NextToken field that you can
// use to retrieve the next page of access points.
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
}
// ListAccessPointsPaginator is a paginator for ListAccessPoints
type ListAccessPointsPaginator struct {
options ListAccessPointsPaginatorOptions
client ListAccessPointsAPIClient
params *ListAccessPointsInput
nextToken *string
firstPage bool
}
// NewListAccessPointsPaginator returns a new ListAccessPointsPaginator
func NewListAccessPointsPaginator(client ListAccessPointsAPIClient, params *ListAccessPointsInput, optFns ...func(*ListAccessPointsPaginatorOptions)) *ListAccessPointsPaginator {
if params == nil {
params = &ListAccessPointsInput{}
}
options := ListAccessPointsPaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAccessPointsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAccessPointsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAccessPoints page.
func (p *ListAccessPointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccessPointsOutput, 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.ListAccessPoints(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListAccessPoints(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "ListAccessPoints",
}
}
func copyListAccessPointsInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*ListAccessPointsInput)
if !ok {
return nil, fmt.Errorf("expect *ListAccessPointsInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func getListAccessPointsARNMember(input interface{}) (*string, bool) {
in := input.(*ListAccessPointsInput)
if in.Bucket == nil {
return nil, false
}
return in.Bucket, true
}
func setListAccessPointsARNMember(input interface{}, v string) error {
in := input.(*ListAccessPointsInput)
in.Bucket = &v
return nil
}
func backFillListAccessPointsAccountID(input interface{}, v string) error {
in := input.(*ListAccessPointsInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addListAccessPointsUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: getListAccessPointsARNMember,
BackfillAccountID: backFillListAccessPointsAccountID,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: setListAccessPointsARNMember,
CopyInput: copyListAccessPointsInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 356 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Returns some or all (up to 1,000) access points associated with the Object
// Lambda Access Point per call. If there are more access points than what can be
// returned in one call, the response will include a continuation token that you
// can use to list the additional access points. The following actions are related
// to ListAccessPointsForObjectLambda :
// - CreateAccessPointForObjectLambda (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPointForObjectLambda.html)
// - DeleteAccessPointForObjectLambda (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointForObjectLambda.html)
// - GetAccessPointForObjectLambda (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointForObjectLambda.html)
func (c *Client) ListAccessPointsForObjectLambda(ctx context.Context, params *ListAccessPointsForObjectLambdaInput, optFns ...func(*Options)) (*ListAccessPointsForObjectLambdaOutput, error) {
if params == nil {
params = &ListAccessPointsForObjectLambdaInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAccessPointsForObjectLambda", params, optFns, c.addOperationListAccessPointsForObjectLambdaMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAccessPointsForObjectLambdaOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAccessPointsForObjectLambdaInput struct {
// The account ID for the account that owns the specified Object Lambda Access
// Point.
//
// This member is required.
AccountId *string
// The maximum number of access points that you want to include in the list. The
// response may contain fewer access points but will never contain more. If there
// are more than this number of access points, then the response will include a
// continuation token in the NextToken field that you can use to retrieve the next
// page of access points.
MaxResults int32
// If the list has more access points than can be returned in one call to this
// API, this field contains a continuation token that you can provide in subsequent
// calls to this API to retrieve additional access points.
NextToken *string
noSmithyDocumentSerde
}
type ListAccessPointsForObjectLambdaOutput struct {
// If the list has more access points than can be returned in one call to this
// API, this field contains a continuation token that you can provide in subsequent
// calls to this API to retrieve additional access points.
NextToken *string
// Returns list of Object Lambda Access Points.
ObjectLambdaAccessPointList []types.ObjectLambdaAccessPoint
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAccessPointsForObjectLambdaMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpListAccessPointsForObjectLambda{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpListAccessPointsForObjectLambda{}, 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 = addEndpointPrefix_opListAccessPointsForObjectLambdaMiddleware(stack); err != nil {
return err
}
if err = addOpListAccessPointsForObjectLambdaValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccessPointsForObjectLambda(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addListAccessPointsForObjectLambdaUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opListAccessPointsForObjectLambdaMiddleware struct {
}
func (*endpointPrefix_opListAccessPointsForObjectLambdaMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListAccessPointsForObjectLambdaMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*ListAccessPointsForObjectLambdaInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListAccessPointsForObjectLambdaMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListAccessPointsForObjectLambdaMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListAccessPointsForObjectLambdaAPIClient is a client that implements the
// ListAccessPointsForObjectLambda operation.
type ListAccessPointsForObjectLambdaAPIClient interface {
ListAccessPointsForObjectLambda(context.Context, *ListAccessPointsForObjectLambdaInput, ...func(*Options)) (*ListAccessPointsForObjectLambdaOutput, error)
}
var _ ListAccessPointsForObjectLambdaAPIClient = (*Client)(nil)
// ListAccessPointsForObjectLambdaPaginatorOptions is the paginator options for
// ListAccessPointsForObjectLambda
type ListAccessPointsForObjectLambdaPaginatorOptions struct {
// The maximum number of access points that you want to include in the list. The
// response may contain fewer access points but will never contain more. If there
// are more than this number of access points, then the response will include a
// continuation token in the NextToken field that you can use to retrieve the next
// page of access points.
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
}
// ListAccessPointsForObjectLambdaPaginator is a paginator for
// ListAccessPointsForObjectLambda
type ListAccessPointsForObjectLambdaPaginator struct {
options ListAccessPointsForObjectLambdaPaginatorOptions
client ListAccessPointsForObjectLambdaAPIClient
params *ListAccessPointsForObjectLambdaInput
nextToken *string
firstPage bool
}
// NewListAccessPointsForObjectLambdaPaginator returns a new
// ListAccessPointsForObjectLambdaPaginator
func NewListAccessPointsForObjectLambdaPaginator(client ListAccessPointsForObjectLambdaAPIClient, params *ListAccessPointsForObjectLambdaInput, optFns ...func(*ListAccessPointsForObjectLambdaPaginatorOptions)) *ListAccessPointsForObjectLambdaPaginator {
if params == nil {
params = &ListAccessPointsForObjectLambdaInput{}
}
options := ListAccessPointsForObjectLambdaPaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAccessPointsForObjectLambdaPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAccessPointsForObjectLambdaPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAccessPointsForObjectLambda page.
func (p *ListAccessPointsForObjectLambdaPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccessPointsForObjectLambdaOutput, 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.ListAccessPointsForObjectLambda(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListAccessPointsForObjectLambda(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "ListAccessPointsForObjectLambda",
}
}
func copyListAccessPointsForObjectLambdaInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*ListAccessPointsForObjectLambdaInput)
if !ok {
return nil, fmt.Errorf("expect *ListAccessPointsForObjectLambdaInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func backFillListAccessPointsForObjectLambdaAccountID(input interface{}, v string) error {
in := input.(*ListAccessPointsForObjectLambdaInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addListAccessPointsForObjectLambdaUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor,
BackfillAccountID: nopBackfillAccountIDAccessor,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: nopSetARNAccessor,
CopyInput: copyListAccessPointsForObjectLambdaInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 330 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Lists current S3 Batch Operations jobs and jobs that have ended within the last
// 30 days for the Amazon Web Services account making the request. For more
// information, see S3 Batch Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/batch-ops.html)
// in the Amazon S3 User Guide. Related actions include:
// - CreateJob (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html)
// - DescribeJob (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DescribeJob.html)
// - UpdateJobPriority (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobPriority.html)
// - UpdateJobStatus (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobStatus.html)
func (c *Client) ListJobs(ctx context.Context, params *ListJobsInput, optFns ...func(*Options)) (*ListJobsOutput, error) {
if params == nil {
params = &ListJobsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListJobs", params, optFns, c.addOperationListJobsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListJobsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListJobsInput struct {
// The Amazon Web Services account ID associated with the S3 Batch Operations job.
//
// This member is required.
AccountId *string
// The List Jobs request returns jobs that match the statuses listed in this
// element.
JobStatuses []types.JobStatus
// The maximum number of jobs that Amazon S3 will include in the List Jobs
// response. If there are more jobs than this number, the response will include a
// pagination token in the NextToken field to enable you to retrieve the next page
// of results.
MaxResults *int32
// A pagination token to request the next page of results. Use the token that
// Amazon S3 returned in the NextToken element of the ListJobsResult from the
// previous List Jobs request.
NextToken *string
noSmithyDocumentSerde
}
type ListJobsOutput struct {
// The list of current jobs and jobs that have ended within the last 30 days.
Jobs []types.JobListDescriptor
// If the List Jobs request produced more than the maximum number of results, you
// can pass this value into a subsequent List Jobs request in order to retrieve
// the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListJobsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpListJobs{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpListJobs{}, 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 = addEndpointPrefix_opListJobsMiddleware(stack); err != nil {
return err
}
if err = addOpListJobsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListJobs(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addListJobsUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opListJobsMiddleware struct {
}
func (*endpointPrefix_opListJobsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListJobsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*ListJobsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListJobsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListJobsMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListJobsAPIClient is a client that implements the ListJobs operation.
type ListJobsAPIClient interface {
ListJobs(context.Context, *ListJobsInput, ...func(*Options)) (*ListJobsOutput, error)
}
var _ ListJobsAPIClient = (*Client)(nil)
// ListJobsPaginatorOptions is the paginator options for ListJobs
type ListJobsPaginatorOptions struct {
// The maximum number of jobs that Amazon S3 will include in the List Jobs
// response. If there are more jobs than this number, the response will include a
// pagination token in the NextToken field to enable you to retrieve 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
}
// ListJobsPaginator is a paginator for ListJobs
type ListJobsPaginator struct {
options ListJobsPaginatorOptions
client ListJobsAPIClient
params *ListJobsInput
nextToken *string
firstPage bool
}
// NewListJobsPaginator returns a new ListJobsPaginator
func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator {
if params == nil {
params = &ListJobsInput{}
}
options := ListJobsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListJobsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListJobsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListJobs page.
func (p *ListJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListJobs(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListJobs(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "ListJobs",
}
}
func copyListJobsInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*ListJobsInput)
if !ok {
return nil, fmt.Errorf("expect *ListJobsInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func backFillListJobsAccountID(input interface{}, v string) error {
in := input.(*ListJobsInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addListJobsUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor,
BackfillAccountID: nopBackfillAccountIDAccessor,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: nopSetARNAccessor,
CopyInput: copyListJobsInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 331 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Returns a list of the Multi-Region Access Points currently associated with the
// specified Amazon Web Services account. Each call can return up to 100
// Multi-Region Access Points, the maximum number of Multi-Region Access Points
// that can be associated with a single account. This action will always be routed
// to the US West (Oregon) Region. For more information about the restrictions
// around managing Multi-Region Access Points, see Managing Multi-Region Access
// Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/ManagingMultiRegionAccessPoints.html)
// in the Amazon S3 User Guide. The following actions are related to
// ListMultiRegionAccessPoint :
// - CreateMultiRegionAccessPoint (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateMultiRegionAccessPoint.html)
// - DeleteMultiRegionAccessPoint (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteMultiRegionAccessPoint.html)
// - DescribeMultiRegionAccessPointOperation (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DescribeMultiRegionAccessPointOperation.html)
// - GetMultiRegionAccessPoint (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetMultiRegionAccessPoint.html)
func (c *Client) ListMultiRegionAccessPoints(ctx context.Context, params *ListMultiRegionAccessPointsInput, optFns ...func(*Options)) (*ListMultiRegionAccessPointsOutput, error) {
if params == nil {
params = &ListMultiRegionAccessPointsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListMultiRegionAccessPoints", params, optFns, c.addOperationListMultiRegionAccessPointsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListMultiRegionAccessPointsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListMultiRegionAccessPointsInput struct {
// The Amazon Web Services account ID for the owner of the Multi-Region Access
// Point.
//
// This member is required.
AccountId *string
// Not currently used. Do not use this parameter.
MaxResults int32
// Not currently used. Do not use this parameter.
NextToken *string
noSmithyDocumentSerde
}
type ListMultiRegionAccessPointsOutput struct {
// The list of Multi-Region Access Points associated with the user.
AccessPoints []types.MultiRegionAccessPointReport
// If the specified bucket has more Multi-Region Access Points than can be
// returned in one call to this action, this field contains a continuation token.
// You can use this token tin subsequent calls to this action to retrieve
// additional Multi-Region Access Points.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListMultiRegionAccessPointsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpListMultiRegionAccessPoints{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpListMultiRegionAccessPoints{}, 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 = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opListMultiRegionAccessPointsMiddleware(stack); err != nil {
return err
}
if err = addOpListMultiRegionAccessPointsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListMultiRegionAccessPoints(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addListMultiRegionAccessPointsUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opListMultiRegionAccessPointsMiddleware struct {
}
func (*endpointPrefix_opListMultiRegionAccessPointsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListMultiRegionAccessPointsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*ListMultiRegionAccessPointsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListMultiRegionAccessPointsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListMultiRegionAccessPointsMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListMultiRegionAccessPointsAPIClient is a client that implements the
// ListMultiRegionAccessPoints operation.
type ListMultiRegionAccessPointsAPIClient interface {
ListMultiRegionAccessPoints(context.Context, *ListMultiRegionAccessPointsInput, ...func(*Options)) (*ListMultiRegionAccessPointsOutput, error)
}
var _ ListMultiRegionAccessPointsAPIClient = (*Client)(nil)
// ListMultiRegionAccessPointsPaginatorOptions is the paginator options for
// ListMultiRegionAccessPoints
type ListMultiRegionAccessPointsPaginatorOptions struct {
// Not currently used. Do not use this parameter.
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
}
// ListMultiRegionAccessPointsPaginator is a paginator for
// ListMultiRegionAccessPoints
type ListMultiRegionAccessPointsPaginator struct {
options ListMultiRegionAccessPointsPaginatorOptions
client ListMultiRegionAccessPointsAPIClient
params *ListMultiRegionAccessPointsInput
nextToken *string
firstPage bool
}
// NewListMultiRegionAccessPointsPaginator returns a new
// ListMultiRegionAccessPointsPaginator
func NewListMultiRegionAccessPointsPaginator(client ListMultiRegionAccessPointsAPIClient, params *ListMultiRegionAccessPointsInput, optFns ...func(*ListMultiRegionAccessPointsPaginatorOptions)) *ListMultiRegionAccessPointsPaginator {
if params == nil {
params = &ListMultiRegionAccessPointsInput{}
}
options := ListMultiRegionAccessPointsPaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListMultiRegionAccessPointsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListMultiRegionAccessPointsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListMultiRegionAccessPoints page.
func (p *ListMultiRegionAccessPointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMultiRegionAccessPointsOutput, 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.ListMultiRegionAccessPoints(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListMultiRegionAccessPoints(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "ListMultiRegionAccessPoints",
}
}
func copyListMultiRegionAccessPointsInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*ListMultiRegionAccessPointsInput)
if !ok {
return nil, fmt.Errorf("expect *ListMultiRegionAccessPointsInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func backFillListMultiRegionAccessPointsAccountID(input interface{}, v string) error {
in := input.(*ListMultiRegionAccessPointsInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addListMultiRegionAccessPointsUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor,
BackfillAccountID: nopBackfillAccountIDAccessor,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: nopSetARNAccessor,
CopyInput: copyListMultiRegionAccessPointsInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 329 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Returns a list of all Outposts buckets in an Outpost that are owned by the
// authenticated sender of the request. For more information, see Using Amazon S3
// on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html)
// in the Amazon S3 User Guide. For an example of the request syntax for Amazon S3
// on Outposts that uses the S3 on Outposts endpoint hostname prefix and
// x-amz-outpost-id in your request, see the Examples (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListRegionalBuckets.html#API_control_ListRegionalBuckets_Examples)
// section.
func (c *Client) ListRegionalBuckets(ctx context.Context, params *ListRegionalBucketsInput, optFns ...func(*Options)) (*ListRegionalBucketsOutput, error) {
if params == nil {
params = &ListRegionalBucketsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListRegionalBuckets", params, optFns, c.addOperationListRegionalBucketsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListRegionalBucketsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListRegionalBucketsInput struct {
// The Amazon Web Services account ID of the Outposts bucket.
//
// This member is required.
AccountId *string
//
MaxResults int32
//
NextToken *string
// The ID of the Outposts resource. This ID is required by Amazon S3 on Outposts
// buckets.
OutpostId *string
noSmithyDocumentSerde
}
type ListRegionalBucketsOutput struct {
// NextToken is sent when isTruncated is true, which means there are more buckets
// that can be listed. The next list requests to Amazon S3 can be continued with
// this NextToken . NextToken is obfuscated and is not a real key.
NextToken *string
//
RegionalBucketList []types.RegionalBucket
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListRegionalBucketsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpListRegionalBuckets{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpListRegionalBuckets{}, 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 = addEndpointPrefix_opListRegionalBucketsMiddleware(stack); err != nil {
return err
}
if err = addOpListRegionalBucketsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRegionalBuckets(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addListRegionalBucketsUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opListRegionalBucketsMiddleware struct {
}
func (*endpointPrefix_opListRegionalBucketsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListRegionalBucketsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*ListRegionalBucketsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListRegionalBucketsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListRegionalBucketsMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListRegionalBucketsAPIClient is a client that implements the
// ListRegionalBuckets operation.
type ListRegionalBucketsAPIClient interface {
ListRegionalBuckets(context.Context, *ListRegionalBucketsInput, ...func(*Options)) (*ListRegionalBucketsOutput, error)
}
var _ ListRegionalBucketsAPIClient = (*Client)(nil)
// ListRegionalBucketsPaginatorOptions is the paginator options for
// ListRegionalBuckets
type ListRegionalBucketsPaginatorOptions struct {
//
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
}
// ListRegionalBucketsPaginator is a paginator for ListRegionalBuckets
type ListRegionalBucketsPaginator struct {
options ListRegionalBucketsPaginatorOptions
client ListRegionalBucketsAPIClient
params *ListRegionalBucketsInput
nextToken *string
firstPage bool
}
// NewListRegionalBucketsPaginator returns a new ListRegionalBucketsPaginator
func NewListRegionalBucketsPaginator(client ListRegionalBucketsAPIClient, params *ListRegionalBucketsInput, optFns ...func(*ListRegionalBucketsPaginatorOptions)) *ListRegionalBucketsPaginator {
if params == nil {
params = &ListRegionalBucketsInput{}
}
options := ListRegionalBucketsPaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListRegionalBucketsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListRegionalBucketsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListRegionalBuckets page.
func (p *ListRegionalBucketsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRegionalBucketsOutput, 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.ListRegionalBuckets(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListRegionalBuckets(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "ListRegionalBuckets",
}
}
func copyListRegionalBucketsInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*ListRegionalBucketsInput)
if !ok {
return nil, fmt.Errorf("expect *ListRegionalBucketsInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
// getListRegionalBucketsOutpostIDMember returns a pointer to string denoting a
// provided outpost-id member value and a boolean indicating if the input has a
// modeled outpost-id,
func getListRegionalBucketsOutpostIDMember(input interface{}) (*string, bool) {
in := input.(*ListRegionalBucketsInput)
if in.OutpostId == nil {
return nil, false
}
return in.OutpostId, true
}
func backFillListRegionalBucketsAccountID(input interface{}, v string) error {
in := input.(*ListRegionalBucketsInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addListRegionalBucketsUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor,
BackfillAccountID: nopBackfillAccountIDAccessor,
GetOutpostIDInput: getListRegionalBucketsOutpostIDMember,
UpdateARNField: nopSetARNAccessor,
CopyInput: copyListRegionalBucketsInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 331 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Gets a list of Amazon S3 Storage Lens configurations. For more information
// about S3 Storage Lens, see Assessing your storage activity and usage with
// Amazon S3 Storage Lens (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html)
// in the Amazon S3 User Guide. To use this action, you must have permission to
// perform the s3:ListStorageLensConfigurations action. For more information, see
// Setting permissions to use Amazon S3 Storage Lens (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html)
// in the Amazon S3 User Guide.
func (c *Client) ListStorageLensConfigurations(ctx context.Context, params *ListStorageLensConfigurationsInput, optFns ...func(*Options)) (*ListStorageLensConfigurationsOutput, error) {
if params == nil {
params = &ListStorageLensConfigurationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListStorageLensConfigurations", params, optFns, c.addOperationListStorageLensConfigurationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListStorageLensConfigurationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListStorageLensConfigurationsInput struct {
// The account ID of the requester.
//
// This member is required.
AccountId *string
// A pagination token to request the next page of results.
NextToken *string
noSmithyDocumentSerde
}
type ListStorageLensConfigurationsOutput struct {
// If the request produced more than the maximum number of S3 Storage Lens
// configuration results, you can pass this value into a subsequent request to
// retrieve the next page of results.
NextToken *string
// A list of S3 Storage Lens configurations.
StorageLensConfigurationList []types.ListStorageLensConfigurationEntry
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListStorageLensConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpListStorageLensConfigurations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpListStorageLensConfigurations{}, 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 = addEndpointPrefix_opListStorageLensConfigurationsMiddleware(stack); err != nil {
return err
}
if err = addOpListStorageLensConfigurationsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListStorageLensConfigurations(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addListStorageLensConfigurationsUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opListStorageLensConfigurationsMiddleware struct {
}
func (*endpointPrefix_opListStorageLensConfigurationsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListStorageLensConfigurationsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*ListStorageLensConfigurationsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListStorageLensConfigurationsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListStorageLensConfigurationsMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListStorageLensConfigurationsAPIClient is a client that implements the
// ListStorageLensConfigurations operation.
type ListStorageLensConfigurationsAPIClient interface {
ListStorageLensConfigurations(context.Context, *ListStorageLensConfigurationsInput, ...func(*Options)) (*ListStorageLensConfigurationsOutput, error)
}
var _ ListStorageLensConfigurationsAPIClient = (*Client)(nil)
// ListStorageLensConfigurationsPaginatorOptions is the paginator options for
// ListStorageLensConfigurations
type ListStorageLensConfigurationsPaginatorOptions 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
}
// ListStorageLensConfigurationsPaginator is a paginator for
// ListStorageLensConfigurations
type ListStorageLensConfigurationsPaginator struct {
options ListStorageLensConfigurationsPaginatorOptions
client ListStorageLensConfigurationsAPIClient
params *ListStorageLensConfigurationsInput
nextToken *string
firstPage bool
}
// NewListStorageLensConfigurationsPaginator returns a new
// ListStorageLensConfigurationsPaginator
func NewListStorageLensConfigurationsPaginator(client ListStorageLensConfigurationsAPIClient, params *ListStorageLensConfigurationsInput, optFns ...func(*ListStorageLensConfigurationsPaginatorOptions)) *ListStorageLensConfigurationsPaginator {
if params == nil {
params = &ListStorageLensConfigurationsInput{}
}
options := ListStorageLensConfigurationsPaginatorOptions{}
for _, fn := range optFns {
fn(&options)
}
return &ListStorageLensConfigurationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListStorageLensConfigurationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListStorageLensConfigurations page.
func (p *ListStorageLensConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStorageLensConfigurationsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
result, err := p.client.ListStorageLensConfigurations(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListStorageLensConfigurations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "ListStorageLensConfigurations",
}
}
func copyListStorageLensConfigurationsInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*ListStorageLensConfigurationsInput)
if !ok {
return nil, fmt.Errorf("expect *ListStorageLensConfigurationsInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func backFillListStorageLensConfigurationsAccountID(input interface{}, v string) error {
in := input.(*ListStorageLensConfigurationsInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addListStorageLensConfigurationsUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor,
BackfillAccountID: nopBackfillAccountIDAccessor,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: nopSetARNAccessor,
CopyInput: copyListStorageLensConfigurationsInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 307 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Replaces configuration for an Object Lambda Access Point. The following actions
// are related to PutAccessPointConfigurationForObjectLambda :
// - GetAccessPointConfigurationForObjectLambda (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointConfigurationForObjectLambda.html)
func (c *Client) PutAccessPointConfigurationForObjectLambda(ctx context.Context, params *PutAccessPointConfigurationForObjectLambdaInput, optFns ...func(*Options)) (*PutAccessPointConfigurationForObjectLambdaOutput, error) {
if params == nil {
params = &PutAccessPointConfigurationForObjectLambdaInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutAccessPointConfigurationForObjectLambda", params, optFns, c.addOperationPutAccessPointConfigurationForObjectLambdaMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutAccessPointConfigurationForObjectLambdaOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutAccessPointConfigurationForObjectLambdaInput struct {
// The account ID for the account that owns the specified Object Lambda Access
// Point.
//
// This member is required.
AccountId *string
// Object Lambda Access Point configuration document.
//
// This member is required.
Configuration *types.ObjectLambdaConfiguration
// The name of the Object Lambda Access Point.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
type PutAccessPointConfigurationForObjectLambdaOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutAccessPointConfigurationForObjectLambdaMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpPutAccessPointConfigurationForObjectLambda{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpPutAccessPointConfigurationForObjectLambda{}, 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 = addEndpointPrefix_opPutAccessPointConfigurationForObjectLambdaMiddleware(stack); err != nil {
return err
}
if err = addOpPutAccessPointConfigurationForObjectLambdaValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutAccessPointConfigurationForObjectLambda(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addPutAccessPointConfigurationForObjectLambdaUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opPutAccessPointConfigurationForObjectLambdaMiddleware struct {
}
func (*endpointPrefix_opPutAccessPointConfigurationForObjectLambdaMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opPutAccessPointConfigurationForObjectLambdaMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*PutAccessPointConfigurationForObjectLambdaInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opPutAccessPointConfigurationForObjectLambdaMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opPutAccessPointConfigurationForObjectLambdaMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opPutAccessPointConfigurationForObjectLambda(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "PutAccessPointConfigurationForObjectLambda",
}
}
func copyPutAccessPointConfigurationForObjectLambdaInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*PutAccessPointConfigurationForObjectLambdaInput)
if !ok {
return nil, fmt.Errorf("expect *PutAccessPointConfigurationForObjectLambdaInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func backFillPutAccessPointConfigurationForObjectLambdaAccountID(input interface{}, v string) error {
in := input.(*PutAccessPointConfigurationForObjectLambdaInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addPutAccessPointConfigurationForObjectLambdaUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor,
BackfillAccountID: nopBackfillAccountIDAccessor,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: nopSetARNAccessor,
CopyInput: copyPutAccessPointConfigurationForObjectLambdaInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 221 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Associates an access policy with the specified access point. Each access point
// can have only one policy, so a request made to this API replaces any existing
// policy associated with the specified access point. All Amazon S3 on Outposts
// REST API requests for this action require an additional parameter of
// x-amz-outpost-id to be passed with the request. In addition, you must use an S3
// on Outposts endpoint hostname prefix instead of s3-control . For an example of
// the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts
// endpoint hostname prefix and the x-amz-outpost-id derived by using the access
// point ARN, see the Examples (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutAccessPointPolicy.html#API_control_PutAccessPointPolicy_Examples)
// section. The following actions are related to PutAccessPointPolicy :
// - GetAccessPointPolicy (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointPolicy.html)
// - DeleteAccessPointPolicy (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointPolicy.html)
func (c *Client) PutAccessPointPolicy(ctx context.Context, params *PutAccessPointPolicyInput, optFns ...func(*Options)) (*PutAccessPointPolicyOutput, error) {
if params == nil {
params = &PutAccessPointPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutAccessPointPolicy", params, optFns, c.addOperationPutAccessPointPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutAccessPointPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutAccessPointPolicyInput struct {
// The Amazon Web Services account ID for owner of the bucket associated with the
// specified access point.
//
// This member is required.
AccountId *string
// The name of the access point that you want to associate with the specified
// policy. For using this parameter with Amazon S3 on Outposts with the REST API,
// you must specify the name and the x-amz-outpost-id as well. For using this
// parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must
// specify the ARN of the access point accessed in the format
// arn:aws:s3-outposts:::outpost//accesspoint/ . For example, to access the access
// point reports-ap through Outpost my-outpost owned by account 123456789012 in
// Region us-west-2 , use the URL encoding of
// arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/accesspoint/reports-ap
// . The value must be URL encoded.
//
// This member is required.
Name *string
// The policy that you want to apply to the specified access point. For more
// information about access point policies, see Managing data access with Amazon
// S3 access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html)
// in the Amazon S3 User Guide.
//
// This member is required.
Policy *string
noSmithyDocumentSerde
}
type PutAccessPointPolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutAccessPointPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpPutAccessPointPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpPutAccessPointPolicy{}, 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 = addEndpointPrefix_opPutAccessPointPolicyMiddleware(stack); err != nil {
return err
}
if err = addOpPutAccessPointPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutAccessPointPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addPutAccessPointPolicyUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opPutAccessPointPolicyMiddleware struct {
}
func (*endpointPrefix_opPutAccessPointPolicyMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opPutAccessPointPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*PutAccessPointPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opPutAccessPointPolicyMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opPutAccessPointPolicyMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opPutAccessPointPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "PutAccessPointPolicy",
}
}
func copyPutAccessPointPolicyInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*PutAccessPointPolicyInput)
if !ok {
return nil, fmt.Errorf("expect *PutAccessPointPolicyInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func getPutAccessPointPolicyARNMember(input interface{}) (*string, bool) {
in := input.(*PutAccessPointPolicyInput)
if in.Name == nil {
return nil, false
}
return in.Name, true
}
func setPutAccessPointPolicyARNMember(input interface{}, v string) error {
in := input.(*PutAccessPointPolicyInput)
in.Name = &v
return nil
}
func backFillPutAccessPointPolicyAccountID(input interface{}, v string) error {
in := input.(*PutAccessPointPolicyInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addPutAccessPointPolicyUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: getPutAccessPointPolicyARNMember,
BackfillAccountID: backFillPutAccessPointPolicyAccountID,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: setPutAccessPointPolicyARNMember,
CopyInput: copyPutAccessPointPolicyInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 253 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Creates or replaces resource policy for an Object Lambda Access Point. For an
// example policy, see Creating Object Lambda Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/olap-create.html#olap-create-cli)
// in the Amazon S3 User Guide. The following actions are related to
// PutAccessPointPolicyForObjectLambda :
// - DeleteAccessPointPolicyForObjectLambda (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointPolicyForObjectLambda.html)
// - GetAccessPointPolicyForObjectLambda (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointPolicyForObjectLambda.html)
func (c *Client) PutAccessPointPolicyForObjectLambda(ctx context.Context, params *PutAccessPointPolicyForObjectLambdaInput, optFns ...func(*Options)) (*PutAccessPointPolicyForObjectLambdaOutput, error) {
if params == nil {
params = &PutAccessPointPolicyForObjectLambdaInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutAccessPointPolicyForObjectLambda", params, optFns, c.addOperationPutAccessPointPolicyForObjectLambdaMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutAccessPointPolicyForObjectLambdaOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutAccessPointPolicyForObjectLambdaInput struct {
// The account ID for the account that owns the specified Object Lambda Access
// Point.
//
// This member is required.
AccountId *string
// The name of the Object Lambda Access Point.
//
// This member is required.
Name *string
// Object Lambda Access Point resource policy document.
//
// This member is required.
Policy *string
noSmithyDocumentSerde
}
type PutAccessPointPolicyForObjectLambdaOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutAccessPointPolicyForObjectLambdaMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpPutAccessPointPolicyForObjectLambda{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpPutAccessPointPolicyForObjectLambda{}, 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 = addEndpointPrefix_opPutAccessPointPolicyForObjectLambdaMiddleware(stack); err != nil {
return err
}
if err = addOpPutAccessPointPolicyForObjectLambdaValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutAccessPointPolicyForObjectLambda(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addPutAccessPointPolicyForObjectLambdaUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opPutAccessPointPolicyForObjectLambdaMiddleware struct {
}
func (*endpointPrefix_opPutAccessPointPolicyForObjectLambdaMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opPutAccessPointPolicyForObjectLambdaMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*PutAccessPointPolicyForObjectLambdaInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opPutAccessPointPolicyForObjectLambdaMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opPutAccessPointPolicyForObjectLambdaMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opPutAccessPointPolicyForObjectLambda(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "PutAccessPointPolicyForObjectLambda",
}
}
func copyPutAccessPointPolicyForObjectLambdaInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*PutAccessPointPolicyForObjectLambdaInput)
if !ok {
return nil, fmt.Errorf("expect *PutAccessPointPolicyForObjectLambdaInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func backFillPutAccessPointPolicyForObjectLambdaAccountID(input interface{}, v string) error {
in := input.(*PutAccessPointPolicyForObjectLambdaInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addPutAccessPointPolicyForObjectLambdaUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor,
BackfillAccountID: nopBackfillAccountIDAccessor,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: nopSetARNAccessor,
CopyInput: copyPutAccessPointPolicyForObjectLambdaInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 223 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// This action puts a lifecycle configuration to an Amazon S3 on Outposts bucket.
// To put a lifecycle configuration to an S3 bucket, see
// PutBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html)
// in the Amazon S3 API Reference. Creates a new lifecycle configuration for the S3
// on Outposts bucket or replaces an existing lifecycle configuration. Outposts
// buckets only support lifecycle configurations that delete/expire objects after a
// certain period of time and abort incomplete multipart uploads. All Amazon S3 on
// Outposts REST API requests for this action require an additional parameter of
// x-amz-outpost-id to be passed with the request. In addition, you must use an S3
// on Outposts endpoint hostname prefix instead of s3-control . For an example of
// the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts
// endpoint hostname prefix and the x-amz-outpost-id derived by using the access
// point ARN, see the Examples (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketLifecycleConfiguration.html#API_control_PutBucketLifecycleConfiguration_Examples)
// section. The following actions are related to PutBucketLifecycleConfiguration :
// - GetBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketLifecycleConfiguration.html)
// - DeleteBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketLifecycleConfiguration.html)
func (c *Client) PutBucketLifecycleConfiguration(ctx context.Context, params *PutBucketLifecycleConfigurationInput, optFns ...func(*Options)) (*PutBucketLifecycleConfigurationOutput, error) {
if params == nil {
params = &PutBucketLifecycleConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutBucketLifecycleConfiguration", params, optFns, c.addOperationPutBucketLifecycleConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutBucketLifecycleConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutBucketLifecycleConfigurationInput struct {
// The Amazon Web Services account ID of the Outposts bucket.
//
// This member is required.
AccountId *string
// The name of the bucket for which to set the configuration.
//
// This member is required.
Bucket *string
// Container for lifecycle rules. You can add as many as 1,000 rules.
LifecycleConfiguration *types.LifecycleConfiguration
noSmithyDocumentSerde
}
type PutBucketLifecycleConfigurationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutBucketLifecycleConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketLifecycleConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpPutBucketLifecycleConfiguration{}, 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 = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opPutBucketLifecycleConfigurationMiddleware(stack); err != nil {
return err
}
if err = addOpPutBucketLifecycleConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutBucketLifecycleConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addPutBucketLifecycleConfigurationUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opPutBucketLifecycleConfigurationMiddleware struct {
}
func (*endpointPrefix_opPutBucketLifecycleConfigurationMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opPutBucketLifecycleConfigurationMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*PutBucketLifecycleConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opPutBucketLifecycleConfigurationMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opPutBucketLifecycleConfigurationMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opPutBucketLifecycleConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "PutBucketLifecycleConfiguration",
}
}
func copyPutBucketLifecycleConfigurationInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*PutBucketLifecycleConfigurationInput)
if !ok {
return nil, fmt.Errorf("expect *PutBucketLifecycleConfigurationInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func getPutBucketLifecycleConfigurationARNMember(input interface{}) (*string, bool) {
in := input.(*PutBucketLifecycleConfigurationInput)
if in.Bucket == nil {
return nil, false
}
return in.Bucket, true
}
func setPutBucketLifecycleConfigurationARNMember(input interface{}, v string) error {
in := input.(*PutBucketLifecycleConfigurationInput)
in.Bucket = &v
return nil
}
func backFillPutBucketLifecycleConfigurationAccountID(input interface{}, v string) error {
in := input.(*PutBucketLifecycleConfigurationInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addPutBucketLifecycleConfigurationUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: getPutBucketLifecycleConfigurationARNMember,
BackfillAccountID: backFillPutBucketLifecycleConfigurationAccountID,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: setPutBucketLifecycleConfigurationARNMember,
CopyInput: copyPutBucketLifecycleConfigurationInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 246 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// This action puts a bucket policy to an Amazon S3 on Outposts bucket. To put a
// policy on an S3 bucket, see PutBucketPolicy (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketPolicy.html)
// in the Amazon S3 API Reference. Applies an Amazon S3 bucket policy to an
// Outposts bucket. For more information, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html)
// in the Amazon S3 User Guide. If you are using an identity other than the root
// user of the Amazon Web Services account that owns the Outposts bucket, the
// calling identity must have the PutBucketPolicy permissions on the specified
// Outposts bucket and belong to the bucket owner's account in order to use this
// action. If you don't have PutBucketPolicy permissions, Amazon S3 returns a 403
// Access Denied error. If you have the correct permissions, but you're not using
// an identity that belongs to the bucket owner's account, Amazon S3 returns a 405
// Method Not Allowed error. As a security precaution, the root user of the Amazon
// Web Services account that owns a bucket can always use this action, even if the
// policy explicitly denies the root user the ability to perform this action. For
// more information about bucket policies, see Using Bucket Policies and User
// Policies (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html)
// . All Amazon S3 on Outposts REST API requests for this action require an
// additional parameter of x-amz-outpost-id to be passed with the request. In
// addition, you must use an S3 on Outposts endpoint hostname prefix instead of
// s3-control . For an example of the request syntax for Amazon S3 on Outposts that
// uses the S3 on Outposts endpoint hostname prefix and the x-amz-outpost-id
// derived by using the access point ARN, see the Examples (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketPolicy.html#API_control_PutBucketPolicy_Examples)
// section. The following actions are related to PutBucketPolicy :
// - GetBucketPolicy (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketPolicy.html)
// - DeleteBucketPolicy (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketPolicy.html)
func (c *Client) PutBucketPolicy(ctx context.Context, params *PutBucketPolicyInput, optFns ...func(*Options)) (*PutBucketPolicyOutput, error) {
if params == nil {
params = &PutBucketPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutBucketPolicy", params, optFns, c.addOperationPutBucketPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutBucketPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutBucketPolicyInput struct {
// The Amazon Web Services account ID of the Outposts bucket.
//
// This member is required.
AccountId *string
// Specifies the bucket. For using this parameter with Amazon S3 on Outposts with
// the REST API, you must specify the name and the x-amz-outpost-id as well. For
// using this parameter with S3 on Outposts with the Amazon Web Services SDK and
// CLI, you must specify the ARN of the bucket accessed in the format
// arn:aws:s3-outposts:::outpost//bucket/ . For example, to access the bucket
// reports through Outpost my-outpost owned by account 123456789012 in Region
// us-west-2 , use the URL encoding of
// arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports .
// The value must be URL encoded.
//
// This member is required.
Bucket *string
// The bucket policy as a JSON document.
//
// This member is required.
Policy *string
// Set this parameter to true to confirm that you want to remove your permissions
// to change this bucket policy in the future. This is not supported by Amazon S3
// on Outposts buckets.
ConfirmRemoveSelfBucketAccess bool
noSmithyDocumentSerde
}
type PutBucketPolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutBucketPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpPutBucketPolicy{}, 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 = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opPutBucketPolicyMiddleware(stack); err != nil {
return err
}
if err = addOpPutBucketPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutBucketPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addPutBucketPolicyUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opPutBucketPolicyMiddleware struct {
}
func (*endpointPrefix_opPutBucketPolicyMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opPutBucketPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*PutBucketPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opPutBucketPolicyMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opPutBucketPolicyMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opPutBucketPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "PutBucketPolicy",
}
}
func copyPutBucketPolicyInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*PutBucketPolicyInput)
if !ok {
return nil, fmt.Errorf("expect *PutBucketPolicyInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func getPutBucketPolicyARNMember(input interface{}) (*string, bool) {
in := input.(*PutBucketPolicyInput)
if in.Bucket == nil {
return nil, false
}
return in.Bucket, true
}
func setPutBucketPolicyARNMember(input interface{}, v string) error {
in := input.(*PutBucketPolicyInput)
in.Bucket = &v
return nil
}
func backFillPutBucketPolicyAccountID(input interface{}, v string) error {
in := input.(*PutBucketPolicyInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addPutBucketPolicyUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: getPutBucketPolicyARNMember,
BackfillAccountID: backFillPutBucketPolicyAccountID,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: setPutBucketPolicyARNMember,
CopyInput: copyPutBucketPolicyInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 269 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// This action creates an Amazon S3 on Outposts bucket's replication
// configuration. To create an S3 bucket's replication configuration, see
// PutBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html)
// in the Amazon S3 API Reference. Creates a replication configuration or replaces
// an existing one. For information about S3 replication on Outposts configuration,
// see Replicating objects for S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsReplication.html)
// in the Amazon S3 User Guide. It can take a while to propagate PUT or DELETE
// requests for a replication configuration to all S3 on Outposts systems.
// Therefore, the replication configuration that's returned by a GET request soon
// after a PUT or DELETE request might return a more recent result than what's on
// the Outpost. If an Outpost is offline, the delay in updating the replication
// configuration on that Outpost can be significant. Specify the replication
// configuration in the request body. In the replication configuration, you provide
// the following information:
// - The name of the destination bucket or buckets where you want S3 on Outposts
// to replicate objects
// - The Identity and Access Management (IAM) role that S3 on Outposts can
// assume to replicate objects on your behalf
// - Other relevant information, such as replication rules
//
// A replication configuration must include at least one rule and can contain a
// maximum of 100. Each rule identifies a subset of objects to replicate by
// filtering the objects in the source Outposts bucket. To choose additional
// subsets of objects to replicate, add a rule for each subset. To specify a subset
// of the objects in the source Outposts bucket to apply a replication rule to, add
// the Filter element as a child of the Rule element. You can filter objects based
// on an object key prefix, one or more object tags, or both. When you add the
// Filter element in the configuration, you must also add the following elements:
// DeleteMarkerReplication , Status , and Priority . Using PutBucketReplication on
// Outposts requires that both the source and destination buckets must have
// versioning enabled. For information about enabling versioning on a bucket, see
// Managing S3 Versioning for your S3 on Outposts bucket (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsManagingVersioning.html)
// . For information about S3 on Outposts replication failure reasons, see
// Replication failure reasons (https://docs.aws.amazon.com/AmazonS3/latest/userguide/outposts-replication-eventbridge.html#outposts-replication-failure-codes)
// in the Amazon S3 User Guide. Handling Replication of Encrypted Objects Outposts
// buckets are encrypted at all times. All the objects in the source Outposts
// bucket are encrypted and can be replicated. Also, all the replicas in the
// destination Outposts bucket are encrypted with the same encryption key as the
// objects in the source Outposts bucket. Permissions To create a
// PutBucketReplication request, you must have
// s3-outposts:PutReplicationConfiguration permissions for the bucket. The Outposts
// bucket owner has this permission by default and can grant it to others. For more
// information about permissions, see Setting up IAM with S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsIAM.html)
// and Managing access to S3 on Outposts buckets (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsBucketPolicy.html)
// . To perform this operation, the user or role must also have the iam:CreateRole
// and iam:PassRole permissions. For more information, see Granting a user
// permissions to pass a role to an Amazon Web Services service (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html)
// . All Amazon S3 on Outposts REST API requests for this action require an
// additional parameter of x-amz-outpost-id to be passed with the request. In
// addition, you must use an S3 on Outposts endpoint hostname prefix instead of
// s3-control . For an example of the request syntax for Amazon S3 on Outposts that
// uses the S3 on Outposts endpoint hostname prefix and the x-amz-outpost-id
// derived by using the access point ARN, see the Examples (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketReplication.html#API_control_PutBucketReplication_Examples)
// section. The following operations are related to PutBucketReplication :
// - GetBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketReplication.html)
// - DeleteBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketReplication.html)
func (c *Client) PutBucketReplication(ctx context.Context, params *PutBucketReplicationInput, optFns ...func(*Options)) (*PutBucketReplicationOutput, error) {
if params == nil {
params = &PutBucketReplicationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutBucketReplication", params, optFns, c.addOperationPutBucketReplicationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutBucketReplicationOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutBucketReplicationInput struct {
// The Amazon Web Services account ID of the Outposts bucket.
//
// This member is required.
AccountId *string
// Specifies the S3 on Outposts bucket to set the configuration for. For using
// this parameter with Amazon S3 on Outposts with the REST API, you must specify
// the name and the x-amz-outpost-id as well. For using this parameter with S3 on
// Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of
// the bucket accessed in the format arn:aws:s3-outposts:::outpost//bucket/ . For
// example, to access the bucket reports through Outpost my-outpost owned by
// account 123456789012 in Region us-west-2 , use the URL encoding of
// arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports .
// The value must be URL encoded.
//
// This member is required.
Bucket *string
//
//
// This member is required.
ReplicationConfiguration *types.ReplicationConfiguration
noSmithyDocumentSerde
}
type PutBucketReplicationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutBucketReplicationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketReplication{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpPutBucketReplication{}, 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 = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opPutBucketReplicationMiddleware(stack); err != nil {
return err
}
if err = addOpPutBucketReplicationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutBucketReplication(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addPutBucketReplicationUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opPutBucketReplicationMiddleware struct {
}
func (*endpointPrefix_opPutBucketReplicationMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opPutBucketReplicationMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*PutBucketReplicationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opPutBucketReplicationMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opPutBucketReplicationMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opPutBucketReplication(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "PutBucketReplication",
}
}
func copyPutBucketReplicationInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*PutBucketReplicationInput)
if !ok {
return nil, fmt.Errorf("expect *PutBucketReplicationInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func getPutBucketReplicationARNMember(input interface{}) (*string, bool) {
in := input.(*PutBucketReplicationInput)
if in.Bucket == nil {
return nil, false
}
return in.Bucket, true
}
func setPutBucketReplicationARNMember(input interface{}, v string) error {
in := input.(*PutBucketReplicationInput)
in.Bucket = &v
return nil
}
func backFillPutBucketReplicationAccountID(input interface{}, v string) error {
in := input.(*PutBucketReplicationInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addPutBucketReplicationUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: getPutBucketReplicationARNMember,
BackfillAccountID: backFillPutBucketReplicationAccountID,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: setPutBucketReplicationARNMember,
CopyInput: copyPutBucketReplicationInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 296 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// This action puts tags on an Amazon S3 on Outposts bucket. To put tags on an S3
// bucket, see PutBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html)
// in the Amazon S3 API Reference. Sets the tags for an S3 on Outposts bucket. For
// more information, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html)
// in the Amazon S3 User Guide. Use tags to organize your Amazon Web Services bill
// to reflect your own cost structure. To do this, sign up to get your Amazon Web
// Services account bill with tag key values included. Then, to see the cost of
// combined resources, organize your billing information according to resources
// with the same tag key values. For example, you can tag several resources with a
// specific application name, and then organize your billing information to see the
// total cost of that application across several services. For more information,
// see Cost allocation and tagging (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html)
// . Within a bucket, if you add a tag that has the same key as an existing tag,
// the new value overwrites the old value. For more information, see Using cost
// allocation in Amazon S3 bucket tags (https://docs.aws.amazon.com/AmazonS3/latest/userguide/CostAllocTagging.html)
// . To use this action, you must have permissions to perform the
// s3-outposts:PutBucketTagging action. The Outposts bucket owner has this
// permission by default and can grant this permission to others. For more
// information about permissions, see Permissions Related to Bucket Subresource
// Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources)
// and Managing access permissions to your Amazon S3 resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html)
// . PutBucketTagging has the following special errors:
// - Error code: InvalidTagError
// - Description: The tag provided was not a valid tag. This error can occur if
// the tag did not pass input validation. For information about tag restrictions,
// see User-Defined Tag Restrictions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html)
// and Amazon Web Services-Generated Cost Allocation Tag Restrictions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/aws-tag-restrictions.html)
// .
// - Error code: MalformedXMLError
// - Description: The XML provided does not match the schema.
// - Error code: OperationAbortedError
// - Description: A conflicting conditional action is currently in progress
// against this resource. Try again.
// - Error code: InternalError
// - Description: The service was unable to apply the provided tag to the
// bucket.
//
// All Amazon S3 on Outposts REST API requests for this action require an
// additional parameter of x-amz-outpost-id to be passed with the request. In
// addition, you must use an S3 on Outposts endpoint hostname prefix instead of
// s3-control . For an example of the request syntax for Amazon S3 on Outposts that
// uses the S3 on Outposts endpoint hostname prefix and the x-amz-outpost-id
// derived by using the access point ARN, see the Examples (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketTagging.html#API_control_PutBucketTagging_Examples)
// section. The following actions are related to PutBucketTagging :
// - GetBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketTagging.html)
// - DeleteBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketTagging.html)
func (c *Client) PutBucketTagging(ctx context.Context, params *PutBucketTaggingInput, optFns ...func(*Options)) (*PutBucketTaggingOutput, error) {
if params == nil {
params = &PutBucketTaggingInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutBucketTagging", params, optFns, c.addOperationPutBucketTaggingMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutBucketTaggingOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutBucketTaggingInput struct {
// The Amazon Web Services account ID of the Outposts bucket.
//
// This member is required.
AccountId *string
// The Amazon Resource Name (ARN) of the bucket. For using this parameter with
// Amazon S3 on Outposts with the REST API, you must specify the name and the
// x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the
// Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed
// in the format arn:aws:s3-outposts:::outpost//bucket/ . For example, to access
// the bucket reports through Outpost my-outpost owned by account 123456789012 in
// Region us-west-2 , use the URL encoding of
// arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports .
// The value must be URL encoded.
//
// This member is required.
Bucket *string
//
//
// This member is required.
Tagging *types.Tagging
noSmithyDocumentSerde
}
type PutBucketTaggingOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutBucketTaggingMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketTagging{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpPutBucketTagging{}, 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 = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opPutBucketTaggingMiddleware(stack); err != nil {
return err
}
if err = addOpPutBucketTaggingValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutBucketTagging(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addPutBucketTaggingUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opPutBucketTaggingMiddleware struct {
}
func (*endpointPrefix_opPutBucketTaggingMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opPutBucketTaggingMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*PutBucketTaggingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opPutBucketTaggingMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opPutBucketTaggingMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opPutBucketTagging(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "PutBucketTagging",
}
}
func copyPutBucketTaggingInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*PutBucketTaggingInput)
if !ok {
return nil, fmt.Errorf("expect *PutBucketTaggingInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func getPutBucketTaggingARNMember(input interface{}) (*string, bool) {
in := input.(*PutBucketTaggingInput)
if in.Bucket == nil {
return nil, false
}
return in.Bucket, true
}
func setPutBucketTaggingARNMember(input interface{}, v string) error {
in := input.(*PutBucketTaggingInput)
in.Bucket = &v
return nil
}
func backFillPutBucketTaggingAccountID(input interface{}, v string) error {
in := input.(*PutBucketTaggingInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addPutBucketTaggingUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: getPutBucketTaggingARNMember,
BackfillAccountID: backFillPutBucketTaggingAccountID,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: setPutBucketTaggingARNMember,
CopyInput: copyPutBucketTaggingInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 286 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// This operation sets the versioning state for S3 on Outposts buckets only. To
// set the versioning state for an S3 bucket, see PutBucketVersioning (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html)
// in the Amazon S3 API Reference. Sets the versioning state for an S3 on Outposts
// bucket. With S3 Versioning, you can save multiple distinct copies of your
// objects and recover from unintended user actions and application failures. You
// can set the versioning state to one of the following:
// - Enabled - Enables versioning for the objects in the bucket. All objects
// added to the bucket receive a unique version ID.
// - Suspended - Suspends versioning for the objects in the bucket. All objects
// added to the bucket receive the version ID null .
//
// If you've never set versioning on your bucket, it has no versioning state. In
// that case, a GetBucketVersioning (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketVersioning.html)
// request does not return a versioning state value. When you enable S3 Versioning,
// for each object in your bucket, you have a current version and zero or more
// noncurrent versions. You can configure your bucket S3 Lifecycle rules to expire
// noncurrent versions after a specified time period. For more information, see
// Creating and managing a lifecycle configuration for your S3 on Outposts bucket (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsLifecycleManaging.html)
// in the Amazon S3 User Guide. If you have an object expiration lifecycle
// configuration in your non-versioned bucket and you want to maintain the same
// permanent delete behavior when you enable versioning, you must add a noncurrent
// expiration policy. The noncurrent expiration lifecycle configuration will manage
// the deletes of the noncurrent object versions in the version-enabled bucket. For
// more information, see Versioning (https://docs.aws.amazon.com/AmazonS3/latest/userguide/Versioning.html)
// in the Amazon S3 User Guide. All Amazon S3 on Outposts REST API requests for
// this action require an additional parameter of x-amz-outpost-id to be passed
// with the request. In addition, you must use an S3 on Outposts endpoint hostname
// prefix instead of s3-control . For an example of the request syntax for Amazon
// S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the
// x-amz-outpost-id derived by using the access point ARN, see the Examples (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketVersioning.html#API_control_PutBucketVersioning_Examples)
// section. The following operations are related to PutBucketVersioning for S3 on
// Outposts.
// - GetBucketVersioning (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketVersioning.html)
// - PutBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketLifecycleConfiguration.html)
// - GetBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketLifecycleConfiguration.html)
func (c *Client) PutBucketVersioning(ctx context.Context, params *PutBucketVersioningInput, optFns ...func(*Options)) (*PutBucketVersioningOutput, error) {
if params == nil {
params = &PutBucketVersioningInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutBucketVersioning", params, optFns, c.addOperationPutBucketVersioningMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutBucketVersioningOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutBucketVersioningInput struct {
// The Amazon Web Services account ID of the S3 on Outposts bucket.
//
// This member is required.
AccountId *string
// The S3 on Outposts bucket to set the versioning state for.
//
// This member is required.
Bucket *string
// The root-level tag for the VersioningConfiguration parameters.
//
// This member is required.
VersioningConfiguration *types.VersioningConfiguration
// The concatenation of the authentication device's serial number, a space, and
// the value that is displayed on your authentication device.
MFA *string
noSmithyDocumentSerde
}
type PutBucketVersioningOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutBucketVersioningMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketVersioning{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpPutBucketVersioning{}, 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 = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opPutBucketVersioningMiddleware(stack); err != nil {
return err
}
if err = addOpPutBucketVersioningValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutBucketVersioning(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addPutBucketVersioningUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opPutBucketVersioningMiddleware struct {
}
func (*endpointPrefix_opPutBucketVersioningMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opPutBucketVersioningMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*PutBucketVersioningInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opPutBucketVersioningMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opPutBucketVersioningMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opPutBucketVersioning(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "PutBucketVersioning",
}
}
func copyPutBucketVersioningInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*PutBucketVersioningInput)
if !ok {
return nil, fmt.Errorf("expect *PutBucketVersioningInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func getPutBucketVersioningARNMember(input interface{}) (*string, bool) {
in := input.(*PutBucketVersioningInput)
if in.Bucket == nil {
return nil, false
}
return in.Bucket, true
}
func setPutBucketVersioningARNMember(input interface{}, v string) error {
in := input.(*PutBucketVersioningInput)
in.Bucket = &v
return nil
}
func backFillPutBucketVersioningAccountID(input interface{}, v string) error {
in := input.(*PutBucketVersioningInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addPutBucketVersioningUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: getPutBucketVersioningARNMember,
BackfillAccountID: backFillPutBucketVersioningAccountID,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: setPutBucketVersioningARNMember,
CopyInput: copyPutBucketVersioningInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 271 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Sets the supplied tag-set on an S3 Batch Operations job. A tag is a key-value
// pair. You can associate S3 Batch Operations tags with any job by sending a PUT
// request against the tagging subresource that is associated with the job. To
// modify the existing tag set, you can either replace the existing tag set
// entirely, or make changes within the existing tag set by retrieving the existing
// tag set using GetJobTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetJobTagging.html)
// , modify that tag set, and use this action to replace the tag set with the one
// you modified. For more information, see Controlling access and labeling jobs
// using tags (https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-managing-jobs.html#batch-ops-job-tags)
// in the Amazon S3 User Guide.
// - If you send this request with an empty tag set, Amazon S3 deletes the
// existing tag set on the Batch Operations job. If you use this method, you are
// charged for a Tier 1 Request (PUT). For more information, see Amazon S3
// pricing (http://aws.amazon.com/s3/pricing/) .
// - For deleting existing tags for your Batch Operations job, a DeleteJobTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteJobTagging.html)
// request is preferred because it achieves the same result without incurring
// charges.
// - A few things to consider about using tags:
// - Amazon S3 limits the maximum number of tags to 50 tags per job.
// - You can associate up to 50 tags with a job as long as they have unique tag
// keys.
// - A tag key can be up to 128 Unicode characters in length, and tag values can
// be up to 256 Unicode characters in length.
// - The key and values are case sensitive.
// - For tagging-related restrictions related to characters and encodings, see
// User-Defined Tag Restrictions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html)
// in the Billing and Cost Management User Guide.
//
// To use the PutJobTagging operation, you must have permission to perform the
// s3:PutJobTagging action. Related actions include:
// - CreateJob (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html)
// - GetJobTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetJobTagging.html)
// - DeleteJobTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteJobTagging.html)
func (c *Client) PutJobTagging(ctx context.Context, params *PutJobTaggingInput, optFns ...func(*Options)) (*PutJobTaggingOutput, error) {
if params == nil {
params = &PutJobTaggingInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutJobTagging", params, optFns, c.addOperationPutJobTaggingMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutJobTaggingOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutJobTaggingInput struct {
// The Amazon Web Services account ID associated with the S3 Batch Operations job.
//
// This member is required.
AccountId *string
// The ID for the S3 Batch Operations job whose tags you want to replace.
//
// This member is required.
JobId *string
// The set of tags to associate with the S3 Batch Operations job.
//
// This member is required.
Tags []types.S3Tag
noSmithyDocumentSerde
}
type PutJobTaggingOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutJobTaggingMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpPutJobTagging{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpPutJobTagging{}, 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 = addEndpointPrefix_opPutJobTaggingMiddleware(stack); err != nil {
return err
}
if err = addOpPutJobTaggingValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutJobTagging(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addPutJobTaggingUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opPutJobTaggingMiddleware struct {
}
func (*endpointPrefix_opPutJobTaggingMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opPutJobTaggingMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*PutJobTaggingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opPutJobTaggingMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opPutJobTaggingMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opPutJobTagging(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "PutJobTagging",
}
}
func copyPutJobTaggingInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*PutJobTaggingInput)
if !ok {
return nil, fmt.Errorf("expect *PutJobTaggingInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func backFillPutJobTaggingAccountID(input interface{}, v string) error {
in := input.(*PutJobTaggingInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addPutJobTaggingUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor,
BackfillAccountID: nopBackfillAccountIDAccessor,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: nopSetARNAccessor,
CopyInput: copyPutJobTaggingInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 250 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Associates an access control policy with the specified Multi-Region Access
// Point. Each Multi-Region Access Point can have only one policy, so a request
// made to this action replaces any existing policy that is associated with the
// specified Multi-Region Access Point. This action will always be routed to the US
// West (Oregon) Region. For more information about the restrictions around
// managing Multi-Region Access Points, see Managing Multi-Region Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/ManagingMultiRegionAccessPoints.html)
// in the Amazon S3 User Guide. The following actions are related to
// PutMultiRegionAccessPointPolicy :
// - GetMultiRegionAccessPointPolicy (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetMultiRegionAccessPointPolicy.html)
// - GetMultiRegionAccessPointPolicyStatus (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetMultiRegionAccessPointPolicyStatus.html)
func (c *Client) PutMultiRegionAccessPointPolicy(ctx context.Context, params *PutMultiRegionAccessPointPolicyInput, optFns ...func(*Options)) (*PutMultiRegionAccessPointPolicyOutput, error) {
if params == nil {
params = &PutMultiRegionAccessPointPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutMultiRegionAccessPointPolicy", params, optFns, c.addOperationPutMultiRegionAccessPointPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutMultiRegionAccessPointPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutMultiRegionAccessPointPolicyInput struct {
// The Amazon Web Services account ID for the owner of the Multi-Region Access
// Point.
//
// This member is required.
AccountId *string
// An idempotency token used to identify the request and guarantee that requests
// are unique.
//
// This member is required.
ClientToken *string
// A container element containing the details of the policy for the Multi-Region
// Access Point.
//
// This member is required.
Details *types.PutMultiRegionAccessPointPolicyInput
noSmithyDocumentSerde
}
type PutMultiRegionAccessPointPolicyOutput struct {
// The request token associated with the request. You can use this token with
// DescribeMultiRegionAccessPointOperation (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DescribeMultiRegionAccessPointOperation.html)
// to determine the status of asynchronous requests.
RequestTokenARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutMultiRegionAccessPointPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpPutMultiRegionAccessPointPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpPutMultiRegionAccessPointPolicy{}, 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 = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opPutMultiRegionAccessPointPolicyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opPutMultiRegionAccessPointPolicyMiddleware(stack, options); err != nil {
return err
}
if err = addOpPutMultiRegionAccessPointPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutMultiRegionAccessPointPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addPutMultiRegionAccessPointPolicyUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opPutMultiRegionAccessPointPolicyMiddleware struct {
}
func (*endpointPrefix_opPutMultiRegionAccessPointPolicyMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opPutMultiRegionAccessPointPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*PutMultiRegionAccessPointPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opPutMultiRegionAccessPointPolicyMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opPutMultiRegionAccessPointPolicyMiddleware{}, `OperationSerializer`, middleware.After)
}
type idempotencyToken_initializeOpPutMultiRegionAccessPointPolicy struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpPutMultiRegionAccessPointPolicy) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpPutMultiRegionAccessPointPolicy) 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.(*PutMultiRegionAccessPointPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *PutMultiRegionAccessPointPolicyInput ")
}
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_opPutMultiRegionAccessPointPolicyMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpPutMultiRegionAccessPointPolicy{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opPutMultiRegionAccessPointPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "PutMultiRegionAccessPointPolicy",
}
}
func copyPutMultiRegionAccessPointPolicyInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*PutMultiRegionAccessPointPolicyInput)
if !ok {
return nil, fmt.Errorf("expect *PutMultiRegionAccessPointPolicyInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func backFillPutMultiRegionAccessPointPolicyAccountID(input interface{}, v string) error {
in := input.(*PutMultiRegionAccessPointPolicyInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addPutMultiRegionAccessPointPolicyUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor,
BackfillAccountID: nopBackfillAccountIDAccessor,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: nopSetARNAccessor,
CopyInput: copyPutMultiRegionAccessPointPolicyInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 275 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Creates or modifies the PublicAccessBlock configuration for an Amazon Web
// Services account. For this operation, users must have the
// s3:PutAccountPublicAccessBlock permission. For more information, see Using
// Amazon S3 block public access (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html)
// . Related actions include:
// - GetPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetPublicAccessBlock.html)
// - DeletePublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeletePublicAccessBlock.html)
func (c *Client) PutPublicAccessBlock(ctx context.Context, params *PutPublicAccessBlockInput, optFns ...func(*Options)) (*PutPublicAccessBlockOutput, error) {
if params == nil {
params = &PutPublicAccessBlockInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutPublicAccessBlock", params, optFns, c.addOperationPutPublicAccessBlockMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutPublicAccessBlockOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutPublicAccessBlockInput struct {
// The account ID for the Amazon Web Services account whose PublicAccessBlock
// configuration you want to set.
//
// This member is required.
AccountId *string
// The PublicAccessBlock configuration that you want to apply to the specified
// Amazon Web Services account.
//
// This member is required.
PublicAccessBlockConfiguration *types.PublicAccessBlockConfiguration
noSmithyDocumentSerde
}
type PutPublicAccessBlockOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutPublicAccessBlockMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpPutPublicAccessBlock{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpPutPublicAccessBlock{}, 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 = addEndpointPrefix_opPutPublicAccessBlockMiddleware(stack); err != nil {
return err
}
if err = addOpPutPublicAccessBlockValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutPublicAccessBlock(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addPutPublicAccessBlockUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opPutPublicAccessBlockMiddleware struct {
}
func (*endpointPrefix_opPutPublicAccessBlockMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opPutPublicAccessBlockMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*PutPublicAccessBlockInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opPutPublicAccessBlockMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opPutPublicAccessBlockMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opPutPublicAccessBlock(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "PutPublicAccessBlock",
}
}
func copyPutPublicAccessBlockInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*PutPublicAccessBlockInput)
if !ok {
return nil, fmt.Errorf("expect *PutPublicAccessBlockInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func backFillPutPublicAccessBlockAccountID(input interface{}, v string) error {
in := input.(*PutPublicAccessBlockInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addPutPublicAccessBlockUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor,
BackfillAccountID: nopBackfillAccountIDAccessor,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: nopSetARNAccessor,
CopyInput: copyPutPublicAccessBlockInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 221 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Puts an Amazon S3 Storage Lens configuration. For more information about S3
// Storage Lens, see Working with Amazon S3 Storage Lens (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html)
// in the Amazon S3 User Guide. For a complete list of S3 Storage Lens metrics, see
// S3 Storage Lens metrics glossary (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens_metrics_glossary.html)
// in the Amazon S3 User Guide. To use this action, you must have permission to
// perform the s3:PutStorageLensConfiguration action. For more information, see
// Setting permissions to use Amazon S3 Storage Lens (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html)
// in the Amazon S3 User Guide.
func (c *Client) PutStorageLensConfiguration(ctx context.Context, params *PutStorageLensConfigurationInput, optFns ...func(*Options)) (*PutStorageLensConfigurationOutput, error) {
if params == nil {
params = &PutStorageLensConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutStorageLensConfiguration", params, optFns, c.addOperationPutStorageLensConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutStorageLensConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutStorageLensConfigurationInput struct {
// The account ID of the requester.
//
// This member is required.
AccountId *string
// The ID of the S3 Storage Lens configuration.
//
// This member is required.
ConfigId *string
// The S3 Storage Lens configuration.
//
// This member is required.
StorageLensConfiguration *types.StorageLensConfiguration
// The tag set of the S3 Storage Lens configuration. You can set up to a maximum
// of 50 tags.
Tags []types.StorageLensTag
noSmithyDocumentSerde
}
type PutStorageLensConfigurationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutStorageLensConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpPutStorageLensConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpPutStorageLensConfiguration{}, 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 = addEndpointPrefix_opPutStorageLensConfigurationMiddleware(stack); err != nil {
return err
}
if err = addOpPutStorageLensConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutStorageLensConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addPutStorageLensConfigurationUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opPutStorageLensConfigurationMiddleware struct {
}
func (*endpointPrefix_opPutStorageLensConfigurationMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opPutStorageLensConfigurationMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*PutStorageLensConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opPutStorageLensConfigurationMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opPutStorageLensConfigurationMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opPutStorageLensConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "PutStorageLensConfiguration",
}
}
func copyPutStorageLensConfigurationInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*PutStorageLensConfigurationInput)
if !ok {
return nil, fmt.Errorf("expect *PutStorageLensConfigurationInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func backFillPutStorageLensConfigurationAccountID(input interface{}, v string) error {
in := input.(*PutStorageLensConfigurationInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addPutStorageLensConfigurationUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor,
BackfillAccountID: nopBackfillAccountIDAccessor,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: nopSetARNAccessor,
CopyInput: copyPutStorageLensConfigurationInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 229 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Put or replace tags on an existing Amazon S3 Storage Lens configuration. For
// more information about S3 Storage Lens, see Assessing your storage activity and
// usage with Amazon S3 Storage Lens (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html)
// in the Amazon S3 User Guide. To use this action, you must have permission to
// perform the s3:PutStorageLensConfigurationTagging action. For more information,
// see Setting permissions to use Amazon S3 Storage Lens (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html)
// in the Amazon S3 User Guide.
func (c *Client) PutStorageLensConfigurationTagging(ctx context.Context, params *PutStorageLensConfigurationTaggingInput, optFns ...func(*Options)) (*PutStorageLensConfigurationTaggingOutput, error) {
if params == nil {
params = &PutStorageLensConfigurationTaggingInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutStorageLensConfigurationTagging", params, optFns, c.addOperationPutStorageLensConfigurationTaggingMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutStorageLensConfigurationTaggingOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutStorageLensConfigurationTaggingInput struct {
// The account ID of the requester.
//
// This member is required.
AccountId *string
// The ID of the S3 Storage Lens configuration.
//
// This member is required.
ConfigId *string
// The tag set of the S3 Storage Lens configuration. You can set up to a maximum
// of 50 tags.
//
// This member is required.
Tags []types.StorageLensTag
noSmithyDocumentSerde
}
type PutStorageLensConfigurationTaggingOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutStorageLensConfigurationTaggingMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpPutStorageLensConfigurationTagging{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpPutStorageLensConfigurationTagging{}, 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 = addEndpointPrefix_opPutStorageLensConfigurationTaggingMiddleware(stack); err != nil {
return err
}
if err = addOpPutStorageLensConfigurationTaggingValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutStorageLensConfigurationTagging(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addPutStorageLensConfigurationTaggingUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opPutStorageLensConfigurationTaggingMiddleware struct {
}
func (*endpointPrefix_opPutStorageLensConfigurationTaggingMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opPutStorageLensConfigurationTaggingMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*PutStorageLensConfigurationTaggingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opPutStorageLensConfigurationTaggingMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opPutStorageLensConfigurationTaggingMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opPutStorageLensConfigurationTagging(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "PutStorageLensConfigurationTagging",
}
}
func copyPutStorageLensConfigurationTaggingInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*PutStorageLensConfigurationTaggingInput)
if !ok {
return nil, fmt.Errorf("expect *PutStorageLensConfigurationTaggingInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func backFillPutStorageLensConfigurationTaggingAccountID(input interface{}, v string) error {
in := input.(*PutStorageLensConfigurationTaggingInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addPutStorageLensConfigurationTaggingUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor,
BackfillAccountID: nopBackfillAccountIDAccessor,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: nopSetARNAccessor,
CopyInput: copyPutStorageLensConfigurationTaggingInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 225 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Submits an updated route configuration for a Multi-Region Access Point. This
// API operation updates the routing status for the specified Regions from active
// to passive, or from passive to active. A value of 0 indicates a passive status,
// which means that traffic won't be routed to the specified Region. A value of 100
// indicates an active status, which means that traffic will be routed to the
// specified Region. At least one Region must be active at all times. When the
// routing configuration is changed, any in-progress operations (uploads, copies,
// deletes, and so on) to formerly active Regions will continue to run to their
// final completion state (success or failure). The routing configurations of any
// Regions that aren’t specified remain unchanged. Updated routing configurations
// might not be immediately applied. It can take up to 2 minutes for your changes
// to take effect. To submit routing control changes and failover requests, use the
// Amazon S3 failover control infrastructure endpoints in these five Amazon Web
// Services Regions:
// - us-east-1
// - us-west-2
// - ap-southeast-2
// - ap-northeast-1
// - eu-west-1
//
// Your Amazon S3 bucket does not need to be in these five Regions.
func (c *Client) SubmitMultiRegionAccessPointRoutes(ctx context.Context, params *SubmitMultiRegionAccessPointRoutesInput, optFns ...func(*Options)) (*SubmitMultiRegionAccessPointRoutesOutput, error) {
if params == nil {
params = &SubmitMultiRegionAccessPointRoutesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SubmitMultiRegionAccessPointRoutes", params, optFns, c.addOperationSubmitMultiRegionAccessPointRoutesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SubmitMultiRegionAccessPointRoutesOutput)
out.ResultMetadata = metadata
return out, nil
}
type SubmitMultiRegionAccessPointRoutesInput struct {
// The Amazon Web Services account ID for the owner of the Multi-Region Access
// Point.
//
// This member is required.
AccountId *string
// The Multi-Region Access Point ARN.
//
// This member is required.
Mrap *string
// The different routes that make up the new route configuration. Active routes
// return a value of 100 , and passive routes return a value of 0 .
//
// This member is required.
RouteUpdates []types.MultiRegionAccessPointRoute
noSmithyDocumentSerde
}
type SubmitMultiRegionAccessPointRoutesOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSubmitMultiRegionAccessPointRoutesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpSubmitMultiRegionAccessPointRoutes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpSubmitMultiRegionAccessPointRoutes{}, 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 = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opSubmitMultiRegionAccessPointRoutesMiddleware(stack); err != nil {
return err
}
if err = addOpSubmitMultiRegionAccessPointRoutesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSubmitMultiRegionAccessPointRoutes(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addSubmitMultiRegionAccessPointRoutesUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opSubmitMultiRegionAccessPointRoutesMiddleware struct {
}
func (*endpointPrefix_opSubmitMultiRegionAccessPointRoutesMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opSubmitMultiRegionAccessPointRoutesMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*SubmitMultiRegionAccessPointRoutesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opSubmitMultiRegionAccessPointRoutesMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opSubmitMultiRegionAccessPointRoutesMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opSubmitMultiRegionAccessPointRoutes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "SubmitMultiRegionAccessPointRoutes",
}
}
func copySubmitMultiRegionAccessPointRoutesInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*SubmitMultiRegionAccessPointRoutesInput)
if !ok {
return nil, fmt.Errorf("expect *SubmitMultiRegionAccessPointRoutesInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func backFillSubmitMultiRegionAccessPointRoutesAccountID(input interface{}, v string) error {
in := input.(*SubmitMultiRegionAccessPointRoutesInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addSubmitMultiRegionAccessPointRoutesUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor,
BackfillAccountID: nopBackfillAccountIDAccessor,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: nopSetARNAccessor,
CopyInput: copySubmitMultiRegionAccessPointRoutesInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 243 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Updates an existing S3 Batch Operations job's priority. For more information,
// see S3 Batch Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/batch-ops.html)
// in the Amazon S3 User Guide. Related actions include:
// - CreateJob (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html)
// - ListJobs (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListJobs.html)
// - DescribeJob (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DescribeJob.html)
// - UpdateJobStatus (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobStatus.html)
func (c *Client) UpdateJobPriority(ctx context.Context, params *UpdateJobPriorityInput, optFns ...func(*Options)) (*UpdateJobPriorityOutput, error) {
if params == nil {
params = &UpdateJobPriorityInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateJobPriority", params, optFns, c.addOperationUpdateJobPriorityMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateJobPriorityOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateJobPriorityInput struct {
// The Amazon Web Services account ID associated with the S3 Batch Operations job.
//
// This member is required.
AccountId *string
// The ID for the job whose priority you want to update.
//
// This member is required.
JobId *string
// The priority you want to assign to this job.
//
// This member is required.
Priority int32
noSmithyDocumentSerde
}
type UpdateJobPriorityOutput struct {
// The ID for the job whose priority Amazon S3 updated.
//
// This member is required.
JobId *string
// The new priority assigned to the specified job.
//
// This member is required.
Priority int32
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateJobPriorityMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpUpdateJobPriority{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpUpdateJobPriority{}, 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 = addEndpointPrefix_opUpdateJobPriorityMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateJobPriorityValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateJobPriority(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addUpdateJobPriorityUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opUpdateJobPriorityMiddleware struct {
}
func (*endpointPrefix_opUpdateJobPriorityMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opUpdateJobPriorityMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*UpdateJobPriorityInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opUpdateJobPriorityMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opUpdateJobPriorityMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opUpdateJobPriority(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "UpdateJobPriority",
}
}
func copyUpdateJobPriorityInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*UpdateJobPriorityInput)
if !ok {
return nil, fmt.Errorf("expect *UpdateJobPriorityInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func backFillUpdateJobPriorityAccountID(input interface{}, v string) error {
in := input.(*UpdateJobPriorityInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addUpdateJobPriorityUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor,
BackfillAccountID: nopBackfillAccountIDAccessor,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: nopSetARNAccessor,
CopyInput: copyUpdateJobPriorityInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 234 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"strings"
)
// Updates the status for the specified job. Use this action to confirm that you
// want to run a job or to cancel an existing job. For more information, see S3
// Batch Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/batch-ops.html)
// in the Amazon S3 User Guide. Related actions include:
// - CreateJob (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html)
// - ListJobs (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListJobs.html)
// - DescribeJob (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DescribeJob.html)
// - UpdateJobStatus (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobStatus.html)
func (c *Client) UpdateJobStatus(ctx context.Context, params *UpdateJobStatusInput, optFns ...func(*Options)) (*UpdateJobStatusOutput, error) {
if params == nil {
params = &UpdateJobStatusInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateJobStatus", params, optFns, c.addOperationUpdateJobStatusMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateJobStatusOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateJobStatusInput struct {
// The Amazon Web Services account ID associated with the S3 Batch Operations job.
//
// This member is required.
AccountId *string
// The ID of the job whose status you want to update.
//
// This member is required.
JobId *string
// The status that you want to move the specified job to.
//
// This member is required.
RequestedJobStatus types.RequestedJobStatus
// A description of the reason why you want to change the specified job's status.
// This field can be any string up to the maximum length.
StatusUpdateReason *string
noSmithyDocumentSerde
}
type UpdateJobStatusOutput struct {
// The ID for the job whose status was updated.
JobId *string
// The current status for the specified job.
Status types.JobStatus
// The reason that the specified job's status was updated.
StatusUpdateReason *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateJobStatusMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpUpdateJobStatus{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpUpdateJobStatus{}, 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 = addEndpointPrefix_opUpdateJobStatusMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateJobStatusValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateJobStatus(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addUpdateJobStatusUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opUpdateJobStatusMiddleware struct {
}
func (*endpointPrefix_opUpdateJobStatusMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opUpdateJobStatusMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
input, ok := in.Parameters.(*UpdateJobStatusInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters)
}
var prefix strings.Builder
if input.AccountId == nil {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")}
} else if !smithyhttp.ValidHostLabel(*input.AccountId) {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)}
} else {
prefix.WriteString(*input.AccountId)
}
prefix.WriteString(".")
req.URL.Host = prefix.String() + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opUpdateJobStatusMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opUpdateJobStatusMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opUpdateJobStatus(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "UpdateJobStatus",
}
}
func copyUpdateJobStatusInputForUpdateEndpoint(params interface{}) (interface{}, error) {
input, ok := params.(*UpdateJobStatusInput)
if !ok {
return nil, fmt.Errorf("expect *UpdateJobStatusInput type, got %T", params)
}
cpy := *input
return &cpy, nil
}
func backFillUpdateJobStatusAccountID(input interface{}, v string) error {
in := input.(*UpdateJobStatusInput)
if in.AccountId != nil {
if !strings.EqualFold(*in.AccountId, v) {
return fmt.Errorf("error backfilling account id")
}
return nil
}
in.AccountId = &v
return nil
}
func addUpdateJobStatusUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{
Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor,
BackfillAccountID: nopBackfillAccountIDAccessor,
GetOutpostIDInput: nopGetOutpostIDFromInput,
UpdateARNField: nopSetARNAccessor,
CopyInput: copyUpdateJobStatusInputForUpdateEndpoint,
},
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
})
}
| 239 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"bytes"
"context"
"encoding/xml"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/service/internal/s3shared"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
smithyxml "github.com/aws/smithy-go/encoding/xml"
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"
"strconv"
"strings"
)
type awsRestxml_deserializeOpCreateAccessPoint struct {
}
func (*awsRestxml_deserializeOpCreateAccessPoint) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpCreateAccessPoint) 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, awsRestxml_deserializeOpErrorCreateAccessPoint(response, &metadata)
}
output := &CreateAccessPointOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentCreateAccessPointOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorCreateAccessPoint(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentCreateAccessPointOutput(v **CreateAccessPointOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *CreateAccessPointOutput
if *v == nil {
sv = &CreateAccessPointOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("AccessPointArn", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.AccessPointArn = ptr.String(xtv)
}
case strings.EqualFold("Alias", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Alias = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpCreateAccessPointForObjectLambda struct {
}
func (*awsRestxml_deserializeOpCreateAccessPointForObjectLambda) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpCreateAccessPointForObjectLambda) 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, awsRestxml_deserializeOpErrorCreateAccessPointForObjectLambda(response, &metadata)
}
output := &CreateAccessPointForObjectLambdaOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentCreateAccessPointForObjectLambdaOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorCreateAccessPointForObjectLambda(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentCreateAccessPointForObjectLambdaOutput(v **CreateAccessPointForObjectLambdaOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *CreateAccessPointForObjectLambdaOutput
if *v == nil {
sv = &CreateAccessPointForObjectLambdaOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Alias", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentObjectLambdaAccessPointAlias(&sv.Alias, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("ObjectLambdaAccessPointArn", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ObjectLambdaAccessPointArn = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpCreateBucket struct {
}
func (*awsRestxml_deserializeOpCreateBucket) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpCreateBucket) 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, awsRestxml_deserializeOpErrorCreateBucket(response, &metadata)
}
output := &CreateBucketOutput{}
out.Result = output
err = awsRestxml_deserializeOpHttpBindingsCreateBucketOutput(output, response)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentCreateBucketOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorCreateBucket(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
case strings.EqualFold("BucketAlreadyExists", errorCode):
return awsRestxml_deserializeErrorBucketAlreadyExists(response, errorBody)
case strings.EqualFold("BucketAlreadyOwnedByYou", errorCode):
return awsRestxml_deserializeErrorBucketAlreadyOwnedByYou(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpHttpBindingsCreateBucketOutput(v *CreateBucketOutput, response *smithyhttp.Response) error {
if v == nil {
return fmt.Errorf("unsupported deserialization for nil %T", v)
}
if headerValues := response.Header.Values("Location"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.Location = ptr.String(headerValues[0])
}
return nil
}
func awsRestxml_deserializeOpDocumentCreateBucketOutput(v **CreateBucketOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *CreateBucketOutput
if *v == nil {
sv = &CreateBucketOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("BucketArn", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.BucketArn = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpCreateJob struct {
}
func (*awsRestxml_deserializeOpCreateJob) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpCreateJob) 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, awsRestxml_deserializeOpErrorCreateJob(response, &metadata)
}
output := &CreateJobOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentCreateJobOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorCreateJob(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestxml_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("IdempotencyException", errorCode):
return awsRestxml_deserializeErrorIdempotencyException(response, errorBody)
case strings.EqualFold("InternalServiceException", errorCode):
return awsRestxml_deserializeErrorInternalServiceException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestxml_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentCreateJobOutput(v **CreateJobOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *CreateJobOutput
if *v == nil {
sv = &CreateJobOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("JobId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.JobId = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpCreateMultiRegionAccessPoint struct {
}
func (*awsRestxml_deserializeOpCreateMultiRegionAccessPoint) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpCreateMultiRegionAccessPoint) 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, awsRestxml_deserializeOpErrorCreateMultiRegionAccessPoint(response, &metadata)
}
output := &CreateMultiRegionAccessPointOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentCreateMultiRegionAccessPointOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorCreateMultiRegionAccessPoint(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentCreateMultiRegionAccessPointOutput(v **CreateMultiRegionAccessPointOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *CreateMultiRegionAccessPointOutput
if *v == nil {
sv = &CreateMultiRegionAccessPointOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("RequestTokenARN", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.RequestTokenARN = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpDeleteAccessPoint struct {
}
func (*awsRestxml_deserializeOpDeleteAccessPoint) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpDeleteAccessPoint) 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, awsRestxml_deserializeOpErrorDeleteAccessPoint(response, &metadata)
}
output := &DeleteAccessPointOutput{}
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 awsRestxml_deserializeOpErrorDeleteAccessPoint(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpDeleteAccessPointForObjectLambda struct {
}
func (*awsRestxml_deserializeOpDeleteAccessPointForObjectLambda) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpDeleteAccessPointForObjectLambda) 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, awsRestxml_deserializeOpErrorDeleteAccessPointForObjectLambda(response, &metadata)
}
output := &DeleteAccessPointForObjectLambdaOutput{}
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 awsRestxml_deserializeOpErrorDeleteAccessPointForObjectLambda(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpDeleteAccessPointPolicy struct {
}
func (*awsRestxml_deserializeOpDeleteAccessPointPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpDeleteAccessPointPolicy) 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, awsRestxml_deserializeOpErrorDeleteAccessPointPolicy(response, &metadata)
}
output := &DeleteAccessPointPolicyOutput{}
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 awsRestxml_deserializeOpErrorDeleteAccessPointPolicy(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpDeleteAccessPointPolicyForObjectLambda struct {
}
func (*awsRestxml_deserializeOpDeleteAccessPointPolicyForObjectLambda) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpDeleteAccessPointPolicyForObjectLambda) 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, awsRestxml_deserializeOpErrorDeleteAccessPointPolicyForObjectLambda(response, &metadata)
}
output := &DeleteAccessPointPolicyForObjectLambdaOutput{}
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 awsRestxml_deserializeOpErrorDeleteAccessPointPolicyForObjectLambda(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpDeleteBucket struct {
}
func (*awsRestxml_deserializeOpDeleteBucket) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpDeleteBucket) 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, awsRestxml_deserializeOpErrorDeleteBucket(response, &metadata)
}
output := &DeleteBucketOutput{}
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 awsRestxml_deserializeOpErrorDeleteBucket(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpDeleteBucketLifecycleConfiguration struct {
}
func (*awsRestxml_deserializeOpDeleteBucketLifecycleConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpDeleteBucketLifecycleConfiguration) 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, awsRestxml_deserializeOpErrorDeleteBucketLifecycleConfiguration(response, &metadata)
}
output := &DeleteBucketLifecycleConfigurationOutput{}
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 awsRestxml_deserializeOpErrorDeleteBucketLifecycleConfiguration(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpDeleteBucketPolicy struct {
}
func (*awsRestxml_deserializeOpDeleteBucketPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpDeleteBucketPolicy) 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, awsRestxml_deserializeOpErrorDeleteBucketPolicy(response, &metadata)
}
output := &DeleteBucketPolicyOutput{}
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 awsRestxml_deserializeOpErrorDeleteBucketPolicy(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpDeleteBucketReplication struct {
}
func (*awsRestxml_deserializeOpDeleteBucketReplication) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpDeleteBucketReplication) 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, awsRestxml_deserializeOpErrorDeleteBucketReplication(response, &metadata)
}
output := &DeleteBucketReplicationOutput{}
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 awsRestxml_deserializeOpErrorDeleteBucketReplication(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpDeleteBucketTagging struct {
}
func (*awsRestxml_deserializeOpDeleteBucketTagging) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpDeleteBucketTagging) 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, awsRestxml_deserializeOpErrorDeleteBucketTagging(response, &metadata)
}
output := &DeleteBucketTaggingOutput{}
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 awsRestxml_deserializeOpErrorDeleteBucketTagging(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpDeleteJobTagging struct {
}
func (*awsRestxml_deserializeOpDeleteJobTagging) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpDeleteJobTagging) 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, awsRestxml_deserializeOpErrorDeleteJobTagging(response, &metadata)
}
output := &DeleteJobTaggingOutput{}
out.Result = output
return out, metadata, err
}
func awsRestxml_deserializeOpErrorDeleteJobTagging(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
case strings.EqualFold("InternalServiceException", errorCode):
return awsRestxml_deserializeErrorInternalServiceException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestxml_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestxml_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpDeleteMultiRegionAccessPoint struct {
}
func (*awsRestxml_deserializeOpDeleteMultiRegionAccessPoint) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpDeleteMultiRegionAccessPoint) 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, awsRestxml_deserializeOpErrorDeleteMultiRegionAccessPoint(response, &metadata)
}
output := &DeleteMultiRegionAccessPointOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentDeleteMultiRegionAccessPointOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorDeleteMultiRegionAccessPoint(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentDeleteMultiRegionAccessPointOutput(v **DeleteMultiRegionAccessPointOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *DeleteMultiRegionAccessPointOutput
if *v == nil {
sv = &DeleteMultiRegionAccessPointOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("RequestTokenARN", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.RequestTokenARN = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpDeletePublicAccessBlock struct {
}
func (*awsRestxml_deserializeOpDeletePublicAccessBlock) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpDeletePublicAccessBlock) 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, awsRestxml_deserializeOpErrorDeletePublicAccessBlock(response, &metadata)
}
output := &DeletePublicAccessBlockOutput{}
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 awsRestxml_deserializeOpErrorDeletePublicAccessBlock(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpDeleteStorageLensConfiguration struct {
}
func (*awsRestxml_deserializeOpDeleteStorageLensConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpDeleteStorageLensConfiguration) 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, awsRestxml_deserializeOpErrorDeleteStorageLensConfiguration(response, &metadata)
}
output := &DeleteStorageLensConfigurationOutput{}
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 awsRestxml_deserializeOpErrorDeleteStorageLensConfiguration(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpDeleteStorageLensConfigurationTagging struct {
}
func (*awsRestxml_deserializeOpDeleteStorageLensConfigurationTagging) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpDeleteStorageLensConfigurationTagging) 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, awsRestxml_deserializeOpErrorDeleteStorageLensConfigurationTagging(response, &metadata)
}
output := &DeleteStorageLensConfigurationTaggingOutput{}
out.Result = output
return out, metadata, err
}
func awsRestxml_deserializeOpErrorDeleteStorageLensConfigurationTagging(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpDescribeJob struct {
}
func (*awsRestxml_deserializeOpDescribeJob) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpDescribeJob) 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, awsRestxml_deserializeOpErrorDescribeJob(response, &metadata)
}
output := &DescribeJobOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentDescribeJobOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorDescribeJob(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestxml_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalServiceException", errorCode):
return awsRestxml_deserializeErrorInternalServiceException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestxml_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestxml_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentDescribeJobOutput(v **DescribeJobOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *DescribeJobOutput
if *v == nil {
sv = &DescribeJobOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Job", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentJobDescriptor(&sv.Job, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpDescribeMultiRegionAccessPointOperation struct {
}
func (*awsRestxml_deserializeOpDescribeMultiRegionAccessPointOperation) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpDescribeMultiRegionAccessPointOperation) 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, awsRestxml_deserializeOpErrorDescribeMultiRegionAccessPointOperation(response, &metadata)
}
output := &DescribeMultiRegionAccessPointOperationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentDescribeMultiRegionAccessPointOperationOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorDescribeMultiRegionAccessPointOperation(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentDescribeMultiRegionAccessPointOperationOutput(v **DescribeMultiRegionAccessPointOperationOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *DescribeMultiRegionAccessPointOperationOutput
if *v == nil {
sv = &DescribeMultiRegionAccessPointOperationOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("AsyncOperation", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentAsyncOperation(&sv.AsyncOperation, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetAccessPoint struct {
}
func (*awsRestxml_deserializeOpGetAccessPoint) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetAccessPoint) 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, awsRestxml_deserializeOpErrorGetAccessPoint(response, &metadata)
}
output := &GetAccessPointOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentGetAccessPointOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetAccessPoint(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetAccessPointOutput(v **GetAccessPointOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetAccessPointOutput
if *v == nil {
sv = &GetAccessPointOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("AccessPointArn", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.AccessPointArn = ptr.String(xtv)
}
case strings.EqualFold("Alias", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Alias = ptr.String(xtv)
}
case strings.EqualFold("Bucket", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Bucket = ptr.String(xtv)
}
case strings.EqualFold("BucketAccountId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.BucketAccountId = ptr.String(xtv)
}
case strings.EqualFold("CreationDate", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.CreationDate = ptr.Time(t)
}
case strings.EqualFold("Endpoints", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentEndpoints(&sv.Endpoints, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Name", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Name = ptr.String(xtv)
}
case strings.EqualFold("NetworkOrigin", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.NetworkOrigin = types.NetworkOrigin(xtv)
}
case strings.EqualFold("PublicAccessBlockConfiguration", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(&sv.PublicAccessBlockConfiguration, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("VpcConfiguration", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentVpcConfiguration(&sv.VpcConfiguration, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetAccessPointConfigurationForObjectLambda struct {
}
func (*awsRestxml_deserializeOpGetAccessPointConfigurationForObjectLambda) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetAccessPointConfigurationForObjectLambda) 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, awsRestxml_deserializeOpErrorGetAccessPointConfigurationForObjectLambda(response, &metadata)
}
output := &GetAccessPointConfigurationForObjectLambdaOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentGetAccessPointConfigurationForObjectLambdaOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetAccessPointConfigurationForObjectLambda(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetAccessPointConfigurationForObjectLambdaOutput(v **GetAccessPointConfigurationForObjectLambdaOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetAccessPointConfigurationForObjectLambdaOutput
if *v == nil {
sv = &GetAccessPointConfigurationForObjectLambdaOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Configuration", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentObjectLambdaConfiguration(&sv.Configuration, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetAccessPointForObjectLambda struct {
}
func (*awsRestxml_deserializeOpGetAccessPointForObjectLambda) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetAccessPointForObjectLambda) 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, awsRestxml_deserializeOpErrorGetAccessPointForObjectLambda(response, &metadata)
}
output := &GetAccessPointForObjectLambdaOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentGetAccessPointForObjectLambdaOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetAccessPointForObjectLambda(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetAccessPointForObjectLambdaOutput(v **GetAccessPointForObjectLambdaOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetAccessPointForObjectLambdaOutput
if *v == nil {
sv = &GetAccessPointForObjectLambdaOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Alias", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentObjectLambdaAccessPointAlias(&sv.Alias, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("CreationDate", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.CreationDate = ptr.Time(t)
}
case strings.EqualFold("Name", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Name = ptr.String(xtv)
}
case strings.EqualFold("PublicAccessBlockConfiguration", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(&sv.PublicAccessBlockConfiguration, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetAccessPointPolicy struct {
}
func (*awsRestxml_deserializeOpGetAccessPointPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetAccessPointPolicy) 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, awsRestxml_deserializeOpErrorGetAccessPointPolicy(response, &metadata)
}
output := &GetAccessPointPolicyOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentGetAccessPointPolicyOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetAccessPointPolicy(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetAccessPointPolicyOutput(v **GetAccessPointPolicyOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetAccessPointPolicyOutput
if *v == nil {
sv = &GetAccessPointPolicyOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Policy", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Policy = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetAccessPointPolicyForObjectLambda struct {
}
func (*awsRestxml_deserializeOpGetAccessPointPolicyForObjectLambda) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetAccessPointPolicyForObjectLambda) 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, awsRestxml_deserializeOpErrorGetAccessPointPolicyForObjectLambda(response, &metadata)
}
output := &GetAccessPointPolicyForObjectLambdaOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentGetAccessPointPolicyForObjectLambdaOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetAccessPointPolicyForObjectLambda(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetAccessPointPolicyForObjectLambdaOutput(v **GetAccessPointPolicyForObjectLambdaOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetAccessPointPolicyForObjectLambdaOutput
if *v == nil {
sv = &GetAccessPointPolicyForObjectLambdaOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Policy", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Policy = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetAccessPointPolicyStatus struct {
}
func (*awsRestxml_deserializeOpGetAccessPointPolicyStatus) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetAccessPointPolicyStatus) 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, awsRestxml_deserializeOpErrorGetAccessPointPolicyStatus(response, &metadata)
}
output := &GetAccessPointPolicyStatusOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentGetAccessPointPolicyStatusOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetAccessPointPolicyStatus(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetAccessPointPolicyStatusOutput(v **GetAccessPointPolicyStatusOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetAccessPointPolicyStatusOutput
if *v == nil {
sv = &GetAccessPointPolicyStatusOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("PolicyStatus", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentPolicyStatus(&sv.PolicyStatus, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetAccessPointPolicyStatusForObjectLambda struct {
}
func (*awsRestxml_deserializeOpGetAccessPointPolicyStatusForObjectLambda) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetAccessPointPolicyStatusForObjectLambda) 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, awsRestxml_deserializeOpErrorGetAccessPointPolicyStatusForObjectLambda(response, &metadata)
}
output := &GetAccessPointPolicyStatusForObjectLambdaOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentGetAccessPointPolicyStatusForObjectLambdaOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetAccessPointPolicyStatusForObjectLambda(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetAccessPointPolicyStatusForObjectLambdaOutput(v **GetAccessPointPolicyStatusForObjectLambdaOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetAccessPointPolicyStatusForObjectLambdaOutput
if *v == nil {
sv = &GetAccessPointPolicyStatusForObjectLambdaOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("PolicyStatus", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentPolicyStatus(&sv.PolicyStatus, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetBucket struct {
}
func (*awsRestxml_deserializeOpGetBucket) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetBucket) 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, awsRestxml_deserializeOpErrorGetBucket(response, &metadata)
}
output := &GetBucketOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentGetBucketOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetBucket(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetBucketOutput(v **GetBucketOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetBucketOutput
if *v == nil {
sv = &GetBucketOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Bucket", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Bucket = ptr.String(xtv)
}
case strings.EqualFold("CreationDate", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.CreationDate = ptr.Time(t)
}
case strings.EqualFold("PublicAccessBlockEnabled", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected PublicAccessBlockEnabled to be of type *bool, got %T instead", val)
}
sv.PublicAccessBlockEnabled = xtv
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetBucketLifecycleConfiguration struct {
}
func (*awsRestxml_deserializeOpGetBucketLifecycleConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetBucketLifecycleConfiguration) 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, awsRestxml_deserializeOpErrorGetBucketLifecycleConfiguration(response, &metadata)
}
output := &GetBucketLifecycleConfigurationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentGetBucketLifecycleConfigurationOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetBucketLifecycleConfiguration(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetBucketLifecycleConfigurationOutput(v **GetBucketLifecycleConfigurationOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetBucketLifecycleConfigurationOutput
if *v == nil {
sv = &GetBucketLifecycleConfigurationOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Rules", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentLifecycleRules(&sv.Rules, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetBucketPolicy struct {
}
func (*awsRestxml_deserializeOpGetBucketPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetBucketPolicy) 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, awsRestxml_deserializeOpErrorGetBucketPolicy(response, &metadata)
}
output := &GetBucketPolicyOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentGetBucketPolicyOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetBucketPolicy(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetBucketPolicyOutput(v **GetBucketPolicyOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetBucketPolicyOutput
if *v == nil {
sv = &GetBucketPolicyOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Policy", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Policy = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetBucketReplication struct {
}
func (*awsRestxml_deserializeOpGetBucketReplication) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetBucketReplication) 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, awsRestxml_deserializeOpErrorGetBucketReplication(response, &metadata)
}
output := &GetBucketReplicationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentGetBucketReplicationOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetBucketReplication(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetBucketReplicationOutput(v **GetBucketReplicationOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetBucketReplicationOutput
if *v == nil {
sv = &GetBucketReplicationOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("ReplicationConfiguration", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentReplicationConfiguration(&sv.ReplicationConfiguration, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetBucketTagging struct {
}
func (*awsRestxml_deserializeOpGetBucketTagging) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetBucketTagging) 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, awsRestxml_deserializeOpErrorGetBucketTagging(response, &metadata)
}
output := &GetBucketTaggingOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentGetBucketTaggingOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetBucketTagging(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetBucketTaggingOutput(v **GetBucketTaggingOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetBucketTaggingOutput
if *v == nil {
sv = &GetBucketTaggingOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("TagSet", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3TagSet(&sv.TagSet, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetBucketVersioning struct {
}
func (*awsRestxml_deserializeOpGetBucketVersioning) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetBucketVersioning) 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, awsRestxml_deserializeOpErrorGetBucketVersioning(response, &metadata)
}
output := &GetBucketVersioningOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentGetBucketVersioningOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetBucketVersioning(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetBucketVersioningOutput(v **GetBucketVersioningOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetBucketVersioningOutput
if *v == nil {
sv = &GetBucketVersioningOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("MfaDelete", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.MFADelete = types.MFADeleteStatus(xtv)
}
case strings.EqualFold("Status", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Status = types.BucketVersioningStatus(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetJobTagging struct {
}
func (*awsRestxml_deserializeOpGetJobTagging) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetJobTagging) 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, awsRestxml_deserializeOpErrorGetJobTagging(response, &metadata)
}
output := &GetJobTaggingOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentGetJobTaggingOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetJobTagging(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
case strings.EqualFold("InternalServiceException", errorCode):
return awsRestxml_deserializeErrorInternalServiceException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestxml_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestxml_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetJobTaggingOutput(v **GetJobTaggingOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetJobTaggingOutput
if *v == nil {
sv = &GetJobTaggingOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Tags", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3TagSet(&sv.Tags, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetMultiRegionAccessPoint struct {
}
func (*awsRestxml_deserializeOpGetMultiRegionAccessPoint) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetMultiRegionAccessPoint) 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, awsRestxml_deserializeOpErrorGetMultiRegionAccessPoint(response, &metadata)
}
output := &GetMultiRegionAccessPointOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetMultiRegionAccessPoint(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointOutput(v **GetMultiRegionAccessPointOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetMultiRegionAccessPointOutput
if *v == nil {
sv = &GetMultiRegionAccessPointOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("AccessPoint", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentMultiRegionAccessPointReport(&sv.AccessPoint, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetMultiRegionAccessPointPolicy struct {
}
func (*awsRestxml_deserializeOpGetMultiRegionAccessPointPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetMultiRegionAccessPointPolicy) 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, awsRestxml_deserializeOpErrorGetMultiRegionAccessPointPolicy(response, &metadata)
}
output := &GetMultiRegionAccessPointPolicyOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointPolicyOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetMultiRegionAccessPointPolicy(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointPolicyOutput(v **GetMultiRegionAccessPointPolicyOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetMultiRegionAccessPointPolicyOutput
if *v == nil {
sv = &GetMultiRegionAccessPointPolicyOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Policy", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentMultiRegionAccessPointPolicyDocument(&sv.Policy, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetMultiRegionAccessPointPolicyStatus struct {
}
func (*awsRestxml_deserializeOpGetMultiRegionAccessPointPolicyStatus) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetMultiRegionAccessPointPolicyStatus) 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, awsRestxml_deserializeOpErrorGetMultiRegionAccessPointPolicyStatus(response, &metadata)
}
output := &GetMultiRegionAccessPointPolicyStatusOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointPolicyStatusOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetMultiRegionAccessPointPolicyStatus(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointPolicyStatusOutput(v **GetMultiRegionAccessPointPolicyStatusOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetMultiRegionAccessPointPolicyStatusOutput
if *v == nil {
sv = &GetMultiRegionAccessPointPolicyStatusOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Established", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentPolicyStatus(&sv.Established, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetMultiRegionAccessPointRoutes struct {
}
func (*awsRestxml_deserializeOpGetMultiRegionAccessPointRoutes) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetMultiRegionAccessPointRoutes) 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, awsRestxml_deserializeOpErrorGetMultiRegionAccessPointRoutes(response, &metadata)
}
output := &GetMultiRegionAccessPointRoutesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointRoutesOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetMultiRegionAccessPointRoutes(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointRoutesOutput(v **GetMultiRegionAccessPointRoutesOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetMultiRegionAccessPointRoutesOutput
if *v == nil {
sv = &GetMultiRegionAccessPointRoutesOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Mrap", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Mrap = ptr.String(xtv)
}
case strings.EqualFold("Routes", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentRouteList(&sv.Routes, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetPublicAccessBlock struct {
}
func (*awsRestxml_deserializeOpGetPublicAccessBlock) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetPublicAccessBlock) 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, awsRestxml_deserializeOpErrorGetPublicAccessBlock(response, &metadata)
}
output := &GetPublicAccessBlockOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(&output.PublicAccessBlockConfiguration, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetPublicAccessBlock(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
case strings.EqualFold("NoSuchPublicAccessBlockConfiguration", errorCode):
return awsRestxml_deserializeErrorNoSuchPublicAccessBlockConfiguration(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetPublicAccessBlockOutput(v **GetPublicAccessBlockOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetPublicAccessBlockOutput
if *v == nil {
sv = &GetPublicAccessBlockOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("PublicAccessBlockConfiguration", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(&sv.PublicAccessBlockConfiguration, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetStorageLensConfiguration struct {
}
func (*awsRestxml_deserializeOpGetStorageLensConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetStorageLensConfiguration) 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, awsRestxml_deserializeOpErrorGetStorageLensConfiguration(response, &metadata)
}
output := &GetStorageLensConfigurationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeDocumentStorageLensConfiguration(&output.StorageLensConfiguration, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetStorageLensConfiguration(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetStorageLensConfigurationOutput(v **GetStorageLensConfigurationOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetStorageLensConfigurationOutput
if *v == nil {
sv = &GetStorageLensConfigurationOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("StorageLensConfiguration", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentStorageLensConfiguration(&sv.StorageLensConfiguration, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpGetStorageLensConfigurationTagging struct {
}
func (*awsRestxml_deserializeOpGetStorageLensConfigurationTagging) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpGetStorageLensConfigurationTagging) 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, awsRestxml_deserializeOpErrorGetStorageLensConfigurationTagging(response, &metadata)
}
output := &GetStorageLensConfigurationTaggingOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentGetStorageLensConfigurationTaggingOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorGetStorageLensConfigurationTagging(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentGetStorageLensConfigurationTaggingOutput(v **GetStorageLensConfigurationTaggingOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetStorageLensConfigurationTaggingOutput
if *v == nil {
sv = &GetStorageLensConfigurationTaggingOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Tags", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentStorageLensTags(&sv.Tags, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpListAccessPoints struct {
}
func (*awsRestxml_deserializeOpListAccessPoints) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpListAccessPoints) 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, awsRestxml_deserializeOpErrorListAccessPoints(response, &metadata)
}
output := &ListAccessPointsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentListAccessPointsOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorListAccessPoints(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentListAccessPointsOutput(v **ListAccessPointsOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *ListAccessPointsOutput
if *v == nil {
sv = &ListAccessPointsOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("AccessPointList", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentAccessPointList(&sv.AccessPointList, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("NextToken", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.NextToken = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpListAccessPointsForObjectLambda struct {
}
func (*awsRestxml_deserializeOpListAccessPointsForObjectLambda) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpListAccessPointsForObjectLambda) 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, awsRestxml_deserializeOpErrorListAccessPointsForObjectLambda(response, &metadata)
}
output := &ListAccessPointsForObjectLambdaOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentListAccessPointsForObjectLambdaOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorListAccessPointsForObjectLambda(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentListAccessPointsForObjectLambdaOutput(v **ListAccessPointsForObjectLambdaOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *ListAccessPointsForObjectLambdaOutput
if *v == nil {
sv = &ListAccessPointsForObjectLambdaOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("NextToken", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.NextToken = ptr.String(xtv)
}
case strings.EqualFold("ObjectLambdaAccessPointList", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentObjectLambdaAccessPointList(&sv.ObjectLambdaAccessPointList, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpListJobs struct {
}
func (*awsRestxml_deserializeOpListJobs) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpListJobs) 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, awsRestxml_deserializeOpErrorListJobs(response, &metadata)
}
output := &ListJobsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentListJobsOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorListJobs(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
case strings.EqualFold("InternalServiceException", errorCode):
return awsRestxml_deserializeErrorInternalServiceException(response, errorBody)
case strings.EqualFold("InvalidNextTokenException", errorCode):
return awsRestxml_deserializeErrorInvalidNextTokenException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsRestxml_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentListJobsOutput(v **ListJobsOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *ListJobsOutput
if *v == nil {
sv = &ListJobsOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Jobs", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentJobListDescriptorList(&sv.Jobs, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("NextToken", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.NextToken = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpListMultiRegionAccessPoints struct {
}
func (*awsRestxml_deserializeOpListMultiRegionAccessPoints) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpListMultiRegionAccessPoints) 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, awsRestxml_deserializeOpErrorListMultiRegionAccessPoints(response, &metadata)
}
output := &ListMultiRegionAccessPointsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentListMultiRegionAccessPointsOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorListMultiRegionAccessPoints(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentListMultiRegionAccessPointsOutput(v **ListMultiRegionAccessPointsOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *ListMultiRegionAccessPointsOutput
if *v == nil {
sv = &ListMultiRegionAccessPointsOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("AccessPoints", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentMultiRegionAccessPointReportList(&sv.AccessPoints, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("NextToken", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.NextToken = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpListRegionalBuckets struct {
}
func (*awsRestxml_deserializeOpListRegionalBuckets) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpListRegionalBuckets) 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, awsRestxml_deserializeOpErrorListRegionalBuckets(response, &metadata)
}
output := &ListRegionalBucketsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentListRegionalBucketsOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorListRegionalBuckets(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentListRegionalBucketsOutput(v **ListRegionalBucketsOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *ListRegionalBucketsOutput
if *v == nil {
sv = &ListRegionalBucketsOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("NextToken", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.NextToken = ptr.String(xtv)
}
case strings.EqualFold("RegionalBucketList", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentRegionalBucketList(&sv.RegionalBucketList, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpListStorageLensConfigurations struct {
}
func (*awsRestxml_deserializeOpListStorageLensConfigurations) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpListStorageLensConfigurations) 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, awsRestxml_deserializeOpErrorListStorageLensConfigurations(response, &metadata)
}
output := &ListStorageLensConfigurationsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentListStorageLensConfigurationsOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorListStorageLensConfigurations(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentListStorageLensConfigurationsOutput(v **ListStorageLensConfigurationsOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *ListStorageLensConfigurationsOutput
if *v == nil {
sv = &ListStorageLensConfigurationsOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("NextToken", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.NextToken = ptr.String(xtv)
}
case strings.EqualFold("StorageLensConfigurationList", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentStorageLensConfigurationListUnwrapped(&sv.StorageLensConfigurationList, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpPutAccessPointConfigurationForObjectLambda struct {
}
func (*awsRestxml_deserializeOpPutAccessPointConfigurationForObjectLambda) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpPutAccessPointConfigurationForObjectLambda) 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, awsRestxml_deserializeOpErrorPutAccessPointConfigurationForObjectLambda(response, &metadata)
}
output := &PutAccessPointConfigurationForObjectLambdaOutput{}
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 awsRestxml_deserializeOpErrorPutAccessPointConfigurationForObjectLambda(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpPutAccessPointPolicy struct {
}
func (*awsRestxml_deserializeOpPutAccessPointPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpPutAccessPointPolicy) 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, awsRestxml_deserializeOpErrorPutAccessPointPolicy(response, &metadata)
}
output := &PutAccessPointPolicyOutput{}
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 awsRestxml_deserializeOpErrorPutAccessPointPolicy(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpPutAccessPointPolicyForObjectLambda struct {
}
func (*awsRestxml_deserializeOpPutAccessPointPolicyForObjectLambda) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpPutAccessPointPolicyForObjectLambda) 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, awsRestxml_deserializeOpErrorPutAccessPointPolicyForObjectLambda(response, &metadata)
}
output := &PutAccessPointPolicyForObjectLambdaOutput{}
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 awsRestxml_deserializeOpErrorPutAccessPointPolicyForObjectLambda(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpPutBucketLifecycleConfiguration struct {
}
func (*awsRestxml_deserializeOpPutBucketLifecycleConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpPutBucketLifecycleConfiguration) 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, awsRestxml_deserializeOpErrorPutBucketLifecycleConfiguration(response, &metadata)
}
output := &PutBucketLifecycleConfigurationOutput{}
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 awsRestxml_deserializeOpErrorPutBucketLifecycleConfiguration(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpPutBucketPolicy struct {
}
func (*awsRestxml_deserializeOpPutBucketPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpPutBucketPolicy) 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, awsRestxml_deserializeOpErrorPutBucketPolicy(response, &metadata)
}
output := &PutBucketPolicyOutput{}
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 awsRestxml_deserializeOpErrorPutBucketPolicy(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpPutBucketReplication struct {
}
func (*awsRestxml_deserializeOpPutBucketReplication) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpPutBucketReplication) 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, awsRestxml_deserializeOpErrorPutBucketReplication(response, &metadata)
}
output := &PutBucketReplicationOutput{}
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 awsRestxml_deserializeOpErrorPutBucketReplication(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpPutBucketTagging struct {
}
func (*awsRestxml_deserializeOpPutBucketTagging) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpPutBucketTagging) 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, awsRestxml_deserializeOpErrorPutBucketTagging(response, &metadata)
}
output := &PutBucketTaggingOutput{}
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 awsRestxml_deserializeOpErrorPutBucketTagging(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpPutBucketVersioning struct {
}
func (*awsRestxml_deserializeOpPutBucketVersioning) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpPutBucketVersioning) 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, awsRestxml_deserializeOpErrorPutBucketVersioning(response, &metadata)
}
output := &PutBucketVersioningOutput{}
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 awsRestxml_deserializeOpErrorPutBucketVersioning(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpPutJobTagging struct {
}
func (*awsRestxml_deserializeOpPutJobTagging) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpPutJobTagging) 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, awsRestxml_deserializeOpErrorPutJobTagging(response, &metadata)
}
output := &PutJobTaggingOutput{}
out.Result = output
return out, metadata, err
}
func awsRestxml_deserializeOpErrorPutJobTagging(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
case strings.EqualFold("InternalServiceException", errorCode):
return awsRestxml_deserializeErrorInternalServiceException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestxml_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestxml_deserializeErrorTooManyRequestsException(response, errorBody)
case strings.EqualFold("TooManyTagsException", errorCode):
return awsRestxml_deserializeErrorTooManyTagsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpPutMultiRegionAccessPointPolicy struct {
}
func (*awsRestxml_deserializeOpPutMultiRegionAccessPointPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpPutMultiRegionAccessPointPolicy) 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, awsRestxml_deserializeOpErrorPutMultiRegionAccessPointPolicy(response, &metadata)
}
output := &PutMultiRegionAccessPointPolicyOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentPutMultiRegionAccessPointPolicyOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorPutMultiRegionAccessPointPolicy(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentPutMultiRegionAccessPointPolicyOutput(v **PutMultiRegionAccessPointPolicyOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *PutMultiRegionAccessPointPolicyOutput
if *v == nil {
sv = &PutMultiRegionAccessPointPolicyOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("RequestTokenARN", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.RequestTokenARN = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpPutPublicAccessBlock struct {
}
func (*awsRestxml_deserializeOpPutPublicAccessBlock) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpPutPublicAccessBlock) 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, awsRestxml_deserializeOpErrorPutPublicAccessBlock(response, &metadata)
}
output := &PutPublicAccessBlockOutput{}
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 awsRestxml_deserializeOpErrorPutPublicAccessBlock(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpPutStorageLensConfiguration struct {
}
func (*awsRestxml_deserializeOpPutStorageLensConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpPutStorageLensConfiguration) 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, awsRestxml_deserializeOpErrorPutStorageLensConfiguration(response, &metadata)
}
output := &PutStorageLensConfigurationOutput{}
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 awsRestxml_deserializeOpErrorPutStorageLensConfiguration(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpPutStorageLensConfigurationTagging struct {
}
func (*awsRestxml_deserializeOpPutStorageLensConfigurationTagging) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpPutStorageLensConfigurationTagging) 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, awsRestxml_deserializeOpErrorPutStorageLensConfigurationTagging(response, &metadata)
}
output := &PutStorageLensConfigurationTaggingOutput{}
out.Result = output
return out, metadata, err
}
func awsRestxml_deserializeOpErrorPutStorageLensConfigurationTagging(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpSubmitMultiRegionAccessPointRoutes struct {
}
func (*awsRestxml_deserializeOpSubmitMultiRegionAccessPointRoutes) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpSubmitMultiRegionAccessPointRoutes) 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, awsRestxml_deserializeOpErrorSubmitMultiRegionAccessPointRoutes(response, &metadata)
}
output := &SubmitMultiRegionAccessPointRoutesOutput{}
out.Result = output
return out, metadata, err
}
func awsRestxml_deserializeOpErrorSubmitMultiRegionAccessPointRoutes(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestxml_deserializeOpUpdateJobPriority struct {
}
func (*awsRestxml_deserializeOpUpdateJobPriority) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpUpdateJobPriority) 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, awsRestxml_deserializeOpErrorUpdateJobPriority(response, &metadata)
}
output := &UpdateJobPriorityOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentUpdateJobPriorityOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorUpdateJobPriority(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestxml_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalServiceException", errorCode):
return awsRestxml_deserializeErrorInternalServiceException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestxml_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestxml_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentUpdateJobPriorityOutput(v **UpdateJobPriorityOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *UpdateJobPriorityOutput
if *v == nil {
sv = &UpdateJobPriorityOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("JobId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.JobId = ptr.String(xtv)
}
case strings.EqualFold("Priority", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.Priority = int32(i64)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
type awsRestxml_deserializeOpUpdateJobStatus struct {
}
func (*awsRestxml_deserializeOpUpdateJobStatus) ID() string {
return "OperationDeserializer"
}
func (m *awsRestxml_deserializeOpUpdateJobStatus) 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, awsRestxml_deserializeOpErrorUpdateJobStatus(response, &metadata)
}
output := &UpdateJobStatusOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
err = awsRestxml_deserializeOpDocumentUpdateJobStatusOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestxml_deserializeOpErrorUpdateJobStatus(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
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
IsWrappedWithErrorTag: true,
})
if err != nil {
return err
}
if hostID := errorComponents.HostID; len(hostID) != 0 {
s3shared.SetHostIDMetadata(metadata, hostID)
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestxml_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalServiceException", errorCode):
return awsRestxml_deserializeErrorInternalServiceException(response, errorBody)
case strings.EqualFold("JobStatusException", errorCode):
return awsRestxml_deserializeErrorJobStatusException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestxml_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestxml_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestxml_deserializeOpDocumentUpdateJobStatusOutput(v **UpdateJobStatusOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *UpdateJobStatusOutput
if *v == nil {
sv = &UpdateJobStatusOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("JobId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.JobId = ptr.String(xtv)
}
case strings.EqualFold("Status", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Status = types.JobStatus(xtv)
}
case strings.EqualFold("StatusUpdateReason", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.StatusUpdateReason = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.BadRequestException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return output
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("Error")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsRestxml_deserializeDocumentBadRequestException(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return output
}
func awsRestxml_deserializeErrorBucketAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.BucketAlreadyExists{}
return output
}
func awsRestxml_deserializeErrorBucketAlreadyOwnedByYou(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.BucketAlreadyOwnedByYou{}
return output
}
func awsRestxml_deserializeErrorIdempotencyException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.IdempotencyException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return output
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("Error")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsRestxml_deserializeDocumentIdempotencyException(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return output
}
func awsRestxml_deserializeErrorInternalServiceException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InternalServiceException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return output
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("Error")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsRestxml_deserializeDocumentInternalServiceException(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return output
}
func awsRestxml_deserializeErrorInvalidNextTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InvalidNextTokenException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return output
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("Error")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsRestxml_deserializeDocumentInvalidNextTokenException(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return output
}
func awsRestxml_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InvalidRequestException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return output
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("Error")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsRestxml_deserializeDocumentInvalidRequestException(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return output
}
func awsRestxml_deserializeErrorJobStatusException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.JobStatusException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return output
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("Error")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsRestxml_deserializeDocumentJobStatusException(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return output
}
func awsRestxml_deserializeErrorNoSuchPublicAccessBlockConfiguration(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.NoSuchPublicAccessBlockConfiguration{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return output
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("Error")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsRestxml_deserializeDocumentNoSuchPublicAccessBlockConfiguration(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return output
}
func awsRestxml_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.NotFoundException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return output
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("Error")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsRestxml_deserializeDocumentNotFoundException(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return output
}
func awsRestxml_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.TooManyRequestsException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return output
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("Error")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsRestxml_deserializeDocumentTooManyRequestsException(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return output
}
func awsRestxml_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.TooManyTagsException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return output
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("Error")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsRestxml_deserializeDocumentTooManyTagsException(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return output
}
func awsRestxml_deserializeDocumentAbortIncompleteMultipartUpload(v **types.AbortIncompleteMultipartUpload, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.AbortIncompleteMultipartUpload
if *v == nil {
sv = &types.AbortIncompleteMultipartUpload{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("DaysAfterInitiation", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.DaysAfterInitiation = int32(i64)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentAccessControlTranslation(v **types.AccessControlTranslation, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.AccessControlTranslation
if *v == nil {
sv = &types.AccessControlTranslation{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Owner", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Owner = types.OwnerOverride(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentAccessPoint(v **types.AccessPoint, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.AccessPoint
if *v == nil {
sv = &types.AccessPoint{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("AccessPointArn", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.AccessPointArn = ptr.String(xtv)
}
case strings.EqualFold("Alias", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Alias = ptr.String(xtv)
}
case strings.EqualFold("Bucket", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Bucket = ptr.String(xtv)
}
case strings.EqualFold("BucketAccountId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.BucketAccountId = ptr.String(xtv)
}
case strings.EqualFold("Name", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Name = ptr.String(xtv)
}
case strings.EqualFold("NetworkOrigin", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.NetworkOrigin = types.NetworkOrigin(xtv)
}
case strings.EqualFold("VpcConfiguration", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentVpcConfiguration(&sv.VpcConfiguration, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentAccessPointList(v *[]types.AccessPoint, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.AccessPoint
if *v == nil {
sv = make([]types.AccessPoint, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("AccessPoint", t.Name.Local):
var col types.AccessPoint
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &col
if err := awsRestxml_deserializeDocumentAccessPoint(&destAddr, nodeDecoder); err != nil {
return err
}
col = *destAddr
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentAccessPointListUnwrapped(v *[]types.AccessPoint, decoder smithyxml.NodeDecoder) error {
var sv []types.AccessPoint
if *v == nil {
sv = make([]types.AccessPoint, 0)
} else {
sv = *v
}
switch {
default:
var mv types.AccessPoint
t := decoder.StartEl
_ = t
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentAccessPoint(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentAccountLevel(v **types.AccountLevel, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.AccountLevel
if *v == nil {
sv = &types.AccountLevel{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("ActivityMetrics", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentActivityMetrics(&sv.ActivityMetrics, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("AdvancedCostOptimizationMetrics", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentAdvancedCostOptimizationMetrics(&sv.AdvancedCostOptimizationMetrics, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("AdvancedDataProtectionMetrics", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentAdvancedDataProtectionMetrics(&sv.AdvancedDataProtectionMetrics, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("BucketLevel", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentBucketLevel(&sv.BucketLevel, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("DetailedStatusCodesMetrics", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentDetailedStatusCodesMetrics(&sv.DetailedStatusCodesMetrics, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentActivityMetrics(v **types.ActivityMetrics, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.ActivityMetrics
if *v == nil {
sv = &types.ActivityMetrics{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("IsEnabled", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected IsEnabled to be of type *bool, got %T instead", val)
}
sv.IsEnabled = xtv
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentAdvancedCostOptimizationMetrics(v **types.AdvancedCostOptimizationMetrics, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.AdvancedCostOptimizationMetrics
if *v == nil {
sv = &types.AdvancedCostOptimizationMetrics{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("IsEnabled", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected IsEnabled to be of type *bool, got %T instead", val)
}
sv.IsEnabled = xtv
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentAdvancedDataProtectionMetrics(v **types.AdvancedDataProtectionMetrics, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.AdvancedDataProtectionMetrics
if *v == nil {
sv = &types.AdvancedDataProtectionMetrics{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("IsEnabled", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected IsEnabled to be of type *bool, got %T instead", val)
}
sv.IsEnabled = xtv
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentAsyncErrorDetails(v **types.AsyncErrorDetails, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.AsyncErrorDetails
if *v == nil {
sv = &types.AsyncErrorDetails{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Code", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Code = ptr.String(xtv)
}
case strings.EqualFold("Message", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Message = ptr.String(xtv)
}
case strings.EqualFold("RequestId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.RequestId = ptr.String(xtv)
}
case strings.EqualFold("Resource", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Resource = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentAsyncOperation(v **types.AsyncOperation, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.AsyncOperation
if *v == nil {
sv = &types.AsyncOperation{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("CreationTime", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.CreationTime = ptr.Time(t)
}
case strings.EqualFold("Operation", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Operation = types.AsyncOperationName(xtv)
}
case strings.EqualFold("RequestParameters", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentAsyncRequestParameters(&sv.RequestParameters, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("RequestStatus", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.RequestStatus = ptr.String(xtv)
}
case strings.EqualFold("RequestTokenARN", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.RequestTokenARN = ptr.String(xtv)
}
case strings.EqualFold("ResponseDetails", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentAsyncResponseDetails(&sv.ResponseDetails, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentAsyncRequestParameters(v **types.AsyncRequestParameters, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.AsyncRequestParameters
if *v == nil {
sv = &types.AsyncRequestParameters{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("CreateMultiRegionAccessPointRequest", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentCreateMultiRegionAccessPointInput(&sv.CreateMultiRegionAccessPointRequest, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("DeleteMultiRegionAccessPointRequest", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentDeleteMultiRegionAccessPointInput(&sv.DeleteMultiRegionAccessPointRequest, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("PutMultiRegionAccessPointPolicyRequest", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentPutMultiRegionAccessPointPolicyInput(&sv.PutMultiRegionAccessPointPolicyRequest, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentAsyncResponseDetails(v **types.AsyncResponseDetails, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.AsyncResponseDetails
if *v == nil {
sv = &types.AsyncResponseDetails{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("ErrorDetails", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentAsyncErrorDetails(&sv.ErrorDetails, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("MultiRegionAccessPointDetails", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentMultiRegionAccessPointsAsyncResponse(&sv.MultiRegionAccessPointDetails, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentAwsLambdaTransformation(v **types.AwsLambdaTransformation, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.AwsLambdaTransformation
if *v == nil {
sv = &types.AwsLambdaTransformation{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("FunctionArn", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.FunctionArn = ptr.String(xtv)
}
case strings.EqualFold("FunctionPayload", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.FunctionPayload = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentBadRequestException(v **types.BadRequestException, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.BadRequestException
if *v == nil {
sv = &types.BadRequestException{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Message", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Message = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentBucketAlreadyExists(v **types.BucketAlreadyExists, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.BucketAlreadyExists
if *v == nil {
sv = &types.BucketAlreadyExists{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentBucketAlreadyOwnedByYou(v **types.BucketAlreadyOwnedByYou, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.BucketAlreadyOwnedByYou
if *v == nil {
sv = &types.BucketAlreadyOwnedByYou{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentBucketLevel(v **types.BucketLevel, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.BucketLevel
if *v == nil {
sv = &types.BucketLevel{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("ActivityMetrics", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentActivityMetrics(&sv.ActivityMetrics, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("AdvancedCostOptimizationMetrics", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentAdvancedCostOptimizationMetrics(&sv.AdvancedCostOptimizationMetrics, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("AdvancedDataProtectionMetrics", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentAdvancedDataProtectionMetrics(&sv.AdvancedDataProtectionMetrics, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("DetailedStatusCodesMetrics", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentDetailedStatusCodesMetrics(&sv.DetailedStatusCodesMetrics, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("PrefixLevel", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentPrefixLevel(&sv.PrefixLevel, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentBuckets(v *[]string, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []string
if *v == nil {
sv = make([]string, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
decoder = memberDecoder
switch {
case strings.EqualFold("Arn", t.Name.Local):
var col string
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
col = xtv
}
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentBucketsUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error {
var sv []string
if *v == nil {
sv = make([]string, 0)
} else {
sv = *v
}
switch {
default:
var mv string
t := decoder.StartEl
_ = t
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
mv = xtv
}
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentCloudWatchMetrics(v **types.CloudWatchMetrics, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.CloudWatchMetrics
if *v == nil {
sv = &types.CloudWatchMetrics{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("IsEnabled", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected IsEnabled to be of type *bool, got %T instead", val)
}
sv.IsEnabled = xtv
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentCreateMultiRegionAccessPointInput(v **types.CreateMultiRegionAccessPointInput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.CreateMultiRegionAccessPointInput
if *v == nil {
sv = &types.CreateMultiRegionAccessPointInput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Name", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Name = ptr.String(xtv)
}
case strings.EqualFold("PublicAccessBlock", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(&sv.PublicAccessBlock, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Regions", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentRegionCreationList(&sv.Regions, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentDeleteMarkerReplication(v **types.DeleteMarkerReplication, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.DeleteMarkerReplication
if *v == nil {
sv = &types.DeleteMarkerReplication{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Status", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Status = types.DeleteMarkerReplicationStatus(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentDeleteMultiRegionAccessPointInput(v **types.DeleteMultiRegionAccessPointInput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.DeleteMultiRegionAccessPointInput
if *v == nil {
sv = &types.DeleteMultiRegionAccessPointInput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Name", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Name = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentDestination(v **types.Destination, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.Destination
if *v == nil {
sv = &types.Destination{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("AccessControlTranslation", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentAccessControlTranslation(&sv.AccessControlTranslation, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Account", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Account = ptr.String(xtv)
}
case strings.EqualFold("Bucket", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Bucket = ptr.String(xtv)
}
case strings.EqualFold("EncryptionConfiguration", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentEncryptionConfiguration(&sv.EncryptionConfiguration, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Metrics", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentMetrics(&sv.Metrics, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("ReplicationTime", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentReplicationTime(&sv.ReplicationTime, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("StorageClass", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.StorageClass = types.ReplicationStorageClass(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentDetailedStatusCodesMetrics(v **types.DetailedStatusCodesMetrics, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.DetailedStatusCodesMetrics
if *v == nil {
sv = &types.DetailedStatusCodesMetrics{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("IsEnabled", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected IsEnabled to be of type *bool, got %T instead", val)
}
sv.IsEnabled = xtv
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentEncryptionConfiguration(v **types.EncryptionConfiguration, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.EncryptionConfiguration
if *v == nil {
sv = &types.EncryptionConfiguration{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("ReplicaKmsKeyID", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ReplicaKmsKeyID = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentEndpoints(v *map[string]string, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv map[string]string
if *v == nil {
sv = make(map[string]string, 0)
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("entry", t.Name.Local):
entryDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentEndpointsUnwrapped(&sv, entryDecoder); err != nil {
return err
}
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentEndpointsUnwrapped(v *map[string]string, decoder smithyxml.NodeDecoder) error {
var sv map[string]string
if *v == nil {
sv = make(map[string]string, 0)
} else {
sv = *v
}
var ek string
var ev string
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
sv[ek] = ev
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("key", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
ek = xtv
}
case strings.EqualFold("value", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
ev = xtv
}
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentEstablishedMultiRegionAccessPointPolicy(v **types.EstablishedMultiRegionAccessPointPolicy, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.EstablishedMultiRegionAccessPointPolicy
if *v == nil {
sv = &types.EstablishedMultiRegionAccessPointPolicy{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Policy", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Policy = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentExclude(v **types.Exclude, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.Exclude
if *v == nil {
sv = &types.Exclude{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Buckets", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentBuckets(&sv.Buckets, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Regions", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentRegions(&sv.Regions, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentExistingObjectReplication(v **types.ExistingObjectReplication, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.ExistingObjectReplication
if *v == nil {
sv = &types.ExistingObjectReplication{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Status", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Status = types.ExistingObjectReplicationStatus(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentGeneratedManifestEncryption(v **types.GeneratedManifestEncryption, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.GeneratedManifestEncryption
if *v == nil {
sv = &types.GeneratedManifestEncryption{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("SSE-KMS", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentSSEKMSEncryption(&sv.SSEKMS, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("SSE-S3", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentSSES3Encryption(&sv.SSES3, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentIdempotencyException(v **types.IdempotencyException, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.IdempotencyException
if *v == nil {
sv = &types.IdempotencyException{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Message", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Message = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentInclude(v **types.Include, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.Include
if *v == nil {
sv = &types.Include{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Buckets", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentBuckets(&sv.Buckets, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Regions", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentRegions(&sv.Regions, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentInternalServiceException(v **types.InternalServiceException, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.InternalServiceException
if *v == nil {
sv = &types.InternalServiceException{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Message", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Message = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentInvalidNextTokenException(v **types.InvalidNextTokenException, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.InvalidNextTokenException
if *v == nil {
sv = &types.InvalidNextTokenException{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Message", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Message = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.InvalidRequestException
if *v == nil {
sv = &types.InvalidRequestException{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Message", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Message = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentJobDescriptor(v **types.JobDescriptor, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.JobDescriptor
if *v == nil {
sv = &types.JobDescriptor{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("ConfirmationRequired", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected ConfirmationRequired to be of type *bool, got %T instead", val)
}
sv.ConfirmationRequired = ptr.Bool(xtv)
}
case strings.EqualFold("CreationTime", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.CreationTime = ptr.Time(t)
}
case strings.EqualFold("Description", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Description = ptr.String(xtv)
}
case strings.EqualFold("FailureReasons", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentJobFailureList(&sv.FailureReasons, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("GeneratedManifestDescriptor", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3GeneratedManifestDescriptor(&sv.GeneratedManifestDescriptor, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("JobArn", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.JobArn = ptr.String(xtv)
}
case strings.EqualFold("JobId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.JobId = ptr.String(xtv)
}
case strings.EqualFold("Manifest", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentJobManifest(&sv.Manifest, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("ManifestGenerator", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentJobManifestGenerator(&sv.ManifestGenerator, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Operation", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentJobOperation(&sv.Operation, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Priority", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.Priority = int32(i64)
}
case strings.EqualFold("ProgressSummary", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentJobProgressSummary(&sv.ProgressSummary, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Report", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentJobReport(&sv.Report, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("RoleArn", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.RoleArn = ptr.String(xtv)
}
case strings.EqualFold("Status", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Status = types.JobStatus(xtv)
}
case strings.EqualFold("StatusUpdateReason", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.StatusUpdateReason = ptr.String(xtv)
}
case strings.EqualFold("SuspendedCause", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.SuspendedCause = ptr.String(xtv)
}
case strings.EqualFold("SuspendedDate", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.SuspendedDate = ptr.Time(t)
}
case strings.EqualFold("TerminationDate", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.TerminationDate = ptr.Time(t)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentJobFailure(v **types.JobFailure, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.JobFailure
if *v == nil {
sv = &types.JobFailure{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("FailureCode", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.FailureCode = ptr.String(xtv)
}
case strings.EqualFold("FailureReason", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.FailureReason = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentJobFailureList(v *[]types.JobFailure, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.JobFailure
if *v == nil {
sv = make([]types.JobFailure, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("member", t.Name.Local):
var col types.JobFailure
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &col
if err := awsRestxml_deserializeDocumentJobFailure(&destAddr, nodeDecoder); err != nil {
return err
}
col = *destAddr
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentJobFailureListUnwrapped(v *[]types.JobFailure, decoder smithyxml.NodeDecoder) error {
var sv []types.JobFailure
if *v == nil {
sv = make([]types.JobFailure, 0)
} else {
sv = *v
}
switch {
default:
var mv types.JobFailure
t := decoder.StartEl
_ = t
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentJobFailure(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentJobListDescriptor(v **types.JobListDescriptor, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.JobListDescriptor
if *v == nil {
sv = &types.JobListDescriptor{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("CreationTime", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.CreationTime = ptr.Time(t)
}
case strings.EqualFold("Description", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Description = ptr.String(xtv)
}
case strings.EqualFold("JobId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.JobId = ptr.String(xtv)
}
case strings.EqualFold("Operation", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Operation = types.OperationName(xtv)
}
case strings.EqualFold("Priority", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.Priority = int32(i64)
}
case strings.EqualFold("ProgressSummary", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentJobProgressSummary(&sv.ProgressSummary, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Status", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Status = types.JobStatus(xtv)
}
case strings.EqualFold("TerminationDate", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.TerminationDate = ptr.Time(t)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentJobListDescriptorList(v *[]types.JobListDescriptor, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.JobListDescriptor
if *v == nil {
sv = make([]types.JobListDescriptor, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("member", t.Name.Local):
var col types.JobListDescriptor
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &col
if err := awsRestxml_deserializeDocumentJobListDescriptor(&destAddr, nodeDecoder); err != nil {
return err
}
col = *destAddr
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentJobListDescriptorListUnwrapped(v *[]types.JobListDescriptor, decoder smithyxml.NodeDecoder) error {
var sv []types.JobListDescriptor
if *v == nil {
sv = make([]types.JobListDescriptor, 0)
} else {
sv = *v
}
switch {
default:
var mv types.JobListDescriptor
t := decoder.StartEl
_ = t
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentJobListDescriptor(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentJobManifest(v **types.JobManifest, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.JobManifest
if *v == nil {
sv = &types.JobManifest{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Location", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentJobManifestLocation(&sv.Location, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Spec", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentJobManifestSpec(&sv.Spec, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentJobManifestFieldList(v *[]types.JobManifestFieldName, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.JobManifestFieldName
if *v == nil {
sv = make([]types.JobManifestFieldName, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
decoder = memberDecoder
switch {
case strings.EqualFold("member", t.Name.Local):
var col types.JobManifestFieldName
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
col = types.JobManifestFieldName(xtv)
}
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentJobManifestFieldListUnwrapped(v *[]types.JobManifestFieldName, decoder smithyxml.NodeDecoder) error {
var sv []types.JobManifestFieldName
if *v == nil {
sv = make([]types.JobManifestFieldName, 0)
} else {
sv = *v
}
switch {
default:
var mv types.JobManifestFieldName
t := decoder.StartEl
_ = t
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
mv = types.JobManifestFieldName(xtv)
}
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentJobManifestGenerator(v *types.JobManifestGenerator, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var uv types.JobManifestGenerator
var memberFound bool
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
if memberFound {
if err = decoder.Decoder.Skip(); err != nil {
return err
}
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("S3JobManifestGenerator", t.Name.Local):
var mv types.S3JobManifestGenerator
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentS3JobManifestGenerator(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
uv = &types.JobManifestGeneratorMemberS3JobManifestGenerator{Value: mv}
memberFound = true
default:
uv = &types.UnknownUnionMember{Tag: t.Name.Local}
memberFound = true
}
decoder = originalDecoder
}
*v = uv
return nil
}
func awsRestxml_deserializeDocumentJobManifestGeneratorFilter(v **types.JobManifestGeneratorFilter, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.JobManifestGeneratorFilter
if *v == nil {
sv = &types.JobManifestGeneratorFilter{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("CreatedAfter", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.CreatedAfter = ptr.Time(t)
}
case strings.EqualFold("CreatedBefore", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.CreatedBefore = ptr.Time(t)
}
case strings.EqualFold("EligibleForReplication", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val)
}
sv.EligibleForReplication = ptr.Bool(xtv)
}
case strings.EqualFold("ObjectReplicationStatuses", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentReplicationStatusFilterList(&sv.ObjectReplicationStatuses, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentJobManifestLocation(v **types.JobManifestLocation, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.JobManifestLocation
if *v == nil {
sv = &types.JobManifestLocation{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("ETag", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ETag = ptr.String(xtv)
}
case strings.EqualFold("ObjectArn", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ObjectArn = ptr.String(xtv)
}
case strings.EqualFold("ObjectVersionId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ObjectVersionId = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentJobManifestSpec(v **types.JobManifestSpec, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.JobManifestSpec
if *v == nil {
sv = &types.JobManifestSpec{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Fields", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentJobManifestFieldList(&sv.Fields, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Format", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Format = types.JobManifestFormat(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentJobOperation(v **types.JobOperation, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.JobOperation
if *v == nil {
sv = &types.JobOperation{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("LambdaInvoke", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentLambdaInvokeOperation(&sv.LambdaInvoke, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("S3DeleteObjectTagging", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3DeleteObjectTaggingOperation(&sv.S3DeleteObjectTagging, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("S3InitiateRestoreObject", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3InitiateRestoreObjectOperation(&sv.S3InitiateRestoreObject, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("S3PutObjectAcl", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3SetObjectAclOperation(&sv.S3PutObjectAcl, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("S3PutObjectCopy", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3CopyObjectOperation(&sv.S3PutObjectCopy, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("S3PutObjectLegalHold", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3SetObjectLegalHoldOperation(&sv.S3PutObjectLegalHold, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("S3PutObjectRetention", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3SetObjectRetentionOperation(&sv.S3PutObjectRetention, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("S3PutObjectTagging", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3SetObjectTaggingOperation(&sv.S3PutObjectTagging, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("S3ReplicateObject", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3ReplicateObjectOperation(&sv.S3ReplicateObject, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentJobProgressSummary(v **types.JobProgressSummary, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.JobProgressSummary
if *v == nil {
sv = &types.JobProgressSummary{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("NumberOfTasksFailed", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.NumberOfTasksFailed = ptr.Int64(i64)
}
case strings.EqualFold("NumberOfTasksSucceeded", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.NumberOfTasksSucceeded = ptr.Int64(i64)
}
case strings.EqualFold("Timers", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentJobTimers(&sv.Timers, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("TotalNumberOfTasks", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.TotalNumberOfTasks = ptr.Int64(i64)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentJobReport(v **types.JobReport, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.JobReport
if *v == nil {
sv = &types.JobReport{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Bucket", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Bucket = ptr.String(xtv)
}
case strings.EqualFold("Enabled", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val)
}
sv.Enabled = xtv
}
case strings.EqualFold("Format", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Format = types.JobReportFormat(xtv)
}
case strings.EqualFold("Prefix", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Prefix = ptr.String(xtv)
}
case strings.EqualFold("ReportScope", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ReportScope = types.JobReportScope(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentJobStatusException(v **types.JobStatusException, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.JobStatusException
if *v == nil {
sv = &types.JobStatusException{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Message", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Message = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentJobTimers(v **types.JobTimers, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.JobTimers
if *v == nil {
sv = &types.JobTimers{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("ElapsedTimeInActiveSeconds", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.ElapsedTimeInActiveSeconds = ptr.Int64(i64)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentLambdaInvokeOperation(v **types.LambdaInvokeOperation, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.LambdaInvokeOperation
if *v == nil {
sv = &types.LambdaInvokeOperation{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("FunctionArn", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.FunctionArn = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentLifecycleExpiration(v **types.LifecycleExpiration, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.LifecycleExpiration
if *v == nil {
sv = &types.LifecycleExpiration{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Date", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.Date = ptr.Time(t)
}
case strings.EqualFold("Days", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.Days = int32(i64)
}
case strings.EqualFold("ExpiredObjectDeleteMarker", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected ExpiredObjectDeleteMarker to be of type *bool, got %T instead", val)
}
sv.ExpiredObjectDeleteMarker = xtv
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentLifecycleRule(v **types.LifecycleRule, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.LifecycleRule
if *v == nil {
sv = &types.LifecycleRule{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("AbortIncompleteMultipartUpload", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentAbortIncompleteMultipartUpload(&sv.AbortIncompleteMultipartUpload, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Expiration", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentLifecycleExpiration(&sv.Expiration, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Filter", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentLifecycleRuleFilter(&sv.Filter, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("ID", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ID = ptr.String(xtv)
}
case strings.EqualFold("NoncurrentVersionExpiration", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentNoncurrentVersionExpiration(&sv.NoncurrentVersionExpiration, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("NoncurrentVersionTransitions", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentNoncurrentVersionTransitionList(&sv.NoncurrentVersionTransitions, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Status", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Status = types.ExpirationStatus(xtv)
}
case strings.EqualFold("Transitions", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentTransitionList(&sv.Transitions, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentLifecycleRuleAndOperator(v **types.LifecycleRuleAndOperator, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.LifecycleRuleAndOperator
if *v == nil {
sv = &types.LifecycleRuleAndOperator{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("ObjectSizeGreaterThan", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.ObjectSizeGreaterThan = ptr.Int64(i64)
}
case strings.EqualFold("ObjectSizeLessThan", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.ObjectSizeLessThan = ptr.Int64(i64)
}
case strings.EqualFold("Prefix", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Prefix = ptr.String(xtv)
}
case strings.EqualFold("Tags", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3TagSet(&sv.Tags, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentLifecycleRuleFilter(v **types.LifecycleRuleFilter, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.LifecycleRuleFilter
if *v == nil {
sv = &types.LifecycleRuleFilter{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("And", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentLifecycleRuleAndOperator(&sv.And, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("ObjectSizeGreaterThan", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.ObjectSizeGreaterThan = ptr.Int64(i64)
}
case strings.EqualFold("ObjectSizeLessThan", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.ObjectSizeLessThan = ptr.Int64(i64)
}
case strings.EqualFold("Prefix", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Prefix = ptr.String(xtv)
}
case strings.EqualFold("Tag", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3Tag(&sv.Tag, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentLifecycleRules(v *[]types.LifecycleRule, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.LifecycleRule
if *v == nil {
sv = make([]types.LifecycleRule, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("Rule", t.Name.Local):
var col types.LifecycleRule
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &col
if err := awsRestxml_deserializeDocumentLifecycleRule(&destAddr, nodeDecoder); err != nil {
return err
}
col = *destAddr
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentLifecycleRulesUnwrapped(v *[]types.LifecycleRule, decoder smithyxml.NodeDecoder) error {
var sv []types.LifecycleRule
if *v == nil {
sv = make([]types.LifecycleRule, 0)
} else {
sv = *v
}
switch {
default:
var mv types.LifecycleRule
t := decoder.StartEl
_ = t
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentLifecycleRule(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentListStorageLensConfigurationEntry(v **types.ListStorageLensConfigurationEntry, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.ListStorageLensConfigurationEntry
if *v == nil {
sv = &types.ListStorageLensConfigurationEntry{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("HomeRegion", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.HomeRegion = ptr.String(xtv)
}
case strings.EqualFold("Id", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Id = ptr.String(xtv)
}
case strings.EqualFold("IsEnabled", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected IsEnabled to be of type *bool, got %T instead", val)
}
sv.IsEnabled = xtv
}
case strings.EqualFold("StorageLensArn", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.StorageLensArn = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentMetrics(v **types.Metrics, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.Metrics
if *v == nil {
sv = &types.Metrics{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("EventThreshold", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentReplicationTimeValue(&sv.EventThreshold, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Status", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Status = types.MetricsStatus(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentMultiRegionAccessPointPolicyDocument(v **types.MultiRegionAccessPointPolicyDocument, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.MultiRegionAccessPointPolicyDocument
if *v == nil {
sv = &types.MultiRegionAccessPointPolicyDocument{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Established", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentEstablishedMultiRegionAccessPointPolicy(&sv.Established, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Proposed", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentProposedMultiRegionAccessPointPolicy(&sv.Proposed, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentMultiRegionAccessPointRegionalResponse(v **types.MultiRegionAccessPointRegionalResponse, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.MultiRegionAccessPointRegionalResponse
if *v == nil {
sv = &types.MultiRegionAccessPointRegionalResponse{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Name", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Name = ptr.String(xtv)
}
case strings.EqualFold("RequestStatus", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.RequestStatus = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentMultiRegionAccessPointRegionalResponseList(v *[]types.MultiRegionAccessPointRegionalResponse, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.MultiRegionAccessPointRegionalResponse
if *v == nil {
sv = make([]types.MultiRegionAccessPointRegionalResponse, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("Region", t.Name.Local):
var col types.MultiRegionAccessPointRegionalResponse
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &col
if err := awsRestxml_deserializeDocumentMultiRegionAccessPointRegionalResponse(&destAddr, nodeDecoder); err != nil {
return err
}
col = *destAddr
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentMultiRegionAccessPointRegionalResponseListUnwrapped(v *[]types.MultiRegionAccessPointRegionalResponse, decoder smithyxml.NodeDecoder) error {
var sv []types.MultiRegionAccessPointRegionalResponse
if *v == nil {
sv = make([]types.MultiRegionAccessPointRegionalResponse, 0)
} else {
sv = *v
}
switch {
default:
var mv types.MultiRegionAccessPointRegionalResponse
t := decoder.StartEl
_ = t
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentMultiRegionAccessPointRegionalResponse(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentMultiRegionAccessPointReport(v **types.MultiRegionAccessPointReport, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.MultiRegionAccessPointReport
if *v == nil {
sv = &types.MultiRegionAccessPointReport{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Alias", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Alias = ptr.String(xtv)
}
case strings.EqualFold("CreatedAt", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.CreatedAt = ptr.Time(t)
}
case strings.EqualFold("Name", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Name = ptr.String(xtv)
}
case strings.EqualFold("PublicAccessBlock", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(&sv.PublicAccessBlock, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Regions", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentRegionReportList(&sv.Regions, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Status", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Status = types.MultiRegionAccessPointStatus(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentMultiRegionAccessPointReportList(v *[]types.MultiRegionAccessPointReport, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.MultiRegionAccessPointReport
if *v == nil {
sv = make([]types.MultiRegionAccessPointReport, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("AccessPoint", t.Name.Local):
var col types.MultiRegionAccessPointReport
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &col
if err := awsRestxml_deserializeDocumentMultiRegionAccessPointReport(&destAddr, nodeDecoder); err != nil {
return err
}
col = *destAddr
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentMultiRegionAccessPointReportListUnwrapped(v *[]types.MultiRegionAccessPointReport, decoder smithyxml.NodeDecoder) error {
var sv []types.MultiRegionAccessPointReport
if *v == nil {
sv = make([]types.MultiRegionAccessPointReport, 0)
} else {
sv = *v
}
switch {
default:
var mv types.MultiRegionAccessPointReport
t := decoder.StartEl
_ = t
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentMultiRegionAccessPointReport(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentMultiRegionAccessPointRoute(v **types.MultiRegionAccessPointRoute, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.MultiRegionAccessPointRoute
if *v == nil {
sv = &types.MultiRegionAccessPointRoute{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Bucket", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Bucket = ptr.String(xtv)
}
case strings.EqualFold("Region", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Region = ptr.String(xtv)
}
case strings.EqualFold("TrafficDialPercentage", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.TrafficDialPercentage = ptr.Int32(int32(i64))
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentMultiRegionAccessPointsAsyncResponse(v **types.MultiRegionAccessPointsAsyncResponse, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.MultiRegionAccessPointsAsyncResponse
if *v == nil {
sv = &types.MultiRegionAccessPointsAsyncResponse{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Regions", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentMultiRegionAccessPointRegionalResponseList(&sv.Regions, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentNoncurrentVersionExpiration(v **types.NoncurrentVersionExpiration, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.NoncurrentVersionExpiration
if *v == nil {
sv = &types.NoncurrentVersionExpiration{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("NewerNoncurrentVersions", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.NewerNoncurrentVersions = ptr.Int32(int32(i64))
}
case strings.EqualFold("NoncurrentDays", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.NoncurrentDays = int32(i64)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentNoncurrentVersionTransition(v **types.NoncurrentVersionTransition, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.NoncurrentVersionTransition
if *v == nil {
sv = &types.NoncurrentVersionTransition{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("NoncurrentDays", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.NoncurrentDays = int32(i64)
}
case strings.EqualFold("StorageClass", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.StorageClass = types.TransitionStorageClass(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentNoncurrentVersionTransitionList(v *[]types.NoncurrentVersionTransition, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.NoncurrentVersionTransition
if *v == nil {
sv = make([]types.NoncurrentVersionTransition, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("NoncurrentVersionTransition", t.Name.Local):
var col types.NoncurrentVersionTransition
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &col
if err := awsRestxml_deserializeDocumentNoncurrentVersionTransition(&destAddr, nodeDecoder); err != nil {
return err
}
col = *destAddr
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentNoncurrentVersionTransitionListUnwrapped(v *[]types.NoncurrentVersionTransition, decoder smithyxml.NodeDecoder) error {
var sv []types.NoncurrentVersionTransition
if *v == nil {
sv = make([]types.NoncurrentVersionTransition, 0)
} else {
sv = *v
}
switch {
default:
var mv types.NoncurrentVersionTransition
t := decoder.StartEl
_ = t
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentNoncurrentVersionTransition(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentNoSuchPublicAccessBlockConfiguration(v **types.NoSuchPublicAccessBlockConfiguration, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.NoSuchPublicAccessBlockConfiguration
if *v == nil {
sv = &types.NoSuchPublicAccessBlockConfiguration{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Message", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Message = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentNotFoundException(v **types.NotFoundException, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.NotFoundException
if *v == nil {
sv = &types.NotFoundException{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Message", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Message = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentObjectLambdaAccessPoint(v **types.ObjectLambdaAccessPoint, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.ObjectLambdaAccessPoint
if *v == nil {
sv = &types.ObjectLambdaAccessPoint{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Alias", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentObjectLambdaAccessPointAlias(&sv.Alias, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Name", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Name = ptr.String(xtv)
}
case strings.EqualFold("ObjectLambdaAccessPointArn", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ObjectLambdaAccessPointArn = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentObjectLambdaAccessPointAlias(v **types.ObjectLambdaAccessPointAlias, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.ObjectLambdaAccessPointAlias
if *v == nil {
sv = &types.ObjectLambdaAccessPointAlias{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Status", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Status = types.ObjectLambdaAccessPointAliasStatus(xtv)
}
case strings.EqualFold("Value", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Value = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentObjectLambdaAccessPointList(v *[]types.ObjectLambdaAccessPoint, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.ObjectLambdaAccessPoint
if *v == nil {
sv = make([]types.ObjectLambdaAccessPoint, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("ObjectLambdaAccessPoint", t.Name.Local):
var col types.ObjectLambdaAccessPoint
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &col
if err := awsRestxml_deserializeDocumentObjectLambdaAccessPoint(&destAddr, nodeDecoder); err != nil {
return err
}
col = *destAddr
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentObjectLambdaAccessPointListUnwrapped(v *[]types.ObjectLambdaAccessPoint, decoder smithyxml.NodeDecoder) error {
var sv []types.ObjectLambdaAccessPoint
if *v == nil {
sv = make([]types.ObjectLambdaAccessPoint, 0)
} else {
sv = *v
}
switch {
default:
var mv types.ObjectLambdaAccessPoint
t := decoder.StartEl
_ = t
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentObjectLambdaAccessPoint(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentObjectLambdaAllowedFeaturesList(v *[]types.ObjectLambdaAllowedFeature, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.ObjectLambdaAllowedFeature
if *v == nil {
sv = make([]types.ObjectLambdaAllowedFeature, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
decoder = memberDecoder
switch {
case strings.EqualFold("AllowedFeature", t.Name.Local):
var col types.ObjectLambdaAllowedFeature
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
col = types.ObjectLambdaAllowedFeature(xtv)
}
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentObjectLambdaAllowedFeaturesListUnwrapped(v *[]types.ObjectLambdaAllowedFeature, decoder smithyxml.NodeDecoder) error {
var sv []types.ObjectLambdaAllowedFeature
if *v == nil {
sv = make([]types.ObjectLambdaAllowedFeature, 0)
} else {
sv = *v
}
switch {
default:
var mv types.ObjectLambdaAllowedFeature
t := decoder.StartEl
_ = t
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
mv = types.ObjectLambdaAllowedFeature(xtv)
}
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentObjectLambdaConfiguration(v **types.ObjectLambdaConfiguration, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.ObjectLambdaConfiguration
if *v == nil {
sv = &types.ObjectLambdaConfiguration{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("AllowedFeatures", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentObjectLambdaAllowedFeaturesList(&sv.AllowedFeatures, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("CloudWatchMetricsEnabled", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val)
}
sv.CloudWatchMetricsEnabled = xtv
}
case strings.EqualFold("SupportingAccessPoint", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.SupportingAccessPoint = ptr.String(xtv)
}
case strings.EqualFold("TransformationConfigurations", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentObjectLambdaTransformationConfigurationsList(&sv.TransformationConfigurations, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentObjectLambdaContentTransformation(v *types.ObjectLambdaContentTransformation, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var uv types.ObjectLambdaContentTransformation
var memberFound bool
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
if memberFound {
if err = decoder.Decoder.Skip(); err != nil {
return err
}
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("AwsLambda", t.Name.Local):
var mv types.AwsLambdaTransformation
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentAwsLambdaTransformation(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
uv = &types.ObjectLambdaContentTransformationMemberAwsLambda{Value: mv}
memberFound = true
default:
uv = &types.UnknownUnionMember{Tag: t.Name.Local}
memberFound = true
}
decoder = originalDecoder
}
*v = uv
return nil
}
func awsRestxml_deserializeDocumentObjectLambdaTransformationConfiguration(v **types.ObjectLambdaTransformationConfiguration, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.ObjectLambdaTransformationConfiguration
if *v == nil {
sv = &types.ObjectLambdaTransformationConfiguration{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Actions", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentObjectLambdaTransformationConfigurationActionsList(&sv.Actions, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("ContentTransformation", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentObjectLambdaContentTransformation(&sv.ContentTransformation, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentObjectLambdaTransformationConfigurationActionsList(v *[]types.ObjectLambdaTransformationConfigurationAction, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.ObjectLambdaTransformationConfigurationAction
if *v == nil {
sv = make([]types.ObjectLambdaTransformationConfigurationAction, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
decoder = memberDecoder
switch {
case strings.EqualFold("Action", t.Name.Local):
var col types.ObjectLambdaTransformationConfigurationAction
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
col = types.ObjectLambdaTransformationConfigurationAction(xtv)
}
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentObjectLambdaTransformationConfigurationActionsListUnwrapped(v *[]types.ObjectLambdaTransformationConfigurationAction, decoder smithyxml.NodeDecoder) error {
var sv []types.ObjectLambdaTransformationConfigurationAction
if *v == nil {
sv = make([]types.ObjectLambdaTransformationConfigurationAction, 0)
} else {
sv = *v
}
switch {
default:
var mv types.ObjectLambdaTransformationConfigurationAction
t := decoder.StartEl
_ = t
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
mv = types.ObjectLambdaTransformationConfigurationAction(xtv)
}
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentObjectLambdaTransformationConfigurationsList(v *[]types.ObjectLambdaTransformationConfiguration, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.ObjectLambdaTransformationConfiguration
if *v == nil {
sv = make([]types.ObjectLambdaTransformationConfiguration, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("TransformationConfiguration", t.Name.Local):
var col types.ObjectLambdaTransformationConfiguration
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &col
if err := awsRestxml_deserializeDocumentObjectLambdaTransformationConfiguration(&destAddr, nodeDecoder); err != nil {
return err
}
col = *destAddr
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentObjectLambdaTransformationConfigurationsListUnwrapped(v *[]types.ObjectLambdaTransformationConfiguration, decoder smithyxml.NodeDecoder) error {
var sv []types.ObjectLambdaTransformationConfiguration
if *v == nil {
sv = make([]types.ObjectLambdaTransformationConfiguration, 0)
} else {
sv = *v
}
switch {
default:
var mv types.ObjectLambdaTransformationConfiguration
t := decoder.StartEl
_ = t
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentObjectLambdaTransformationConfiguration(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentPolicyStatus(v **types.PolicyStatus, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.PolicyStatus
if *v == nil {
sv = &types.PolicyStatus{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("IsPublic", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected IsPublic to be of type *bool, got %T instead", val)
}
sv.IsPublic = xtv
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentPrefixLevel(v **types.PrefixLevel, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.PrefixLevel
if *v == nil {
sv = &types.PrefixLevel{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("StorageMetrics", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentPrefixLevelStorageMetrics(&sv.StorageMetrics, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentPrefixLevelStorageMetrics(v **types.PrefixLevelStorageMetrics, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.PrefixLevelStorageMetrics
if *v == nil {
sv = &types.PrefixLevelStorageMetrics{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("IsEnabled", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected IsEnabled to be of type *bool, got %T instead", val)
}
sv.IsEnabled = xtv
}
case strings.EqualFold("SelectionCriteria", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentSelectionCriteria(&sv.SelectionCriteria, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentProposedMultiRegionAccessPointPolicy(v **types.ProposedMultiRegionAccessPointPolicy, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.ProposedMultiRegionAccessPointPolicy
if *v == nil {
sv = &types.ProposedMultiRegionAccessPointPolicy{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Policy", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Policy = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(v **types.PublicAccessBlockConfiguration, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.PublicAccessBlockConfiguration
if *v == nil {
sv = &types.PublicAccessBlockConfiguration{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("BlockPublicAcls", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected Setting to be of type *bool, got %T instead", val)
}
sv.BlockPublicAcls = xtv
}
case strings.EqualFold("BlockPublicPolicy", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected Setting to be of type *bool, got %T instead", val)
}
sv.BlockPublicPolicy = xtv
}
case strings.EqualFold("IgnorePublicAcls", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected Setting to be of type *bool, got %T instead", val)
}
sv.IgnorePublicAcls = xtv
}
case strings.EqualFold("RestrictPublicBuckets", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected Setting to be of type *bool, got %T instead", val)
}
sv.RestrictPublicBuckets = xtv
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentPutMultiRegionAccessPointPolicyInput(v **types.PutMultiRegionAccessPointPolicyInput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.PutMultiRegionAccessPointPolicyInput
if *v == nil {
sv = &types.PutMultiRegionAccessPointPolicyInput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Name", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Name = ptr.String(xtv)
}
case strings.EqualFold("Policy", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Policy = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentRegion(v **types.Region, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.Region
if *v == nil {
sv = &types.Region{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Bucket", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Bucket = ptr.String(xtv)
}
case strings.EqualFold("BucketAccountId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.BucketAccountId = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentRegionalBucket(v **types.RegionalBucket, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.RegionalBucket
if *v == nil {
sv = &types.RegionalBucket{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Bucket", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Bucket = ptr.String(xtv)
}
case strings.EqualFold("BucketArn", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.BucketArn = ptr.String(xtv)
}
case strings.EqualFold("CreationDate", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.CreationDate = ptr.Time(t)
}
case strings.EqualFold("OutpostId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.OutpostId = ptr.String(xtv)
}
case strings.EqualFold("PublicAccessBlockEnabled", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected PublicAccessBlockEnabled to be of type *bool, got %T instead", val)
}
sv.PublicAccessBlockEnabled = xtv
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentRegionalBucketList(v *[]types.RegionalBucket, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.RegionalBucket
if *v == nil {
sv = make([]types.RegionalBucket, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("RegionalBucket", t.Name.Local):
var col types.RegionalBucket
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &col
if err := awsRestxml_deserializeDocumentRegionalBucket(&destAddr, nodeDecoder); err != nil {
return err
}
col = *destAddr
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentRegionalBucketListUnwrapped(v *[]types.RegionalBucket, decoder smithyxml.NodeDecoder) error {
var sv []types.RegionalBucket
if *v == nil {
sv = make([]types.RegionalBucket, 0)
} else {
sv = *v
}
switch {
default:
var mv types.RegionalBucket
t := decoder.StartEl
_ = t
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentRegionalBucket(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentRegionCreationList(v *[]types.Region, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.Region
if *v == nil {
sv = make([]types.Region, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("Region", t.Name.Local):
var col types.Region
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &col
if err := awsRestxml_deserializeDocumentRegion(&destAddr, nodeDecoder); err != nil {
return err
}
col = *destAddr
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentRegionCreationListUnwrapped(v *[]types.Region, decoder smithyxml.NodeDecoder) error {
var sv []types.Region
if *v == nil {
sv = make([]types.Region, 0)
} else {
sv = *v
}
switch {
default:
var mv types.Region
t := decoder.StartEl
_ = t
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentRegion(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentRegionReport(v **types.RegionReport, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.RegionReport
if *v == nil {
sv = &types.RegionReport{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Bucket", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Bucket = ptr.String(xtv)
}
case strings.EqualFold("BucketAccountId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.BucketAccountId = ptr.String(xtv)
}
case strings.EqualFold("Region", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Region = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentRegionReportList(v *[]types.RegionReport, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.RegionReport
if *v == nil {
sv = make([]types.RegionReport, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("Region", t.Name.Local):
var col types.RegionReport
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &col
if err := awsRestxml_deserializeDocumentRegionReport(&destAddr, nodeDecoder); err != nil {
return err
}
col = *destAddr
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentRegionReportListUnwrapped(v *[]types.RegionReport, decoder smithyxml.NodeDecoder) error {
var sv []types.RegionReport
if *v == nil {
sv = make([]types.RegionReport, 0)
} else {
sv = *v
}
switch {
default:
var mv types.RegionReport
t := decoder.StartEl
_ = t
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentRegionReport(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentRegions(v *[]string, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []string
if *v == nil {
sv = make([]string, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
decoder = memberDecoder
switch {
case strings.EqualFold("Region", t.Name.Local):
var col string
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
col = xtv
}
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentRegionsUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error {
var sv []string
if *v == nil {
sv = make([]string, 0)
} else {
sv = *v
}
switch {
default:
var mv string
t := decoder.StartEl
_ = t
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
mv = xtv
}
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentReplicaModifications(v **types.ReplicaModifications, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.ReplicaModifications
if *v == nil {
sv = &types.ReplicaModifications{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Status", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Status = types.ReplicaModificationsStatus(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentReplicationConfiguration(v **types.ReplicationConfiguration, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.ReplicationConfiguration
if *v == nil {
sv = &types.ReplicationConfiguration{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Role", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Role = ptr.String(xtv)
}
case strings.EqualFold("Rules", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentReplicationRules(&sv.Rules, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentReplicationRule(v **types.ReplicationRule, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.ReplicationRule
if *v == nil {
sv = &types.ReplicationRule{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Bucket", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Bucket = ptr.String(xtv)
}
case strings.EqualFold("DeleteMarkerReplication", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentDeleteMarkerReplication(&sv.DeleteMarkerReplication, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Destination", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentDestination(&sv.Destination, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("ExistingObjectReplication", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentExistingObjectReplication(&sv.ExistingObjectReplication, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Filter", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentReplicationRuleFilter(&sv.Filter, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("ID", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ID = ptr.String(xtv)
}
case strings.EqualFold("Prefix", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Prefix = ptr.String(xtv)
}
case strings.EqualFold("Priority", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.Priority = ptr.Int32(int32(i64))
}
case strings.EqualFold("SourceSelectionCriteria", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentSourceSelectionCriteria(&sv.SourceSelectionCriteria, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Status", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Status = types.ReplicationRuleStatus(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentReplicationRuleAndOperator(v **types.ReplicationRuleAndOperator, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.ReplicationRuleAndOperator
if *v == nil {
sv = &types.ReplicationRuleAndOperator{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Prefix", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Prefix = ptr.String(xtv)
}
case strings.EqualFold("Tags", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3TagSet(&sv.Tags, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentReplicationRuleFilter(v **types.ReplicationRuleFilter, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.ReplicationRuleFilter
if *v == nil {
sv = &types.ReplicationRuleFilter{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("And", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentReplicationRuleAndOperator(&sv.And, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Prefix", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Prefix = ptr.String(xtv)
}
case strings.EqualFold("Tag", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3Tag(&sv.Tag, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentReplicationRules(v *[]types.ReplicationRule, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.ReplicationRule
if *v == nil {
sv = make([]types.ReplicationRule, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("Rule", t.Name.Local):
var col types.ReplicationRule
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &col
if err := awsRestxml_deserializeDocumentReplicationRule(&destAddr, nodeDecoder); err != nil {
return err
}
col = *destAddr
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentReplicationRulesUnwrapped(v *[]types.ReplicationRule, decoder smithyxml.NodeDecoder) error {
var sv []types.ReplicationRule
if *v == nil {
sv = make([]types.ReplicationRule, 0)
} else {
sv = *v
}
switch {
default:
var mv types.ReplicationRule
t := decoder.StartEl
_ = t
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentReplicationRule(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentReplicationStatusFilterList(v *[]types.ReplicationStatus, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.ReplicationStatus
if *v == nil {
sv = make([]types.ReplicationStatus, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
decoder = memberDecoder
switch {
case strings.EqualFold("member", t.Name.Local):
var col types.ReplicationStatus
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
col = types.ReplicationStatus(xtv)
}
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentReplicationStatusFilterListUnwrapped(v *[]types.ReplicationStatus, decoder smithyxml.NodeDecoder) error {
var sv []types.ReplicationStatus
if *v == nil {
sv = make([]types.ReplicationStatus, 0)
} else {
sv = *v
}
switch {
default:
var mv types.ReplicationStatus
t := decoder.StartEl
_ = t
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
mv = types.ReplicationStatus(xtv)
}
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentReplicationTime(v **types.ReplicationTime, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.ReplicationTime
if *v == nil {
sv = &types.ReplicationTime{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Status", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Status = types.ReplicationTimeStatus(xtv)
}
case strings.EqualFold("Time", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentReplicationTimeValue(&sv.Time, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentReplicationTimeValue(v **types.ReplicationTimeValue, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.ReplicationTimeValue
if *v == nil {
sv = &types.ReplicationTimeValue{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Minutes", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.Minutes = ptr.Int32(int32(i64))
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentRouteList(v *[]types.MultiRegionAccessPointRoute, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.MultiRegionAccessPointRoute
if *v == nil {
sv = make([]types.MultiRegionAccessPointRoute, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("Route", t.Name.Local):
var col types.MultiRegionAccessPointRoute
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &col
if err := awsRestxml_deserializeDocumentMultiRegionAccessPointRoute(&destAddr, nodeDecoder); err != nil {
return err
}
col = *destAddr
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentRouteListUnwrapped(v *[]types.MultiRegionAccessPointRoute, decoder smithyxml.NodeDecoder) error {
var sv []types.MultiRegionAccessPointRoute
if *v == nil {
sv = make([]types.MultiRegionAccessPointRoute, 0)
} else {
sv = *v
}
switch {
default:
var mv types.MultiRegionAccessPointRoute
t := decoder.StartEl
_ = t
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentMultiRegionAccessPointRoute(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3AccessControlList(v **types.S3AccessControlList, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3AccessControlList
if *v == nil {
sv = &types.S3AccessControlList{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Grants", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3GrantList(&sv.Grants, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Owner", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3ObjectOwner(&sv.Owner, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3AccessControlPolicy(v **types.S3AccessControlPolicy, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3AccessControlPolicy
if *v == nil {
sv = &types.S3AccessControlPolicy{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("AccessControlList", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3AccessControlList(&sv.AccessControlList, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("CannedAccessControlList", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.CannedAccessControlList = types.S3CannedAccessControlList(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3BucketDestination(v **types.S3BucketDestination, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3BucketDestination
if *v == nil {
sv = &types.S3BucketDestination{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("AccountId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.AccountId = ptr.String(xtv)
}
case strings.EqualFold("Arn", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Arn = ptr.String(xtv)
}
case strings.EqualFold("Encryption", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentStorageLensDataExportEncryption(&sv.Encryption, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Format", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Format = types.Format(xtv)
}
case strings.EqualFold("OutputSchemaVersion", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.OutputSchemaVersion = types.OutputSchemaVersion(xtv)
}
case strings.EqualFold("Prefix", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Prefix = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3CopyObjectOperation(v **types.S3CopyObjectOperation, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3CopyObjectOperation
if *v == nil {
sv = &types.S3CopyObjectOperation{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("AccessControlGrants", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3GrantList(&sv.AccessControlGrants, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("BucketKeyEnabled", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val)
}
sv.BucketKeyEnabled = xtv
}
case strings.EqualFold("CannedAccessControlList", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.CannedAccessControlList = types.S3CannedAccessControlList(xtv)
}
case strings.EqualFold("ChecksumAlgorithm", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ChecksumAlgorithm = types.S3ChecksumAlgorithm(xtv)
}
case strings.EqualFold("MetadataDirective", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.MetadataDirective = types.S3MetadataDirective(xtv)
}
case strings.EqualFold("ModifiedSinceConstraint", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.ModifiedSinceConstraint = ptr.Time(t)
}
case strings.EqualFold("NewObjectMetadata", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3ObjectMetadata(&sv.NewObjectMetadata, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("NewObjectTagging", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3TagSet(&sv.NewObjectTagging, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("ObjectLockLegalHoldStatus", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ObjectLockLegalHoldStatus = types.S3ObjectLockLegalHoldStatus(xtv)
}
case strings.EqualFold("ObjectLockMode", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ObjectLockMode = types.S3ObjectLockMode(xtv)
}
case strings.EqualFold("ObjectLockRetainUntilDate", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.ObjectLockRetainUntilDate = ptr.Time(t)
}
case strings.EqualFold("RedirectLocation", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.RedirectLocation = ptr.String(xtv)
}
case strings.EqualFold("RequesterPays", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val)
}
sv.RequesterPays = xtv
}
case strings.EqualFold("SSEAwsKmsKeyId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.SSEAwsKmsKeyId = ptr.String(xtv)
}
case strings.EqualFold("StorageClass", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.StorageClass = types.S3StorageClass(xtv)
}
case strings.EqualFold("TargetKeyPrefix", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.TargetKeyPrefix = ptr.String(xtv)
}
case strings.EqualFold("TargetResource", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.TargetResource = ptr.String(xtv)
}
case strings.EqualFold("UnModifiedSinceConstraint", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.UnModifiedSinceConstraint = ptr.Time(t)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3DeleteObjectTaggingOperation(v **types.S3DeleteObjectTaggingOperation, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3DeleteObjectTaggingOperation
if *v == nil {
sv = &types.S3DeleteObjectTaggingOperation{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3GeneratedManifestDescriptor(v **types.S3GeneratedManifestDescriptor, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3GeneratedManifestDescriptor
if *v == nil {
sv = &types.S3GeneratedManifestDescriptor{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Format", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Format = types.GeneratedManifestFormat(xtv)
}
case strings.EqualFold("Location", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentJobManifestLocation(&sv.Location, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3Grant(v **types.S3Grant, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3Grant
if *v == nil {
sv = &types.S3Grant{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Grantee", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3Grantee(&sv.Grantee, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Permission", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Permission = types.S3Permission(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3Grantee(v **types.S3Grantee, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3Grantee
if *v == nil {
sv = &types.S3Grantee{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("DisplayName", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.DisplayName = ptr.String(xtv)
}
case strings.EqualFold("Identifier", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Identifier = ptr.String(xtv)
}
case strings.EqualFold("TypeIdentifier", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.TypeIdentifier = types.S3GranteeTypeIdentifier(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3GrantList(v *[]types.S3Grant, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.S3Grant
if *v == nil {
sv = make([]types.S3Grant, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("member", t.Name.Local):
var col types.S3Grant
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &col
if err := awsRestxml_deserializeDocumentS3Grant(&destAddr, nodeDecoder); err != nil {
return err
}
col = *destAddr
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3GrantListUnwrapped(v *[]types.S3Grant, decoder smithyxml.NodeDecoder) error {
var sv []types.S3Grant
if *v == nil {
sv = make([]types.S3Grant, 0)
} else {
sv = *v
}
switch {
default:
var mv types.S3Grant
t := decoder.StartEl
_ = t
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentS3Grant(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3InitiateRestoreObjectOperation(v **types.S3InitiateRestoreObjectOperation, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3InitiateRestoreObjectOperation
if *v == nil {
sv = &types.S3InitiateRestoreObjectOperation{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("ExpirationInDays", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.ExpirationInDays = ptr.Int32(int32(i64))
}
case strings.EqualFold("GlacierJobTier", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.GlacierJobTier = types.S3GlacierJobTier(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3JobManifestGenerator(v **types.S3JobManifestGenerator, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3JobManifestGenerator
if *v == nil {
sv = &types.S3JobManifestGenerator{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("EnableManifestOutput", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val)
}
sv.EnableManifestOutput = xtv
}
case strings.EqualFold("ExpectedBucketOwner", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ExpectedBucketOwner = ptr.String(xtv)
}
case strings.EqualFold("Filter", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentJobManifestGeneratorFilter(&sv.Filter, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("ManifestOutputLocation", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3ManifestOutputLocation(&sv.ManifestOutputLocation, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("SourceBucket", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.SourceBucket = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3ManifestOutputLocation(v **types.S3ManifestOutputLocation, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3ManifestOutputLocation
if *v == nil {
sv = &types.S3ManifestOutputLocation{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Bucket", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Bucket = ptr.String(xtv)
}
case strings.EqualFold("ExpectedManifestBucketOwner", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ExpectedManifestBucketOwner = ptr.String(xtv)
}
case strings.EqualFold("ManifestEncryption", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentGeneratedManifestEncryption(&sv.ManifestEncryption, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("ManifestFormat", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ManifestFormat = types.GeneratedManifestFormat(xtv)
}
case strings.EqualFold("ManifestPrefix", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ManifestPrefix = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3ObjectLockLegalHold(v **types.S3ObjectLockLegalHold, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3ObjectLockLegalHold
if *v == nil {
sv = &types.S3ObjectLockLegalHold{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Status", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Status = types.S3ObjectLockLegalHoldStatus(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3ObjectMetadata(v **types.S3ObjectMetadata, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3ObjectMetadata
if *v == nil {
sv = &types.S3ObjectMetadata{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("CacheControl", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.CacheControl = ptr.String(xtv)
}
case strings.EqualFold("ContentDisposition", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ContentDisposition = ptr.String(xtv)
}
case strings.EqualFold("ContentEncoding", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ContentEncoding = ptr.String(xtv)
}
case strings.EqualFold("ContentLanguage", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ContentLanguage = ptr.String(xtv)
}
case strings.EqualFold("ContentLength", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.ContentLength = ptr.Int64(i64)
}
case strings.EqualFold("ContentMD5", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ContentMD5 = ptr.String(xtv)
}
case strings.EqualFold("ContentType", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ContentType = ptr.String(xtv)
}
case strings.EqualFold("HttpExpiresDate", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.HttpExpiresDate = ptr.Time(t)
}
case strings.EqualFold("RequesterCharged", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val)
}
sv.RequesterCharged = xtv
}
case strings.EqualFold("SSEAlgorithm", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.SSEAlgorithm = types.S3SSEAlgorithm(xtv)
}
case strings.EqualFold("UserMetadata", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3UserMetadata(&sv.UserMetadata, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3ObjectOwner(v **types.S3ObjectOwner, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3ObjectOwner
if *v == nil {
sv = &types.S3ObjectOwner{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("DisplayName", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.DisplayName = ptr.String(xtv)
}
case strings.EqualFold("ID", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.ID = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3ReplicateObjectOperation(v **types.S3ReplicateObjectOperation, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3ReplicateObjectOperation
if *v == nil {
sv = &types.S3ReplicateObjectOperation{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3Retention(v **types.S3Retention, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3Retention
if *v == nil {
sv = &types.S3Retention{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Mode", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Mode = types.S3ObjectLockRetentionMode(xtv)
}
case strings.EqualFold("RetainUntilDate", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.RetainUntilDate = ptr.Time(t)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3SetObjectAclOperation(v **types.S3SetObjectAclOperation, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3SetObjectAclOperation
if *v == nil {
sv = &types.S3SetObjectAclOperation{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("AccessControlPolicy", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3AccessControlPolicy(&sv.AccessControlPolicy, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3SetObjectLegalHoldOperation(v **types.S3SetObjectLegalHoldOperation, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3SetObjectLegalHoldOperation
if *v == nil {
sv = &types.S3SetObjectLegalHoldOperation{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("LegalHold", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3ObjectLockLegalHold(&sv.LegalHold, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3SetObjectRetentionOperation(v **types.S3SetObjectRetentionOperation, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3SetObjectRetentionOperation
if *v == nil {
sv = &types.S3SetObjectRetentionOperation{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("BypassGovernanceRetention", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val)
}
sv.BypassGovernanceRetention = ptr.Bool(xtv)
}
case strings.EqualFold("Retention", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3Retention(&sv.Retention, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3SetObjectTaggingOperation(v **types.S3SetObjectTaggingOperation, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3SetObjectTaggingOperation
if *v == nil {
sv = &types.S3SetObjectTaggingOperation{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("TagSet", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3TagSet(&sv.TagSet, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3Tag(v **types.S3Tag, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.S3Tag
if *v == nil {
sv = &types.S3Tag{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Key", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Key = ptr.String(xtv)
}
case strings.EqualFold("Value", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Value = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3TagSet(v *[]types.S3Tag, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.S3Tag
if *v == nil {
sv = make([]types.S3Tag, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("member", t.Name.Local):
var col types.S3Tag
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &col
if err := awsRestxml_deserializeDocumentS3Tag(&destAddr, nodeDecoder); err != nil {
return err
}
col = *destAddr
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3TagSetUnwrapped(v *[]types.S3Tag, decoder smithyxml.NodeDecoder) error {
var sv []types.S3Tag
if *v == nil {
sv = make([]types.S3Tag, 0)
} else {
sv = *v
}
switch {
default:
var mv types.S3Tag
t := decoder.StartEl
_ = t
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentS3Tag(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3UserMetadata(v *map[string]string, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv map[string]string
if *v == nil {
sv = make(map[string]string, 0)
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("entry", t.Name.Local):
entryDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3UserMetadataUnwrapped(&sv, entryDecoder); err != nil {
return err
}
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentS3UserMetadataUnwrapped(v *map[string]string, decoder smithyxml.NodeDecoder) error {
var sv map[string]string
if *v == nil {
sv = make(map[string]string, 0)
} else {
sv = *v
}
var ek string
var ev string
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
sv[ek] = ev
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("key", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
ek = xtv
}
case strings.EqualFold("value", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
ev = xtv
}
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentSelectionCriteria(v **types.SelectionCriteria, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.SelectionCriteria
if *v == nil {
sv = &types.SelectionCriteria{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Delimiter", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Delimiter = ptr.String(xtv)
}
case strings.EqualFold("MaxDepth", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.MaxDepth = int32(i64)
}
case strings.EqualFold("MinStorageBytesPercentage", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
f64, err := strconv.ParseFloat(xtv, 64)
if err != nil {
return err
}
sv.MinStorageBytesPercentage = f64
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentSourceSelectionCriteria(v **types.SourceSelectionCriteria, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.SourceSelectionCriteria
if *v == nil {
sv = &types.SourceSelectionCriteria{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("ReplicaModifications", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentReplicaModifications(&sv.ReplicaModifications, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("SseKmsEncryptedObjects", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentSseKmsEncryptedObjects(&sv.SseKmsEncryptedObjects, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentSSEKMS(v **types.SSEKMS, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.SSEKMS
if *v == nil {
sv = &types.SSEKMS{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("KeyId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.KeyId = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentSseKmsEncryptedObjects(v **types.SseKmsEncryptedObjects, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.SseKmsEncryptedObjects
if *v == nil {
sv = &types.SseKmsEncryptedObjects{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Status", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Status = types.SseKmsEncryptedObjectsStatus(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentSSEKMSEncryption(v **types.SSEKMSEncryption, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.SSEKMSEncryption
if *v == nil {
sv = &types.SSEKMSEncryption{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("KeyId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.KeyId = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentSSES3(v **types.SSES3, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.SSES3
if *v == nil {
sv = &types.SSES3{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentSSES3Encryption(v **types.SSES3Encryption, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.SSES3Encryption
if *v == nil {
sv = &types.SSES3Encryption{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentStorageLensAwsOrg(v **types.StorageLensAwsOrg, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.StorageLensAwsOrg
if *v == nil {
sv = &types.StorageLensAwsOrg{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Arn", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Arn = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentStorageLensConfiguration(v **types.StorageLensConfiguration, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.StorageLensConfiguration
if *v == nil {
sv = &types.StorageLensConfiguration{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("AccountLevel", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentAccountLevel(&sv.AccountLevel, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("AwsOrg", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentStorageLensAwsOrg(&sv.AwsOrg, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("DataExport", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentStorageLensDataExport(&sv.DataExport, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Exclude", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentExclude(&sv.Exclude, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Id", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Id = ptr.String(xtv)
}
case strings.EqualFold("Include", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentInclude(&sv.Include, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("IsEnabled", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv, err := strconv.ParseBool(string(val))
if err != nil {
return fmt.Errorf("expected IsEnabled to be of type *bool, got %T instead", val)
}
sv.IsEnabled = xtv
}
case strings.EqualFold("StorageLensArn", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.StorageLensArn = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentStorageLensConfigurationList(v *[]types.ListStorageLensConfigurationEntry, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.ListStorageLensConfigurationEntry
if *v == nil {
sv = make([]types.ListStorageLensConfigurationEntry, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("StorageLensConfiguration", t.Name.Local):
var col types.ListStorageLensConfigurationEntry
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &col
if err := awsRestxml_deserializeDocumentListStorageLensConfigurationEntry(&destAddr, nodeDecoder); err != nil {
return err
}
col = *destAddr
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentStorageLensConfigurationListUnwrapped(v *[]types.ListStorageLensConfigurationEntry, decoder smithyxml.NodeDecoder) error {
var sv []types.ListStorageLensConfigurationEntry
if *v == nil {
sv = make([]types.ListStorageLensConfigurationEntry, 0)
} else {
sv = *v
}
switch {
default:
var mv types.ListStorageLensConfigurationEntry
t := decoder.StartEl
_ = t
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentListStorageLensConfigurationEntry(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentStorageLensDataExport(v **types.StorageLensDataExport, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.StorageLensDataExport
if *v == nil {
sv = &types.StorageLensDataExport{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("CloudWatchMetrics", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentCloudWatchMetrics(&sv.CloudWatchMetrics, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("S3BucketDestination", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentS3BucketDestination(&sv.S3BucketDestination, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentStorageLensDataExportEncryption(v **types.StorageLensDataExportEncryption, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.StorageLensDataExportEncryption
if *v == nil {
sv = &types.StorageLensDataExportEncryption{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("SSE-KMS", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentSSEKMS(&sv.SSEKMS, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("SSE-S3", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsRestxml_deserializeDocumentSSES3(&sv.SSES3, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentStorageLensTag(v **types.StorageLensTag, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.StorageLensTag
if *v == nil {
sv = &types.StorageLensTag{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Key", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Key = ptr.String(xtv)
}
case strings.EqualFold("Value", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Value = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentStorageLensTags(v *[]types.StorageLensTag, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.StorageLensTag
if *v == nil {
sv = make([]types.StorageLensTag, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("Tag", t.Name.Local):
var col types.StorageLensTag
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &col
if err := awsRestxml_deserializeDocumentStorageLensTag(&destAddr, nodeDecoder); err != nil {
return err
}
col = *destAddr
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentStorageLensTagsUnwrapped(v *[]types.StorageLensTag, decoder smithyxml.NodeDecoder) error {
var sv []types.StorageLensTag
if *v == nil {
sv = make([]types.StorageLensTag, 0)
} else {
sv = *v
}
switch {
default:
var mv types.StorageLensTag
t := decoder.StartEl
_ = t
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentStorageLensTag(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentTooManyRequestsException(v **types.TooManyRequestsException, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.TooManyRequestsException
if *v == nil {
sv = &types.TooManyRequestsException{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Message", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Message = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.TooManyTagsException
if *v == nil {
sv = &types.TooManyTagsException{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Message", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Message = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentTransition(v **types.Transition, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.Transition
if *v == nil {
sv = &types.Transition{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Date", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.Date = ptr.Time(t)
}
case strings.EqualFold("Days", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.Days = int32(i64)
}
case strings.EqualFold("StorageClass", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.StorageClass = types.TransitionStorageClass(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentTransitionList(v *[]types.Transition, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv []types.Transition
if *v == nil {
sv = make([]types.Transition, 0)
} else {
sv = *v
}
originalDecoder := decoder
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
switch {
case strings.EqualFold("Transition", t.Name.Local):
var col types.Transition
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &col
if err := awsRestxml_deserializeDocumentTransition(&destAddr, nodeDecoder); err != nil {
return err
}
col = *destAddr
sv = append(sv, col)
default:
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentTransitionListUnwrapped(v *[]types.Transition, decoder smithyxml.NodeDecoder) error {
var sv []types.Transition
if *v == nil {
sv = make([]types.Transition, 0)
} else {
sv = *v
}
switch {
default:
var mv types.Transition
t := decoder.StartEl
_ = t
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
destAddr := &mv
if err := awsRestxml_deserializeDocumentTransition(&destAddr, nodeDecoder); err != nil {
return err
}
mv = *destAddr
sv = append(sv, mv)
}
*v = sv
return nil
}
func awsRestxml_deserializeDocumentVpcConfiguration(v **types.VpcConfiguration, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.VpcConfiguration
if *v == nil {
sv = &types.VpcConfiguration{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("VpcId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.VpcId = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
| 18,187 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package s3control provides the API client, operations, and parameter types for
// AWS S3 Control.
//
// Amazon Web Services S3 Control provides access to Amazon S3 control plane
// actions.
package s3control
| 9 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
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/s3control/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 = "s3"
}
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
}
}
if options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateUnset {
if options.UseDualstack {
options.EndpointOptions.UseDualStackEndpoint = aws.DualStackEndpointStateEnabled
} else {
options.EndpointOptions.UseDualStackEndpoint = aws.DualStackEndpointStateDisabled
}
}
}
| 209 |
aws-sdk-go-v2 | aws | Go | // Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.
package s3control
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.31.7"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyxml "github.com/aws/smithy-go/encoding/xml"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"math"
)
type awsRestxml_serializeOpCreateAccessPoint struct {
}
func (*awsRestxml_serializeOpCreateAccessPoint) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpCreateAccessPoint) 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.(*CreateAccessPointInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspoint/{Name}")
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 := awsRestxml_serializeOpHttpBindingsCreateAccessPointInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/xml")
xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "CreateAccessPointRequest",
},
Attr: rootAttr,
}
root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/"))
if err := awsRestxml_serializeOpDocumentCreateAccessPointInput(input, xmlEncoder.RootElement(root)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsCreateAccessPointInput(v *CreateAccessPointInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeOpDocumentCreateAccessPointInput(v *CreateAccessPointInput, value smithyxml.Value) error {
defer value.Close()
if v.Bucket != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Bucket",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Bucket)
}
if v.BucketAccountId != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "BucketAccountId",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.BucketAccountId)
}
if v.PublicAccessBlockConfiguration != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "PublicAccessBlockConfiguration",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentPublicAccessBlockConfiguration(v.PublicAccessBlockConfiguration, el); err != nil {
return err
}
}
if v.VpcConfiguration != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "VpcConfiguration",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentVpcConfiguration(v.VpcConfiguration, el); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpCreateAccessPointForObjectLambda struct {
}
func (*awsRestxml_serializeOpCreateAccessPointForObjectLambda) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpCreateAccessPointForObjectLambda) 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.(*CreateAccessPointForObjectLambdaInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}")
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 := awsRestxml_serializeOpHttpBindingsCreateAccessPointForObjectLambdaInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/xml")
xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "CreateAccessPointForObjectLambdaRequest",
},
Attr: rootAttr,
}
root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/"))
if err := awsRestxml_serializeOpDocumentCreateAccessPointForObjectLambdaInput(input, xmlEncoder.RootElement(root)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsCreateAccessPointForObjectLambdaInput(v *CreateAccessPointForObjectLambdaInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeOpDocumentCreateAccessPointForObjectLambdaInput(v *CreateAccessPointForObjectLambdaInput, value smithyxml.Value) error {
defer value.Close()
if v.Configuration != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Configuration",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentObjectLambdaConfiguration(v.Configuration, el); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpCreateBucket struct {
}
func (*awsRestxml_serializeOpCreateBucket) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpCreateBucket) 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.(*CreateBucketInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}")
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 := awsRestxml_serializeOpHttpBindingsCreateBucketInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if input.CreateBucketConfiguration != nil {
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("application/xml")
}
xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
payloadRootAttr := []smithyxml.Attr{}
payloadRoot := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "CreateBucketConfiguration",
},
Attr: payloadRootAttr,
}
payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/"))
if err := awsRestxml_serializeDocumentCreateBucketConfiguration(input.CreateBucketConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
payload := bytes.NewReader(xmlEncoder.Bytes())
if request, err = request.SetStream(payload); 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 awsRestxml_serializeOpHttpBindingsCreateBucketInput(v *CreateBucketInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if len(v.ACL) > 0 {
locationName := "X-Amz-Acl"
encoder.SetHeader(locationName).String(string(v.ACL))
}
if v.Bucket == nil || len(*v.Bucket) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")}
}
if v.Bucket != nil {
if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil {
return err
}
}
if v.GrantFullControl != nil && len(*v.GrantFullControl) > 0 {
locationName := "X-Amz-Grant-Full-Control"
encoder.SetHeader(locationName).String(*v.GrantFullControl)
}
if v.GrantRead != nil && len(*v.GrantRead) > 0 {
locationName := "X-Amz-Grant-Read"
encoder.SetHeader(locationName).String(*v.GrantRead)
}
if v.GrantReadACP != nil && len(*v.GrantReadACP) > 0 {
locationName := "X-Amz-Grant-Read-Acp"
encoder.SetHeader(locationName).String(*v.GrantReadACP)
}
if v.GrantWrite != nil && len(*v.GrantWrite) > 0 {
locationName := "X-Amz-Grant-Write"
encoder.SetHeader(locationName).String(*v.GrantWrite)
}
if v.GrantWriteACP != nil && len(*v.GrantWriteACP) > 0 {
locationName := "X-Amz-Grant-Write-Acp"
encoder.SetHeader(locationName).String(*v.GrantWriteACP)
}
if v.ObjectLockEnabledForBucket {
locationName := "X-Amz-Bucket-Object-Lock-Enabled"
encoder.SetHeader(locationName).Boolean(v.ObjectLockEnabledForBucket)
}
if v.OutpostId != nil && len(*v.OutpostId) > 0 {
locationName := "X-Amz-Outpost-Id"
encoder.SetHeader(locationName).String(*v.OutpostId)
}
return nil
}
type awsRestxml_serializeOpCreateJob struct {
}
func (*awsRestxml_serializeOpCreateJob) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpCreateJob) 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.(*CreateJobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/jobs")
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 := awsRestxml_serializeOpHttpBindingsCreateJobInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/xml")
xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "CreateJobRequest",
},
Attr: rootAttr,
}
root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/"))
if err := awsRestxml_serializeOpDocumentCreateJobInput(input, xmlEncoder.RootElement(root)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsCreateJobInput(v *CreateJobInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
return nil
}
func awsRestxml_serializeOpDocumentCreateJobInput(v *CreateJobInput, value smithyxml.Value) error {
defer value.Close()
if v.ClientRequestToken != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ClientRequestToken",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.ClientRequestToken)
}
if v.ConfirmationRequired != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ConfirmationRequired",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(*v.ConfirmationRequired)
}
if v.Description != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Description",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Description)
}
if v.Manifest != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Manifest",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentJobManifest(v.Manifest, el); err != nil {
return err
}
}
if v.ManifestGenerator != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ManifestGenerator",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentJobManifestGenerator(v.ManifestGenerator, el); err != nil {
return err
}
}
if v.Operation != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Operation",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentJobOperation(v.Operation, el); err != nil {
return err
}
}
if v.Priority != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Priority",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Integer(*v.Priority)
}
if v.Report != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Report",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentJobReport(v.Report, el); err != nil {
return err
}
}
if v.RoleArn != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "RoleArn",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.RoleArn)
}
if v.Tags != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Tags",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3TagSet(v.Tags, el); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpCreateMultiRegionAccessPoint struct {
}
func (*awsRestxml_serializeOpCreateMultiRegionAccessPoint) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpCreateMultiRegionAccessPoint) 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.(*CreateMultiRegionAccessPointInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/async-requests/mrap/create")
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 := awsRestxml_serializeOpHttpBindingsCreateMultiRegionAccessPointInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/xml")
xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "CreateMultiRegionAccessPointRequest",
},
Attr: rootAttr,
}
root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/"))
if err := awsRestxml_serializeOpDocumentCreateMultiRegionAccessPointInput(input, xmlEncoder.RootElement(root)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsCreateMultiRegionAccessPointInput(v *CreateMultiRegionAccessPointInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
return nil
}
func awsRestxml_serializeOpDocumentCreateMultiRegionAccessPointInput(v *CreateMultiRegionAccessPointInput, value smithyxml.Value) error {
defer value.Close()
if v.ClientToken != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ClientToken",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.ClientToken)
}
if v.Details != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Details",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentCreateMultiRegionAccessPointInput(v.Details, el); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpDeleteAccessPoint struct {
}
func (*awsRestxml_serializeOpDeleteAccessPoint) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpDeleteAccessPoint) 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.(*DeleteAccessPointInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspoint/{Name}")
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 := awsRestxml_serializeOpHttpBindingsDeleteAccessPointInput(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 awsRestxml_serializeOpHttpBindingsDeleteAccessPointInput(v *DeleteAccessPointInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpDeleteAccessPointForObjectLambda struct {
}
func (*awsRestxml_serializeOpDeleteAccessPointForObjectLambda) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpDeleteAccessPointForObjectLambda) 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.(*DeleteAccessPointForObjectLambdaInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}")
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 := awsRestxml_serializeOpHttpBindingsDeleteAccessPointForObjectLambdaInput(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 awsRestxml_serializeOpHttpBindingsDeleteAccessPointForObjectLambdaInput(v *DeleteAccessPointForObjectLambdaInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpDeleteAccessPointPolicy struct {
}
func (*awsRestxml_serializeOpDeleteAccessPointPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpDeleteAccessPointPolicy) 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.(*DeleteAccessPointPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspoint/{Name}/policy")
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 := awsRestxml_serializeOpHttpBindingsDeleteAccessPointPolicyInput(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 awsRestxml_serializeOpHttpBindingsDeleteAccessPointPolicyInput(v *DeleteAccessPointPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpDeleteAccessPointPolicyForObjectLambda struct {
}
func (*awsRestxml_serializeOpDeleteAccessPointPolicyForObjectLambda) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpDeleteAccessPointPolicyForObjectLambda) 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.(*DeleteAccessPointPolicyForObjectLambdaInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}/policy")
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 := awsRestxml_serializeOpHttpBindingsDeleteAccessPointPolicyForObjectLambdaInput(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 awsRestxml_serializeOpHttpBindingsDeleteAccessPointPolicyForObjectLambdaInput(v *DeleteAccessPointPolicyForObjectLambdaInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpDeleteBucket struct {
}
func (*awsRestxml_serializeOpDeleteBucket) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpDeleteBucket) 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.(*DeleteBucketInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}")
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 := awsRestxml_serializeOpHttpBindingsDeleteBucketInput(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 awsRestxml_serializeOpHttpBindingsDeleteBucketInput(v *DeleteBucketInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Bucket == nil || len(*v.Bucket) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")}
}
if v.Bucket != nil {
if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpDeleteBucketLifecycleConfiguration struct {
}
func (*awsRestxml_serializeOpDeleteBucketLifecycleConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpDeleteBucketLifecycleConfiguration) 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.(*DeleteBucketLifecycleConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/lifecycleconfiguration")
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 := awsRestxml_serializeOpHttpBindingsDeleteBucketLifecycleConfigurationInput(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 awsRestxml_serializeOpHttpBindingsDeleteBucketLifecycleConfigurationInput(v *DeleteBucketLifecycleConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Bucket == nil || len(*v.Bucket) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")}
}
if v.Bucket != nil {
if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpDeleteBucketPolicy struct {
}
func (*awsRestxml_serializeOpDeleteBucketPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpDeleteBucketPolicy) 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.(*DeleteBucketPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/policy")
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 := awsRestxml_serializeOpHttpBindingsDeleteBucketPolicyInput(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 awsRestxml_serializeOpHttpBindingsDeleteBucketPolicyInput(v *DeleteBucketPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Bucket == nil || len(*v.Bucket) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")}
}
if v.Bucket != nil {
if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpDeleteBucketReplication struct {
}
func (*awsRestxml_serializeOpDeleteBucketReplication) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpDeleteBucketReplication) 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.(*DeleteBucketReplicationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/replication")
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 := awsRestxml_serializeOpHttpBindingsDeleteBucketReplicationInput(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 awsRestxml_serializeOpHttpBindingsDeleteBucketReplicationInput(v *DeleteBucketReplicationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Bucket == nil || len(*v.Bucket) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")}
}
if v.Bucket != nil {
if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpDeleteBucketTagging struct {
}
func (*awsRestxml_serializeOpDeleteBucketTagging) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpDeleteBucketTagging) 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.(*DeleteBucketTaggingInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/tagging")
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 := awsRestxml_serializeOpHttpBindingsDeleteBucketTaggingInput(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 awsRestxml_serializeOpHttpBindingsDeleteBucketTaggingInput(v *DeleteBucketTaggingInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Bucket == nil || len(*v.Bucket) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")}
}
if v.Bucket != nil {
if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpDeleteJobTagging struct {
}
func (*awsRestxml_serializeOpDeleteJobTagging) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpDeleteJobTagging) 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.(*DeleteJobTaggingInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/jobs/{JobId}/tagging")
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 := awsRestxml_serializeOpHttpBindingsDeleteJobTaggingInput(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 awsRestxml_serializeOpHttpBindingsDeleteJobTaggingInput(v *DeleteJobTaggingInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.JobId == nil || len(*v.JobId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member JobId must not be empty")}
}
if v.JobId != nil {
if err := encoder.SetURI("JobId").String(*v.JobId); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpDeleteMultiRegionAccessPoint struct {
}
func (*awsRestxml_serializeOpDeleteMultiRegionAccessPoint) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpDeleteMultiRegionAccessPoint) 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.(*DeleteMultiRegionAccessPointInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/async-requests/mrap/delete")
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 := awsRestxml_serializeOpHttpBindingsDeleteMultiRegionAccessPointInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/xml")
xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "DeleteMultiRegionAccessPointRequest",
},
Attr: rootAttr,
}
root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/"))
if err := awsRestxml_serializeOpDocumentDeleteMultiRegionAccessPointInput(input, xmlEncoder.RootElement(root)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsDeleteMultiRegionAccessPointInput(v *DeleteMultiRegionAccessPointInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
return nil
}
func awsRestxml_serializeOpDocumentDeleteMultiRegionAccessPointInput(v *DeleteMultiRegionAccessPointInput, value smithyxml.Value) error {
defer value.Close()
if v.ClientToken != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ClientToken",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.ClientToken)
}
if v.Details != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Details",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentDeleteMultiRegionAccessPointInput(v.Details, el); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpDeletePublicAccessBlock struct {
}
func (*awsRestxml_serializeOpDeletePublicAccessBlock) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpDeletePublicAccessBlock) 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.(*DeletePublicAccessBlockInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/configuration/publicAccessBlock")
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 := awsRestxml_serializeOpHttpBindingsDeletePublicAccessBlockInput(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 awsRestxml_serializeOpHttpBindingsDeletePublicAccessBlockInput(v *DeletePublicAccessBlockInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
return nil
}
type awsRestxml_serializeOpDeleteStorageLensConfiguration struct {
}
func (*awsRestxml_serializeOpDeleteStorageLensConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpDeleteStorageLensConfiguration) 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.(*DeleteStorageLensConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelens/{ConfigId}")
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 := awsRestxml_serializeOpHttpBindingsDeleteStorageLensConfigurationInput(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 awsRestxml_serializeOpHttpBindingsDeleteStorageLensConfigurationInput(v *DeleteStorageLensConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.ConfigId == nil || len(*v.ConfigId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigId must not be empty")}
}
if v.ConfigId != nil {
if err := encoder.SetURI("ConfigId").String(*v.ConfigId); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpDeleteStorageLensConfigurationTagging struct {
}
func (*awsRestxml_serializeOpDeleteStorageLensConfigurationTagging) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpDeleteStorageLensConfigurationTagging) 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.(*DeleteStorageLensConfigurationTaggingInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelens/{ConfigId}/tagging")
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 := awsRestxml_serializeOpHttpBindingsDeleteStorageLensConfigurationTaggingInput(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 awsRestxml_serializeOpHttpBindingsDeleteStorageLensConfigurationTaggingInput(v *DeleteStorageLensConfigurationTaggingInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.ConfigId == nil || len(*v.ConfigId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigId must not be empty")}
}
if v.ConfigId != nil {
if err := encoder.SetURI("ConfigId").String(*v.ConfigId); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpDescribeJob struct {
}
func (*awsRestxml_serializeOpDescribeJob) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpDescribeJob) 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.(*DescribeJobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/jobs/{JobId}")
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 := awsRestxml_serializeOpHttpBindingsDescribeJobInput(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 awsRestxml_serializeOpHttpBindingsDescribeJobInput(v *DescribeJobInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.JobId == nil || len(*v.JobId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member JobId must not be empty")}
}
if v.JobId != nil {
if err := encoder.SetURI("JobId").String(*v.JobId); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpDescribeMultiRegionAccessPointOperation struct {
}
func (*awsRestxml_serializeOpDescribeMultiRegionAccessPointOperation) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpDescribeMultiRegionAccessPointOperation) 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.(*DescribeMultiRegionAccessPointOperationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/async-requests/mrap/{RequestTokenARN+}")
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 := awsRestxml_serializeOpHttpBindingsDescribeMultiRegionAccessPointOperationInput(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 awsRestxml_serializeOpHttpBindingsDescribeMultiRegionAccessPointOperationInput(v *DescribeMultiRegionAccessPointOperationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.RequestTokenARN == nil || len(*v.RequestTokenARN) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member RequestTokenARN must not be empty")}
}
if v.RequestTokenARN != nil {
if err := encoder.SetURI("RequestTokenARN").String(*v.RequestTokenARN); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpGetAccessPoint struct {
}
func (*awsRestxml_serializeOpGetAccessPoint) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetAccessPoint) 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.(*GetAccessPointInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspoint/{Name}")
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 := awsRestxml_serializeOpHttpBindingsGetAccessPointInput(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 awsRestxml_serializeOpHttpBindingsGetAccessPointInput(v *GetAccessPointInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpGetAccessPointConfigurationForObjectLambda struct {
}
func (*awsRestxml_serializeOpGetAccessPointConfigurationForObjectLambda) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetAccessPointConfigurationForObjectLambda) 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.(*GetAccessPointConfigurationForObjectLambdaInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}/configuration")
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 := awsRestxml_serializeOpHttpBindingsGetAccessPointConfigurationForObjectLambdaInput(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 awsRestxml_serializeOpHttpBindingsGetAccessPointConfigurationForObjectLambdaInput(v *GetAccessPointConfigurationForObjectLambdaInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpGetAccessPointForObjectLambda struct {
}
func (*awsRestxml_serializeOpGetAccessPointForObjectLambda) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetAccessPointForObjectLambda) 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.(*GetAccessPointForObjectLambdaInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}")
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 := awsRestxml_serializeOpHttpBindingsGetAccessPointForObjectLambdaInput(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 awsRestxml_serializeOpHttpBindingsGetAccessPointForObjectLambdaInput(v *GetAccessPointForObjectLambdaInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpGetAccessPointPolicy struct {
}
func (*awsRestxml_serializeOpGetAccessPointPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetAccessPointPolicy) 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.(*GetAccessPointPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspoint/{Name}/policy")
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 := awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyInput(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 awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyInput(v *GetAccessPointPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpGetAccessPointPolicyForObjectLambda struct {
}
func (*awsRestxml_serializeOpGetAccessPointPolicyForObjectLambda) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetAccessPointPolicyForObjectLambda) 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.(*GetAccessPointPolicyForObjectLambdaInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}/policy")
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 := awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyForObjectLambdaInput(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 awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyForObjectLambdaInput(v *GetAccessPointPolicyForObjectLambdaInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpGetAccessPointPolicyStatus struct {
}
func (*awsRestxml_serializeOpGetAccessPointPolicyStatus) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetAccessPointPolicyStatus) 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.(*GetAccessPointPolicyStatusInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspoint/{Name}/policyStatus")
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 := awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyStatusInput(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 awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyStatusInput(v *GetAccessPointPolicyStatusInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpGetAccessPointPolicyStatusForObjectLambda struct {
}
func (*awsRestxml_serializeOpGetAccessPointPolicyStatusForObjectLambda) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetAccessPointPolicyStatusForObjectLambda) 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.(*GetAccessPointPolicyStatusForObjectLambdaInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}/policyStatus")
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 := awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyStatusForObjectLambdaInput(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 awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyStatusForObjectLambdaInput(v *GetAccessPointPolicyStatusForObjectLambdaInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpGetBucket struct {
}
func (*awsRestxml_serializeOpGetBucket) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetBucket) 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.(*GetBucketInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}")
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 := awsRestxml_serializeOpHttpBindingsGetBucketInput(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 awsRestxml_serializeOpHttpBindingsGetBucketInput(v *GetBucketInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Bucket == nil || len(*v.Bucket) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")}
}
if v.Bucket != nil {
if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpGetBucketLifecycleConfiguration struct {
}
func (*awsRestxml_serializeOpGetBucketLifecycleConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetBucketLifecycleConfiguration) 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.(*GetBucketLifecycleConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/lifecycleconfiguration")
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 := awsRestxml_serializeOpHttpBindingsGetBucketLifecycleConfigurationInput(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 awsRestxml_serializeOpHttpBindingsGetBucketLifecycleConfigurationInput(v *GetBucketLifecycleConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Bucket == nil || len(*v.Bucket) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")}
}
if v.Bucket != nil {
if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpGetBucketPolicy struct {
}
func (*awsRestxml_serializeOpGetBucketPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetBucketPolicy) 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.(*GetBucketPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/policy")
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 := awsRestxml_serializeOpHttpBindingsGetBucketPolicyInput(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 awsRestxml_serializeOpHttpBindingsGetBucketPolicyInput(v *GetBucketPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Bucket == nil || len(*v.Bucket) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")}
}
if v.Bucket != nil {
if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpGetBucketReplication struct {
}
func (*awsRestxml_serializeOpGetBucketReplication) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetBucketReplication) 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.(*GetBucketReplicationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/replication")
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 := awsRestxml_serializeOpHttpBindingsGetBucketReplicationInput(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 awsRestxml_serializeOpHttpBindingsGetBucketReplicationInput(v *GetBucketReplicationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Bucket == nil || len(*v.Bucket) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")}
}
if v.Bucket != nil {
if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpGetBucketTagging struct {
}
func (*awsRestxml_serializeOpGetBucketTagging) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetBucketTagging) 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.(*GetBucketTaggingInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/tagging")
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 := awsRestxml_serializeOpHttpBindingsGetBucketTaggingInput(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 awsRestxml_serializeOpHttpBindingsGetBucketTaggingInput(v *GetBucketTaggingInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Bucket == nil || len(*v.Bucket) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")}
}
if v.Bucket != nil {
if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpGetBucketVersioning struct {
}
func (*awsRestxml_serializeOpGetBucketVersioning) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetBucketVersioning) 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.(*GetBucketVersioningInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/versioning")
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 := awsRestxml_serializeOpHttpBindingsGetBucketVersioningInput(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 awsRestxml_serializeOpHttpBindingsGetBucketVersioningInput(v *GetBucketVersioningInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Bucket == nil || len(*v.Bucket) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")}
}
if v.Bucket != nil {
if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpGetJobTagging struct {
}
func (*awsRestxml_serializeOpGetJobTagging) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetJobTagging) 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.(*GetJobTaggingInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/jobs/{JobId}/tagging")
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 := awsRestxml_serializeOpHttpBindingsGetJobTaggingInput(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 awsRestxml_serializeOpHttpBindingsGetJobTaggingInput(v *GetJobTaggingInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.JobId == nil || len(*v.JobId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member JobId must not be empty")}
}
if v.JobId != nil {
if err := encoder.SetURI("JobId").String(*v.JobId); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpGetMultiRegionAccessPoint struct {
}
func (*awsRestxml_serializeOpGetMultiRegionAccessPoint) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetMultiRegionAccessPoint) 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.(*GetMultiRegionAccessPointInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/mrap/instances/{Name+}")
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 := awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointInput(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 awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointInput(v *GetMultiRegionAccessPointInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpGetMultiRegionAccessPointPolicy struct {
}
func (*awsRestxml_serializeOpGetMultiRegionAccessPointPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetMultiRegionAccessPointPolicy) 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.(*GetMultiRegionAccessPointPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/mrap/instances/{Name+}/policy")
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 := awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointPolicyInput(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 awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointPolicyInput(v *GetMultiRegionAccessPointPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpGetMultiRegionAccessPointPolicyStatus struct {
}
func (*awsRestxml_serializeOpGetMultiRegionAccessPointPolicyStatus) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetMultiRegionAccessPointPolicyStatus) 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.(*GetMultiRegionAccessPointPolicyStatusInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/mrap/instances/{Name+}/policystatus")
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 := awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointPolicyStatusInput(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 awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointPolicyStatusInput(v *GetMultiRegionAccessPointPolicyStatusInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpGetMultiRegionAccessPointRoutes struct {
}
func (*awsRestxml_serializeOpGetMultiRegionAccessPointRoutes) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetMultiRegionAccessPointRoutes) 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.(*GetMultiRegionAccessPointRoutesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/mrap/instances/{Mrap+}/routes")
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 := awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointRoutesInput(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 awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointRoutesInput(v *GetMultiRegionAccessPointRoutesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Mrap == nil || len(*v.Mrap) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Mrap must not be empty")}
}
if v.Mrap != nil {
if err := encoder.SetURI("Mrap").String(*v.Mrap); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpGetPublicAccessBlock struct {
}
func (*awsRestxml_serializeOpGetPublicAccessBlock) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetPublicAccessBlock) 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.(*GetPublicAccessBlockInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/configuration/publicAccessBlock")
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 := awsRestxml_serializeOpHttpBindingsGetPublicAccessBlockInput(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 awsRestxml_serializeOpHttpBindingsGetPublicAccessBlockInput(v *GetPublicAccessBlockInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
return nil
}
type awsRestxml_serializeOpGetStorageLensConfiguration struct {
}
func (*awsRestxml_serializeOpGetStorageLensConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetStorageLensConfiguration) 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.(*GetStorageLensConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelens/{ConfigId}")
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 := awsRestxml_serializeOpHttpBindingsGetStorageLensConfigurationInput(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 awsRestxml_serializeOpHttpBindingsGetStorageLensConfigurationInput(v *GetStorageLensConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.ConfigId == nil || len(*v.ConfigId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigId must not be empty")}
}
if v.ConfigId != nil {
if err := encoder.SetURI("ConfigId").String(*v.ConfigId); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpGetStorageLensConfigurationTagging struct {
}
func (*awsRestxml_serializeOpGetStorageLensConfigurationTagging) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpGetStorageLensConfigurationTagging) 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.(*GetStorageLensConfigurationTaggingInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelens/{ConfigId}/tagging")
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 := awsRestxml_serializeOpHttpBindingsGetStorageLensConfigurationTaggingInput(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 awsRestxml_serializeOpHttpBindingsGetStorageLensConfigurationTaggingInput(v *GetStorageLensConfigurationTaggingInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.ConfigId == nil || len(*v.ConfigId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigId must not be empty")}
}
if v.ConfigId != nil {
if err := encoder.SetURI("ConfigId").String(*v.ConfigId); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpListAccessPoints struct {
}
func (*awsRestxml_serializeOpListAccessPoints) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpListAccessPoints) 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.(*ListAccessPointsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspoint")
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 := awsRestxml_serializeOpHttpBindingsListAccessPointsInput(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 awsRestxml_serializeOpHttpBindingsListAccessPointsInput(v *ListAccessPointsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Bucket != nil {
encoder.SetQuery("bucket").String(*v.Bucket)
}
if v.MaxResults != 0 {
encoder.SetQuery("maxResults").Integer(v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestxml_serializeOpListAccessPointsForObjectLambda struct {
}
func (*awsRestxml_serializeOpListAccessPointsForObjectLambda) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpListAccessPointsForObjectLambda) 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.(*ListAccessPointsForObjectLambdaInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda")
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 := awsRestxml_serializeOpHttpBindingsListAccessPointsForObjectLambdaInput(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 awsRestxml_serializeOpHttpBindingsListAccessPointsForObjectLambdaInput(v *ListAccessPointsForObjectLambdaInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.MaxResults != 0 {
encoder.SetQuery("maxResults").Integer(v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestxml_serializeOpListJobs struct {
}
func (*awsRestxml_serializeOpListJobs) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpListJobs) 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.(*ListJobsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/jobs")
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 := awsRestxml_serializeOpHttpBindingsListJobsInput(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 awsRestxml_serializeOpHttpBindingsListJobsInput(v *ListJobsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.JobStatuses != nil {
for i := range v.JobStatuses {
encoder.AddQuery("jobStatuses").String(string(v.JobStatuses[i]))
}
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestxml_serializeOpListMultiRegionAccessPoints struct {
}
func (*awsRestxml_serializeOpListMultiRegionAccessPoints) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpListMultiRegionAccessPoints) 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.(*ListMultiRegionAccessPointsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/mrap/instances")
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 := awsRestxml_serializeOpHttpBindingsListMultiRegionAccessPointsInput(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 awsRestxml_serializeOpHttpBindingsListMultiRegionAccessPointsInput(v *ListMultiRegionAccessPointsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.MaxResults != 0 {
encoder.SetQuery("maxResults").Integer(v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestxml_serializeOpListRegionalBuckets struct {
}
func (*awsRestxml_serializeOpListRegionalBuckets) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpListRegionalBuckets) 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.(*ListRegionalBucketsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket")
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 := awsRestxml_serializeOpHttpBindingsListRegionalBucketsInput(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 awsRestxml_serializeOpHttpBindingsListRegionalBucketsInput(v *ListRegionalBucketsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.MaxResults != 0 {
encoder.SetQuery("maxResults").Integer(v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.OutpostId != nil && len(*v.OutpostId) > 0 {
locationName := "X-Amz-Outpost-Id"
encoder.SetHeader(locationName).String(*v.OutpostId)
}
return nil
}
type awsRestxml_serializeOpListStorageLensConfigurations struct {
}
func (*awsRestxml_serializeOpListStorageLensConfigurations) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpListStorageLensConfigurations) 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.(*ListStorageLensConfigurationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelens")
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 := awsRestxml_serializeOpHttpBindingsListStorageLensConfigurationsInput(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 awsRestxml_serializeOpHttpBindingsListStorageLensConfigurationsInput(v *ListStorageLensConfigurationsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestxml_serializeOpPutAccessPointConfigurationForObjectLambda struct {
}
func (*awsRestxml_serializeOpPutAccessPointConfigurationForObjectLambda) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpPutAccessPointConfigurationForObjectLambda) 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.(*PutAccessPointConfigurationForObjectLambdaInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}/configuration")
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 := awsRestxml_serializeOpHttpBindingsPutAccessPointConfigurationForObjectLambdaInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/xml")
xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "PutAccessPointConfigurationForObjectLambdaRequest",
},
Attr: rootAttr,
}
root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/"))
if err := awsRestxml_serializeOpDocumentPutAccessPointConfigurationForObjectLambdaInput(input, xmlEncoder.RootElement(root)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsPutAccessPointConfigurationForObjectLambdaInput(v *PutAccessPointConfigurationForObjectLambdaInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeOpDocumentPutAccessPointConfigurationForObjectLambdaInput(v *PutAccessPointConfigurationForObjectLambdaInput, value smithyxml.Value) error {
defer value.Close()
if v.Configuration != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Configuration",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentObjectLambdaConfiguration(v.Configuration, el); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpPutAccessPointPolicy struct {
}
func (*awsRestxml_serializeOpPutAccessPointPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpPutAccessPointPolicy) 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.(*PutAccessPointPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspoint/{Name}/policy")
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 := awsRestxml_serializeOpHttpBindingsPutAccessPointPolicyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/xml")
xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "PutAccessPointPolicyRequest",
},
Attr: rootAttr,
}
root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/"))
if err := awsRestxml_serializeOpDocumentPutAccessPointPolicyInput(input, xmlEncoder.RootElement(root)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsPutAccessPointPolicyInput(v *PutAccessPointPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeOpDocumentPutAccessPointPolicyInput(v *PutAccessPointPolicyInput, value smithyxml.Value) error {
defer value.Close()
if v.Policy != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Policy",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Policy)
}
return nil
}
type awsRestxml_serializeOpPutAccessPointPolicyForObjectLambda struct {
}
func (*awsRestxml_serializeOpPutAccessPointPolicyForObjectLambda) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpPutAccessPointPolicyForObjectLambda) 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.(*PutAccessPointPolicyForObjectLambdaInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}/policy")
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 := awsRestxml_serializeOpHttpBindingsPutAccessPointPolicyForObjectLambdaInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/xml")
xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "PutAccessPointPolicyForObjectLambdaRequest",
},
Attr: rootAttr,
}
root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/"))
if err := awsRestxml_serializeOpDocumentPutAccessPointPolicyForObjectLambdaInput(input, xmlEncoder.RootElement(root)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsPutAccessPointPolicyForObjectLambdaInput(v *PutAccessPointPolicyForObjectLambdaInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeOpDocumentPutAccessPointPolicyForObjectLambdaInput(v *PutAccessPointPolicyForObjectLambdaInput, value smithyxml.Value) error {
defer value.Close()
if v.Policy != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Policy",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Policy)
}
return nil
}
type awsRestxml_serializeOpPutBucketLifecycleConfiguration struct {
}
func (*awsRestxml_serializeOpPutBucketLifecycleConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpPutBucketLifecycleConfiguration) 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.(*PutBucketLifecycleConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/lifecycleconfiguration")
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 := awsRestxml_serializeOpHttpBindingsPutBucketLifecycleConfigurationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if input.LifecycleConfiguration != nil {
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("application/xml")
}
xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
payloadRootAttr := []smithyxml.Attr{}
payloadRoot := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "LifecycleConfiguration",
},
Attr: payloadRootAttr,
}
payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/"))
if err := awsRestxml_serializeDocumentLifecycleConfiguration(input.LifecycleConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
payload := bytes.NewReader(xmlEncoder.Bytes())
if request, err = request.SetStream(payload); 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 awsRestxml_serializeOpHttpBindingsPutBucketLifecycleConfigurationInput(v *PutBucketLifecycleConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Bucket == nil || len(*v.Bucket) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")}
}
if v.Bucket != nil {
if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpPutBucketPolicy struct {
}
func (*awsRestxml_serializeOpPutBucketPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpPutBucketPolicy) 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.(*PutBucketPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/policy")
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 := awsRestxml_serializeOpHttpBindingsPutBucketPolicyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/xml")
xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "PutBucketPolicyRequest",
},
Attr: rootAttr,
}
root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/"))
if err := awsRestxml_serializeOpDocumentPutBucketPolicyInput(input, xmlEncoder.RootElement(root)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsPutBucketPolicyInput(v *PutBucketPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Bucket == nil || len(*v.Bucket) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")}
}
if v.Bucket != nil {
if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil {
return err
}
}
if v.ConfirmRemoveSelfBucketAccess {
locationName := "X-Amz-Confirm-Remove-Self-Bucket-Access"
encoder.SetHeader(locationName).Boolean(v.ConfirmRemoveSelfBucketAccess)
}
return nil
}
func awsRestxml_serializeOpDocumentPutBucketPolicyInput(v *PutBucketPolicyInput, value smithyxml.Value) error {
defer value.Close()
if v.Policy != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Policy",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Policy)
}
return nil
}
type awsRestxml_serializeOpPutBucketReplication struct {
}
func (*awsRestxml_serializeOpPutBucketReplication) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpPutBucketReplication) 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.(*PutBucketReplicationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/replication")
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 := awsRestxml_serializeOpHttpBindingsPutBucketReplicationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if input.ReplicationConfiguration != nil {
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("application/xml")
}
xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
payloadRootAttr := []smithyxml.Attr{}
payloadRoot := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ReplicationConfiguration",
},
Attr: payloadRootAttr,
}
payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/"))
if err := awsRestxml_serializeDocumentReplicationConfiguration(input.ReplicationConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
payload := bytes.NewReader(xmlEncoder.Bytes())
if request, err = request.SetStream(payload); 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 awsRestxml_serializeOpHttpBindingsPutBucketReplicationInput(v *PutBucketReplicationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Bucket == nil || len(*v.Bucket) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")}
}
if v.Bucket != nil {
if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpPutBucketTagging struct {
}
func (*awsRestxml_serializeOpPutBucketTagging) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpPutBucketTagging) 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.(*PutBucketTaggingInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/tagging")
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 := awsRestxml_serializeOpHttpBindingsPutBucketTaggingInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if input.Tagging != nil {
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("application/xml")
}
xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
payloadRootAttr := []smithyxml.Attr{}
payloadRoot := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Tagging",
},
Attr: payloadRootAttr,
}
payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/"))
if err := awsRestxml_serializeDocumentTagging(input.Tagging, xmlEncoder.RootElement(payloadRoot)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
payload := bytes.NewReader(xmlEncoder.Bytes())
if request, err = request.SetStream(payload); 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 awsRestxml_serializeOpHttpBindingsPutBucketTaggingInput(v *PutBucketTaggingInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Bucket == nil || len(*v.Bucket) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")}
}
if v.Bucket != nil {
if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpPutBucketVersioning struct {
}
func (*awsRestxml_serializeOpPutBucketVersioning) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpPutBucketVersioning) 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.(*PutBucketVersioningInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/versioning")
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 := awsRestxml_serializeOpHttpBindingsPutBucketVersioningInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if input.VersioningConfiguration != nil {
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("application/xml")
}
xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
payloadRootAttr := []smithyxml.Attr{}
payloadRoot := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "VersioningConfiguration",
},
Attr: payloadRootAttr,
}
payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/"))
if err := awsRestxml_serializeDocumentVersioningConfiguration(input.VersioningConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
payload := bytes.NewReader(xmlEncoder.Bytes())
if request, err = request.SetStream(payload); 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 awsRestxml_serializeOpHttpBindingsPutBucketVersioningInput(v *PutBucketVersioningInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Bucket == nil || len(*v.Bucket) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")}
}
if v.Bucket != nil {
if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil {
return err
}
}
if v.MFA != nil && len(*v.MFA) > 0 {
locationName := "X-Amz-Mfa"
encoder.SetHeader(locationName).String(*v.MFA)
}
return nil
}
type awsRestxml_serializeOpPutJobTagging struct {
}
func (*awsRestxml_serializeOpPutJobTagging) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpPutJobTagging) 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.(*PutJobTaggingInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/jobs/{JobId}/tagging")
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 := awsRestxml_serializeOpHttpBindingsPutJobTaggingInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/xml")
xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "PutJobTaggingRequest",
},
Attr: rootAttr,
}
root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/"))
if err := awsRestxml_serializeOpDocumentPutJobTaggingInput(input, xmlEncoder.RootElement(root)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsPutJobTaggingInput(v *PutJobTaggingInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.JobId == nil || len(*v.JobId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member JobId must not be empty")}
}
if v.JobId != nil {
if err := encoder.SetURI("JobId").String(*v.JobId); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeOpDocumentPutJobTaggingInput(v *PutJobTaggingInput, value smithyxml.Value) error {
defer value.Close()
if v.Tags != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Tags",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3TagSet(v.Tags, el); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpPutMultiRegionAccessPointPolicy struct {
}
func (*awsRestxml_serializeOpPutMultiRegionAccessPointPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpPutMultiRegionAccessPointPolicy) 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.(*PutMultiRegionAccessPointPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/async-requests/mrap/put-policy")
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 := awsRestxml_serializeOpHttpBindingsPutMultiRegionAccessPointPolicyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/xml")
xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "PutMultiRegionAccessPointPolicyRequest",
},
Attr: rootAttr,
}
root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/"))
if err := awsRestxml_serializeOpDocumentPutMultiRegionAccessPointPolicyInput(input, xmlEncoder.RootElement(root)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsPutMultiRegionAccessPointPolicyInput(v *PutMultiRegionAccessPointPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
return nil
}
func awsRestxml_serializeOpDocumentPutMultiRegionAccessPointPolicyInput(v *PutMultiRegionAccessPointPolicyInput, value smithyxml.Value) error {
defer value.Close()
if v.ClientToken != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ClientToken",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.ClientToken)
}
if v.Details != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Details",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentPutMultiRegionAccessPointPolicyInput(v.Details, el); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpPutPublicAccessBlock struct {
}
func (*awsRestxml_serializeOpPutPublicAccessBlock) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpPutPublicAccessBlock) 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.(*PutPublicAccessBlockInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/configuration/publicAccessBlock")
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 := awsRestxml_serializeOpHttpBindingsPutPublicAccessBlockInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if input.PublicAccessBlockConfiguration != nil {
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("application/xml")
}
xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
payloadRootAttr := []smithyxml.Attr{}
payloadRoot := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "PublicAccessBlockConfiguration",
},
Attr: payloadRootAttr,
}
payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/"))
if err := awsRestxml_serializeDocumentPublicAccessBlockConfiguration(input.PublicAccessBlockConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
payload := bytes.NewReader(xmlEncoder.Bytes())
if request, err = request.SetStream(payload); 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 awsRestxml_serializeOpHttpBindingsPutPublicAccessBlockInput(v *PutPublicAccessBlockInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
return nil
}
type awsRestxml_serializeOpPutStorageLensConfiguration struct {
}
func (*awsRestxml_serializeOpPutStorageLensConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpPutStorageLensConfiguration) 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.(*PutStorageLensConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelens/{ConfigId}")
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 := awsRestxml_serializeOpHttpBindingsPutStorageLensConfigurationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/xml")
xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "PutStorageLensConfigurationRequest",
},
Attr: rootAttr,
}
root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/"))
if err := awsRestxml_serializeOpDocumentPutStorageLensConfigurationInput(input, xmlEncoder.RootElement(root)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsPutStorageLensConfigurationInput(v *PutStorageLensConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.ConfigId == nil || len(*v.ConfigId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigId must not be empty")}
}
if v.ConfigId != nil {
if err := encoder.SetURI("ConfigId").String(*v.ConfigId); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeOpDocumentPutStorageLensConfigurationInput(v *PutStorageLensConfigurationInput, value smithyxml.Value) error {
defer value.Close()
if v.StorageLensConfiguration != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "StorageLensConfiguration",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentStorageLensConfiguration(v.StorageLensConfiguration, el); err != nil {
return err
}
}
if v.Tags != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Tags",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentStorageLensTags(v.Tags, el); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpPutStorageLensConfigurationTagging struct {
}
func (*awsRestxml_serializeOpPutStorageLensConfigurationTagging) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpPutStorageLensConfigurationTagging) 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.(*PutStorageLensConfigurationTaggingInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelens/{ConfigId}/tagging")
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 := awsRestxml_serializeOpHttpBindingsPutStorageLensConfigurationTaggingInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/xml")
xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "PutStorageLensConfigurationTaggingRequest",
},
Attr: rootAttr,
}
root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/"))
if err := awsRestxml_serializeOpDocumentPutStorageLensConfigurationTaggingInput(input, xmlEncoder.RootElement(root)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsPutStorageLensConfigurationTaggingInput(v *PutStorageLensConfigurationTaggingInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.ConfigId == nil || len(*v.ConfigId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigId must not be empty")}
}
if v.ConfigId != nil {
if err := encoder.SetURI("ConfigId").String(*v.ConfigId); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeOpDocumentPutStorageLensConfigurationTaggingInput(v *PutStorageLensConfigurationTaggingInput, value smithyxml.Value) error {
defer value.Close()
if v.Tags != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Tags",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentStorageLensTags(v.Tags, el); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpSubmitMultiRegionAccessPointRoutes struct {
}
func (*awsRestxml_serializeOpSubmitMultiRegionAccessPointRoutes) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpSubmitMultiRegionAccessPointRoutes) 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.(*SubmitMultiRegionAccessPointRoutesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/mrap/instances/{Mrap+}/routes")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PATCH"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestxml_serializeOpHttpBindingsSubmitMultiRegionAccessPointRoutesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/xml")
xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "SubmitMultiRegionAccessPointRoutesRequest",
},
Attr: rootAttr,
}
root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/"))
if err := awsRestxml_serializeOpDocumentSubmitMultiRegionAccessPointRoutesInput(input, xmlEncoder.RootElement(root)); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsSubmitMultiRegionAccessPointRoutesInput(v *SubmitMultiRegionAccessPointRoutesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.Mrap == nil || len(*v.Mrap) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Mrap must not be empty")}
}
if v.Mrap != nil {
if err := encoder.SetURI("Mrap").String(*v.Mrap); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeOpDocumentSubmitMultiRegionAccessPointRoutesInput(v *SubmitMultiRegionAccessPointRoutesInput, value smithyxml.Value) error {
defer value.Close()
if v.RouteUpdates != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "RouteUpdates",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentRouteList(v.RouteUpdates, el); err != nil {
return err
}
}
return nil
}
type awsRestxml_serializeOpUpdateJobPriority struct {
}
func (*awsRestxml_serializeOpUpdateJobPriority) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpUpdateJobPriority) 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.(*UpdateJobPriorityInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/jobs/{JobId}/priority")
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 := awsRestxml_serializeOpHttpBindingsUpdateJobPriorityInput(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 awsRestxml_serializeOpHttpBindingsUpdateJobPriorityInput(v *UpdateJobPriorityInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.JobId == nil || len(*v.JobId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member JobId must not be empty")}
}
if v.JobId != nil {
if err := encoder.SetURI("JobId").String(*v.JobId); err != nil {
return err
}
}
{
encoder.SetQuery("priority").Integer(v.Priority)
}
return nil
}
type awsRestxml_serializeOpUpdateJobStatus struct {
}
func (*awsRestxml_serializeOpUpdateJobStatus) ID() string {
return "OperationSerializer"
}
func (m *awsRestxml_serializeOpUpdateJobStatus) 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.(*UpdateJobStatusInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v20180820/jobs/{JobId}/status")
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 := awsRestxml_serializeOpHttpBindingsUpdateJobStatusInput(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 awsRestxml_serializeOpHttpBindingsUpdateJobStatusInput(v *UpdateJobStatusInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccountId != nil && len(*v.AccountId) > 0 {
locationName := "X-Amz-Account-Id"
encoder.SetHeader(locationName).String(*v.AccountId)
}
if v.JobId == nil || len(*v.JobId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member JobId must not be empty")}
}
if v.JobId != nil {
if err := encoder.SetURI("JobId").String(*v.JobId); err != nil {
return err
}
}
if len(v.RequestedJobStatus) > 0 {
encoder.SetQuery("requestedJobStatus").String(string(v.RequestedJobStatus))
}
if v.StatusUpdateReason != nil {
encoder.SetQuery("statusUpdateReason").String(*v.StatusUpdateReason)
}
return nil
}
func awsRestxml_serializeDocumentAbortIncompleteMultipartUpload(v *types.AbortIncompleteMultipartUpload, value smithyxml.Value) error {
defer value.Close()
if v.DaysAfterInitiation != 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "DaysAfterInitiation",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Integer(v.DaysAfterInitiation)
}
return nil
}
func awsRestxml_serializeDocumentAccessControlTranslation(v *types.AccessControlTranslation, value smithyxml.Value) error {
defer value.Close()
if len(v.Owner) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Owner",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.Owner))
}
return nil
}
func awsRestxml_serializeDocumentAccountLevel(v *types.AccountLevel, value smithyxml.Value) error {
defer value.Close()
if v.ActivityMetrics != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ActivityMetrics",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentActivityMetrics(v.ActivityMetrics, el); err != nil {
return err
}
}
if v.AdvancedCostOptimizationMetrics != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "AdvancedCostOptimizationMetrics",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentAdvancedCostOptimizationMetrics(v.AdvancedCostOptimizationMetrics, el); err != nil {
return err
}
}
if v.AdvancedDataProtectionMetrics != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "AdvancedDataProtectionMetrics",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentAdvancedDataProtectionMetrics(v.AdvancedDataProtectionMetrics, el); err != nil {
return err
}
}
if v.BucketLevel != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "BucketLevel",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentBucketLevel(v.BucketLevel, el); err != nil {
return err
}
}
if v.DetailedStatusCodesMetrics != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "DetailedStatusCodesMetrics",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentDetailedStatusCodesMetrics(v.DetailedStatusCodesMetrics, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentActivityMetrics(v *types.ActivityMetrics, value smithyxml.Value) error {
defer value.Close()
if v.IsEnabled {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "IsEnabled",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(v.IsEnabled)
}
return nil
}
func awsRestxml_serializeDocumentAdvancedCostOptimizationMetrics(v *types.AdvancedCostOptimizationMetrics, value smithyxml.Value) error {
defer value.Close()
if v.IsEnabled {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "IsEnabled",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(v.IsEnabled)
}
return nil
}
func awsRestxml_serializeDocumentAdvancedDataProtectionMetrics(v *types.AdvancedDataProtectionMetrics, value smithyxml.Value) error {
defer value.Close()
if v.IsEnabled {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "IsEnabled",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(v.IsEnabled)
}
return nil
}
func awsRestxml_serializeDocumentAwsLambdaTransformation(v *types.AwsLambdaTransformation, value smithyxml.Value) error {
defer value.Close()
if v.FunctionArn != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "FunctionArn",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.FunctionArn)
}
if v.FunctionPayload != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "FunctionPayload",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.FunctionPayload)
}
return nil
}
func awsRestxml_serializeDocumentBucketLevel(v *types.BucketLevel, value smithyxml.Value) error {
defer value.Close()
if v.ActivityMetrics != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ActivityMetrics",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentActivityMetrics(v.ActivityMetrics, el); err != nil {
return err
}
}
if v.AdvancedCostOptimizationMetrics != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "AdvancedCostOptimizationMetrics",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentAdvancedCostOptimizationMetrics(v.AdvancedCostOptimizationMetrics, el); err != nil {
return err
}
}
if v.AdvancedDataProtectionMetrics != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "AdvancedDataProtectionMetrics",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentAdvancedDataProtectionMetrics(v.AdvancedDataProtectionMetrics, el); err != nil {
return err
}
}
if v.DetailedStatusCodesMetrics != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "DetailedStatusCodesMetrics",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentDetailedStatusCodesMetrics(v.DetailedStatusCodesMetrics, el); err != nil {
return err
}
}
if v.PrefixLevel != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "PrefixLevel",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentPrefixLevel(v.PrefixLevel, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentBuckets(v []string, value smithyxml.Value) error {
var array *smithyxml.Array
if !value.IsFlattened() {
defer value.Close()
}
customMemberNameAttr := []smithyxml.Attr{}
customMemberName := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Arn",
},
Attr: customMemberNameAttr,
}
array = value.ArrayWithCustomName(customMemberName)
for i := range v {
am := array.Member()
am.String(v[i])
}
return nil
}
func awsRestxml_serializeDocumentCloudWatchMetrics(v *types.CloudWatchMetrics, value smithyxml.Value) error {
defer value.Close()
{
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "IsEnabled",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(v.IsEnabled)
}
return nil
}
func awsRestxml_serializeDocumentCreateBucketConfiguration(v *types.CreateBucketConfiguration, value smithyxml.Value) error {
defer value.Close()
if len(v.LocationConstraint) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "LocationConstraint",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.LocationConstraint))
}
return nil
}
func awsRestxml_serializeDocumentCreateMultiRegionAccessPointInput(v *types.CreateMultiRegionAccessPointInput, value smithyxml.Value) error {
defer value.Close()
if v.Name != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Name",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Name)
}
if v.PublicAccessBlock != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "PublicAccessBlock",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentPublicAccessBlockConfiguration(v.PublicAccessBlock, el); err != nil {
return err
}
}
if v.Regions != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Regions",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentRegionCreationList(v.Regions, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentDeleteMarkerReplication(v *types.DeleteMarkerReplication, value smithyxml.Value) error {
defer value.Close()
if len(v.Status) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Status",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.Status))
}
return nil
}
func awsRestxml_serializeDocumentDeleteMultiRegionAccessPointInput(v *types.DeleteMultiRegionAccessPointInput, value smithyxml.Value) error {
defer value.Close()
if v.Name != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Name",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Name)
}
return nil
}
func awsRestxml_serializeDocumentDestination(v *types.Destination, value smithyxml.Value) error {
defer value.Close()
if v.AccessControlTranslation != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "AccessControlTranslation",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentAccessControlTranslation(v.AccessControlTranslation, el); err != nil {
return err
}
}
if v.Account != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Account",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Account)
}
if v.Bucket != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Bucket",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Bucket)
}
if v.EncryptionConfiguration != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "EncryptionConfiguration",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentEncryptionConfiguration(v.EncryptionConfiguration, el); err != nil {
return err
}
}
if v.Metrics != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Metrics",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentMetrics(v.Metrics, el); err != nil {
return err
}
}
if v.ReplicationTime != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ReplicationTime",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentReplicationTime(v.ReplicationTime, el); err != nil {
return err
}
}
if len(v.StorageClass) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "StorageClass",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.StorageClass))
}
return nil
}
func awsRestxml_serializeDocumentDetailedStatusCodesMetrics(v *types.DetailedStatusCodesMetrics, value smithyxml.Value) error {
defer value.Close()
if v.IsEnabled {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "IsEnabled",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(v.IsEnabled)
}
return nil
}
func awsRestxml_serializeDocumentEncryptionConfiguration(v *types.EncryptionConfiguration, value smithyxml.Value) error {
defer value.Close()
if v.ReplicaKmsKeyID != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ReplicaKmsKeyID",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.ReplicaKmsKeyID)
}
return nil
}
func awsRestxml_serializeDocumentExclude(v *types.Exclude, value smithyxml.Value) error {
defer value.Close()
if v.Buckets != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Buckets",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentBuckets(v.Buckets, el); err != nil {
return err
}
}
if v.Regions != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Regions",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentRegions(v.Regions, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentExistingObjectReplication(v *types.ExistingObjectReplication, value smithyxml.Value) error {
defer value.Close()
if len(v.Status) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Status",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.Status))
}
return nil
}
func awsRestxml_serializeDocumentGeneratedManifestEncryption(v *types.GeneratedManifestEncryption, value smithyxml.Value) error {
defer value.Close()
if v.SSEKMS != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "SSE-KMS",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentSSEKMSEncryption(v.SSEKMS, el); err != nil {
return err
}
}
if v.SSES3 != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "SSE-S3",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentSSES3Encryption(v.SSES3, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentInclude(v *types.Include, value smithyxml.Value) error {
defer value.Close()
if v.Buckets != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Buckets",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentBuckets(v.Buckets, el); err != nil {
return err
}
}
if v.Regions != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Regions",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentRegions(v.Regions, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentJobManifest(v *types.JobManifest, value smithyxml.Value) error {
defer value.Close()
if v.Location != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Location",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentJobManifestLocation(v.Location, el); err != nil {
return err
}
}
if v.Spec != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Spec",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentJobManifestSpec(v.Spec, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentJobManifestFieldList(v []types.JobManifestFieldName, value smithyxml.Value) error {
var array *smithyxml.Array
if !value.IsFlattened() {
defer value.Close()
}
array = value.Array()
for i := range v {
am := array.Member()
am.String(string(v[i]))
}
return nil
}
func awsRestxml_serializeDocumentJobManifestGenerator(v types.JobManifestGenerator, value smithyxml.Value) error {
defer value.Close()
switch uv := v.(type) {
case *types.JobManifestGeneratorMemberS3JobManifestGenerator:
customMemberNameAttr := []smithyxml.Attr{}
customMemberName := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "S3JobManifestGenerator",
},
Attr: customMemberNameAttr,
}
av := value.MemberElement(customMemberName)
if err := awsRestxml_serializeDocumentS3JobManifestGenerator(&uv.Value, av); err != nil {
return err
}
default:
return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v)
}
return nil
}
func awsRestxml_serializeDocumentJobManifestGeneratorFilter(v *types.JobManifestGeneratorFilter, value smithyxml.Value) error {
defer value.Close()
if v.CreatedAfter != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "CreatedAfter",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(smithytime.FormatDateTime(*v.CreatedAfter))
}
if v.CreatedBefore != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "CreatedBefore",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(smithytime.FormatDateTime(*v.CreatedBefore))
}
if v.EligibleForReplication != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "EligibleForReplication",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(*v.EligibleForReplication)
}
if v.ObjectReplicationStatuses != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ObjectReplicationStatuses",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentReplicationStatusFilterList(v.ObjectReplicationStatuses, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentJobManifestLocation(v *types.JobManifestLocation, value smithyxml.Value) error {
defer value.Close()
if v.ETag != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ETag",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.ETag)
}
if v.ObjectArn != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ObjectArn",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.ObjectArn)
}
if v.ObjectVersionId != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ObjectVersionId",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.ObjectVersionId)
}
return nil
}
func awsRestxml_serializeDocumentJobManifestSpec(v *types.JobManifestSpec, value smithyxml.Value) error {
defer value.Close()
if v.Fields != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Fields",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentJobManifestFieldList(v.Fields, el); err != nil {
return err
}
}
if len(v.Format) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Format",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.Format))
}
return nil
}
func awsRestxml_serializeDocumentJobOperation(v *types.JobOperation, value smithyxml.Value) error {
defer value.Close()
if v.LambdaInvoke != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "LambdaInvoke",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentLambdaInvokeOperation(v.LambdaInvoke, el); err != nil {
return err
}
}
if v.S3DeleteObjectTagging != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "S3DeleteObjectTagging",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3DeleteObjectTaggingOperation(v.S3DeleteObjectTagging, el); err != nil {
return err
}
}
if v.S3InitiateRestoreObject != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "S3InitiateRestoreObject",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3InitiateRestoreObjectOperation(v.S3InitiateRestoreObject, el); err != nil {
return err
}
}
if v.S3PutObjectAcl != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "S3PutObjectAcl",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3SetObjectAclOperation(v.S3PutObjectAcl, el); err != nil {
return err
}
}
if v.S3PutObjectCopy != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "S3PutObjectCopy",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3CopyObjectOperation(v.S3PutObjectCopy, el); err != nil {
return err
}
}
if v.S3PutObjectLegalHold != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "S3PutObjectLegalHold",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3SetObjectLegalHoldOperation(v.S3PutObjectLegalHold, el); err != nil {
return err
}
}
if v.S3PutObjectRetention != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "S3PutObjectRetention",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3SetObjectRetentionOperation(v.S3PutObjectRetention, el); err != nil {
return err
}
}
if v.S3PutObjectTagging != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "S3PutObjectTagging",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3SetObjectTaggingOperation(v.S3PutObjectTagging, el); err != nil {
return err
}
}
if v.S3ReplicateObject != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "S3ReplicateObject",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3ReplicateObjectOperation(v.S3ReplicateObject, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentJobReport(v *types.JobReport, value smithyxml.Value) error {
defer value.Close()
if v.Bucket != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Bucket",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Bucket)
}
{
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Enabled",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(v.Enabled)
}
if len(v.Format) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Format",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.Format))
}
if v.Prefix != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Prefix",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Prefix)
}
if len(v.ReportScope) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ReportScope",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.ReportScope))
}
return nil
}
func awsRestxml_serializeDocumentLambdaInvokeOperation(v *types.LambdaInvokeOperation, value smithyxml.Value) error {
defer value.Close()
if v.FunctionArn != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "FunctionArn",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.FunctionArn)
}
return nil
}
func awsRestxml_serializeDocumentLifecycleConfiguration(v *types.LifecycleConfiguration, value smithyxml.Value) error {
defer value.Close()
if v.Rules != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Rules",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentLifecycleRules(v.Rules, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentLifecycleExpiration(v *types.LifecycleExpiration, value smithyxml.Value) error {
defer value.Close()
if v.Date != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Date",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(smithytime.FormatDateTime(*v.Date))
}
if v.Days != 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Days",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Integer(v.Days)
}
if v.ExpiredObjectDeleteMarker {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ExpiredObjectDeleteMarker",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(v.ExpiredObjectDeleteMarker)
}
return nil
}
func awsRestxml_serializeDocumentLifecycleRule(v *types.LifecycleRule, value smithyxml.Value) error {
defer value.Close()
if v.AbortIncompleteMultipartUpload != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "AbortIncompleteMultipartUpload",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentAbortIncompleteMultipartUpload(v.AbortIncompleteMultipartUpload, el); err != nil {
return err
}
}
if v.Expiration != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Expiration",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentLifecycleExpiration(v.Expiration, el); err != nil {
return err
}
}
if v.Filter != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Filter",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentLifecycleRuleFilter(v.Filter, el); err != nil {
return err
}
}
if v.ID != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ID",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.ID)
}
if v.NoncurrentVersionExpiration != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "NoncurrentVersionExpiration",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentNoncurrentVersionExpiration(v.NoncurrentVersionExpiration, el); err != nil {
return err
}
}
if v.NoncurrentVersionTransitions != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "NoncurrentVersionTransitions",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentNoncurrentVersionTransitionList(v.NoncurrentVersionTransitions, el); err != nil {
return err
}
}
if len(v.Status) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Status",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.Status))
}
if v.Transitions != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Transitions",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentTransitionList(v.Transitions, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentLifecycleRuleAndOperator(v *types.LifecycleRuleAndOperator, value smithyxml.Value) error {
defer value.Close()
if v.ObjectSizeGreaterThan != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ObjectSizeGreaterThan",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Long(*v.ObjectSizeGreaterThan)
}
if v.ObjectSizeLessThan != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ObjectSizeLessThan",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Long(*v.ObjectSizeLessThan)
}
if v.Prefix != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Prefix",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Prefix)
}
if v.Tags != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Tags",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3TagSet(v.Tags, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentLifecycleRuleFilter(v *types.LifecycleRuleFilter, value smithyxml.Value) error {
defer value.Close()
if v.And != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "And",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentLifecycleRuleAndOperator(v.And, el); err != nil {
return err
}
}
if v.ObjectSizeGreaterThan != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ObjectSizeGreaterThan",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Long(*v.ObjectSizeGreaterThan)
}
if v.ObjectSizeLessThan != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ObjectSizeLessThan",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Long(*v.ObjectSizeLessThan)
}
if v.Prefix != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Prefix",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Prefix)
}
if v.Tag != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Tag",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3Tag(v.Tag, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentLifecycleRules(v []types.LifecycleRule, value smithyxml.Value) error {
var array *smithyxml.Array
if !value.IsFlattened() {
defer value.Close()
}
customMemberNameAttr := []smithyxml.Attr{}
customMemberName := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Rule",
},
Attr: customMemberNameAttr,
}
array = value.ArrayWithCustomName(customMemberName)
for i := range v {
am := array.Member()
if err := awsRestxml_serializeDocumentLifecycleRule(&v[i], am); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentMetrics(v *types.Metrics, value smithyxml.Value) error {
defer value.Close()
if v.EventThreshold != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "EventThreshold",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentReplicationTimeValue(v.EventThreshold, el); err != nil {
return err
}
}
if len(v.Status) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Status",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.Status))
}
return nil
}
func awsRestxml_serializeDocumentMultiRegionAccessPointRoute(v *types.MultiRegionAccessPointRoute, value smithyxml.Value) error {
defer value.Close()
if v.Bucket != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Bucket",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Bucket)
}
if v.Region != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Region",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Region)
}
if v.TrafficDialPercentage != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "TrafficDialPercentage",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Integer(*v.TrafficDialPercentage)
}
return nil
}
func awsRestxml_serializeDocumentNoncurrentVersionExpiration(v *types.NoncurrentVersionExpiration, value smithyxml.Value) error {
defer value.Close()
if v.NewerNoncurrentVersions != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "NewerNoncurrentVersions",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Integer(*v.NewerNoncurrentVersions)
}
if v.NoncurrentDays != 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "NoncurrentDays",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Integer(v.NoncurrentDays)
}
return nil
}
func awsRestxml_serializeDocumentNoncurrentVersionTransition(v *types.NoncurrentVersionTransition, value smithyxml.Value) error {
defer value.Close()
if v.NoncurrentDays != 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "NoncurrentDays",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Integer(v.NoncurrentDays)
}
if len(v.StorageClass) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "StorageClass",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.StorageClass))
}
return nil
}
func awsRestxml_serializeDocumentNoncurrentVersionTransitionList(v []types.NoncurrentVersionTransition, value smithyxml.Value) error {
var array *smithyxml.Array
if !value.IsFlattened() {
defer value.Close()
}
customMemberNameAttr := []smithyxml.Attr{}
customMemberName := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "NoncurrentVersionTransition",
},
Attr: customMemberNameAttr,
}
array = value.ArrayWithCustomName(customMemberName)
for i := range v {
am := array.Member()
if err := awsRestxml_serializeDocumentNoncurrentVersionTransition(&v[i], am); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentObjectLambdaAllowedFeaturesList(v []types.ObjectLambdaAllowedFeature, value smithyxml.Value) error {
var array *smithyxml.Array
if !value.IsFlattened() {
defer value.Close()
}
customMemberNameAttr := []smithyxml.Attr{}
customMemberName := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "AllowedFeature",
},
Attr: customMemberNameAttr,
}
array = value.ArrayWithCustomName(customMemberName)
for i := range v {
am := array.Member()
am.String(string(v[i]))
}
return nil
}
func awsRestxml_serializeDocumentObjectLambdaConfiguration(v *types.ObjectLambdaConfiguration, value smithyxml.Value) error {
defer value.Close()
if v.AllowedFeatures != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "AllowedFeatures",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentObjectLambdaAllowedFeaturesList(v.AllowedFeatures, el); err != nil {
return err
}
}
if v.CloudWatchMetricsEnabled {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "CloudWatchMetricsEnabled",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(v.CloudWatchMetricsEnabled)
}
if v.SupportingAccessPoint != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "SupportingAccessPoint",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.SupportingAccessPoint)
}
if v.TransformationConfigurations != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "TransformationConfigurations",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentObjectLambdaTransformationConfigurationsList(v.TransformationConfigurations, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentObjectLambdaContentTransformation(v types.ObjectLambdaContentTransformation, value smithyxml.Value) error {
defer value.Close()
switch uv := v.(type) {
case *types.ObjectLambdaContentTransformationMemberAwsLambda:
customMemberNameAttr := []smithyxml.Attr{}
customMemberName := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "AwsLambda",
},
Attr: customMemberNameAttr,
}
av := value.MemberElement(customMemberName)
if err := awsRestxml_serializeDocumentAwsLambdaTransformation(&uv.Value, av); err != nil {
return err
}
default:
return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v)
}
return nil
}
func awsRestxml_serializeDocumentObjectLambdaTransformationConfiguration(v *types.ObjectLambdaTransformationConfiguration, value smithyxml.Value) error {
defer value.Close()
if v.Actions != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Actions",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentObjectLambdaTransformationConfigurationActionsList(v.Actions, el); err != nil {
return err
}
}
if v.ContentTransformation != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ContentTransformation",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentObjectLambdaContentTransformation(v.ContentTransformation, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentObjectLambdaTransformationConfigurationActionsList(v []types.ObjectLambdaTransformationConfigurationAction, value smithyxml.Value) error {
var array *smithyxml.Array
if !value.IsFlattened() {
defer value.Close()
}
customMemberNameAttr := []smithyxml.Attr{}
customMemberName := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Action",
},
Attr: customMemberNameAttr,
}
array = value.ArrayWithCustomName(customMemberName)
for i := range v {
am := array.Member()
am.String(string(v[i]))
}
return nil
}
func awsRestxml_serializeDocumentObjectLambdaTransformationConfigurationsList(v []types.ObjectLambdaTransformationConfiguration, value smithyxml.Value) error {
var array *smithyxml.Array
if !value.IsFlattened() {
defer value.Close()
}
customMemberNameAttr := []smithyxml.Attr{}
customMemberName := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "TransformationConfiguration",
},
Attr: customMemberNameAttr,
}
array = value.ArrayWithCustomName(customMemberName)
for i := range v {
am := array.Member()
if err := awsRestxml_serializeDocumentObjectLambdaTransformationConfiguration(&v[i], am); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentPrefixLevel(v *types.PrefixLevel, value smithyxml.Value) error {
defer value.Close()
if v.StorageMetrics != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "StorageMetrics",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentPrefixLevelStorageMetrics(v.StorageMetrics, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentPrefixLevelStorageMetrics(v *types.PrefixLevelStorageMetrics, value smithyxml.Value) error {
defer value.Close()
if v.IsEnabled {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "IsEnabled",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(v.IsEnabled)
}
if v.SelectionCriteria != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "SelectionCriteria",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentSelectionCriteria(v.SelectionCriteria, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentPublicAccessBlockConfiguration(v *types.PublicAccessBlockConfiguration, value smithyxml.Value) error {
defer value.Close()
if v.BlockPublicAcls {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "BlockPublicAcls",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(v.BlockPublicAcls)
}
if v.BlockPublicPolicy {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "BlockPublicPolicy",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(v.BlockPublicPolicy)
}
if v.IgnorePublicAcls {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "IgnorePublicAcls",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(v.IgnorePublicAcls)
}
if v.RestrictPublicBuckets {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "RestrictPublicBuckets",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(v.RestrictPublicBuckets)
}
return nil
}
func awsRestxml_serializeDocumentPutMultiRegionAccessPointPolicyInput(v *types.PutMultiRegionAccessPointPolicyInput, value smithyxml.Value) error {
defer value.Close()
if v.Name != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Name",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Name)
}
if v.Policy != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Policy",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Policy)
}
return nil
}
func awsRestxml_serializeDocumentRegion(v *types.Region, value smithyxml.Value) error {
defer value.Close()
if v.Bucket != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Bucket",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Bucket)
}
if v.BucketAccountId != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "BucketAccountId",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.BucketAccountId)
}
return nil
}
func awsRestxml_serializeDocumentRegionCreationList(v []types.Region, value smithyxml.Value) error {
var array *smithyxml.Array
if !value.IsFlattened() {
defer value.Close()
}
customMemberNameAttr := []smithyxml.Attr{}
customMemberName := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Region",
},
Attr: customMemberNameAttr,
}
array = value.ArrayWithCustomName(customMemberName)
for i := range v {
am := array.Member()
if err := awsRestxml_serializeDocumentRegion(&v[i], am); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentRegions(v []string, value smithyxml.Value) error {
var array *smithyxml.Array
if !value.IsFlattened() {
defer value.Close()
}
customMemberNameAttr := []smithyxml.Attr{}
customMemberName := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Region",
},
Attr: customMemberNameAttr,
}
array = value.ArrayWithCustomName(customMemberName)
for i := range v {
am := array.Member()
am.String(v[i])
}
return nil
}
func awsRestxml_serializeDocumentReplicaModifications(v *types.ReplicaModifications, value smithyxml.Value) error {
defer value.Close()
if len(v.Status) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Status",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.Status))
}
return nil
}
func awsRestxml_serializeDocumentReplicationConfiguration(v *types.ReplicationConfiguration, value smithyxml.Value) error {
defer value.Close()
if v.Role != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Role",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Role)
}
if v.Rules != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Rules",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentReplicationRules(v.Rules, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentReplicationRule(v *types.ReplicationRule, value smithyxml.Value) error {
defer value.Close()
if v.Bucket != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Bucket",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Bucket)
}
if v.DeleteMarkerReplication != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "DeleteMarkerReplication",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentDeleteMarkerReplication(v.DeleteMarkerReplication, el); err != nil {
return err
}
}
if v.Destination != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Destination",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentDestination(v.Destination, el); err != nil {
return err
}
}
if v.ExistingObjectReplication != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ExistingObjectReplication",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentExistingObjectReplication(v.ExistingObjectReplication, el); err != nil {
return err
}
}
if v.Filter != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Filter",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentReplicationRuleFilter(v.Filter, el); err != nil {
return err
}
}
if v.ID != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ID",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.ID)
}
if v.Prefix != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Prefix",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Prefix)
}
if v.Priority != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Priority",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Integer(*v.Priority)
}
if v.SourceSelectionCriteria != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "SourceSelectionCriteria",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentSourceSelectionCriteria(v.SourceSelectionCriteria, el); err != nil {
return err
}
}
if len(v.Status) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Status",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.Status))
}
return nil
}
func awsRestxml_serializeDocumentReplicationRuleAndOperator(v *types.ReplicationRuleAndOperator, value smithyxml.Value) error {
defer value.Close()
if v.Prefix != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Prefix",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Prefix)
}
if v.Tags != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Tags",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3TagSet(v.Tags, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentReplicationRuleFilter(v *types.ReplicationRuleFilter, value smithyxml.Value) error {
defer value.Close()
if v.And != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "And",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentReplicationRuleAndOperator(v.And, el); err != nil {
return err
}
}
if v.Prefix != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Prefix",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Prefix)
}
if v.Tag != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Tag",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3Tag(v.Tag, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentReplicationRules(v []types.ReplicationRule, value smithyxml.Value) error {
var array *smithyxml.Array
if !value.IsFlattened() {
defer value.Close()
}
customMemberNameAttr := []smithyxml.Attr{}
customMemberName := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Rule",
},
Attr: customMemberNameAttr,
}
array = value.ArrayWithCustomName(customMemberName)
for i := range v {
am := array.Member()
if err := awsRestxml_serializeDocumentReplicationRule(&v[i], am); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentReplicationStatusFilterList(v []types.ReplicationStatus, value smithyxml.Value) error {
var array *smithyxml.Array
if !value.IsFlattened() {
defer value.Close()
}
array = value.Array()
for i := range v {
am := array.Member()
am.String(string(v[i]))
}
return nil
}
func awsRestxml_serializeDocumentReplicationTime(v *types.ReplicationTime, value smithyxml.Value) error {
defer value.Close()
if len(v.Status) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Status",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.Status))
}
if v.Time != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Time",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentReplicationTimeValue(v.Time, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentReplicationTimeValue(v *types.ReplicationTimeValue, value smithyxml.Value) error {
defer value.Close()
if v.Minutes != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Minutes",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Integer(*v.Minutes)
}
return nil
}
func awsRestxml_serializeDocumentRouteList(v []types.MultiRegionAccessPointRoute, value smithyxml.Value) error {
var array *smithyxml.Array
if !value.IsFlattened() {
defer value.Close()
}
customMemberNameAttr := []smithyxml.Attr{}
customMemberName := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Route",
},
Attr: customMemberNameAttr,
}
array = value.ArrayWithCustomName(customMemberName)
for i := range v {
am := array.Member()
if err := awsRestxml_serializeDocumentMultiRegionAccessPointRoute(&v[i], am); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentS3AccessControlList(v *types.S3AccessControlList, value smithyxml.Value) error {
defer value.Close()
if v.Grants != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Grants",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3GrantList(v.Grants, el); err != nil {
return err
}
}
if v.Owner != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Owner",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3ObjectOwner(v.Owner, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentS3AccessControlPolicy(v *types.S3AccessControlPolicy, value smithyxml.Value) error {
defer value.Close()
if v.AccessControlList != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "AccessControlList",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3AccessControlList(v.AccessControlList, el); err != nil {
return err
}
}
if len(v.CannedAccessControlList) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "CannedAccessControlList",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.CannedAccessControlList))
}
return nil
}
func awsRestxml_serializeDocumentS3BucketDestination(v *types.S3BucketDestination, value smithyxml.Value) error {
defer value.Close()
if v.AccountId != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "AccountId",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.AccountId)
}
if v.Arn != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Arn",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Arn)
}
if v.Encryption != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Encryption",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentStorageLensDataExportEncryption(v.Encryption, el); err != nil {
return err
}
}
if len(v.Format) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Format",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.Format))
}
if len(v.OutputSchemaVersion) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "OutputSchemaVersion",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.OutputSchemaVersion))
}
if v.Prefix != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Prefix",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Prefix)
}
return nil
}
func awsRestxml_serializeDocumentS3CopyObjectOperation(v *types.S3CopyObjectOperation, value smithyxml.Value) error {
defer value.Close()
if v.AccessControlGrants != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "AccessControlGrants",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3GrantList(v.AccessControlGrants, el); err != nil {
return err
}
}
if v.BucketKeyEnabled {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "BucketKeyEnabled",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(v.BucketKeyEnabled)
}
if len(v.CannedAccessControlList) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "CannedAccessControlList",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.CannedAccessControlList))
}
if len(v.ChecksumAlgorithm) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ChecksumAlgorithm",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.ChecksumAlgorithm))
}
if len(v.MetadataDirective) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "MetadataDirective",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.MetadataDirective))
}
if v.ModifiedSinceConstraint != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ModifiedSinceConstraint",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(smithytime.FormatDateTime(*v.ModifiedSinceConstraint))
}
if v.NewObjectMetadata != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "NewObjectMetadata",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3ObjectMetadata(v.NewObjectMetadata, el); err != nil {
return err
}
}
if v.NewObjectTagging != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "NewObjectTagging",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3TagSet(v.NewObjectTagging, el); err != nil {
return err
}
}
if len(v.ObjectLockLegalHoldStatus) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ObjectLockLegalHoldStatus",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.ObjectLockLegalHoldStatus))
}
if len(v.ObjectLockMode) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ObjectLockMode",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.ObjectLockMode))
}
if v.ObjectLockRetainUntilDate != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ObjectLockRetainUntilDate",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(smithytime.FormatDateTime(*v.ObjectLockRetainUntilDate))
}
if v.RedirectLocation != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "RedirectLocation",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.RedirectLocation)
}
if v.RequesterPays {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "RequesterPays",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(v.RequesterPays)
}
if v.SSEAwsKmsKeyId != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "SSEAwsKmsKeyId",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.SSEAwsKmsKeyId)
}
if len(v.StorageClass) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "StorageClass",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.StorageClass))
}
if v.TargetKeyPrefix != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "TargetKeyPrefix",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.TargetKeyPrefix)
}
if v.TargetResource != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "TargetResource",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.TargetResource)
}
if v.UnModifiedSinceConstraint != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "UnModifiedSinceConstraint",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(smithytime.FormatDateTime(*v.UnModifiedSinceConstraint))
}
return nil
}
func awsRestxml_serializeDocumentS3DeleteObjectTaggingOperation(v *types.S3DeleteObjectTaggingOperation, value smithyxml.Value) error {
defer value.Close()
return nil
}
func awsRestxml_serializeDocumentS3Grant(v *types.S3Grant, value smithyxml.Value) error {
defer value.Close()
if v.Grantee != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Grantee",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3Grantee(v.Grantee, el); err != nil {
return err
}
}
if len(v.Permission) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Permission",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.Permission))
}
return nil
}
func awsRestxml_serializeDocumentS3Grantee(v *types.S3Grantee, value smithyxml.Value) error {
defer value.Close()
if v.DisplayName != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "DisplayName",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.DisplayName)
}
if v.Identifier != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Identifier",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Identifier)
}
if len(v.TypeIdentifier) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "TypeIdentifier",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.TypeIdentifier))
}
return nil
}
func awsRestxml_serializeDocumentS3GrantList(v []types.S3Grant, value smithyxml.Value) error {
var array *smithyxml.Array
if !value.IsFlattened() {
defer value.Close()
}
array = value.Array()
for i := range v {
am := array.Member()
if err := awsRestxml_serializeDocumentS3Grant(&v[i], am); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentS3InitiateRestoreObjectOperation(v *types.S3InitiateRestoreObjectOperation, value smithyxml.Value) error {
defer value.Close()
if v.ExpirationInDays != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ExpirationInDays",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Integer(*v.ExpirationInDays)
}
if len(v.GlacierJobTier) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "GlacierJobTier",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.GlacierJobTier))
}
return nil
}
func awsRestxml_serializeDocumentS3JobManifestGenerator(v *types.S3JobManifestGenerator, value smithyxml.Value) error {
defer value.Close()
{
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "EnableManifestOutput",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(v.EnableManifestOutput)
}
if v.ExpectedBucketOwner != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ExpectedBucketOwner",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.ExpectedBucketOwner)
}
if v.Filter != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Filter",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentJobManifestGeneratorFilter(v.Filter, el); err != nil {
return err
}
}
if v.ManifestOutputLocation != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ManifestOutputLocation",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3ManifestOutputLocation(v.ManifestOutputLocation, el); err != nil {
return err
}
}
if v.SourceBucket != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "SourceBucket",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.SourceBucket)
}
return nil
}
func awsRestxml_serializeDocumentS3ManifestOutputLocation(v *types.S3ManifestOutputLocation, value smithyxml.Value) error {
defer value.Close()
if v.Bucket != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Bucket",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Bucket)
}
if v.ExpectedManifestBucketOwner != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ExpectedManifestBucketOwner",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.ExpectedManifestBucketOwner)
}
if v.ManifestEncryption != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ManifestEncryption",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentGeneratedManifestEncryption(v.ManifestEncryption, el); err != nil {
return err
}
}
if len(v.ManifestFormat) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ManifestFormat",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.ManifestFormat))
}
if v.ManifestPrefix != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ManifestPrefix",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.ManifestPrefix)
}
return nil
}
func awsRestxml_serializeDocumentS3ObjectLockLegalHold(v *types.S3ObjectLockLegalHold, value smithyxml.Value) error {
defer value.Close()
if len(v.Status) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Status",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.Status))
}
return nil
}
func awsRestxml_serializeDocumentS3ObjectMetadata(v *types.S3ObjectMetadata, value smithyxml.Value) error {
defer value.Close()
if v.CacheControl != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "CacheControl",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.CacheControl)
}
if v.ContentDisposition != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ContentDisposition",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.ContentDisposition)
}
if v.ContentEncoding != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ContentEncoding",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.ContentEncoding)
}
if v.ContentLanguage != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ContentLanguage",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.ContentLanguage)
}
if v.ContentLength != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ContentLength",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Long(*v.ContentLength)
}
if v.ContentMD5 != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ContentMD5",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.ContentMD5)
}
if v.ContentType != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ContentType",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.ContentType)
}
if v.HttpExpiresDate != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "HttpExpiresDate",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(smithytime.FormatDateTime(*v.HttpExpiresDate))
}
if v.RequesterCharged {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "RequesterCharged",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(v.RequesterCharged)
}
if len(v.SSEAlgorithm) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "SSEAlgorithm",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.SSEAlgorithm))
}
if v.UserMetadata != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "UserMetadata",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3UserMetadata(v.UserMetadata, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentS3ObjectOwner(v *types.S3ObjectOwner, value smithyxml.Value) error {
defer value.Close()
if v.DisplayName != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "DisplayName",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.DisplayName)
}
if v.ID != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ID",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.ID)
}
return nil
}
func awsRestxml_serializeDocumentS3ReplicateObjectOperation(v *types.S3ReplicateObjectOperation, value smithyxml.Value) error {
defer value.Close()
return nil
}
func awsRestxml_serializeDocumentS3Retention(v *types.S3Retention, value smithyxml.Value) error {
defer value.Close()
if len(v.Mode) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Mode",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.Mode))
}
if v.RetainUntilDate != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "RetainUntilDate",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(smithytime.FormatDateTime(*v.RetainUntilDate))
}
return nil
}
func awsRestxml_serializeDocumentS3SetObjectAclOperation(v *types.S3SetObjectAclOperation, value smithyxml.Value) error {
defer value.Close()
if v.AccessControlPolicy != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "AccessControlPolicy",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3AccessControlPolicy(v.AccessControlPolicy, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentS3SetObjectLegalHoldOperation(v *types.S3SetObjectLegalHoldOperation, value smithyxml.Value) error {
defer value.Close()
if v.LegalHold != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "LegalHold",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3ObjectLockLegalHold(v.LegalHold, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentS3SetObjectRetentionOperation(v *types.S3SetObjectRetentionOperation, value smithyxml.Value) error {
defer value.Close()
if v.BypassGovernanceRetention != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "BypassGovernanceRetention",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(*v.BypassGovernanceRetention)
}
if v.Retention != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Retention",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3Retention(v.Retention, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentS3SetObjectTaggingOperation(v *types.S3SetObjectTaggingOperation, value smithyxml.Value) error {
defer value.Close()
if v.TagSet != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "TagSet",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3TagSet(v.TagSet, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentS3Tag(v *types.S3Tag, value smithyxml.Value) error {
defer value.Close()
if v.Key != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Key",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Key)
}
if v.Value != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Value",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Value)
}
return nil
}
func awsRestxml_serializeDocumentS3TagSet(v []types.S3Tag, value smithyxml.Value) error {
var array *smithyxml.Array
if !value.IsFlattened() {
defer value.Close()
}
array = value.Array()
for i := range v {
am := array.Member()
if err := awsRestxml_serializeDocumentS3Tag(&v[i], am); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentS3UserMetadata(v map[string]string, value smithyxml.Value) error {
if !value.IsFlattened() {
defer value.Close()
}
m := value.Map()
for key := range v {
entry := m.Entry()
keyElementAttr := []smithyxml.Attr{}
keyElement := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "key",
},
Attr: keyElementAttr,
}
entry.MemberElement(keyElement).String(key)
valueElementAttr := []smithyxml.Attr{}
valueElement := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "value",
},
Attr: valueElementAttr,
}
entry.MemberElement(valueElement).String(v[key])
entry.Close()
}
return nil
}
func awsRestxml_serializeDocumentSelectionCriteria(v *types.SelectionCriteria, value smithyxml.Value) error {
defer value.Close()
if v.Delimiter != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Delimiter",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Delimiter)
}
if v.MaxDepth != 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "MaxDepth",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Integer(v.MaxDepth)
}
if v.MinStorageBytesPercentage != 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "MinStorageBytesPercentage",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
switch {
case math.IsNaN(v.MinStorageBytesPercentage):
el.String("NaN")
case math.IsInf(v.MinStorageBytesPercentage, 1):
el.String("Infinity")
case math.IsInf(v.MinStorageBytesPercentage, -1):
el.String("-Infinity")
default:
el.Double(v.MinStorageBytesPercentage)
}
}
return nil
}
func awsRestxml_serializeDocumentSourceSelectionCriteria(v *types.SourceSelectionCriteria, value smithyxml.Value) error {
defer value.Close()
if v.ReplicaModifications != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "ReplicaModifications",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentReplicaModifications(v.ReplicaModifications, el); err != nil {
return err
}
}
if v.SseKmsEncryptedObjects != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "SseKmsEncryptedObjects",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentSseKmsEncryptedObjects(v.SseKmsEncryptedObjects, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentSSEKMS(v *types.SSEKMS, value smithyxml.Value) error {
defer value.Close()
if v.KeyId != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "KeyId",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.KeyId)
}
return nil
}
func awsRestxml_serializeDocumentSseKmsEncryptedObjects(v *types.SseKmsEncryptedObjects, value smithyxml.Value) error {
defer value.Close()
if len(v.Status) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Status",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.Status))
}
return nil
}
func awsRestxml_serializeDocumentSSEKMSEncryption(v *types.SSEKMSEncryption, value smithyxml.Value) error {
defer value.Close()
if v.KeyId != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "KeyId",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.KeyId)
}
return nil
}
func awsRestxml_serializeDocumentSSES3(v *types.SSES3, value smithyxml.Value) error {
defer value.Close()
return nil
}
func awsRestxml_serializeDocumentSSES3Encryption(v *types.SSES3Encryption, value smithyxml.Value) error {
defer value.Close()
return nil
}
func awsRestxml_serializeDocumentStorageLensAwsOrg(v *types.StorageLensAwsOrg, value smithyxml.Value) error {
defer value.Close()
if v.Arn != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Arn",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Arn)
}
return nil
}
func awsRestxml_serializeDocumentStorageLensConfiguration(v *types.StorageLensConfiguration, value smithyxml.Value) error {
defer value.Close()
if v.AccountLevel != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "AccountLevel",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentAccountLevel(v.AccountLevel, el); err != nil {
return err
}
}
if v.AwsOrg != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "AwsOrg",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentStorageLensAwsOrg(v.AwsOrg, el); err != nil {
return err
}
}
if v.DataExport != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "DataExport",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentStorageLensDataExport(v.DataExport, el); err != nil {
return err
}
}
if v.Exclude != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Exclude",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentExclude(v.Exclude, el); err != nil {
return err
}
}
if v.Id != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Id",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Id)
}
if v.Include != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Include",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentInclude(v.Include, el); err != nil {
return err
}
}
{
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "IsEnabled",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Boolean(v.IsEnabled)
}
if v.StorageLensArn != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "StorageLensArn",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.StorageLensArn)
}
return nil
}
func awsRestxml_serializeDocumentStorageLensDataExport(v *types.StorageLensDataExport, value smithyxml.Value) error {
defer value.Close()
if v.CloudWatchMetrics != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "CloudWatchMetrics",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentCloudWatchMetrics(v.CloudWatchMetrics, el); err != nil {
return err
}
}
if v.S3BucketDestination != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "S3BucketDestination",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3BucketDestination(v.S3BucketDestination, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentStorageLensDataExportEncryption(v *types.StorageLensDataExportEncryption, value smithyxml.Value) error {
defer value.Close()
if v.SSEKMS != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "SSE-KMS",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentSSEKMS(v.SSEKMS, el); err != nil {
return err
}
}
if v.SSES3 != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "SSE-S3",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentSSES3(v.SSES3, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentStorageLensTag(v *types.StorageLensTag, value smithyxml.Value) error {
defer value.Close()
if v.Key != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Key",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Key)
}
if v.Value != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Value",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.Value)
}
return nil
}
func awsRestxml_serializeDocumentStorageLensTags(v []types.StorageLensTag, value smithyxml.Value) error {
var array *smithyxml.Array
if !value.IsFlattened() {
defer value.Close()
}
customMemberNameAttr := []smithyxml.Attr{}
customMemberName := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Tag",
},
Attr: customMemberNameAttr,
}
array = value.ArrayWithCustomName(customMemberName)
for i := range v {
am := array.Member()
if err := awsRestxml_serializeDocumentStorageLensTag(&v[i], am); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentTagging(v *types.Tagging, value smithyxml.Value) error {
defer value.Close()
if v.TagSet != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "TagSet",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
if err := awsRestxml_serializeDocumentS3TagSet(v.TagSet, el); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentTransition(v *types.Transition, value smithyxml.Value) error {
defer value.Close()
if v.Date != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Date",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(smithytime.FormatDateTime(*v.Date))
}
if v.Days != 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Days",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.Integer(v.Days)
}
if len(v.StorageClass) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "StorageClass",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.StorageClass))
}
return nil
}
func awsRestxml_serializeDocumentTransitionList(v []types.Transition, value smithyxml.Value) error {
var array *smithyxml.Array
if !value.IsFlattened() {
defer value.Close()
}
customMemberNameAttr := []smithyxml.Attr{}
customMemberName := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Transition",
},
Attr: customMemberNameAttr,
}
array = value.ArrayWithCustomName(customMemberName)
for i := range v {
am := array.Member()
if err := awsRestxml_serializeDocumentTransition(&v[i], am); err != nil {
return err
}
}
return nil
}
func awsRestxml_serializeDocumentVersioningConfiguration(v *types.VersioningConfiguration, value smithyxml.Value) error {
defer value.Close()
if len(v.MFADelete) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "MfaDelete",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.MFADelete))
}
if len(v.Status) > 0 {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "Status",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(string(v.Status))
}
return nil
}
func awsRestxml_serializeDocumentVpcConfiguration(v *types.VpcConfiguration, value smithyxml.Value) error {
defer value.Close()
if v.VpcId != nil {
rootAttr := []smithyxml.Attr{}
root := smithyxml.StartElement{
Name: smithyxml.Name{
Local: "VpcId",
},
Attr: rootAttr,
}
el := value.MemberElement(root)
el.String(*v.VpcId)
}
return nil
}
| 8,440 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3control
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpCreateAccessPointForObjectLambda struct {
}
func (*validateOpCreateAccessPointForObjectLambda) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateAccessPointForObjectLambda) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateAccessPointForObjectLambdaInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateAccessPointForObjectLambdaInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateAccessPoint struct {
}
func (*validateOpCreateAccessPoint) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateAccessPoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateAccessPointInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateAccessPointInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateBucket struct {
}
func (*validateOpCreateBucket) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateBucket) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateBucketInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateBucketInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateJob struct {
}
func (*validateOpCreateJob) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateJobInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateJobInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateMultiRegionAccessPoint struct {
}
func (*validateOpCreateMultiRegionAccessPoint) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateMultiRegionAccessPoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateMultiRegionAccessPointInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateMultiRegionAccessPointInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteAccessPointForObjectLambda struct {
}
func (*validateOpDeleteAccessPointForObjectLambda) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteAccessPointForObjectLambda) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAccessPointForObjectLambdaInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAccessPointForObjectLambdaInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteAccessPoint struct {
}
func (*validateOpDeleteAccessPoint) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteAccessPoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAccessPointInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAccessPointInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteAccessPointPolicyForObjectLambda struct {
}
func (*validateOpDeleteAccessPointPolicyForObjectLambda) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteAccessPointPolicyForObjectLambda) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAccessPointPolicyForObjectLambdaInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAccessPointPolicyForObjectLambdaInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteAccessPointPolicy struct {
}
func (*validateOpDeleteAccessPointPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteAccessPointPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAccessPointPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAccessPointPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteBucket struct {
}
func (*validateOpDeleteBucket) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteBucket) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteBucketInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteBucketInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteBucketLifecycleConfiguration struct {
}
func (*validateOpDeleteBucketLifecycleConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteBucketLifecycleConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteBucketLifecycleConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteBucketLifecycleConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteBucketPolicy struct {
}
func (*validateOpDeleteBucketPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteBucketPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteBucketPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteBucketPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteBucketReplication struct {
}
func (*validateOpDeleteBucketReplication) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteBucketReplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteBucketReplicationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteBucketReplicationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteBucketTagging struct {
}
func (*validateOpDeleteBucketTagging) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteBucketTagging) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteBucketTaggingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteBucketTaggingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteJobTagging struct {
}
func (*validateOpDeleteJobTagging) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteJobTagging) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteJobTaggingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteJobTaggingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteMultiRegionAccessPoint struct {
}
func (*validateOpDeleteMultiRegionAccessPoint) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteMultiRegionAccessPoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteMultiRegionAccessPointInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteMultiRegionAccessPointInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeletePublicAccessBlock struct {
}
func (*validateOpDeletePublicAccessBlock) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeletePublicAccessBlock) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeletePublicAccessBlockInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeletePublicAccessBlockInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteStorageLensConfiguration struct {
}
func (*validateOpDeleteStorageLensConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteStorageLensConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteStorageLensConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteStorageLensConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteStorageLensConfigurationTagging struct {
}
func (*validateOpDeleteStorageLensConfigurationTagging) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteStorageLensConfigurationTagging) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteStorageLensConfigurationTaggingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteStorageLensConfigurationTaggingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeJob struct {
}
func (*validateOpDescribeJob) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeJobInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeJobInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeMultiRegionAccessPointOperation struct {
}
func (*validateOpDescribeMultiRegionAccessPointOperation) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeMultiRegionAccessPointOperation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeMultiRegionAccessPointOperationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeMultiRegionAccessPointOperationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetAccessPointConfigurationForObjectLambda struct {
}
func (*validateOpGetAccessPointConfigurationForObjectLambda) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetAccessPointConfigurationForObjectLambda) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetAccessPointConfigurationForObjectLambdaInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetAccessPointConfigurationForObjectLambdaInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetAccessPointForObjectLambda struct {
}
func (*validateOpGetAccessPointForObjectLambda) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetAccessPointForObjectLambda) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetAccessPointForObjectLambdaInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetAccessPointForObjectLambdaInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetAccessPoint struct {
}
func (*validateOpGetAccessPoint) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetAccessPoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetAccessPointInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetAccessPointInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetAccessPointPolicyForObjectLambda struct {
}
func (*validateOpGetAccessPointPolicyForObjectLambda) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetAccessPointPolicyForObjectLambda) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetAccessPointPolicyForObjectLambdaInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetAccessPointPolicyForObjectLambdaInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetAccessPointPolicy struct {
}
func (*validateOpGetAccessPointPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetAccessPointPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetAccessPointPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetAccessPointPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetAccessPointPolicyStatusForObjectLambda struct {
}
func (*validateOpGetAccessPointPolicyStatusForObjectLambda) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetAccessPointPolicyStatusForObjectLambda) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetAccessPointPolicyStatusForObjectLambdaInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetAccessPointPolicyStatusForObjectLambdaInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetAccessPointPolicyStatus struct {
}
func (*validateOpGetAccessPointPolicyStatus) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetAccessPointPolicyStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetAccessPointPolicyStatusInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetAccessPointPolicyStatusInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetBucket struct {
}
func (*validateOpGetBucket) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetBucket) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetBucketInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetBucketInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetBucketLifecycleConfiguration struct {
}
func (*validateOpGetBucketLifecycleConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetBucketLifecycleConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetBucketLifecycleConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetBucketLifecycleConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetBucketPolicy struct {
}
func (*validateOpGetBucketPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetBucketPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetBucketPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetBucketPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetBucketReplication struct {
}
func (*validateOpGetBucketReplication) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetBucketReplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetBucketReplicationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetBucketReplicationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetBucketTagging struct {
}
func (*validateOpGetBucketTagging) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetBucketTagging) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetBucketTaggingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetBucketTaggingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetBucketVersioning struct {
}
func (*validateOpGetBucketVersioning) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetBucketVersioning) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetBucketVersioningInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetBucketVersioningInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetJobTagging struct {
}
func (*validateOpGetJobTagging) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetJobTagging) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetJobTaggingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetJobTaggingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetMultiRegionAccessPoint struct {
}
func (*validateOpGetMultiRegionAccessPoint) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetMultiRegionAccessPoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetMultiRegionAccessPointInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetMultiRegionAccessPointInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetMultiRegionAccessPointPolicy struct {
}
func (*validateOpGetMultiRegionAccessPointPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetMultiRegionAccessPointPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetMultiRegionAccessPointPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetMultiRegionAccessPointPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetMultiRegionAccessPointPolicyStatus struct {
}
func (*validateOpGetMultiRegionAccessPointPolicyStatus) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetMultiRegionAccessPointPolicyStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetMultiRegionAccessPointPolicyStatusInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetMultiRegionAccessPointPolicyStatusInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetMultiRegionAccessPointRoutes struct {
}
func (*validateOpGetMultiRegionAccessPointRoutes) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetMultiRegionAccessPointRoutes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetMultiRegionAccessPointRoutesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetMultiRegionAccessPointRoutesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetPublicAccessBlock struct {
}
func (*validateOpGetPublicAccessBlock) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetPublicAccessBlock) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetPublicAccessBlockInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetPublicAccessBlockInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetStorageLensConfiguration struct {
}
func (*validateOpGetStorageLensConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetStorageLensConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetStorageLensConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetStorageLensConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetStorageLensConfigurationTagging struct {
}
func (*validateOpGetStorageLensConfigurationTagging) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetStorageLensConfigurationTagging) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetStorageLensConfigurationTaggingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetStorageLensConfigurationTaggingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAccessPointsForObjectLambda struct {
}
func (*validateOpListAccessPointsForObjectLambda) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAccessPointsForObjectLambda) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAccessPointsForObjectLambdaInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAccessPointsForObjectLambdaInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAccessPoints struct {
}
func (*validateOpListAccessPoints) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAccessPoints) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAccessPointsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAccessPointsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListJobs struct {
}
func (*validateOpListJobs) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListJobs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListJobsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListJobsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListMultiRegionAccessPoints struct {
}
func (*validateOpListMultiRegionAccessPoints) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListMultiRegionAccessPoints) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListMultiRegionAccessPointsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListMultiRegionAccessPointsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListRegionalBuckets struct {
}
func (*validateOpListRegionalBuckets) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListRegionalBuckets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListRegionalBucketsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListRegionalBucketsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListStorageLensConfigurations struct {
}
func (*validateOpListStorageLensConfigurations) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListStorageLensConfigurations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListStorageLensConfigurationsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListStorageLensConfigurationsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutAccessPointConfigurationForObjectLambda struct {
}
func (*validateOpPutAccessPointConfigurationForObjectLambda) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutAccessPointConfigurationForObjectLambda) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutAccessPointConfigurationForObjectLambdaInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutAccessPointConfigurationForObjectLambdaInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutAccessPointPolicyForObjectLambda struct {
}
func (*validateOpPutAccessPointPolicyForObjectLambda) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutAccessPointPolicyForObjectLambda) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutAccessPointPolicyForObjectLambdaInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutAccessPointPolicyForObjectLambdaInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutAccessPointPolicy struct {
}
func (*validateOpPutAccessPointPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutAccessPointPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutAccessPointPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutAccessPointPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutBucketLifecycleConfiguration struct {
}
func (*validateOpPutBucketLifecycleConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutBucketLifecycleConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutBucketLifecycleConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutBucketLifecycleConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutBucketPolicy struct {
}
func (*validateOpPutBucketPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutBucketPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutBucketPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutBucketPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutBucketReplication struct {
}
func (*validateOpPutBucketReplication) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutBucketReplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutBucketReplicationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutBucketReplicationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutBucketTagging struct {
}
func (*validateOpPutBucketTagging) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutBucketTagging) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutBucketTaggingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutBucketTaggingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutBucketVersioning struct {
}
func (*validateOpPutBucketVersioning) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutBucketVersioning) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutBucketVersioningInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutBucketVersioningInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutJobTagging struct {
}
func (*validateOpPutJobTagging) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutJobTagging) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutJobTaggingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutJobTaggingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutMultiRegionAccessPointPolicy struct {
}
func (*validateOpPutMultiRegionAccessPointPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutMultiRegionAccessPointPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutMultiRegionAccessPointPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutMultiRegionAccessPointPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutPublicAccessBlock struct {
}
func (*validateOpPutPublicAccessBlock) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutPublicAccessBlock) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutPublicAccessBlockInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutPublicAccessBlockInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutStorageLensConfiguration struct {
}
func (*validateOpPutStorageLensConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutStorageLensConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutStorageLensConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutStorageLensConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutStorageLensConfigurationTagging struct {
}
func (*validateOpPutStorageLensConfigurationTagging) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutStorageLensConfigurationTagging) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutStorageLensConfigurationTaggingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutStorageLensConfigurationTaggingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSubmitMultiRegionAccessPointRoutes struct {
}
func (*validateOpSubmitMultiRegionAccessPointRoutes) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSubmitMultiRegionAccessPointRoutes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SubmitMultiRegionAccessPointRoutesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSubmitMultiRegionAccessPointRoutesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateJobPriority struct {
}
func (*validateOpUpdateJobPriority) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateJobPriority) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateJobPriorityInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateJobPriorityInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateJobStatus struct {
}
func (*validateOpUpdateJobStatus) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateJobStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateJobStatusInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateJobStatusInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpCreateAccessPointForObjectLambdaValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateAccessPointForObjectLambda{}, middleware.After)
}
func addOpCreateAccessPointValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateAccessPoint{}, middleware.After)
}
func addOpCreateBucketValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateBucket{}, middleware.After)
}
func addOpCreateJobValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateJob{}, middleware.After)
}
func addOpCreateMultiRegionAccessPointValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateMultiRegionAccessPoint{}, middleware.After)
}
func addOpDeleteAccessPointForObjectLambdaValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteAccessPointForObjectLambda{}, middleware.After)
}
func addOpDeleteAccessPointValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteAccessPoint{}, middleware.After)
}
func addOpDeleteAccessPointPolicyForObjectLambdaValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteAccessPointPolicyForObjectLambda{}, middleware.After)
}
func addOpDeleteAccessPointPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteAccessPointPolicy{}, middleware.After)
}
func addOpDeleteBucketValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteBucket{}, middleware.After)
}
func addOpDeleteBucketLifecycleConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteBucketLifecycleConfiguration{}, middleware.After)
}
func addOpDeleteBucketPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteBucketPolicy{}, middleware.After)
}
func addOpDeleteBucketReplicationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteBucketReplication{}, middleware.After)
}
func addOpDeleteBucketTaggingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteBucketTagging{}, middleware.After)
}
func addOpDeleteJobTaggingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteJobTagging{}, middleware.After)
}
func addOpDeleteMultiRegionAccessPointValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteMultiRegionAccessPoint{}, middleware.After)
}
func addOpDeletePublicAccessBlockValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeletePublicAccessBlock{}, middleware.After)
}
func addOpDeleteStorageLensConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteStorageLensConfiguration{}, middleware.After)
}
func addOpDeleteStorageLensConfigurationTaggingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteStorageLensConfigurationTagging{}, middleware.After)
}
func addOpDescribeJobValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeJob{}, middleware.After)
}
func addOpDescribeMultiRegionAccessPointOperationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeMultiRegionAccessPointOperation{}, middleware.After)
}
func addOpGetAccessPointConfigurationForObjectLambdaValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetAccessPointConfigurationForObjectLambda{}, middleware.After)
}
func addOpGetAccessPointForObjectLambdaValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetAccessPointForObjectLambda{}, middleware.After)
}
func addOpGetAccessPointValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetAccessPoint{}, middleware.After)
}
func addOpGetAccessPointPolicyForObjectLambdaValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetAccessPointPolicyForObjectLambda{}, middleware.After)
}
func addOpGetAccessPointPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetAccessPointPolicy{}, middleware.After)
}
func addOpGetAccessPointPolicyStatusForObjectLambdaValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetAccessPointPolicyStatusForObjectLambda{}, middleware.After)
}
func addOpGetAccessPointPolicyStatusValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetAccessPointPolicyStatus{}, middleware.After)
}
func addOpGetBucketValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetBucket{}, middleware.After)
}
func addOpGetBucketLifecycleConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetBucketLifecycleConfiguration{}, middleware.After)
}
func addOpGetBucketPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetBucketPolicy{}, middleware.After)
}
func addOpGetBucketReplicationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetBucketReplication{}, middleware.After)
}
func addOpGetBucketTaggingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetBucketTagging{}, middleware.After)
}
func addOpGetBucketVersioningValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetBucketVersioning{}, middleware.After)
}
func addOpGetJobTaggingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetJobTagging{}, middleware.After)
}
func addOpGetMultiRegionAccessPointValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetMultiRegionAccessPoint{}, middleware.After)
}
func addOpGetMultiRegionAccessPointPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetMultiRegionAccessPointPolicy{}, middleware.After)
}
func addOpGetMultiRegionAccessPointPolicyStatusValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetMultiRegionAccessPointPolicyStatus{}, middleware.After)
}
func addOpGetMultiRegionAccessPointRoutesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetMultiRegionAccessPointRoutes{}, middleware.After)
}
func addOpGetPublicAccessBlockValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetPublicAccessBlock{}, middleware.After)
}
func addOpGetStorageLensConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetStorageLensConfiguration{}, middleware.After)
}
func addOpGetStorageLensConfigurationTaggingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetStorageLensConfigurationTagging{}, middleware.After)
}
func addOpListAccessPointsForObjectLambdaValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAccessPointsForObjectLambda{}, middleware.After)
}
func addOpListAccessPointsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAccessPoints{}, middleware.After)
}
func addOpListJobsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListJobs{}, middleware.After)
}
func addOpListMultiRegionAccessPointsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListMultiRegionAccessPoints{}, middleware.After)
}
func addOpListRegionalBucketsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListRegionalBuckets{}, middleware.After)
}
func addOpListStorageLensConfigurationsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListStorageLensConfigurations{}, middleware.After)
}
func addOpPutAccessPointConfigurationForObjectLambdaValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutAccessPointConfigurationForObjectLambda{}, middleware.After)
}
func addOpPutAccessPointPolicyForObjectLambdaValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutAccessPointPolicyForObjectLambda{}, middleware.After)
}
func addOpPutAccessPointPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutAccessPointPolicy{}, middleware.After)
}
func addOpPutBucketLifecycleConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutBucketLifecycleConfiguration{}, middleware.After)
}
func addOpPutBucketPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutBucketPolicy{}, middleware.After)
}
func addOpPutBucketReplicationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutBucketReplication{}, middleware.After)
}
func addOpPutBucketTaggingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutBucketTagging{}, middleware.After)
}
func addOpPutBucketVersioningValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutBucketVersioning{}, middleware.After)
}
func addOpPutJobTaggingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutJobTagging{}, middleware.After)
}
func addOpPutMultiRegionAccessPointPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutMultiRegionAccessPointPolicy{}, middleware.After)
}
func addOpPutPublicAccessBlockValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutPublicAccessBlock{}, middleware.After)
}
func addOpPutStorageLensConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutStorageLensConfiguration{}, middleware.After)
}
func addOpPutStorageLensConfigurationTaggingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutStorageLensConfigurationTagging{}, middleware.After)
}
func addOpSubmitMultiRegionAccessPointRoutesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSubmitMultiRegionAccessPointRoutes{}, middleware.After)
}
func addOpUpdateJobPriorityValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateJobPriority{}, middleware.After)
}
func addOpUpdateJobStatusValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateJobStatus{}, middleware.After)
}
func validateAccessControlTranslation(v *types.AccessControlTranslation) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AccessControlTranslation"}
if len(v.Owner) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Owner"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAccountLevel(v *types.AccountLevel) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AccountLevel"}
if v.BucketLevel == nil {
invalidParams.Add(smithy.NewErrParamRequired("BucketLevel"))
} else if v.BucketLevel != nil {
if err := validateBucketLevel(v.BucketLevel); err != nil {
invalidParams.AddNested("BucketLevel", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAwsLambdaTransformation(v *types.AwsLambdaTransformation) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AwsLambdaTransformation"}
if v.FunctionArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBucketLevel(v *types.BucketLevel) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BucketLevel"}
if v.PrefixLevel != nil {
if err := validatePrefixLevel(v.PrefixLevel); err != nil {
invalidParams.AddNested("PrefixLevel", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCloudWatchMetrics(v *types.CloudWatchMetrics) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CloudWatchMetrics"}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCreateMultiRegionAccessPointInput(v *types.CreateMultiRegionAccessPointInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateMultiRegionAccessPointInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Regions == nil {
invalidParams.Add(smithy.NewErrParamRequired("Regions"))
} else if v.Regions != nil {
if err := validateRegionCreationList(v.Regions); err != nil {
invalidParams.AddNested("Regions", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDeleteMarkerReplication(v *types.DeleteMarkerReplication) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteMarkerReplication"}
if len(v.Status) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Status"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDeleteMultiRegionAccessPointInput(v *types.DeleteMultiRegionAccessPointInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteMultiRegionAccessPointInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDestination(v *types.Destination) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Destination"}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if v.ReplicationTime != nil {
if err := validateReplicationTime(v.ReplicationTime); err != nil {
invalidParams.AddNested("ReplicationTime", err.(smithy.InvalidParamsError))
}
}
if v.AccessControlTranslation != nil {
if err := validateAccessControlTranslation(v.AccessControlTranslation); err != nil {
invalidParams.AddNested("AccessControlTranslation", err.(smithy.InvalidParamsError))
}
}
if v.Metrics != nil {
if err := validateMetrics(v.Metrics); err != nil {
invalidParams.AddNested("Metrics", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateExistingObjectReplication(v *types.ExistingObjectReplication) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExistingObjectReplication"}
if len(v.Status) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Status"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateGeneratedManifestEncryption(v *types.GeneratedManifestEncryption) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GeneratedManifestEncryption"}
if v.SSEKMS != nil {
if err := validateSSEKMSEncryption(v.SSEKMS); err != nil {
invalidParams.AddNested("SSEKMS", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateJobManifest(v *types.JobManifest) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "JobManifest"}
if v.Spec == nil {
invalidParams.Add(smithy.NewErrParamRequired("Spec"))
} else if v.Spec != nil {
if err := validateJobManifestSpec(v.Spec); err != nil {
invalidParams.AddNested("Spec", err.(smithy.InvalidParamsError))
}
}
if v.Location == nil {
invalidParams.Add(smithy.NewErrParamRequired("Location"))
} else if v.Location != nil {
if err := validateJobManifestLocation(v.Location); err != nil {
invalidParams.AddNested("Location", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateJobManifestGenerator(v types.JobManifestGenerator) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "JobManifestGenerator"}
switch uv := v.(type) {
case *types.JobManifestGeneratorMemberS3JobManifestGenerator:
if err := validateS3JobManifestGenerator(&uv.Value); err != nil {
invalidParams.AddNested("[S3JobManifestGenerator]", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateJobManifestLocation(v *types.JobManifestLocation) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "JobManifestLocation"}
if v.ObjectArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ObjectArn"))
}
if v.ETag == nil {
invalidParams.Add(smithy.NewErrParamRequired("ETag"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateJobManifestSpec(v *types.JobManifestSpec) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "JobManifestSpec"}
if len(v.Format) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Format"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateJobOperation(v *types.JobOperation) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "JobOperation"}
if v.S3PutObjectCopy != nil {
if err := validateS3CopyObjectOperation(v.S3PutObjectCopy); err != nil {
invalidParams.AddNested("S3PutObjectCopy", err.(smithy.InvalidParamsError))
}
}
if v.S3PutObjectAcl != nil {
if err := validateS3SetObjectAclOperation(v.S3PutObjectAcl); err != nil {
invalidParams.AddNested("S3PutObjectAcl", err.(smithy.InvalidParamsError))
}
}
if v.S3PutObjectTagging != nil {
if err := validateS3SetObjectTaggingOperation(v.S3PutObjectTagging); err != nil {
invalidParams.AddNested("S3PutObjectTagging", err.(smithy.InvalidParamsError))
}
}
if v.S3PutObjectLegalHold != nil {
if err := validateS3SetObjectLegalHoldOperation(v.S3PutObjectLegalHold); err != nil {
invalidParams.AddNested("S3PutObjectLegalHold", err.(smithy.InvalidParamsError))
}
}
if v.S3PutObjectRetention != nil {
if err := validateS3SetObjectRetentionOperation(v.S3PutObjectRetention); err != nil {
invalidParams.AddNested("S3PutObjectRetention", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateJobReport(v *types.JobReport) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "JobReport"}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLifecycleConfiguration(v *types.LifecycleConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LifecycleConfiguration"}
if v.Rules != nil {
if err := validateLifecycleRules(v.Rules); err != nil {
invalidParams.AddNested("Rules", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLifecycleRule(v *types.LifecycleRule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LifecycleRule"}
if v.Filter != nil {
if err := validateLifecycleRuleFilter(v.Filter); err != nil {
invalidParams.AddNested("Filter", err.(smithy.InvalidParamsError))
}
}
if len(v.Status) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Status"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLifecycleRuleAndOperator(v *types.LifecycleRuleAndOperator) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LifecycleRuleAndOperator"}
if v.Tags != nil {
if err := validateS3TagSet(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLifecycleRuleFilter(v *types.LifecycleRuleFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LifecycleRuleFilter"}
if v.Tag != nil {
if err := validateS3Tag(v.Tag); err != nil {
invalidParams.AddNested("Tag", err.(smithy.InvalidParamsError))
}
}
if v.And != nil {
if err := validateLifecycleRuleAndOperator(v.And); err != nil {
invalidParams.AddNested("And", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLifecycleRules(v []types.LifecycleRule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LifecycleRules"}
for i := range v {
if err := validateLifecycleRule(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMetrics(v *types.Metrics) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Metrics"}
if len(v.Status) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Status"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMultiRegionAccessPointRoute(v *types.MultiRegionAccessPointRoute) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "MultiRegionAccessPointRoute"}
if v.TrafficDialPercentage == nil {
invalidParams.Add(smithy.NewErrParamRequired("TrafficDialPercentage"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateObjectLambdaConfiguration(v *types.ObjectLambdaConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ObjectLambdaConfiguration"}
if v.SupportingAccessPoint == nil {
invalidParams.Add(smithy.NewErrParamRequired("SupportingAccessPoint"))
}
if v.TransformationConfigurations == nil {
invalidParams.Add(smithy.NewErrParamRequired("TransformationConfigurations"))
} else if v.TransformationConfigurations != nil {
if err := validateObjectLambdaTransformationConfigurationsList(v.TransformationConfigurations); err != nil {
invalidParams.AddNested("TransformationConfigurations", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateObjectLambdaContentTransformation(v types.ObjectLambdaContentTransformation) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ObjectLambdaContentTransformation"}
switch uv := v.(type) {
case *types.ObjectLambdaContentTransformationMemberAwsLambda:
if err := validateAwsLambdaTransformation(&uv.Value); err != nil {
invalidParams.AddNested("[AwsLambda]", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateObjectLambdaTransformationConfiguration(v *types.ObjectLambdaTransformationConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ObjectLambdaTransformationConfiguration"}
if v.Actions == nil {
invalidParams.Add(smithy.NewErrParamRequired("Actions"))
}
if v.ContentTransformation == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContentTransformation"))
} else if v.ContentTransformation != nil {
if err := validateObjectLambdaContentTransformation(v.ContentTransformation); err != nil {
invalidParams.AddNested("ContentTransformation", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateObjectLambdaTransformationConfigurationsList(v []types.ObjectLambdaTransformationConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ObjectLambdaTransformationConfigurationsList"}
for i := range v {
if err := validateObjectLambdaTransformationConfiguration(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePrefixLevel(v *types.PrefixLevel) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PrefixLevel"}
if v.StorageMetrics == nil {
invalidParams.Add(smithy.NewErrParamRequired("StorageMetrics"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePutMultiRegionAccessPointPolicyInput(v *types.PutMultiRegionAccessPointPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutMultiRegionAccessPointPolicyInput"}
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 validateRegion(v *types.Region) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Region"}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRegionCreationList(v []types.Region) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RegionCreationList"}
for i := range v {
if err := validateRegion(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateReplicaModifications(v *types.ReplicaModifications) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ReplicaModifications"}
if len(v.Status) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Status"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateReplicationConfiguration(v *types.ReplicationConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ReplicationConfiguration"}
if v.Role == nil {
invalidParams.Add(smithy.NewErrParamRequired("Role"))
}
if v.Rules == nil {
invalidParams.Add(smithy.NewErrParamRequired("Rules"))
} else if v.Rules != nil {
if err := validateReplicationRules(v.Rules); err != nil {
invalidParams.AddNested("Rules", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateReplicationRule(v *types.ReplicationRule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ReplicationRule"}
if v.Filter != nil {
if err := validateReplicationRuleFilter(v.Filter); err != nil {
invalidParams.AddNested("Filter", err.(smithy.InvalidParamsError))
}
}
if len(v.Status) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Status"))
}
if v.SourceSelectionCriteria != nil {
if err := validateSourceSelectionCriteria(v.SourceSelectionCriteria); err != nil {
invalidParams.AddNested("SourceSelectionCriteria", err.(smithy.InvalidParamsError))
}
}
if v.ExistingObjectReplication != nil {
if err := validateExistingObjectReplication(v.ExistingObjectReplication); err != nil {
invalidParams.AddNested("ExistingObjectReplication", err.(smithy.InvalidParamsError))
}
}
if v.Destination == nil {
invalidParams.Add(smithy.NewErrParamRequired("Destination"))
} else if v.Destination != nil {
if err := validateDestination(v.Destination); err != nil {
invalidParams.AddNested("Destination", err.(smithy.InvalidParamsError))
}
}
if v.DeleteMarkerReplication != nil {
if err := validateDeleteMarkerReplication(v.DeleteMarkerReplication); err != nil {
invalidParams.AddNested("DeleteMarkerReplication", err.(smithy.InvalidParamsError))
}
}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateReplicationRuleAndOperator(v *types.ReplicationRuleAndOperator) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ReplicationRuleAndOperator"}
if v.Tags != nil {
if err := validateS3TagSet(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateReplicationRuleFilter(v *types.ReplicationRuleFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ReplicationRuleFilter"}
if v.Tag != nil {
if err := validateS3Tag(v.Tag); err != nil {
invalidParams.AddNested("Tag", err.(smithy.InvalidParamsError))
}
}
if v.And != nil {
if err := validateReplicationRuleAndOperator(v.And); err != nil {
invalidParams.AddNested("And", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateReplicationRules(v []types.ReplicationRule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ReplicationRules"}
for i := range v {
if err := validateReplicationRule(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateReplicationTime(v *types.ReplicationTime) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ReplicationTime"}
if len(v.Status) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Status"))
}
if v.Time == nil {
invalidParams.Add(smithy.NewErrParamRequired("Time"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRouteList(v []types.MultiRegionAccessPointRoute) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RouteList"}
for i := range v {
if err := validateMultiRegionAccessPointRoute(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateS3AccessControlList(v *types.S3AccessControlList) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3AccessControlList"}
if v.Owner == nil {
invalidParams.Add(smithy.NewErrParamRequired("Owner"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateS3AccessControlPolicy(v *types.S3AccessControlPolicy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3AccessControlPolicy"}
if v.AccessControlList != nil {
if err := validateS3AccessControlList(v.AccessControlList); err != nil {
invalidParams.AddNested("AccessControlList", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateS3BucketDestination(v *types.S3BucketDestination) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3BucketDestination"}
if len(v.Format) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Format"))
}
if len(v.OutputSchemaVersion) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("OutputSchemaVersion"))
}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Arn == nil {
invalidParams.Add(smithy.NewErrParamRequired("Arn"))
}
if v.Encryption != nil {
if err := validateStorageLensDataExportEncryption(v.Encryption); err != nil {
invalidParams.AddNested("Encryption", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateS3CopyObjectOperation(v *types.S3CopyObjectOperation) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3CopyObjectOperation"}
if v.NewObjectTagging != nil {
if err := validateS3TagSet(v.NewObjectTagging); err != nil {
invalidParams.AddNested("NewObjectTagging", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateS3JobManifestGenerator(v *types.S3JobManifestGenerator) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3JobManifestGenerator"}
if v.SourceBucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("SourceBucket"))
}
if v.ManifestOutputLocation != nil {
if err := validateS3ManifestOutputLocation(v.ManifestOutputLocation); err != nil {
invalidParams.AddNested("ManifestOutputLocation", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateS3ManifestOutputLocation(v *types.S3ManifestOutputLocation) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3ManifestOutputLocation"}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if v.ManifestEncryption != nil {
if err := validateGeneratedManifestEncryption(v.ManifestEncryption); err != nil {
invalidParams.AddNested("ManifestEncryption", err.(smithy.InvalidParamsError))
}
}
if len(v.ManifestFormat) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ManifestFormat"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateS3ObjectLockLegalHold(v *types.S3ObjectLockLegalHold) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3ObjectLockLegalHold"}
if len(v.Status) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Status"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateS3SetObjectAclOperation(v *types.S3SetObjectAclOperation) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3SetObjectAclOperation"}
if v.AccessControlPolicy != nil {
if err := validateS3AccessControlPolicy(v.AccessControlPolicy); err != nil {
invalidParams.AddNested("AccessControlPolicy", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateS3SetObjectLegalHoldOperation(v *types.S3SetObjectLegalHoldOperation) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3SetObjectLegalHoldOperation"}
if v.LegalHold == nil {
invalidParams.Add(smithy.NewErrParamRequired("LegalHold"))
} else if v.LegalHold != nil {
if err := validateS3ObjectLockLegalHold(v.LegalHold); err != nil {
invalidParams.AddNested("LegalHold", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateS3SetObjectRetentionOperation(v *types.S3SetObjectRetentionOperation) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3SetObjectRetentionOperation"}
if v.Retention == nil {
invalidParams.Add(smithy.NewErrParamRequired("Retention"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateS3SetObjectTaggingOperation(v *types.S3SetObjectTaggingOperation) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3SetObjectTaggingOperation"}
if v.TagSet != nil {
if err := validateS3TagSet(v.TagSet); err != nil {
invalidParams.AddNested("TagSet", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateS3Tag(v *types.S3Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3Tag"}
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 validateS3TagSet(v []types.S3Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3TagSet"}
for i := range v {
if err := validateS3Tag(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSourceSelectionCriteria(v *types.SourceSelectionCriteria) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SourceSelectionCriteria"}
if v.SseKmsEncryptedObjects != nil {
if err := validateSseKmsEncryptedObjects(v.SseKmsEncryptedObjects); err != nil {
invalidParams.AddNested("SseKmsEncryptedObjects", err.(smithy.InvalidParamsError))
}
}
if v.ReplicaModifications != nil {
if err := validateReplicaModifications(v.ReplicaModifications); err != nil {
invalidParams.AddNested("ReplicaModifications", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSSEKMS(v *types.SSEKMS) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SSEKMS"}
if v.KeyId == nil {
invalidParams.Add(smithy.NewErrParamRequired("KeyId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSseKmsEncryptedObjects(v *types.SseKmsEncryptedObjects) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SseKmsEncryptedObjects"}
if len(v.Status) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Status"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSSEKMSEncryption(v *types.SSEKMSEncryption) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SSEKMSEncryption"}
if v.KeyId == nil {
invalidParams.Add(smithy.NewErrParamRequired("KeyId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateStorageLensAwsOrg(v *types.StorageLensAwsOrg) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StorageLensAwsOrg"}
if v.Arn == nil {
invalidParams.Add(smithy.NewErrParamRequired("Arn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateStorageLensConfiguration(v *types.StorageLensConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StorageLensConfiguration"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.AccountLevel == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountLevel"))
} else if v.AccountLevel != nil {
if err := validateAccountLevel(v.AccountLevel); err != nil {
invalidParams.AddNested("AccountLevel", err.(smithy.InvalidParamsError))
}
}
if v.DataExport != nil {
if err := validateStorageLensDataExport(v.DataExport); err != nil {
invalidParams.AddNested("DataExport", err.(smithy.InvalidParamsError))
}
}
if v.AwsOrg != nil {
if err := validateStorageLensAwsOrg(v.AwsOrg); err != nil {
invalidParams.AddNested("AwsOrg", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateStorageLensDataExport(v *types.StorageLensDataExport) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StorageLensDataExport"}
if v.S3BucketDestination != nil {
if err := validateS3BucketDestination(v.S3BucketDestination); err != nil {
invalidParams.AddNested("S3BucketDestination", err.(smithy.InvalidParamsError))
}
}
if v.CloudWatchMetrics != nil {
if err := validateCloudWatchMetrics(v.CloudWatchMetrics); err != nil {
invalidParams.AddNested("CloudWatchMetrics", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateStorageLensDataExportEncryption(v *types.StorageLensDataExportEncryption) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StorageLensDataExportEncryption"}
if v.SSEKMS != nil {
if err := validateSSEKMS(v.SSEKMS); err != nil {
invalidParams.AddNested("SSEKMS", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateStorageLensTag(v *types.StorageLensTag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StorageLensTag"}
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 validateStorageLensTags(v []types.StorageLensTag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StorageLensTags"}
for i := range v {
if err := validateStorageLensTag(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTagging(v *types.Tagging) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Tagging"}
if v.TagSet == nil {
invalidParams.Add(smithy.NewErrParamRequired("TagSet"))
} else if v.TagSet != nil {
if err := validateS3TagSet(v.TagSet); err != nil {
invalidParams.AddNested("TagSet", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateVpcConfiguration(v *types.VpcConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "VpcConfiguration"}
if v.VpcId == nil {
invalidParams.Add(smithy.NewErrParamRequired("VpcId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateAccessPointForObjectLambdaInput(v *CreateAccessPointForObjectLambdaInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateAccessPointForObjectLambdaInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Configuration == nil {
invalidParams.Add(smithy.NewErrParamRequired("Configuration"))
} else if v.Configuration != nil {
if err := validateObjectLambdaConfiguration(v.Configuration); err != nil {
invalidParams.AddNested("Configuration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateAccessPointInput(v *CreateAccessPointInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateAccessPointInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if v.VpcConfiguration != nil {
if err := validateVpcConfiguration(v.VpcConfiguration); err != nil {
invalidParams.AddNested("VpcConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateBucketInput(v *CreateBucketInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateBucketInput"}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateJobInput(v *CreateJobInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateJobInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Operation == nil {
invalidParams.Add(smithy.NewErrParamRequired("Operation"))
} else if v.Operation != nil {
if err := validateJobOperation(v.Operation); err != nil {
invalidParams.AddNested("Operation", err.(smithy.InvalidParamsError))
}
}
if v.Report == nil {
invalidParams.Add(smithy.NewErrParamRequired("Report"))
} else if v.Report != nil {
if err := validateJobReport(v.Report); err != nil {
invalidParams.AddNested("Report", err.(smithy.InvalidParamsError))
}
}
if v.ClientRequestToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientRequestToken"))
}
if v.Manifest != nil {
if err := validateJobManifest(v.Manifest); err != nil {
invalidParams.AddNested("Manifest", err.(smithy.InvalidParamsError))
}
}
if v.Priority == nil {
invalidParams.Add(smithy.NewErrParamRequired("Priority"))
}
if v.RoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleArn"))
}
if v.Tags != nil {
if err := validateS3TagSet(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if v.ManifestGenerator != nil {
if err := validateJobManifestGenerator(v.ManifestGenerator); err != nil {
invalidParams.AddNested("ManifestGenerator", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateMultiRegionAccessPointInput(v *CreateMultiRegionAccessPointInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateMultiRegionAccessPointInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if v.Details == nil {
invalidParams.Add(smithy.NewErrParamRequired("Details"))
} else if v.Details != nil {
if err := validateCreateMultiRegionAccessPointInput(v.Details); err != nil {
invalidParams.AddNested("Details", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAccessPointForObjectLambdaInput(v *DeleteAccessPointForObjectLambdaInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAccessPointForObjectLambdaInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAccessPointInput(v *DeleteAccessPointInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAccessPointInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAccessPointPolicyForObjectLambdaInput(v *DeleteAccessPointPolicyForObjectLambdaInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAccessPointPolicyForObjectLambdaInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAccessPointPolicyInput(v *DeleteAccessPointPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAccessPointPolicyInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteBucketInput(v *DeleteBucketInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteBucketInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteBucketLifecycleConfigurationInput(v *DeleteBucketLifecycleConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteBucketLifecycleConfigurationInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteBucketPolicyInput(v *DeleteBucketPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteBucketPolicyInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteBucketReplicationInput(v *DeleteBucketReplicationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteBucketReplicationInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteBucketTaggingInput(v *DeleteBucketTaggingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteBucketTaggingInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteJobTaggingInput(v *DeleteJobTaggingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteJobTaggingInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.JobId == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteMultiRegionAccessPointInput(v *DeleteMultiRegionAccessPointInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteMultiRegionAccessPointInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if v.Details == nil {
invalidParams.Add(smithy.NewErrParamRequired("Details"))
} else if v.Details != nil {
if err := validateDeleteMultiRegionAccessPointInput(v.Details); err != nil {
invalidParams.AddNested("Details", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeletePublicAccessBlockInput(v *DeletePublicAccessBlockInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeletePublicAccessBlockInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteStorageLensConfigurationInput(v *DeleteStorageLensConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteStorageLensConfigurationInput"}
if v.ConfigId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConfigId"))
}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteStorageLensConfigurationTaggingInput(v *DeleteStorageLensConfigurationTaggingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteStorageLensConfigurationTaggingInput"}
if v.ConfigId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConfigId"))
}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeJobInput(v *DescribeJobInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeJobInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.JobId == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeMultiRegionAccessPointOperationInput(v *DescribeMultiRegionAccessPointOperationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeMultiRegionAccessPointOperationInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.RequestTokenARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("RequestTokenARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetAccessPointConfigurationForObjectLambdaInput(v *GetAccessPointConfigurationForObjectLambdaInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetAccessPointConfigurationForObjectLambdaInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetAccessPointForObjectLambdaInput(v *GetAccessPointForObjectLambdaInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetAccessPointForObjectLambdaInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetAccessPointInput(v *GetAccessPointInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetAccessPointInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetAccessPointPolicyForObjectLambdaInput(v *GetAccessPointPolicyForObjectLambdaInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetAccessPointPolicyForObjectLambdaInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetAccessPointPolicyInput(v *GetAccessPointPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetAccessPointPolicyInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetAccessPointPolicyStatusForObjectLambdaInput(v *GetAccessPointPolicyStatusForObjectLambdaInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetAccessPointPolicyStatusForObjectLambdaInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetAccessPointPolicyStatusInput(v *GetAccessPointPolicyStatusInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetAccessPointPolicyStatusInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetBucketInput(v *GetBucketInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetBucketInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetBucketLifecycleConfigurationInput(v *GetBucketLifecycleConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetBucketLifecycleConfigurationInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetBucketPolicyInput(v *GetBucketPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetBucketPolicyInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetBucketReplicationInput(v *GetBucketReplicationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetBucketReplicationInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetBucketTaggingInput(v *GetBucketTaggingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetBucketTaggingInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetBucketVersioningInput(v *GetBucketVersioningInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetBucketVersioningInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetJobTaggingInput(v *GetJobTaggingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetJobTaggingInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.JobId == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetMultiRegionAccessPointInput(v *GetMultiRegionAccessPointInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetMultiRegionAccessPointInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetMultiRegionAccessPointPolicyInput(v *GetMultiRegionAccessPointPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetMultiRegionAccessPointPolicyInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetMultiRegionAccessPointPolicyStatusInput(v *GetMultiRegionAccessPointPolicyStatusInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetMultiRegionAccessPointPolicyStatusInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetMultiRegionAccessPointRoutesInput(v *GetMultiRegionAccessPointRoutesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetMultiRegionAccessPointRoutesInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Mrap == nil {
invalidParams.Add(smithy.NewErrParamRequired("Mrap"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetPublicAccessBlockInput(v *GetPublicAccessBlockInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetPublicAccessBlockInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetStorageLensConfigurationInput(v *GetStorageLensConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetStorageLensConfigurationInput"}
if v.ConfigId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConfigId"))
}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetStorageLensConfigurationTaggingInput(v *GetStorageLensConfigurationTaggingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetStorageLensConfigurationTaggingInput"}
if v.ConfigId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConfigId"))
}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAccessPointsForObjectLambdaInput(v *ListAccessPointsForObjectLambdaInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAccessPointsForObjectLambdaInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAccessPointsInput(v *ListAccessPointsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAccessPointsInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListJobsInput(v *ListJobsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListJobsInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListMultiRegionAccessPointsInput(v *ListMultiRegionAccessPointsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListMultiRegionAccessPointsInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListRegionalBucketsInput(v *ListRegionalBucketsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListRegionalBucketsInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListStorageLensConfigurationsInput(v *ListStorageLensConfigurationsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListStorageLensConfigurationsInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutAccessPointConfigurationForObjectLambdaInput(v *PutAccessPointConfigurationForObjectLambdaInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutAccessPointConfigurationForObjectLambdaInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Configuration == nil {
invalidParams.Add(smithy.NewErrParamRequired("Configuration"))
} else if v.Configuration != nil {
if err := validateObjectLambdaConfiguration(v.Configuration); err != nil {
invalidParams.AddNested("Configuration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutAccessPointPolicyForObjectLambdaInput(v *PutAccessPointPolicyForObjectLambdaInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutAccessPointPolicyForObjectLambdaInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
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 validateOpPutAccessPointPolicyInput(v *PutAccessPointPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutAccessPointPolicyInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
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 validateOpPutBucketLifecycleConfigurationInput(v *PutBucketLifecycleConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutBucketLifecycleConfigurationInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if v.LifecycleConfiguration != nil {
if err := validateLifecycleConfiguration(v.LifecycleConfiguration); err != nil {
invalidParams.AddNested("LifecycleConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutBucketPolicyInput(v *PutBucketPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutBucketPolicyInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if v.Policy == nil {
invalidParams.Add(smithy.NewErrParamRequired("Policy"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutBucketReplicationInput(v *PutBucketReplicationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutBucketReplicationInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if v.ReplicationConfiguration == nil {
invalidParams.Add(smithy.NewErrParamRequired("ReplicationConfiguration"))
} else if v.ReplicationConfiguration != nil {
if err := validateReplicationConfiguration(v.ReplicationConfiguration); err != nil {
invalidParams.AddNested("ReplicationConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutBucketTaggingInput(v *PutBucketTaggingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutBucketTaggingInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if v.Tagging == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tagging"))
} else if v.Tagging != nil {
if err := validateTagging(v.Tagging); err != nil {
invalidParams.AddNested("Tagging", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutBucketVersioningInput(v *PutBucketVersioningInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutBucketVersioningInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if v.VersioningConfiguration == nil {
invalidParams.Add(smithy.NewErrParamRequired("VersioningConfiguration"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutJobTaggingInput(v *PutJobTaggingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutJobTaggingInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.JobId == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobId"))
}
if v.Tags == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tags"))
} else if v.Tags != nil {
if err := validateS3TagSet(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutMultiRegionAccessPointPolicyInput(v *PutMultiRegionAccessPointPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutMultiRegionAccessPointPolicyInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if v.Details == nil {
invalidParams.Add(smithy.NewErrParamRequired("Details"))
} else if v.Details != nil {
if err := validatePutMultiRegionAccessPointPolicyInput(v.Details); err != nil {
invalidParams.AddNested("Details", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutPublicAccessBlockInput(v *PutPublicAccessBlockInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutPublicAccessBlockInput"}
if v.PublicAccessBlockConfiguration == nil {
invalidParams.Add(smithy.NewErrParamRequired("PublicAccessBlockConfiguration"))
}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutStorageLensConfigurationInput(v *PutStorageLensConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutStorageLensConfigurationInput"}
if v.ConfigId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConfigId"))
}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.StorageLensConfiguration == nil {
invalidParams.Add(smithy.NewErrParamRequired("StorageLensConfiguration"))
} else if v.StorageLensConfiguration != nil {
if err := validateStorageLensConfiguration(v.StorageLensConfiguration); err != nil {
invalidParams.AddNested("StorageLensConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.Tags != nil {
if err := validateStorageLensTags(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutStorageLensConfigurationTaggingInput(v *PutStorageLensConfigurationTaggingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutStorageLensConfigurationTaggingInput"}
if v.ConfigId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConfigId"))
}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Tags == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tags"))
} else if v.Tags != nil {
if err := validateStorageLensTags(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSubmitMultiRegionAccessPointRoutesInput(v *SubmitMultiRegionAccessPointRoutesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SubmitMultiRegionAccessPointRoutesInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.Mrap == nil {
invalidParams.Add(smithy.NewErrParamRequired("Mrap"))
}
if v.RouteUpdates == nil {
invalidParams.Add(smithy.NewErrParamRequired("RouteUpdates"))
} else if v.RouteUpdates != nil {
if err := validateRouteList(v.RouteUpdates); err != nil {
invalidParams.AddNested("RouteUpdates", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateJobPriorityInput(v *UpdateJobPriorityInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateJobPriorityInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.JobId == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateJobStatusInput(v *UpdateJobStatusInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateJobStatusInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if v.JobId == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobId"))
}
if len(v.RequestedJobStatus) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("RequestedJobStatus"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 4,039 |
aws-sdk-go-v2 | aws | Go | package customizations
import (
"context"
"fmt"
"github.com/aws/smithy-go/middleware"
"github.com/aws/aws-sdk-go-v2/service/internal/s3shared"
)
// BackfillInput validates and backfill's values from ARN into request serializable input.
// This middleware must be executed after `ARNLookup` and before `inputValidationMiddleware`.
type BackfillInput struct {
// CopyInput creates a copy of input to be modified, this ensures the original input is not modified.
CopyInput func(interface{}) (interface{}, error)
// BackfillAccountID points to a function that validates the input for accountID. If absent, it populates the
// accountID and returns a copy. If present, but different than passed in accountID value throws an error
BackfillAccountID func(interface{}, string) error
}
// ID representing the middleware
func (m *BackfillInput) ID() string {
return "S3Control:BackfillInput"
}
// HandleInitialize handles the middleware behavior in an Initialize step.
func (m *BackfillInput) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
// fetch arn from context
av, ok := s3shared.GetARNResourceFromContext(ctx)
if !ok {
return next.HandleInitialize(ctx, in)
}
// if not supported, move to next
if m.BackfillAccountID == nil {
return next.HandleInitialize(ctx, in)
}
// check if input is already cloned
if !s3shared.IsClonedInput(ctx) {
// create a copy of input, and assign it on params
in.Parameters, err = m.CopyInput(in.Parameters)
if err != nil {
return out, metadata, fmt.Errorf("error creating a copy of input")
}
// set clone key on context
ctx = s3shared.SetClonedInputKey(ctx, true)
}
// backfill account id
err = m.BackfillAccountID(in.Parameters, av.AccountID)
if err != nil {
return out, metadata, fmt.Errorf("invalid ARN, %w", err)
}
return next.HandleInitialize(ctx, in)
}
| 63 |
aws-sdk-go-v2 | aws | Go | /*
Package customizations provides customizations for the Amazon S3-Control API client.
This package provides support for following S3-Control customizations
BackfillInput Middleware: validates and backfills data from an ARN resource into a copy of operation input.
ProcessOutpostID Middleware: applied on CreateBucket, ListRegionalBuckets operation, triggers a custom endpoint generation flow.
ProcessARN Middleware: processes an ARN if provided as input and updates the endpoint as per the arn type.
UpdateEndpoint Middleware: resolves a custom endpoint as per s3-control config options.
# Dualstack support
By default dualstack support for s3-control client is disabled. By enabling `UseDualstack`
option on s3-control client, you can enable dualstack endpoint support.
# Endpoint customizations
Customizations to lookup ARN, backfill input, process outpost id, process ARN
needs to happen before request serialization. UpdateEndpoint middleware which mutates
resources based on Options such as UseDualstack for modifying resolved endpoint
are executed after request serialization.
Middleware layering:
Initialize : HTTP Request -> ARN Lookup -> BackfillInput -> Input-Validation -> Serialize step
Serialize : HTTP Request -> Process-OutpostID -> Process ARN -> operation serializer -> Update-Endpoint customization -> next middleware
Customization option:
UseARNRegion (Disabled by Default)
UseDualstack (Disabled by Default)
*/
package customizations
| 39 |
aws-sdk-go-v2 | aws | Go | package customizations
import (
"context"
"fmt"
"net/url"
"strings"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"github.com/aws/aws-sdk-go-v2/aws"
awsarn "github.com/aws/aws-sdk-go-v2/aws/arn"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/service/internal/s3shared"
"github.com/aws/aws-sdk-go-v2/service/internal/s3shared/arn"
s3endpoints "github.com/aws/aws-sdk-go-v2/service/s3control/internal/endpoints/s3"
)
const (
// outpost id header
outpostIDHeader = "x-amz-outpost-id"
// account id header
accountIDHeader = "x-amz-account-id"
)
// processARNResource is used to process an ARN resource.
type processARNResource struct {
// CopyInput creates a copy of input to be modified, this ensures the original input is not modified.
CopyInput func(interface{}) (interface{}, error)
// UpdateARNField points to a function that takes in a copy of input, updates the ARN field with
// the provided value and returns the input
UpdateARNField func(interface{}, string) error
// UseARNRegion indicates if region parsed from an ARN should be used.
UseARNRegion bool
// EndpointResolver used to resolve endpoints. This may be a custom endpoint resolver
EndpointResolver EndpointResolver
// EndpointResolverOptions used by endpoint resolver
EndpointResolverOptions EndpointResolverOptions
}
// ID returns the middleware ID.
func (*processARNResource) ID() string { return "S3Control:ProcessARNResourceMiddleware" }
func (m *processARNResource) HandleSerialize(
ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler,
) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
// if arn region resolves to custom endpoint that is mutable
if smithyhttp.GetHostnameImmutable(ctx) {
return next.HandleSerialize(ctx, in)
}
// check if arn was provided, if not skip this middleware
arnValue, ok := s3shared.GetARNResourceFromContext(ctx)
if !ok {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown request type %T", req)
}
// parse arn into an endpoint arn wrt to service
resource, err := parseEndpointARN(arnValue)
if err != nil {
return out, metadata, err
}
resourceRequest := s3shared.ResourceRequest{
Resource: resource,
RequestRegion: awsmiddleware.GetRegion(ctx),
SigningRegion: awsmiddleware.GetSigningRegion(ctx),
PartitionID: awsmiddleware.GetPartitionID(ctx),
UseARNRegion: m.UseARNRegion,
}
// validate resource request
if err := validateResourceRequest(resourceRequest); err != nil {
return out, metadata, err
}
// if not done already, clone the input and reassign it to in.Parameters
if !s3shared.IsClonedInput(ctx) {
in.Parameters, err = m.CopyInput(in.Parameters)
if err != nil {
return out, metadata, fmt.Errorf("error creating a copy of input while processing arn")
}
// set copy input key on context
ctx = s3shared.SetClonedInputKey(ctx, true)
}
// switch to correct endpoint updater
switch tv := resource.(type) {
case arn.OutpostAccessPointARN:
// validations
// check if dual stack
if m.EndpointResolverOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled {
return out, metadata, s3shared.NewClientConfiguredForDualStackError(tv,
resourceRequest.PartitionID, resourceRequest.RequestRegion, nil)
}
// Disable endpoint host prefix for s3-control
ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true)
if m.UpdateARNField == nil {
return out, metadata, fmt.Errorf("error updating arnable field while serializing")
}
// update the arnable field with access point name
err = m.UpdateARNField(in.Parameters, tv.AccessPointName)
if err != nil {
return out, metadata, fmt.Errorf("error updating arnable field while serializing")
}
// Add outpostID header
req.Header.Add(outpostIDHeader, tv.OutpostID)
// build outpost access point request
ctx, err = buildOutpostAccessPointRequest(ctx, outpostAccessPointOptions{
processARNResource: *m,
request: req,
resource: tv,
partitionID: resourceRequest.PartitionID,
requestRegion: resourceRequest.RequestRegion,
})
if err != nil {
return out, metadata, err
}
// process outpost accesspoint ARN
case arn.OutpostBucketARN:
// check if dual stack
if m.EndpointResolverOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled {
return out, metadata, s3shared.NewClientConfiguredForDualStackError(tv,
resourceRequest.PartitionID, resourceRequest.RequestRegion, nil)
}
// Disable endpoint host prefix for s3-control
ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true)
if m.UpdateARNField == nil {
return out, metadata, fmt.Errorf("error updating arnable field while serializing")
}
// update the arnable field with bucket name
err = m.UpdateARNField(in.Parameters, tv.BucketName)
if err != nil {
return out, metadata, fmt.Errorf("error updating arnable field while serializing")
}
// Add outpostID header
req.Header.Add(outpostIDHeader, tv.OutpostID)
// build outpost bucket request
ctx, err = buildOutpostBucketRequest(ctx, outpostBucketOptions{
processARNResource: *m,
request: req,
resource: tv,
partitionID: resourceRequest.PartitionID,
requestRegion: resourceRequest.RequestRegion,
})
if err != nil {
return out, metadata, err
}
default:
return out, metadata, s3shared.NewInvalidARNError(resource, nil)
}
// Add account-id header for the request if not present.
// SDK must always send the x-amz-account-id header for all requests
// where an accountId has been extracted from an ARN or the accountId field modeled as a header.
if h := req.Header.Get(accountIDHeader); len(h) == 0 {
req.Header.Add(accountIDHeader, resource.GetARN().AccountID)
}
return next.HandleSerialize(ctx, in)
}
// validate if s3 resource and request config is compatible.
func validateResourceRequest(resourceRequest s3shared.ResourceRequest) error {
// check if resourceRequest leads to a cross partition error
v, err := resourceRequest.IsCrossPartition()
if err != nil {
return err
}
if v {
// if cross partition
return s3shared.NewClientPartitionMismatchError(resourceRequest.Resource,
resourceRequest.PartitionID, resourceRequest.RequestRegion, nil)
}
// check if resourceRequest leads to a cross region error
if !resourceRequest.AllowCrossRegion() && resourceRequest.IsCrossRegion() {
// if cross region, but not use ARN region is not enabled
return s3shared.NewClientRegionMismatchError(resourceRequest.Resource,
resourceRequest.PartitionID, resourceRequest.RequestRegion, nil)
}
return nil
}
// Used by shapes with members decorated as endpoint ARN.
func parseEndpointARN(v awsarn.ARN) (arn.Resource, error) {
return arn.ParseResource(v, resourceParser)
}
func resourceParser(a awsarn.ARN) (arn.Resource, error) {
resParts := arn.SplitResource(a.Resource)
switch resParts[0] {
case "outpost":
return arn.ParseOutpostARNResource(a, resParts[1:])
default:
return nil, arn.InvalidARNError{ARN: a, Reason: "unknown resource type"}
}
}
// ====== Outpost Accesspoint ========
type outpostAccessPointOptions struct {
processARNResource
request *smithyhttp.Request
resource arn.OutpostAccessPointARN
partitionID string
requestRegion string
}
func buildOutpostAccessPointRequest(ctx context.Context, options outpostAccessPointOptions) (context.Context, error) {
tv := options.resource
req := options.request
// Build outpost access point resource
resolveRegion := tv.Region
resolveService := tv.Service
endpointsID := resolveService
if resolveService == "s3-outposts" {
endpointsID = "s3"
}
// resolve regional endpoint for resolved region.
var endpoint aws.Endpoint
var err error
endpointSource := awsmiddleware.GetEndpointSource(ctx)
eo := options.EndpointResolverOptions
eo.Logger = middleware.GetLogger(ctx)
eo.ResolvedRegion = ""
if endpointsID == "s3" && endpointSource == aws.EndpointSourceServiceMetadata {
// use s3 endpoint resolver
endpoint, err = s3endpoints.New().ResolveEndpoint(resolveRegion, s3endpoints.Options{
LogDeprecated: eo.LogDeprecated,
DisableHTTPS: eo.DisableHTTPS,
UseFIPSEndpoint: eo.UseFIPSEndpoint,
UseDualStackEndpoint: eo.UseDualStackEndpoint,
})
} else {
endpoint, err = options.EndpointResolver.ResolveEndpoint(resolveRegion, eo)
}
if err != nil {
return ctx, s3shared.NewFailedToResolveEndpointError(
tv,
options.partitionID,
options.requestRegion,
err,
)
}
req.URL, err = url.Parse(endpoint.URL)
if err != nil {
return ctx, fmt.Errorf("failed to parse endpoint URL: %w", err)
}
// redirect signer to use resolved endpoint signing name and region
if len(endpoint.SigningName) != 0 {
ctx = awsmiddleware.SetSigningName(ctx, endpoint.SigningName)
} else {
// assign resolved service from arn as signing name
ctx = awsmiddleware.SetSigningName(ctx, resolveService)
}
if len(endpoint.SigningRegion) != 0 {
// redirect signer to use resolved endpoint signing name and region
ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)
} else {
ctx = awsmiddleware.SetSigningRegion(ctx, resolveRegion)
}
// skip arn processing, if arn region resolves to a immutable endpoint
if endpoint.HostnameImmutable {
return ctx, nil
}
// add url host as s3-outposts
cfgHost := req.URL.Host
if strings.HasPrefix(cfgHost, endpointsID) {
req.URL.Host = resolveService + cfgHost[len(endpointsID):]
// update serviceID to resolved service
ctx = awsmiddleware.SetServiceID(ctx, resolveService)
}
// validate the endpoint host
if err := smithyhttp.ValidateEndpointHost(req.URL.Host); err != nil {
return ctx, s3shared.NewInvalidARNError(tv, err)
}
// Disable endpoint host prefix for s3-control
ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true)
return ctx, nil
}
// ======= Outpost Bucket =========
type outpostBucketOptions struct {
processARNResource
request *smithyhttp.Request
resource arn.OutpostBucketARN
partitionID string
requestRegion string
}
func buildOutpostBucketRequest(ctx context.Context, options outpostBucketOptions) (context.Context, error) {
tv := options.resource
req := options.request
// Build endpoint from outpost bucket arn
resolveRegion := tv.Region
resolveService := tv.Service
// Outpost bucket resource uses `s3-control` as serviceEndpointLabel
endpointsID := "s3-control"
// resolve regional endpoint for resolved region.
eo := options.EndpointResolverOptions
eo.Logger = middleware.GetLogger(ctx)
eo.ResolvedRegion = ""
endpoint, err := options.EndpointResolver.ResolveEndpoint(resolveRegion, eo)
if err != nil {
return ctx, s3shared.NewFailedToResolveEndpointError(
tv,
options.partitionID,
options.requestRegion,
err,
)
}
// assign resolved endpoint url to request url
req.URL, err = url.Parse(endpoint.URL)
if err != nil {
return ctx, fmt.Errorf("failed to parse endpoint URL: %w", err)
}
if len(endpoint.SigningName) != 0 {
ctx = awsmiddleware.SetSigningName(ctx, endpoint.SigningName)
} else {
// assign resolved service from arn as signing name
ctx = awsmiddleware.SetSigningName(ctx, resolveService)
}
if len(endpoint.SigningRegion) != 0 {
// redirect signer to use resolved endpoint signing name and region
ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)
} else {
ctx = awsmiddleware.SetSigningRegion(ctx, resolveRegion)
}
// skip arn processing, if arn region resolves to a immutable endpoint
if endpoint.HostnameImmutable {
return ctx, nil
}
cfgHost := req.URL.Host
if strings.HasPrefix(cfgHost, endpointsID) {
// replace service endpointID label with resolved service
req.URL.Host = resolveService + cfgHost[len(endpointsID):]
// update serviceID to resolved service
ctx = awsmiddleware.SetServiceID(ctx, resolveService)
}
// validate the endpoint host
if err := smithyhttp.ValidateEndpointHost(req.URL.Host); err != nil {
return ctx, s3shared.NewInvalidARNError(tv, err)
}
// Disable endpoint host prefix for s3-control
ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true)
return ctx, nil
}
| 404 |
aws-sdk-go-v2 | aws | Go | package customizations
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"net/url"
"strings"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// processOutpostIDMiddleware is special customization middleware to be applied for operations
// CreateBucket, ListRegionalBuckets which must resolve endpoint to s3-outposts.{region}.amazonaws.com
// with region as client region and signed by s3-control if an outpost id is provided.
type processOutpostIDMiddleware struct {
// GetOutpostID points to a function that processes an input and returns an outpostID as string ptr,
// and bool indicating if outpostID is supported or set.
GetOutpostID func(interface{}) (*string, bool)
// EndpointResolver used to resolve endpoints. This may be a custom endpoint resolver
EndpointResolver EndpointResolver
// EndpointResolverOptions used by endpoint resolver
EndpointResolverOptions EndpointResolverOptions
}
// ID returns the middleware ID.
func (*processOutpostIDMiddleware) ID() string { return "S3Control:ProcessOutpostIDMiddleware" }
// HandleSerialize adds a serialize step, this has to be before operation serializer and arn endpoint logic.
// Ideally this step will be ahead of ARN customization for CreateBucket, ListRegionalBucket operation.
func (m *processOutpostIDMiddleware) HandleSerialize(
ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler,
) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
// if host name is immutable, skip this customization
if smithyhttp.GetHostnameImmutable(ctx) {
return next.HandleSerialize(ctx, in)
}
// attempt to fetch an outpost id
outpostID, ok := m.GetOutpostID(in.Parameters)
if !ok {
return next.HandleSerialize(ctx, in)
}
// check if outpostID was not set or is empty
if outpostID == nil || len(strings.TrimSpace(*outpostID)) == 0 {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown request type %T", req)
}
requestRegion := awsmiddleware.GetRegion(ctx)
ero := m.EndpointResolverOptions
// validate if dualstack
if ero.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled {
return out, metadata, fmt.Errorf("dualstack is not supported for outposts request")
}
endpoint, err := m.EndpointResolver.ResolveEndpoint(requestRegion, ero)
if err != nil {
return out, metadata, err
}
// resolved endpoint with endpoint-id s3-control
endpointsID := "s3-control"
// resolved service label that must be used in case endpointsID is s3-control
resolveService := "s3-outposts"
req.URL, err = url.Parse(endpoint.URL)
if err != nil {
return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err)
}
if len(endpoint.SigningName) != 0 {
ctx = awsmiddleware.SetSigningName(ctx, endpoint.SigningName)
} else {
// assign resolved service from arn as signing name
ctx = awsmiddleware.SetSigningName(ctx, resolveService)
}
if len(endpoint.SigningRegion) != 0 {
// redirect signer to use resolved endpoint signing name and region
ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)
} else {
ctx = awsmiddleware.SetSigningRegion(ctx, requestRegion)
}
// add url host as s3-outposts
cfgHost := req.URL.Host
if strings.HasPrefix(cfgHost, endpointsID) {
req.URL.Host = resolveService + cfgHost[len(endpointsID):]
ctx = awsmiddleware.SetServiceID(ctx, resolveService)
}
// Disable endpoint host prefix for s3-control
ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true)
return next.HandleSerialize(ctx, in)
}
| 112 |
aws-sdk-go-v2 | aws | Go | package customizations
import (
"github.com/aws/smithy-go/middleware"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/internal/s3shared"
internalendpoints "github.com/aws/aws-sdk-go-v2/service/s3control/internal/endpoints"
)
// EndpointResolver interface for resolving service endpoints.
type EndpointResolver interface {
ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)
}
// EndpointResolverOptions is the service endpoint resolver options
type EndpointResolverOptions = internalendpoints.Options
// UpdateEndpointParameterAccessor represents accessor functions used by the middleware
type UpdateEndpointParameterAccessor struct {
// GetARNInput points to a function that processes an input and returns ARN as string ptr,
// and bool indicating if ARN is supported or set.
GetARNInput func(interface{}) (*string, bool)
// GetOutpostIDInput points to a function that processes an input and returns a outpostID as string ptr,
// and bool indicating if outpostID is supported or set.
GetOutpostIDInput func(interface{}) (*string, bool)
// CopyInput creates a copy of input to be modified, this ensures the original input is not modified.
CopyInput func(interface{}) (interface{}, error)
// BackfillAccountID points to a function that validates the input for accountID. If absent, it populates the
// accountID. If present, but different than passed in accountID value throws an error
BackfillAccountID func(interface{}, string) error
// UpdateARNField points to a function that takes in a copy of input, updates the ARN field with
// the provided value and returns any error
UpdateARNField func(interface{}, string) error
}
// UpdateEndpointOptions provides the options for the UpdateEndpoint middleware setup.
type UpdateEndpointOptions struct {
// Accessor are parameter accessors used by the middleware
Accessor UpdateEndpointParameterAccessor
// UseARNRegion indicates if region parsed from an ARN should be used.
UseARNRegion bool
// EndpointResolver used to resolve endpoints. This may be a custom endpoint resolver
EndpointResolver EndpointResolver
// EndpointResolverOptions used by endpoint resolver
EndpointResolverOptions EndpointResolverOptions
}
// UpdateEndpoint adds the middleware to the middleware stack based on the UpdateEndpointOptions.
func UpdateEndpoint(stack *middleware.Stack, options UpdateEndpointOptions) (err error) {
// validate and backfill account id from ARN
err = stack.Initialize.Add(&BackfillInput{
CopyInput: options.Accessor.CopyInput,
BackfillAccountID: options.Accessor.BackfillAccountID,
}, middleware.Before)
if err != nil {
return err
}
// initial arn look up middleware should be before BackfillInput
err = stack.Initialize.Insert(&s3shared.ARNLookup{
GetARNValue: options.Accessor.GetARNInput,
}, (*BackfillInput)(nil).ID(), middleware.Before)
if err != nil {
return err
}
// process arn
err = stack.Serialize.Insert(&processARNResource{
CopyInput: options.Accessor.CopyInput,
UpdateARNField: options.Accessor.UpdateARNField,
UseARNRegion: options.UseARNRegion,
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointResolverOptions,
}, "OperationSerializer", middleware.Before)
if err != nil {
return err
}
// outpostID middleware
err = stack.Serialize.Insert(&processOutpostIDMiddleware{
GetOutpostID: options.Accessor.GetOutpostIDInput,
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointResolverOptions,
}, (*processARNResource)(nil).ID(), middleware.Before)
if err != nil {
return err
}
return err
}
| 100 |
aws-sdk-go-v2 | aws | Go | package customizations_test
import (
"context"
"fmt"
"strconv"
"strings"
"testing"
"github.com/aws/aws-sdk-go-v2/aws"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/internal/awstesting/unit"
"github.com/aws/aws-sdk-go-v2/service/s3control"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
type s3controlEndpointTest struct {
bucket string
accountID string
url string
err string
}
func TestUpdateEndpointBuild(t *testing.T) {
cases := map[string]map[string]struct {
tests []s3controlEndpointTest
useDualstack bool
customEndpoint *aws.Endpoint
}{
"default endpoint": {
"default": {
tests: []s3controlEndpointTest{
{"abc", "123456789012", "https://123456789012.s3-control.mock-region.amazonaws.com/v20180820/bucket/abc", ""},
{"a.b.c", "123456789012", "https://123456789012.s3-control.mock-region.amazonaws.com/v20180820/bucket/a.b.c", ""},
{"a$b$c", "123456789012", "https://123456789012.s3-control.mock-region.amazonaws.com/v20180820/bucket/a%24b%24c", ""},
},
},
"DualStack": {
useDualstack: true,
tests: []s3controlEndpointTest{
{"abc", "123456789012", "https://123456789012.s3-control.dualstack.mock-region.amazonaws.com/v20180820/bucket/abc", ""},
{"a.b.c", "123456789012", "https://123456789012.s3-control.dualstack.mock-region.amazonaws.com/v20180820/bucket/a.b.c", ""},
{"a$b$c", "123456789012", "https://123456789012.s3-control.dualstack.mock-region.amazonaws.com/v20180820/bucket/a%24b%24c", ""},
},
},
},
"immutable endpoint": {
"default": {
customEndpoint: &aws.Endpoint{
URL: "https://example.region.amazonaws.com",
HostnameImmutable: true,
},
tests: []s3controlEndpointTest{
{"abc", "123456789012", "https://example.region.amazonaws.com/v20180820/bucket/abc", ""},
{"a.b.c", "123456789012", "https://example.region.amazonaws.com/v20180820/bucket/a.b.c", ""},
{"a$b$c", "123456789012", "https://example.region.amazonaws.com/v20180820/bucket/a%24b%24c", ""},
},
},
},
}
for suitName, cs := range cases {
t.Run(suitName, func(t *testing.T) {
for unitName, c := range cs {
t.Run(unitName, func(t *testing.T) {
options := s3control.Options{
Credentials: unit.StubCredentialsProvider{},
Retryer: aws.NopRetryer{},
Region: "mock-region",
HTTPClient: smithyhttp.NopClient{},
UseDualstack: c.useDualstack,
}
if c.customEndpoint != nil {
options.EndpointResolver = s3control.EndpointResolverFunc(
func(region string, options s3control.EndpointResolverOptions) (aws.Endpoint, error) {
return *c.customEndpoint, nil
})
}
svc := s3control.New(options)
for i, test := range c.tests {
t.Run(strconv.Itoa(i), func(t *testing.T) {
fm := requestRetrieverMiddleware{}
_, err := svc.DeleteBucket(context.Background(),
&s3control.DeleteBucketInput{
Bucket: &test.bucket,
AccountId: &test.accountID,
},
func(options *s3control.Options) {
options.APIOptions = append(options.APIOptions,
func(stack *middleware.Stack) error {
stack.Serialize.Insert(&fm,
"OperationSerializer", middleware.Before)
return nil
})
},
)
if test.err != "" {
if err == nil {
t.Fatalf("test %d: expected error, got none", i)
}
if a, e := err.Error(), test.err; !strings.Contains(a, e) {
t.Fatalf("expect error code to contain %q, got %q", e, a)
}
return
}
if err != nil {
t.Fatalf("expect no error, got %v", err)
}
req := fm.request.Build(context.Background())
if e, a := test.url, req.URL.String(); e != a {
t.Fatalf("expect URL %s, got %s", e, a)
}
})
}
})
}
})
}
}
func TestEndpointWithARN(t *testing.T) {
// test cases
cases := map[string]struct {
options s3control.Options
bucket string
expectedErr string
expectedReqURL string
expectedSigningName string
expectedSigningRegion string
expectedHeaderForOutpostID string
expectedHeaderForAccountID bool
}{
"Outpost AccessPoint with no S3UseARNRegion flag set": {
bucket: "arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint",
options: s3control.Options{
Region: "us-west-2",
},
expectedReqURL: "https://s3-outposts.us-west-2.amazonaws.com/v20180820/bucket/myaccesspoint",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-west-2",
expectedHeaderForAccountID: true,
expectedHeaderForOutpostID: "op-01234567890123456",
},
"Outpost AccessPoint Cross-Region Enabled": {
bucket: "arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint",
options: s3control.Options{
Region: "us-west-2",
UseARNRegion: true,
},
expectedReqURL: "https://s3-outposts.us-east-1.amazonaws.com/v20180820/bucket/myaccesspoint",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-east-1",
expectedHeaderForAccountID: true,
expectedHeaderForOutpostID: "op-01234567890123456",
},
"Outpost AccessPoint Cross-Region Disabled": {
bucket: "arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint",
options: s3control.Options{
Region: "us-west-2",
},
expectedErr: "client region does not match provided ARN region",
},
"Outpost AccessPoint other partition": {
bucket: "arn:aws-cn:s3-outposts:cn-north-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint",
options: s3control.Options{
Region: "us-west-2",
UseARNRegion: true,
},
expectedErr: "ConfigurationError : client partition does not match provided ARN partition",
},
"Outpost AccessPoint us-gov region": {
bucket: "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint",
options: s3control.Options{
Region: "us-gov-east-1",
UseARNRegion: true,
},
expectedReqURL: "https://s3-outposts.us-gov-east-1.amazonaws.com/v20180820/bucket/myaccesspoint",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-gov-east-1",
expectedHeaderForAccountID: true,
expectedHeaderForOutpostID: "op-01234567890123456",
},
"Outpost AccessPoint with client region as FIPS": {
bucket: "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint",
options: s3control.Options{
Region: "us-gov-east-1",
EndpointOptions: s3control.EndpointResolverOptions{
UseFIPSEndpoint: aws.FIPSEndpointStateEnabled,
},
},
expectedReqURL: "https://s3-outposts-fips.us-gov-east-1.amazonaws.com/v20180820/bucket/myaccesspoint",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-gov-east-1",
expectedHeaderForOutpostID: "op-01234567890123456",
expectedHeaderForAccountID: true,
},
"Outpost AccessPoint with client region as FIPS (ResolvedRegion)": {
bucket: "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint",
options: s3control.Options{
Region: "us-gov-east-1-fips",
},
expectedReqURL: "https://s3-outposts-fips.us-gov-east-1.amazonaws.com/v20180820/bucket/myaccesspoint",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-gov-east-1",
expectedHeaderForOutpostID: "op-01234567890123456",
expectedHeaderForAccountID: true,
},
"Outpost AccessPoint with client FIPS and use arn region enabled": {
bucket: "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint",
options: s3control.Options{
Region: "us-gov-east-1",
EndpointOptions: s3control.EndpointResolverOptions{
UseFIPSEndpoint: aws.FIPSEndpointStateEnabled,
},
UseARNRegion: true,
},
expectedReqURL: "https://s3-outposts-fips.us-gov-east-1.amazonaws.com/v20180820/bucket/myaccesspoint",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-gov-east-1",
expectedHeaderForOutpostID: "op-01234567890123456",
expectedHeaderForAccountID: true,
},
"Outpost AccessPoint with client FIPS (ResolvedRegion) and use arn region enabled": {
bucket: "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint",
options: s3control.Options{
Region: "us-gov-east-1-fips",
UseARNRegion: true,
},
expectedReqURL: "https://s3-outposts-fips.us-gov-east-1.amazonaws.com/v20180820/bucket/myaccesspoint",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-gov-east-1",
expectedHeaderForOutpostID: "op-01234567890123456",
expectedHeaderForAccountID: true,
},
"Outpost AccessPoint client FIPS and cross region ARN": {
bucket: "arn:aws-us-gov:s3-outposts:us-gov-west-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint",
options: s3control.Options{
Region: "us-gov-east-1",
UseARNRegion: true,
EndpointOptions: s3control.EndpointResolverOptions{
UseFIPSEndpoint: aws.FIPSEndpointStateEnabled,
},
},
expectedReqURL: "https://s3-outposts-fips.us-gov-west-1.amazonaws.com/v20180820/bucket/myaccesspoint",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-gov-west-1",
expectedHeaderForOutpostID: "op-01234567890123456",
expectedHeaderForAccountID: true,
},
"Outpost AccessPoint client FIPS (ResolvedRegion) and cross region ARN": {
bucket: "arn:aws-us-gov:s3-outposts:us-gov-west-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint",
options: s3control.Options{
Region: "us-gov-east-1-fips",
UseARNRegion: true,
},
expectedReqURL: "https://s3-outposts-fips.us-gov-west-1.amazonaws.com/v20180820/bucket/myaccesspoint",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-gov-west-1",
expectedHeaderForOutpostID: "op-01234567890123456",
expectedHeaderForAccountID: true,
},
"Outpost AccessPoint client FIPS with valid ARN region": {
bucket: "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint",
options: s3control.Options{
Region: "us-gov-east-1",
EndpointOptions: s3control.EndpointResolverOptions{
UseFIPSEndpoint: aws.FIPSEndpointStateEnabled,
},
UseARNRegion: true,
},
expectedReqURL: "https://s3-outposts-fips.us-gov-east-1.amazonaws.com/v20180820/bucket/myaccesspoint",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-gov-east-1",
expectedHeaderForOutpostID: "op-01234567890123456",
expectedHeaderForAccountID: true,
},
"Outpost AccessPoint client FIPS (ResolvedRegion) with valid ARN region": {
bucket: "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint",
options: s3control.Options{
Region: "us-gov-east-1-fips",
UseARNRegion: true,
},
expectedReqURL: "https://s3-outposts-fips.us-gov-east-1.amazonaws.com/v20180820/bucket/myaccesspoint",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-gov-east-1",
expectedHeaderForOutpostID: "op-01234567890123456",
expectedHeaderForAccountID: true,
},
"Outpost AccessPoint with DualStack": {
bucket: "arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint",
options: s3control.Options{
Region: "us-west-2",
UseARNRegion: true,
UseDualstack: true,
},
expectedErr: "ConfigurationError : client configured for S3 Dual-stack but is not supported with resource ARN",
},
"Invalid outpost resource format": {
bucket: "arn:aws:s3-outposts:us-west-2:123456789012:outpost",
options: s3control.Options{
Region: "us-west-2",
},
expectedErr: "outpost resource-id not set",
},
"Missing access point for outpost resource": {
bucket: "arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456",
options: s3control.Options{
Region: "us-west-2",
},
expectedErr: "incomplete outpost resource type",
},
"access point": {
bucket: "myaccesspoint",
options: s3control.Options{
Region: "us-west-2",
},
expectedReqURL: "https://123456789012.s3-control.us-west-2.amazonaws.com/v20180820/bucket/myaccesspoint",
expectedHeaderForAccountID: true,
expectedSigningRegion: "us-west-2",
expectedSigningName: "s3",
},
"outpost access point with unsupported sub-resource": {
bucket: "arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:mybucket:object:foo",
options: s3control.Options{
Region: "us-west-2",
},
expectedErr: "sub resource not supported",
},
"Missing outpost identifiers in outpost access point arn": {
bucket: "arn:aws:s3-outposts:us-west-2:123456789012:accesspoint:myendpoint",
options: s3control.Options{
Region: "us-west-2",
},
expectedErr: "invalid Amazon s3-outposts ARN",
},
"Outpost Bucket with no S3UseARNRegion flag set": {
bucket: "arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:bucket:mybucket",
options: s3control.Options{
Region: "us-west-2",
},
expectedReqURL: "https://s3-outposts.us-west-2.amazonaws.com/v20180820/bucket/mybucket",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-west-2",
expectedHeaderForOutpostID: "op-01234567890123456",
expectedHeaderForAccountID: true,
},
"Outpost Bucket Cross-Region Enabled": {
bucket: "arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket",
options: s3control.Options{
Region: "us-west-2",
UseARNRegion: true,
},
expectedReqURL: "https://s3-outposts.us-east-1.amazonaws.com/v20180820/bucket/mybucket",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-east-1",
expectedHeaderForOutpostID: "op-01234567890123456",
expectedHeaderForAccountID: true,
},
"Outpost Bucket Cross-Region Disabled": {
bucket: "arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket",
options: s3control.Options{
Region: "us-west-2",
},
expectedErr: "client region does not match provided ARN region",
},
"Outpost Bucket other partition": {
bucket: "arn:aws-cn:s3-outposts:cn-north-1:123456789012:outpost:op-01234567890123456:bucket:mybucket",
options: s3control.Options{
Region: "us-west-2",
UseARNRegion: true,
},
expectedErr: "ConfigurationError : client partition does not match provided ARN partition",
},
"Outpost Bucket us-gov region": {
bucket: "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket",
options: s3control.Options{
Region: "us-gov-east-1",
UseARNRegion: true,
},
expectedReqURL: "https://s3-outposts.us-gov-east-1.amazonaws.com/v20180820/bucket/mybucket",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-gov-east-1",
expectedHeaderForOutpostID: "op-01234567890123456",
expectedHeaderForAccountID: true,
},
"Outpost Bucket client FIPS, cross-region ARN": {
bucket: "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket",
options: s3control.Options{
Region: "us-gov-west-1",
EndpointOptions: s3control.EndpointResolverOptions{
UseFIPSEndpoint: aws.FIPSEndpointStateEnabled,
},
},
expectedErr: "ConfigurationError : client region does not match provided ARN region",
},
"Outpost Bucket client FIPS (ResolvedRegion), cross-region ARN": {
bucket: "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket",
options: s3control.Options{
Region: "us-gov-west-1-fips",
},
expectedErr: "ConfigurationError : client region does not match provided ARN region",
},
"Outpost Bucket client FIPS with non cross-region ARN region": {
bucket: "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket",
options: s3control.Options{
Region: "us-gov-east-1",
UseARNRegion: true,
EndpointOptions: s3control.EndpointResolverOptions{
UseFIPSEndpoint: aws.FIPSEndpointStateEnabled,
},
},
expectedReqURL: "https://s3-outposts-fips.us-gov-east-1.amazonaws.com/v20180820/bucket/mybucket",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-gov-east-1",
expectedHeaderForOutpostID: "op-01234567890123456",
expectedHeaderForAccountID: true,
},
"Outpost Bucket client FIPS (ResolvedRegion) with non cross-region ARN region": {
bucket: "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket",
options: s3control.Options{
Region: "us-gov-east-1-fips",
UseARNRegion: true,
},
expectedReqURL: "https://s3-outposts-fips.us-gov-east-1.amazonaws.com/v20180820/bucket/mybucket",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-gov-east-1",
expectedHeaderForOutpostID: "op-01234567890123456",
expectedHeaderForAccountID: true,
},
"Outpost Bucket with DualStack": {
bucket: "arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:bucket:mybucket",
options: s3control.Options{
Region: "us-west-2",
UseDualstack: true,
},
expectedErr: "ConfigurationError : client configured for S3 Dual-stack but is not supported with resource ARN",
},
"Missing bucket id": {
bucket: "arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:bucket",
options: s3control.Options{
Region: "us-west-2",
},
expectedErr: "invalid Amazon s3-outposts ARN",
},
"Invalid ARN": {
bucket: "arn:aws:s3-outposts:us-west-2:123456789012:bucket:mybucket",
options: s3control.Options{
Region: "us-west-2",
},
expectedErr: "invalid Amazon s3-outposts ARN, unknown resource type",
},
"Invalid Outpost Bucket ARN with FIPS pseudo-region (prefix)": {
bucket: "arn:aws:s3-outposts:fips-us-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket",
options: s3control.Options{
Region: "us-west-2",
UseARNRegion: true,
},
expectedErr: "FIPS region not allowed in ARN",
},
"Invalid Outpost Bucket ARN with FIPS pseudo-region (suffix)": {
bucket: "arn:aws:s3-outposts:us-east-1-fips:123456789012:outpost:op-01234567890123456:bucket:mybucket",
options: s3control.Options{
Region: "us-west-2",
UseARNRegion: true,
},
expectedErr: "FIPS region not allowed in ARN",
},
"Invalid Outpost AccessPoint ARN with FIPS pseudo-region (prefix)": {
bucket: "arn:aws-us-gov:s3-outposts:fips-us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint",
options: s3control.Options{
Region: "us-west-2",
UseARNRegion: true,
},
expectedErr: "FIPS region not allowed in ARN",
},
"Invalid Outpost AccessPoint ARN with FIPS pseudo-region (suffix)": {
bucket: "arn:aws-us-gov:s3-outposts:us-east-1-fips:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint",
options: s3control.Options{
Region: "us-west-2",
UseARNRegion: true,
},
expectedErr: "FIPS region not allowed in ARN",
},
}
for name, c := range cases {
t.Run(name, func(t *testing.T) {
// options
opts := c.options.Copy()
opts.Credentials = unit.StubCredentialsProvider{}
opts.HTTPClient = smithyhttp.NopClient{}
opts.Retryer = aws.NopRetryer{}
// build an s3control client
svc := s3control.New(opts)
// setup a request retriever middleware
fm := requestRetrieverMiddleware{}
ctx := context.Background()
// call an operation
_, err := svc.GetBucket(ctx, &s3control.GetBucketInput{
Bucket: ptr.String(c.bucket),
AccountId: ptr.String("123456789012"),
}, func(options *s3control.Options) {
// append request retriever middleware for request inspection
options.APIOptions = append(options.APIOptions,
func(stack *middleware.Stack) error {
// adds AFTER operation serializer middleware
stack.Serialize.Insert(&fm, "OperationSerializer", middleware.After)
return nil
})
})
// inspect any errors
if len(c.expectedErr) != 0 {
if err == nil {
t.Fatalf("expected error, got none")
}
if a, e := err.Error(), c.expectedErr; !strings.Contains(a, e) {
t.Fatalf("expect error code to contain %q, got %q", e, a)
}
return
}
if err != nil {
t.Fatalf("expect no error, got %v", err)
}
// build the captured request
req := fm.request.Build(ctx)
// verify the built request is as expected
if e, a := c.expectedReqURL, req.URL.String(); e != a {
t.Fatalf("expect url %s, got %s", e, a)
}
if e, a := c.expectedSigningRegion, fm.signingRegion; !strings.EqualFold(e, a) {
t.Fatalf("expect signing region as %s, got %s", e, a)
}
if e, a := c.expectedSigningName, fm.signingName; !strings.EqualFold(e, a) {
t.Fatalf("expect signing name as %s, got %s", e, a)
}
if c.expectedHeaderForAccountID {
if e, a := "123456789012", req.Header.Get("x-amz-account-id"); e != a {
t.Fatalf("expect account id header value to be %v, got %v", e, a)
}
}
if e, a := c.expectedHeaderForOutpostID, req.Header.Get("x-amz-outpost-id"); e != a {
t.Fatalf("expect outpost id header value to be %v, got %v", e, a)
}
})
}
}
type requestRetrieverMiddleware struct {
request *smithyhttp.Request
signingRegion string
signingName string
}
func TestCustomEndpoint_SpecialOperations(t *testing.T) {
cases := map[string]testCaseForEndpointCustomization{
"CreateBucketOperation": {
options: s3control.Options{
Region: "us-west-2",
},
operation: func(ctx context.Context, svc *s3control.Client, fm *requestRetrieverMiddleware) (interface{}, error) {
return svc.CreateBucket(ctx, &s3control.CreateBucketInput{
Bucket: aws.String("mockBucket"),
OutpostId: aws.String("op-01234567890123456"),
}, func(options *s3control.Options) {
// append request retriever middleware for request inspection
options.APIOptions = append(options.APIOptions,
func(stack *middleware.Stack) error {
// adds AFTER operation serializer middleware
stack.Serialize.Insert(fm, "OperationSerializer", middleware.After)
return nil
})
})
},
expectedReqURL: "https://s3-outposts.us-west-2.amazonaws.com/v20180820/bucket/mockBucket",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-west-2",
expectedHeaderForOutpostID: "op-01234567890123456",
expectedHeaderForAccountID: false,
},
"ListRegionalBucketsOperation": {
options: s3control.Options{
Region: "us-west-2",
},
operation: func(ctx context.Context, svc *s3control.Client, fm *requestRetrieverMiddleware) (interface{}, error) {
return svc.ListRegionalBuckets(ctx, &s3control.ListRegionalBucketsInput{
AccountId: aws.String("123456789012"),
OutpostId: aws.String("op-01234567890123456"),
}, func(options *s3control.Options) {
// append request retriever middleware for request inspection
options.APIOptions = append(options.APIOptions,
func(stack *middleware.Stack) error {
// adds AFTER operation serializer middleware
stack.Serialize.Insert(fm, "OperationSerializer", middleware.After)
return nil
})
})
},
expectedReqURL: "https://s3-outposts.us-west-2.amazonaws.com/v20180820/bucket",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-west-2",
expectedHeaderForOutpostID: "op-01234567890123456",
expectedHeaderForAccountID: true,
},
"ListRegionalBucketsOperation with client FIPS": {
options: s3control.Options{
Region: "us-west-2",
EndpointOptions: s3control.EndpointResolverOptions{
UseFIPSEndpoint: aws.FIPSEndpointStateEnabled,
},
},
operation: func(ctx context.Context, svc *s3control.Client, fm *requestRetrieverMiddleware) (interface{}, error) {
return svc.ListRegionalBuckets(ctx, &s3control.ListRegionalBucketsInput{
AccountId: aws.String("123456789012"),
OutpostId: aws.String("op-01234567890123456"),
}, func(options *s3control.Options) {
// append request retriever middleware for request inspection
options.APIOptions = append(options.APIOptions,
func(stack *middleware.Stack) error {
// adds AFTER operation serializer middleware
stack.Serialize.Insert(fm, "OperationSerializer", middleware.After)
return nil
})
})
},
expectedReqURL: "https://s3-outposts-fips.us-west-2.amazonaws.com/v20180820/bucket",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-west-2",
expectedHeaderForOutpostID: "op-01234567890123456",
expectedHeaderForAccountID: true,
},
"ListRegionalBucketsOperation with client FIPS (ResolvedRegion)": {
options: s3control.Options{
Region: "us-west-2-fips",
},
operation: func(ctx context.Context, svc *s3control.Client, fm *requestRetrieverMiddleware) (interface{}, error) {
return svc.ListRegionalBuckets(ctx, &s3control.ListRegionalBucketsInput{
AccountId: aws.String("123456789012"),
OutpostId: aws.String("op-01234567890123456"),
}, func(options *s3control.Options) {
// append request retriever middleware for request inspection
options.APIOptions = append(options.APIOptions,
func(stack *middleware.Stack) error {
// adds AFTER operation serializer middleware
stack.Serialize.Insert(fm, "OperationSerializer", middleware.After)
return nil
})
})
},
expectedReqURL: "https://s3-outposts-fips.us-west-2.amazonaws.com/v20180820/bucket",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-west-2",
expectedHeaderForOutpostID: "op-01234567890123456",
expectedHeaderForAccountID: true,
},
"CreateBucketOperation with client FIPS": {
options: s3control.Options{
Region: "us-gov-west-1",
EndpointOptions: s3control.EndpointResolverOptions{
UseFIPSEndpoint: aws.FIPSEndpointStateEnabled,
},
},
operation: func(ctx context.Context, svc *s3control.Client, fm *requestRetrieverMiddleware) (interface{}, error) {
return svc.CreateBucket(ctx, &s3control.CreateBucketInput{
Bucket: aws.String("mockBucket"),
OutpostId: aws.String("op-01234567890123456"),
}, func(options *s3control.Options) {
// append request retriever middleware for request inspection
options.APIOptions = append(options.APIOptions,
func(stack *middleware.Stack) error {
// adds AFTER operation serializer middleware
stack.Serialize.Insert(fm, "OperationSerializer", middleware.After)
return nil
})
})
},
expectedReqURL: "https://s3-outposts-fips.us-gov-west-1.amazonaws.com/v20180820/bucket/mockBucket",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-gov-west-1",
expectedHeaderForOutpostID: "op-01234567890123456",
expectedHeaderForAccountID: false,
},
"CreateBucketOperation with client FIPS (ResolvedRegion)": {
options: s3control.Options{
Region: "us-gov-west-1-fips",
},
operation: func(ctx context.Context, svc *s3control.Client, fm *requestRetrieverMiddleware) (interface{}, error) {
return svc.CreateBucket(ctx, &s3control.CreateBucketInput{
Bucket: aws.String("mockBucket"),
OutpostId: aws.String("op-01234567890123456"),
}, func(options *s3control.Options) {
// append request retriever middleware for request inspection
options.APIOptions = append(options.APIOptions,
func(stack *middleware.Stack) error {
// adds AFTER operation serializer middleware
stack.Serialize.Insert(fm, "OperationSerializer", middleware.After)
return nil
})
})
},
expectedReqURL: "https://s3-outposts-fips.us-gov-west-1.amazonaws.com/v20180820/bucket/mockBucket",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-gov-west-1",
expectedHeaderForOutpostID: "op-01234567890123456",
expectedHeaderForAccountID: false,
},
"CreateAccessPoint bucket arn": {
options: s3control.Options{
Region: "us-west-2",
},
operation: func(ctx context.Context, svc *s3control.Client, fm *requestRetrieverMiddleware) (interface{}, error) {
return svc.CreateAccessPoint(ctx, &s3control.CreateAccessPointInput{
AccountId: aws.String("123456789012"),
Bucket: aws.String("arn:aws:s3:us-west-2:123456789012:bucket:mockBucket"),
Name: aws.String("mockName"),
}, func(options *s3control.Options) {
// append request retriever middleware for request inspection
options.APIOptions = append(options.APIOptions,
func(stack *middleware.Stack) error {
// adds AFTER operation serializer middleware
stack.Serialize.Insert(fm, "OperationSerializer", middleware.After)
return nil
})
})
},
expectedErr: "invalid Amazon s3 ARN, unknown resource type",
},
"CreateAccessPoint outpost bucket arn": {
options: s3control.Options{
Region: "us-west-2",
},
operation: func(ctx context.Context, svc *s3control.Client, fm *requestRetrieverMiddleware) (interface{}, error) {
return svc.CreateAccessPoint(ctx, &s3control.CreateAccessPointInput{
AccountId: aws.String("123456789012"),
Bucket: aws.String("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:bucket:mockBucket"),
Name: aws.String("mockName"),
}, func(options *s3control.Options) {
// append request retriever middleware for request inspection
options.APIOptions = append(options.APIOptions,
func(stack *middleware.Stack) error {
// adds AFTER operation serializer middleware
stack.Serialize.Insert(fm, "OperationSerializer", middleware.After)
return nil
})
})
},
expectedReqURL: "https://s3-outposts.us-west-2.amazonaws.com/v20180820/accesspoint/mockName",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-west-2",
expectedHeaderForOutpostID: "op-01234567890123456",
},
"CreateAccessPoint outpost bucket arn, client FIPS": {
options: s3control.Options{
Region: "us-west-2",
EndpointOptions: s3control.EndpointResolverOptions{
UseFIPSEndpoint: aws.FIPSEndpointStateEnabled,
},
},
operation: func(ctx context.Context, svc *s3control.Client, fm *requestRetrieverMiddleware) (interface{}, error) {
return svc.CreateAccessPoint(ctx, &s3control.CreateAccessPointInput{
AccountId: aws.String("123456789012"),
Bucket: aws.String("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:bucket:mockBucket"),
Name: aws.String("mockName"),
}, func(options *s3control.Options) {
// append request retriever middleware for request inspection
options.APIOptions = append(options.APIOptions,
func(stack *middleware.Stack) error {
// adds AFTER operation serializer middleware
stack.Serialize.Insert(fm, "OperationSerializer", middleware.After)
return nil
})
})
},
expectedReqURL: "https://s3-outposts-fips.us-west-2.amazonaws.com/v20180820/accesspoint/mockName",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-west-2",
expectedHeaderForOutpostID: "op-01234567890123456",
},
"CreateAccessPoint outpost bucket arn, client FIPS (ResolvedRegion)": {
options: s3control.Options{
Region: "us-west-2-fips",
},
operation: func(ctx context.Context, svc *s3control.Client, fm *requestRetrieverMiddleware) (interface{}, error) {
return svc.CreateAccessPoint(ctx, &s3control.CreateAccessPointInput{
AccountId: aws.String("123456789012"),
Bucket: aws.String("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:bucket:mockBucket"),
Name: aws.String("mockName"),
}, func(options *s3control.Options) {
// append request retriever middleware for request inspection
options.APIOptions = append(options.APIOptions,
func(stack *middleware.Stack) error {
// adds AFTER operation serializer middleware
stack.Serialize.Insert(fm, "OperationSerializer", middleware.After)
return nil
})
})
},
expectedReqURL: "https://s3-outposts-fips.us-west-2.amazonaws.com/v20180820/accesspoint/mockName",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-west-2",
expectedHeaderForOutpostID: "op-01234567890123456",
},
}
for name, c := range cases {
t.Run(name, func(t *testing.T) {
runValidations(t, c)
})
}
}
func runValidations(t *testing.T, c testCaseForEndpointCustomization) {
// options
opts := c.options.Copy()
opts.Credentials = unit.StubCredentialsProvider{}
opts.HTTPClient = smithyhttp.NopClient{}
opts.Retryer = aws.NopRetryer{}
// build an s3control client
svc := s3control.New(opts)
// setup a request retriever middleware
fm := requestRetrieverMiddleware{}
ctx := context.Background()
// call an operation
_, err := c.operation(ctx, svc, &fm)
// inspect any errors
if len(c.expectedErr) != 0 {
if err == nil {
t.Fatalf("expected error, got none")
}
if a, e := err.Error(), c.expectedErr; !strings.Contains(a, e) {
t.Fatalf("expect error code to contain %q, got %q", e, a)
}
return
}
if err != nil {
t.Fatalf("expect no error, got %v", err)
}
// build the captured request
req := fm.request.Build(ctx)
// verify the built request is as expected
if e, a := c.expectedReqURL, req.URL.String(); e != a {
t.Fatalf("expect url %s, got %s", e, a)
}
if e, a := c.expectedSigningRegion, fm.signingRegion; !strings.EqualFold(e, a) {
t.Fatalf("expect signing region as %s, got %s", e, a)
}
if e, a := c.expectedSigningName, fm.signingName; !strings.EqualFold(e, a) {
t.Fatalf("expect signing name as %s, got %s", e, a)
}
if c.expectedHeaderForAccountID {
if e, a := "123456789012", req.Header.Get("x-amz-account-id"); e != a {
t.Fatalf("expect account id header value to be %v, got %v", e, a)
}
}
if e, a := c.expectedHeaderForOutpostID, req.Header.Get("x-amz-outpost-id"); e != a {
t.Fatalf("expect outpost id header value to be %v, got %v", e, a)
}
}
type testCaseForEndpointCustomization struct {
options s3control.Options
operation func(context.Context, *s3control.Client, *requestRetrieverMiddleware) (interface{}, error)
expectedReqURL string
expectedSigningName string
expectedSigningRegion string
expectedHeaderForOutpostID string
expectedErr string
expectedHeaderForAccountID bool
}
func TestVPC_CustomEndpoint(t *testing.T) {
account := "123456789012"
cases := map[string]testCaseForEndpointCustomization{
"standard GetAccesspoint with custom endpoint url": {
options: s3control.Options{
EndpointResolver: s3control.EndpointResolverFromURL("https://beta.example.com"),
Region: "us-west-2",
},
operation: func(ctx context.Context, svc *s3control.Client, fm *requestRetrieverMiddleware) (interface{}, error) {
return svc.GetAccessPoint(ctx, &s3control.GetAccessPointInput{
AccountId: aws.String(account),
Name: aws.String("apname"),
}, addRequestRetriever(fm))
},
expectedReqURL: "https://123456789012.beta.example.com/v20180820/accesspoint/apname",
expectedSigningName: "s3",
expectedSigningRegion: "us-west-2",
},
"Outpost Accesspoint ARN with GetAccesspoint and custom endpoint url": {
options: s3control.Options{
EndpointResolver: s3control.EndpointResolverFromURL(
"https://beta.example.com",
),
Region: "us-west-2",
},
operation: func(ctx context.Context, svc *s3control.Client, fm *requestRetrieverMiddleware) (interface{}, error) {
return svc.GetAccessPoint(ctx, &s3control.GetAccessPointInput{
AccountId: aws.String(account),
Name: aws.String("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint"),
}, addRequestRetriever(fm))
},
expectedReqURL: "https://beta.example.com/v20180820/accesspoint/myaccesspoint",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-west-2",
expectedHeaderForOutpostID: "op-01234567890123456",
},
"standard CreateBucket with custom endpoint url": {
options: s3control.Options{
EndpointResolver: s3control.EndpointResolverFromURL("https://beta.example.com"),
Region: "us-west-2",
},
operation: func(ctx context.Context, svc *s3control.Client, fm *requestRetrieverMiddleware) (interface{}, error) {
return svc.CreateBucket(ctx, &s3control.CreateBucketInput{
Bucket: aws.String("bucketname"),
OutpostId: aws.String("op-01234567890123456"),
}, addRequestRetriever(fm))
},
expectedReqURL: "https://beta.example.com/v20180820/bucket/bucketname",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-west-2",
expectedHeaderForOutpostID: "op-01234567890123456",
},
"Outpost Accesspoint for GetBucket with custom endpoint url": {
options: s3control.Options{
EndpointResolver: s3control.EndpointResolverFromURL("https://beta.example.com"),
Region: "us-west-2",
},
operation: func(ctx context.Context, svc *s3control.Client, fm *requestRetrieverMiddleware) (interface{}, error) {
return svc.GetBucket(ctx, &s3control.GetBucketInput{
Bucket: aws.String("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:bucket:mybucket"),
}, addRequestRetriever(fm))
},
expectedReqURL: "https://beta.example.com/v20180820/bucket/mybucket",
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-west-2",
expectedHeaderForOutpostID: "op-01234567890123456",
},
"GetAccesspoint with dualstack and custom endpoint url": {
options: s3control.Options{
EndpointResolver: s3control.EndpointResolverFromURL("https://beta.example.com"),
Region: "us-west-2",
UseDualstack: true,
},
operation: func(ctx context.Context, svc *s3control.Client, fm *requestRetrieverMiddleware) (interface{}, error) {
return svc.GetAccessPoint(ctx, &s3control.GetAccessPointInput{
AccountId: aws.String(account),
Name: aws.String("apname"),
}, addRequestRetriever(fm))
},
expectedReqURL: "https://123456789012.beta.example.com/v20180820/accesspoint/apname",
expectedSigningName: "s3",
expectedSigningRegion: "us-west-2",
},
"GetAccesspoint with Outposts accesspoint ARN and dualstack": {
options: s3control.Options{
EndpointResolver: s3control.EndpointResolverFromURL("https://beta.example.com"),
Region: "us-west-2",
UseDualstack: true,
},
operation: func(ctx context.Context, svc *s3control.Client, fm *requestRetrieverMiddleware) (interface{}, error) {
return svc.GetAccessPoint(ctx, &s3control.GetAccessPointInput{
AccountId: aws.String(account),
Name: aws.String("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint"),
}, addRequestRetriever(fm))
},
expectedErr: "client configured for S3 Dual-stack but is not supported with resource ARN",
},
"standard CreateBucket with dualstack": {
options: s3control.Options{
EndpointResolver: s3control.EndpointResolverFromURL("https://beta.example.com"),
Region: "us-west-2",
UseDualstack: true,
},
operation: func(ctx context.Context, svc *s3control.Client, fm *requestRetrieverMiddleware) (interface{}, error) {
return svc.CreateBucket(ctx, &s3control.CreateBucketInput{
Bucket: aws.String("bucketname"),
OutpostId: aws.String("op-1234567890123456"),
}, addRequestRetriever(fm))
},
expectedErr: " dualstack is not supported for outposts request",
},
"GetBucket with Outpost bucket ARN": {
options: s3control.Options{
EndpointResolver: s3control.EndpointResolverFromURL("https://beta.example.com"),
Region: "us-west-2",
UseDualstack: true,
},
operation: func(ctx context.Context, svc *s3control.Client, fm *requestRetrieverMiddleware) (interface{}, error) {
return svc.GetBucket(ctx, &s3control.GetBucketInput{
Bucket: aws.String("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:bucket:mybucket"),
}, addRequestRetriever(fm))
},
expectedErr: "client configured for S3 Dual-stack but is not supported with resource ARN",
},
}
for name, c := range cases {
t.Run(name, func(t *testing.T) {
runValidations(t, c)
})
}
}
func TestInputIsNotModified(t *testing.T) {
inputBucket := "arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket"
// build options
opts := s3control.Options{}
opts.Credentials = unit.StubCredentialsProvider{}
opts.HTTPClient = smithyhttp.NopClient{}
opts.Retryer = aws.NopRetryer{}
opts.Region = "us-west-2"
opts.UseARNRegion = true
ctx := context.Background()
fm := requestRetrieverMiddleware{}
svc := s3control.New(opts)
params := s3control.DeleteBucketInput{Bucket: ptr.String(inputBucket)}
_, err := svc.DeleteBucket(ctx, ¶ms, func(options *s3control.Options) {
// append request retriever middleware for request inspection
options.APIOptions = append(options.APIOptions,
func(stack *middleware.Stack) error {
// adds AFTER operation serializer middleware
stack.Serialize.Insert(&fm, "OperationSerializer", middleware.After)
return nil
})
})
if err != nil {
t.Fatalf("expect no error, got %v", err.Error())
}
// check if req params were modified
if e, a := *params.Bucket, inputBucket; !strings.EqualFold(e, a) {
t.Fatalf("expected no modification for operation input, "+
"expected %v, got %v as bucket input", e, a)
}
if params.AccountId != nil {
t.Fatalf("expected original input to be unmodified, but account id was backfilled")
}
req := fm.request.Build(ctx)
modifiedAccountID := req.Header.Get("x-amz-account-id")
if len(modifiedAccountID) == 0 {
t.Fatalf("expected account id to be backfilled/modified, was not")
}
if e, a := "123456789012", modifiedAccountID; !strings.EqualFold(e, a) {
t.Fatalf("unexpected diff in account id backfilled from arn, expected %v, got %v", e, a)
}
}
func TestUseDualStackClientBehavior(t *testing.T) {
cases := map[string]testCaseForEndpointCustomization{
"client options dual-stack false, endpoint resolver dual-stack unset": {
options: s3control.Options{
Region: "us-west-2",
UseDualstack: false,
},
expectedReqURL: "https://012345678901.s3-control.us-west-2.amazonaws.com/v20180820/bucket/test-bucket",
expectedSigningRegion: "us-west-2",
expectedSigningName: "s3",
},
"client options dual-stack true, endpoint resolver dual-stack unset": {
options: s3control.Options{
Region: "us-west-2",
UseDualstack: true,
},
expectedReqURL: "https://012345678901.s3-control.dualstack.us-west-2.amazonaws.com/v20180820/bucket/test-bucket",
expectedSigningRegion: "us-west-2",
expectedSigningName: "s3",
},
"client options dual-stack off, endpoint resolver dual-stack disabled": {
options: s3control.Options{
Region: "us-west-2",
EndpointOptions: s3control.EndpointResolverOptions{
UseDualStackEndpoint: aws.DualStackEndpointStateDisabled,
},
},
expectedReqURL: "https://012345678901.s3-control.us-west-2.amazonaws.com/v20180820/bucket/test-bucket",
expectedSigningRegion: "us-west-2",
expectedSigningName: "s3",
},
"client options dual-stack off, endpoint resolver dual-stack enabled": {
options: s3control.Options{
Region: "us-west-2",
EndpointOptions: s3control.EndpointResolverOptions{
UseDualStackEndpoint: aws.DualStackEndpointStateEnabled,
},
},
expectedReqURL: "https://012345678901.s3-control.dualstack.us-west-2.amazonaws.com/v20180820/bucket/test-bucket",
expectedSigningRegion: "us-west-2",
expectedSigningName: "s3",
},
"client options dual-stack on, endpoint resolver dual-stack disabled": {
options: s3control.Options{
Region: "us-west-2",
UseDualstack: true,
EndpointOptions: s3control.EndpointResolverOptions{
UseDualStackEndpoint: aws.DualStackEndpointStateDisabled,
},
},
expectedReqURL: "https://012345678901.s3-control.us-west-2.amazonaws.com/v20180820/bucket/test-bucket",
expectedSigningRegion: "us-west-2",
expectedSigningName: "s3",
},
"client options dual-stack off, endpoint resolver dual-stack on": {
options: s3control.Options{
Region: "us-west-2",
UseDualstack: false,
EndpointOptions: s3control.EndpointResolverOptions{
UseDualStackEndpoint: aws.DualStackEndpointStateEnabled,
},
},
expectedReqURL: "https://012345678901.s3-control.dualstack.us-west-2.amazonaws.com/v20180820/bucket/test-bucket",
expectedSigningRegion: "us-west-2",
expectedSigningName: "s3",
},
}
for name, tt := range cases {
t.Run(name, func(t *testing.T) {
tt.operation = func(ctx context.Context, client *s3control.Client, retrieverMiddleware *requestRetrieverMiddleware) (interface{}, error) {
return client.GetBucket(ctx, &s3control.GetBucketInput{
AccountId: aws.String("012345678901"),
Bucket: aws.String("test-bucket"),
}, addRequestRetriever(retrieverMiddleware))
}
runValidations(t, tt)
})
}
}
func (*requestRetrieverMiddleware) ID() string { return "S3:requestRetrieverMiddleware" }
func (rm *requestRetrieverMiddleware) 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 request type %T", req)
}
rm.request = req
rm.signingName = awsmiddleware.GetSigningName(ctx)
rm.signingRegion = awsmiddleware.GetSigningRegion(ctx)
return next.HandleSerialize(ctx, in)
}
var addRequestRetriever = func(fm *requestRetrieverMiddleware) func(options *s3control.Options) {
return func(options *s3control.Options) {
// append request retriever middleware for request inspection
options.APIOptions = append(options.APIOptions,
func(stack *middleware.Stack) error {
// adds AFTER operation serializer middleware
stack.Serialize.Insert(fm, "OperationSerializer", middleware.After)
return nil
})
}
}
| 1,193 |
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 S3 Control 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: "s3-control.dualstack.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"s3v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-control-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"s3v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-control-fips.dualstack.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"s3v4"},
},
{
Variant: 0,
}: {
Hostname: "s3-control.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"s3v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{
Hostname: "s3-control.ap-northeast-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-1",
},
},
endpoints.EndpointKey{
Region: "ap-northeast-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.ap-northeast-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-1",
},
},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{
Hostname: "s3-control.ap-northeast-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-2",
},
},
endpoints.EndpointKey{
Region: "ap-northeast-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.ap-northeast-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-2",
},
},
endpoints.EndpointKey{
Region: "ap-northeast-3",
}: endpoints.Endpoint{
Hostname: "s3-control.ap-northeast-3.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-3",
},
},
endpoints.EndpointKey{
Region: "ap-northeast-3",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.ap-northeast-3.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-3",
},
},
endpoints.EndpointKey{
Region: "ap-south-1",
}: endpoints.Endpoint{
Hostname: "s3-control.ap-south-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "ap-south-1",
},
},
endpoints.EndpointKey{
Region: "ap-south-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.ap-south-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "ap-south-1",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{
Hostname: "s3-control.ap-southeast-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-1",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.ap-southeast-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-1",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{
Hostname: "s3-control.ap-southeast-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-2",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.ap-southeast-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-2",
},
},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{
Hostname: "s3-control.ca-central-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
},
endpoints.EndpointKey{
Region: "ca-central-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-control-fips.ca-central-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
},
endpoints.EndpointKey{
Region: "ca-central-1",
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-control-fips.dualstack.ca-central-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
},
endpoints.EndpointKey{
Region: "ca-central-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.ca-central-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
},
endpoints.EndpointKey{
Region: "ca-central-1-fips",
}: endpoints.Endpoint{
Hostname: "s3-control-fips.ca-central-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{
Hostname: "s3-control.eu-central-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "eu-central-1",
},
},
endpoints.EndpointKey{
Region: "eu-central-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.eu-central-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "eu-central-1",
},
},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{
Hostname: "s3-control.eu-north-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "eu-north-1",
},
},
endpoints.EndpointKey{
Region: "eu-north-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.eu-north-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "eu-north-1",
},
},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{
Hostname: "s3-control.eu-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-1",
},
},
endpoints.EndpointKey{
Region: "eu-west-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.eu-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-1",
},
},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{
Hostname: "s3-control.eu-west-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-2",
},
},
endpoints.EndpointKey{
Region: "eu-west-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.eu-west-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-2",
},
},
endpoints.EndpointKey{
Region: "eu-west-3",
}: endpoints.Endpoint{
Hostname: "s3-control.eu-west-3.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-3",
},
},
endpoints.EndpointKey{
Region: "eu-west-3",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.eu-west-3.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-3",
},
},
endpoints.EndpointKey{
Region: "sa-east-1",
}: endpoints.Endpoint{
Hostname: "s3-control.sa-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "sa-east-1",
},
},
endpoints.EndpointKey{
Region: "sa-east-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.sa-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "sa-east-1",
},
},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{
Hostname: "s3-control.us-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-control-fips.dualstack.us-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-control-fips.us-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.us-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
},
endpoints.EndpointKey{
Region: "us-east-1-fips",
}: endpoints.Endpoint{
Hostname: "s3-control-fips.us-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{
Hostname: "s3-control.us-east-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-control-fips.dualstack.us-east-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-control-fips.us-east-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.us-east-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
},
endpoints.EndpointKey{
Region: "us-east-2-fips",
}: endpoints.Endpoint{
Hostname: "s3-control-fips.us-east-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{
Hostname: "s3-control.us-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-control-fips.dualstack.us-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-control-fips.us-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.us-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
},
endpoints.EndpointKey{
Region: "us-west-1-fips",
}: endpoints.Endpoint{
Hostname: "s3-control-fips.us-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{
Hostname: "s3-control.us-west-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-control-fips.dualstack.us-west-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-control-fips.us-west-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.us-west-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
},
endpoints.EndpointKey{
Region: "us-west-2-fips",
}: endpoints.Endpoint{
Hostname: "s3-control-fips.us-west-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"s3v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-control-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"s3v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-control-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"s3v4"},
},
{
Variant: 0,
}: {
Hostname: "s3-control.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"s3v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "cn-north-1",
}: endpoints.Endpoint{
Hostname: "s3-control.cn-north-1.amazonaws.com.cn",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "cn-north-1",
},
},
endpoints.EndpointKey{
Region: "cn-north-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.cn-north-1.amazonaws.com.cn",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "cn-north-1",
},
},
endpoints.EndpointKey{
Region: "cn-northwest-1",
}: endpoints.Endpoint{
Hostname: "s3-control.cn-northwest-1.amazonaws.com.cn",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "cn-northwest-1",
},
},
endpoints.EndpointKey{
Region: "cn-northwest-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.cn-northwest-1.amazonaws.com.cn",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "cn-northwest-1",
},
},
},
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-control-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "s3-control.{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: "s3-control-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "s3-control.{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: "s3-control-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "s3-control.{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: "s3-control-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "s3-control.{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: "s3-control.dualstack.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"s3v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-control-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"s3v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-control-fips.dualstack.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"s3v4"},
},
{
Variant: 0,
}: {
Hostname: "s3-control.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"s3v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "us-gov-east-1",
}: endpoints.Endpoint{
Hostname: "s3-control.us-gov-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
},
endpoints.EndpointKey{
Region: "us-gov-east-1",
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-control-fips.dualstack.us-gov-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
},
endpoints.EndpointKey{
Region: "us-gov-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-control-fips.us-gov-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
},
endpoints.EndpointKey{
Region: "us-gov-east-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.us-gov-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
},
endpoints.EndpointKey{
Region: "us-gov-east-1-fips",
}: endpoints.Endpoint{
Hostname: "s3-control-fips.us-gov-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{
Hostname: "s3-control.us-gov-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-control-fips.dualstack.us-gov-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-control-fips.us-gov-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-control.dualstack.us-gov-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
},
endpoints.EndpointKey{
Region: "us-gov-west-1-fips",
}: endpoints.Endpoint{
Hostname: "s3-control-fips.us-gov-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
},
},
}
| 912 |
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 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 S3 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: "s3.dualstack.{region}.amazonaws.com",
Protocols: []string{"http", "https"},
SignatureVersions: []string{"s3v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-fips.{region}.amazonaws.com",
Protocols: []string{"http", "https"},
SignatureVersions: []string{"s3v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-fips.dualstack.{region}.amazonaws.com",
Protocols: []string{"http", "https"},
SignatureVersions: []string{"s3v4"},
},
{
Variant: 0,
}: {
Hostname: "s3.{region}.amazonaws.com",
Protocols: []string{"http", "https"},
SignatureVersions: []string{"s3v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "af-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "af-south-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.af-south-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "ap-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-east-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.ap-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{
Hostname: "s3.ap-northeast-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "ap-northeast-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.ap-northeast-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.ap-northeast-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "ap-northeast-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-3",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.ap-northeast-3.amazonaws.com",
},
endpoints.EndpointKey{
Region: "ap-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.ap-south-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "ap-south-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.ap-south-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{
Hostname: "s3.ap-southeast-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "ap-southeast-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.ap-southeast-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{
Hostname: "s3.ap-southeast-2.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "ap-southeast-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.ap-southeast-2.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "ap-southeast-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-3",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.ap-southeast-3.amazonaws.com",
},
endpoints.EndpointKey{
Region: "ap-southeast-4",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-4",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.ap-southeast-4.amazonaws.com",
},
endpoints.EndpointKey{
Region: "aws-global",
}: endpoints.Endpoint{
Hostname: "s3.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-fips.ca-central-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "ca-central-1",
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-fips.dualstack.ca-central-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "ca-central-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.ca-central-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.eu-central-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "eu-central-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.eu-central-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-north-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.eu-north-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "eu-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-south-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.eu-south-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "eu-south-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-south-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.eu-south-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{
Hostname: "s3.eu-west-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "eu-west-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.eu-west-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.eu-west-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "eu-west-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-3",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.eu-west-3.amazonaws.com",
},
endpoints.EndpointKey{
Region: "fips-ca-central-1",
}: endpoints.Endpoint{
Hostname: "s3-fips.ca-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-east-1",
}: endpoints.Endpoint{
Hostname: "s3-fips.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-east-2",
}: endpoints.Endpoint{
Hostname: "s3-fips.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-west-1",
}: endpoints.Endpoint{
Hostname: "s3-fips.us-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-west-2",
}: endpoints.Endpoint{
Hostname: "s3-fips.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "me-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "me-central-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.me-central-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "me-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "me-south-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.me-south-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "s3-external-1",
}: endpoints.Endpoint{
Hostname: "s3-external-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
},
endpoints.EndpointKey{
Region: "sa-east-1",
}: endpoints.Endpoint{
Hostname: "s3.sa-east-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "sa-east-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.sa-east-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{
Hostname: "s3.us-east-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-fips.dualstack.us-east-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-fips.us-east-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.us-east-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-fips.dualstack.us-east-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-fips.us-east-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.us-east-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{
Hostname: "s3.us-west-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-fips.dualstack.us-west-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-fips.us-west-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.us-west-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{
Hostname: "s3.us-west-2.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-fips.dualstack.us-west-2.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-fips.us-west-2.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.us-west-2.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.{region}.amazonaws.com.cn",
Protocols: []string{"http", "https"},
SignatureVersions: []string{"s3v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-fips.{region}.amazonaws.com.cn",
Protocols: []string{"http", "https"},
SignatureVersions: []string{"s3v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"http", "https"},
SignatureVersions: []string{"s3v4"},
},
{
Variant: 0,
}: {
Hostname: "s3.{region}.amazonaws.com.cn",
Protocols: []string{"http", "https"},
SignatureVersions: []string{"s3v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "cn-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "cn-north-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.cn-north-1.amazonaws.com.cn",
},
endpoints.EndpointKey{
Region: "cn-northwest-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "cn-northwest-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.cn-northwest-1.amazonaws.com.cn",
},
},
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"s3v4"},
},
{
Variant: 0,
}: {
Hostname: "s3.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"s3v4"},
},
},
RegionRegex: partitionRegexp.AwsIso,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "us-iso-east-1",
}: endpoints.Endpoint{
Protocols: []string{"http", "https"},
SignatureVersions: []string{"s3v4"},
},
endpoints.EndpointKey{
Region: "us-iso-west-1",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-iso-b",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"http", "https"},
SignatureVersions: []string{"s3v4"},
},
{
Variant: 0,
}: {
Hostname: "s3.{region}.sc2s.sgov.gov",
Protocols: []string{"http", "https"},
SignatureVersions: []string{"s3v4"},
},
},
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: "s3-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "s3.{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: "s3-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "s3.{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: "s3.dualstack.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"s3", "s3v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"s3", "s3v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-fips.dualstack.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"s3", "s3v4"},
},
{
Variant: 0,
}: {
Hostname: "s3.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"s3", "s3v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "fips-us-gov-east-1",
}: endpoints.Endpoint{
Hostname: "s3-fips.us-gov-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-gov-west-1",
}: endpoints.Endpoint{
Hostname: "s3-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{
Hostname: "s3.us-gov-east-1.amazonaws.com",
Protocols: []string{"http", "https"},
},
endpoints.EndpointKey{
Region: "us-gov-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-fips.us-gov-east-1.amazonaws.com",
Protocols: []string{"http", "https"},
},
endpoints.EndpointKey{
Region: "us-gov-east-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.us-gov-east-1.amazonaws.com",
Protocols: []string{"http", "https"},
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{
Hostname: "s3.us-gov-west-1.amazonaws.com",
Protocols: []string{"http", "https"},
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-fips.us-gov-west-1.amazonaws.com",
Protocols: []string{"http", "https"},
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3.dualstack.us-gov-west-1.amazonaws.com",
Protocols: []string{"http", "https"},
},
},
},
}
| 799 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
type AsyncOperationName string
// Enum values for AsyncOperationName
const (
AsyncOperationNameCreateMultiRegionAccessPoint AsyncOperationName = "CreateMultiRegionAccessPoint"
AsyncOperationNameDeleteMultiRegionAccessPoint AsyncOperationName = "DeleteMultiRegionAccessPoint"
AsyncOperationNamePutMultiRegionAccessPointPolicy AsyncOperationName = "PutMultiRegionAccessPointPolicy"
)
// Values returns all known values for AsyncOperationName. 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 (AsyncOperationName) Values() []AsyncOperationName {
return []AsyncOperationName{
"CreateMultiRegionAccessPoint",
"DeleteMultiRegionAccessPoint",
"PutMultiRegionAccessPointPolicy",
}
}
type BucketCannedACL string
// Enum values for BucketCannedACL
const (
BucketCannedACLPrivate BucketCannedACL = "private"
BucketCannedACLPublicRead BucketCannedACL = "public-read"
BucketCannedACLPublicReadWrite BucketCannedACL = "public-read-write"
BucketCannedACLAuthenticatedRead BucketCannedACL = "authenticated-read"
)
// Values returns all known values for BucketCannedACL. 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 (BucketCannedACL) Values() []BucketCannedACL {
return []BucketCannedACL{
"private",
"public-read",
"public-read-write",
"authenticated-read",
}
}
type BucketLocationConstraint string
// Enum values for BucketLocationConstraint
const (
BucketLocationConstraintEu BucketLocationConstraint = "EU"
BucketLocationConstraintEuWest1 BucketLocationConstraint = "eu-west-1"
BucketLocationConstraintUsWest1 BucketLocationConstraint = "us-west-1"
BucketLocationConstraintUsWest2 BucketLocationConstraint = "us-west-2"
BucketLocationConstraintApSouth1 BucketLocationConstraint = "ap-south-1"
BucketLocationConstraintApSoutheast1 BucketLocationConstraint = "ap-southeast-1"
BucketLocationConstraintApSoutheast2 BucketLocationConstraint = "ap-southeast-2"
BucketLocationConstraintApNortheast1 BucketLocationConstraint = "ap-northeast-1"
BucketLocationConstraintSaEast1 BucketLocationConstraint = "sa-east-1"
BucketLocationConstraintCnNorth1 BucketLocationConstraint = "cn-north-1"
BucketLocationConstraintEuCentral1 BucketLocationConstraint = "eu-central-1"
)
// Values returns all known values for BucketLocationConstraint. 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 (BucketLocationConstraint) Values() []BucketLocationConstraint {
return []BucketLocationConstraint{
"EU",
"eu-west-1",
"us-west-1",
"us-west-2",
"ap-south-1",
"ap-southeast-1",
"ap-southeast-2",
"ap-northeast-1",
"sa-east-1",
"cn-north-1",
"eu-central-1",
}
}
type BucketVersioningStatus string
// Enum values for BucketVersioningStatus
const (
BucketVersioningStatusEnabled BucketVersioningStatus = "Enabled"
BucketVersioningStatusSuspended BucketVersioningStatus = "Suspended"
)
// Values returns all known values for BucketVersioningStatus. 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 (BucketVersioningStatus) Values() []BucketVersioningStatus {
return []BucketVersioningStatus{
"Enabled",
"Suspended",
}
}
type DeleteMarkerReplicationStatus string
// Enum values for DeleteMarkerReplicationStatus
const (
DeleteMarkerReplicationStatusEnabled DeleteMarkerReplicationStatus = "Enabled"
DeleteMarkerReplicationStatusDisabled DeleteMarkerReplicationStatus = "Disabled"
)
// Values returns all known values for DeleteMarkerReplicationStatus. 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 (DeleteMarkerReplicationStatus) Values() []DeleteMarkerReplicationStatus {
return []DeleteMarkerReplicationStatus{
"Enabled",
"Disabled",
}
}
type ExistingObjectReplicationStatus string
// Enum values for ExistingObjectReplicationStatus
const (
ExistingObjectReplicationStatusEnabled ExistingObjectReplicationStatus = "Enabled"
ExistingObjectReplicationStatusDisabled ExistingObjectReplicationStatus = "Disabled"
)
// Values returns all known values for ExistingObjectReplicationStatus. 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 (ExistingObjectReplicationStatus) Values() []ExistingObjectReplicationStatus {
return []ExistingObjectReplicationStatus{
"Enabled",
"Disabled",
}
}
type ExpirationStatus string
// Enum values for ExpirationStatus
const (
ExpirationStatusEnabled ExpirationStatus = "Enabled"
ExpirationStatusDisabled ExpirationStatus = "Disabled"
)
// Values returns all known values for ExpirationStatus. 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 (ExpirationStatus) Values() []ExpirationStatus {
return []ExpirationStatus{
"Enabled",
"Disabled",
}
}
type Format string
// Enum values for Format
const (
FormatCsv Format = "CSV"
FormatParquet Format = "Parquet"
)
// Values returns all known values for Format. 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 (Format) Values() []Format {
return []Format{
"CSV",
"Parquet",
}
}
type GeneratedManifestFormat string
// Enum values for GeneratedManifestFormat
const (
GeneratedManifestFormatS3InventoryReportCsv20211130 GeneratedManifestFormat = "S3InventoryReport_CSV_20211130"
)
// Values returns all known values for GeneratedManifestFormat. 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 (GeneratedManifestFormat) Values() []GeneratedManifestFormat {
return []GeneratedManifestFormat{
"S3InventoryReport_CSV_20211130",
}
}
type JobManifestFieldName string
// Enum values for JobManifestFieldName
const (
JobManifestFieldNameIgnore JobManifestFieldName = "Ignore"
JobManifestFieldNameBucket JobManifestFieldName = "Bucket"
JobManifestFieldNameKey JobManifestFieldName = "Key"
JobManifestFieldNameVersionId JobManifestFieldName = "VersionId"
)
// Values returns all known values for JobManifestFieldName. 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 (JobManifestFieldName) Values() []JobManifestFieldName {
return []JobManifestFieldName{
"Ignore",
"Bucket",
"Key",
"VersionId",
}
}
type JobManifestFormat string
// Enum values for JobManifestFormat
const (
JobManifestFormatS3BatchOperationsCsv20180820 JobManifestFormat = "S3BatchOperations_CSV_20180820"
JobManifestFormatS3InventoryReportCsv20161130 JobManifestFormat = "S3InventoryReport_CSV_20161130"
)
// Values returns all known values for JobManifestFormat. 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 (JobManifestFormat) Values() []JobManifestFormat {
return []JobManifestFormat{
"S3BatchOperations_CSV_20180820",
"S3InventoryReport_CSV_20161130",
}
}
type JobReportFormat string
// Enum values for JobReportFormat
const (
JobReportFormatReportCsv20180820 JobReportFormat = "Report_CSV_20180820"
)
// Values returns all known values for JobReportFormat. 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 (JobReportFormat) Values() []JobReportFormat {
return []JobReportFormat{
"Report_CSV_20180820",
}
}
type JobReportScope string
// Enum values for JobReportScope
const (
JobReportScopeAllTasks JobReportScope = "AllTasks"
JobReportScopeFailedTasksOnly JobReportScope = "FailedTasksOnly"
)
// Values returns all known values for JobReportScope. 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 (JobReportScope) Values() []JobReportScope {
return []JobReportScope{
"AllTasks",
"FailedTasksOnly",
}
}
type JobStatus string
// Enum values for JobStatus
const (
JobStatusActive JobStatus = "Active"
JobStatusCancelled JobStatus = "Cancelled"
JobStatusCancelling JobStatus = "Cancelling"
JobStatusComplete JobStatus = "Complete"
JobStatusCompleting JobStatus = "Completing"
JobStatusFailed JobStatus = "Failed"
JobStatusFailing JobStatus = "Failing"
JobStatusNew JobStatus = "New"
JobStatusPaused JobStatus = "Paused"
JobStatusPausing JobStatus = "Pausing"
JobStatusPreparing JobStatus = "Preparing"
JobStatusReady JobStatus = "Ready"
JobStatusSuspended JobStatus = "Suspended"
)
// Values returns all known values for JobStatus. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (JobStatus) Values() []JobStatus {
return []JobStatus{
"Active",
"Cancelled",
"Cancelling",
"Complete",
"Completing",
"Failed",
"Failing",
"New",
"Paused",
"Pausing",
"Preparing",
"Ready",
"Suspended",
}
}
type MetricsStatus string
// Enum values for MetricsStatus
const (
MetricsStatusEnabled MetricsStatus = "Enabled"
MetricsStatusDisabled MetricsStatus = "Disabled"
)
// Values returns all known values for MetricsStatus. 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 (MetricsStatus) Values() []MetricsStatus {
return []MetricsStatus{
"Enabled",
"Disabled",
}
}
type MFADelete string
// Enum values for MFADelete
const (
MFADeleteEnabled MFADelete = "Enabled"
MFADeleteDisabled MFADelete = "Disabled"
)
// Values returns all known values for MFADelete. 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 (MFADelete) Values() []MFADelete {
return []MFADelete{
"Enabled",
"Disabled",
}
}
type MFADeleteStatus string
// Enum values for MFADeleteStatus
const (
MFADeleteStatusEnabled MFADeleteStatus = "Enabled"
MFADeleteStatusDisabled MFADeleteStatus = "Disabled"
)
// Values returns all known values for MFADeleteStatus. 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 (MFADeleteStatus) Values() []MFADeleteStatus {
return []MFADeleteStatus{
"Enabled",
"Disabled",
}
}
type MultiRegionAccessPointStatus string
// Enum values for MultiRegionAccessPointStatus
const (
MultiRegionAccessPointStatusReady MultiRegionAccessPointStatus = "READY"
MultiRegionAccessPointStatusInconsistentAcrossRegions MultiRegionAccessPointStatus = "INCONSISTENT_ACROSS_REGIONS"
MultiRegionAccessPointStatusCreating MultiRegionAccessPointStatus = "CREATING"
MultiRegionAccessPointStatusPartiallyCreated MultiRegionAccessPointStatus = "PARTIALLY_CREATED"
MultiRegionAccessPointStatusPartiallyDeleted MultiRegionAccessPointStatus = "PARTIALLY_DELETED"
MultiRegionAccessPointStatusDeleting MultiRegionAccessPointStatus = "DELETING"
)
// Values returns all known values for MultiRegionAccessPointStatus. 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 (MultiRegionAccessPointStatus) Values() []MultiRegionAccessPointStatus {
return []MultiRegionAccessPointStatus{
"READY",
"INCONSISTENT_ACROSS_REGIONS",
"CREATING",
"PARTIALLY_CREATED",
"PARTIALLY_DELETED",
"DELETING",
}
}
type NetworkOrigin string
// Enum values for NetworkOrigin
const (
NetworkOriginInternet NetworkOrigin = "Internet"
NetworkOriginVpc NetworkOrigin = "VPC"
)
// Values returns all known values for NetworkOrigin. 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 (NetworkOrigin) Values() []NetworkOrigin {
return []NetworkOrigin{
"Internet",
"VPC",
}
}
type ObjectLambdaAccessPointAliasStatus string
// Enum values for ObjectLambdaAccessPointAliasStatus
const (
ObjectLambdaAccessPointAliasStatusProvisioning ObjectLambdaAccessPointAliasStatus = "PROVISIONING"
ObjectLambdaAccessPointAliasStatusReady ObjectLambdaAccessPointAliasStatus = "READY"
)
// Values returns all known values for ObjectLambdaAccessPointAliasStatus. 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 (ObjectLambdaAccessPointAliasStatus) Values() []ObjectLambdaAccessPointAliasStatus {
return []ObjectLambdaAccessPointAliasStatus{
"PROVISIONING",
"READY",
}
}
type ObjectLambdaAllowedFeature string
// Enum values for ObjectLambdaAllowedFeature
const (
ObjectLambdaAllowedFeatureGetObjectRange ObjectLambdaAllowedFeature = "GetObject-Range"
ObjectLambdaAllowedFeatureGetObjectPartNumber ObjectLambdaAllowedFeature = "GetObject-PartNumber"
ObjectLambdaAllowedFeatureHeadObjectRange ObjectLambdaAllowedFeature = "HeadObject-Range"
ObjectLambdaAllowedFeatureHeadObjectPartNumber ObjectLambdaAllowedFeature = "HeadObject-PartNumber"
)
// Values returns all known values for ObjectLambdaAllowedFeature. 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 (ObjectLambdaAllowedFeature) Values() []ObjectLambdaAllowedFeature {
return []ObjectLambdaAllowedFeature{
"GetObject-Range",
"GetObject-PartNumber",
"HeadObject-Range",
"HeadObject-PartNumber",
}
}
type ObjectLambdaTransformationConfigurationAction string
// Enum values for ObjectLambdaTransformationConfigurationAction
const (
ObjectLambdaTransformationConfigurationActionGetObject ObjectLambdaTransformationConfigurationAction = "GetObject"
ObjectLambdaTransformationConfigurationActionHeadObject ObjectLambdaTransformationConfigurationAction = "HeadObject"
ObjectLambdaTransformationConfigurationActionListObjects ObjectLambdaTransformationConfigurationAction = "ListObjects"
ObjectLambdaTransformationConfigurationActionListObjectsV2 ObjectLambdaTransformationConfigurationAction = "ListObjectsV2"
)
// Values returns all known values for
// ObjectLambdaTransformationConfigurationAction. 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 (ObjectLambdaTransformationConfigurationAction) Values() []ObjectLambdaTransformationConfigurationAction {
return []ObjectLambdaTransformationConfigurationAction{
"GetObject",
"HeadObject",
"ListObjects",
"ListObjectsV2",
}
}
type OperationName string
// Enum values for OperationName
const (
OperationNameLambdaInvoke OperationName = "LambdaInvoke"
OperationNameS3PutObjectCopy OperationName = "S3PutObjectCopy"
OperationNameS3PutObjectAcl OperationName = "S3PutObjectAcl"
OperationNameS3PutObjectTagging OperationName = "S3PutObjectTagging"
OperationNameS3DeleteObjectTagging OperationName = "S3DeleteObjectTagging"
OperationNameS3InitiateRestoreObject OperationName = "S3InitiateRestoreObject"
OperationNameS3PutObjectLegalHold OperationName = "S3PutObjectLegalHold"
OperationNameS3PutObjectRetention OperationName = "S3PutObjectRetention"
OperationNameS3ReplicateObject OperationName = "S3ReplicateObject"
)
// Values returns all known values for OperationName. 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 (OperationName) Values() []OperationName {
return []OperationName{
"LambdaInvoke",
"S3PutObjectCopy",
"S3PutObjectAcl",
"S3PutObjectTagging",
"S3DeleteObjectTagging",
"S3InitiateRestoreObject",
"S3PutObjectLegalHold",
"S3PutObjectRetention",
"S3ReplicateObject",
}
}
type OutputSchemaVersion string
// Enum values for OutputSchemaVersion
const (
OutputSchemaVersionV1 OutputSchemaVersion = "V_1"
)
// Values returns all known values for OutputSchemaVersion. 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 (OutputSchemaVersion) Values() []OutputSchemaVersion {
return []OutputSchemaVersion{
"V_1",
}
}
type OwnerOverride string
// Enum values for OwnerOverride
const (
OwnerOverrideDestination OwnerOverride = "Destination"
)
// Values returns all known values for OwnerOverride. 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 (OwnerOverride) Values() []OwnerOverride {
return []OwnerOverride{
"Destination",
}
}
type ReplicaModificationsStatus string
// Enum values for ReplicaModificationsStatus
const (
ReplicaModificationsStatusEnabled ReplicaModificationsStatus = "Enabled"
ReplicaModificationsStatusDisabled ReplicaModificationsStatus = "Disabled"
)
// Values returns all known values for ReplicaModificationsStatus. 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 (ReplicaModificationsStatus) Values() []ReplicaModificationsStatus {
return []ReplicaModificationsStatus{
"Enabled",
"Disabled",
}
}
type ReplicationRuleStatus string
// Enum values for ReplicationRuleStatus
const (
ReplicationRuleStatusEnabled ReplicationRuleStatus = "Enabled"
ReplicationRuleStatusDisabled ReplicationRuleStatus = "Disabled"
)
// Values returns all known values for ReplicationRuleStatus. 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 (ReplicationRuleStatus) Values() []ReplicationRuleStatus {
return []ReplicationRuleStatus{
"Enabled",
"Disabled",
}
}
type ReplicationStatus string
// Enum values for ReplicationStatus
const (
ReplicationStatusCompleted ReplicationStatus = "COMPLETED"
ReplicationStatusFailed ReplicationStatus = "FAILED"
ReplicationStatusReplica ReplicationStatus = "REPLICA"
ReplicationStatusNone ReplicationStatus = "NONE"
)
// Values returns all known values for ReplicationStatus. 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 (ReplicationStatus) Values() []ReplicationStatus {
return []ReplicationStatus{
"COMPLETED",
"FAILED",
"REPLICA",
"NONE",
}
}
type ReplicationStorageClass string
// Enum values for ReplicationStorageClass
const (
ReplicationStorageClassStandard ReplicationStorageClass = "STANDARD"
ReplicationStorageClassReducedRedundancy ReplicationStorageClass = "REDUCED_REDUNDANCY"
ReplicationStorageClassStandardIa ReplicationStorageClass = "STANDARD_IA"
ReplicationStorageClassOnezoneIa ReplicationStorageClass = "ONEZONE_IA"
ReplicationStorageClassIntelligentTiering ReplicationStorageClass = "INTELLIGENT_TIERING"
ReplicationStorageClassGlacier ReplicationStorageClass = "GLACIER"
ReplicationStorageClassDeepArchive ReplicationStorageClass = "DEEP_ARCHIVE"
ReplicationStorageClassOutposts ReplicationStorageClass = "OUTPOSTS"
ReplicationStorageClassGlacierIr ReplicationStorageClass = "GLACIER_IR"
)
// Values returns all known values for ReplicationStorageClass. 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 (ReplicationStorageClass) Values() []ReplicationStorageClass {
return []ReplicationStorageClass{
"STANDARD",
"REDUCED_REDUNDANCY",
"STANDARD_IA",
"ONEZONE_IA",
"INTELLIGENT_TIERING",
"GLACIER",
"DEEP_ARCHIVE",
"OUTPOSTS",
"GLACIER_IR",
}
}
type ReplicationTimeStatus string
// Enum values for ReplicationTimeStatus
const (
ReplicationTimeStatusEnabled ReplicationTimeStatus = "Enabled"
ReplicationTimeStatusDisabled ReplicationTimeStatus = "Disabled"
)
// Values returns all known values for ReplicationTimeStatus. 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 (ReplicationTimeStatus) Values() []ReplicationTimeStatus {
return []ReplicationTimeStatus{
"Enabled",
"Disabled",
}
}
type RequestedJobStatus string
// Enum values for RequestedJobStatus
const (
RequestedJobStatusCancelled RequestedJobStatus = "Cancelled"
RequestedJobStatusReady RequestedJobStatus = "Ready"
)
// Values returns all known values for RequestedJobStatus. 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 (RequestedJobStatus) Values() []RequestedJobStatus {
return []RequestedJobStatus{
"Cancelled",
"Ready",
}
}
type S3CannedAccessControlList string
// Enum values for S3CannedAccessControlList
const (
S3CannedAccessControlListPrivate S3CannedAccessControlList = "private"
S3CannedAccessControlListPublicRead S3CannedAccessControlList = "public-read"
S3CannedAccessControlListPublicReadWrite S3CannedAccessControlList = "public-read-write"
S3CannedAccessControlListAwsExecRead S3CannedAccessControlList = "aws-exec-read"
S3CannedAccessControlListAuthenticatedRead S3CannedAccessControlList = "authenticated-read"
S3CannedAccessControlListBucketOwnerRead S3CannedAccessControlList = "bucket-owner-read"
S3CannedAccessControlListBucketOwnerFullControl S3CannedAccessControlList = "bucket-owner-full-control"
)
// Values returns all known values for S3CannedAccessControlList. 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 (S3CannedAccessControlList) Values() []S3CannedAccessControlList {
return []S3CannedAccessControlList{
"private",
"public-read",
"public-read-write",
"aws-exec-read",
"authenticated-read",
"bucket-owner-read",
"bucket-owner-full-control",
}
}
type S3ChecksumAlgorithm string
// Enum values for S3ChecksumAlgorithm
const (
S3ChecksumAlgorithmCrc32 S3ChecksumAlgorithm = "CRC32"
S3ChecksumAlgorithmCrc32c S3ChecksumAlgorithm = "CRC32C"
S3ChecksumAlgorithmSha1 S3ChecksumAlgorithm = "SHA1"
S3ChecksumAlgorithmSha256 S3ChecksumAlgorithm = "SHA256"
)
// Values returns all known values for S3ChecksumAlgorithm. 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 (S3ChecksumAlgorithm) Values() []S3ChecksumAlgorithm {
return []S3ChecksumAlgorithm{
"CRC32",
"CRC32C",
"SHA1",
"SHA256",
}
}
type S3GlacierJobTier string
// Enum values for S3GlacierJobTier
const (
S3GlacierJobTierBulk S3GlacierJobTier = "BULK"
S3GlacierJobTierStandard S3GlacierJobTier = "STANDARD"
)
// Values returns all known values for S3GlacierJobTier. 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 (S3GlacierJobTier) Values() []S3GlacierJobTier {
return []S3GlacierJobTier{
"BULK",
"STANDARD",
}
}
type S3GranteeTypeIdentifier string
// Enum values for S3GranteeTypeIdentifier
const (
S3GranteeTypeIdentifierCanonical S3GranteeTypeIdentifier = "id"
S3GranteeTypeIdentifierEmailAddress S3GranteeTypeIdentifier = "emailAddress"
S3GranteeTypeIdentifierGroup S3GranteeTypeIdentifier = "uri"
)
// Values returns all known values for S3GranteeTypeIdentifier. 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 (S3GranteeTypeIdentifier) Values() []S3GranteeTypeIdentifier {
return []S3GranteeTypeIdentifier{
"id",
"emailAddress",
"uri",
}
}
type S3MetadataDirective string
// Enum values for S3MetadataDirective
const (
S3MetadataDirectiveCopy S3MetadataDirective = "COPY"
S3MetadataDirectiveReplace S3MetadataDirective = "REPLACE"
)
// Values returns all known values for S3MetadataDirective. 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 (S3MetadataDirective) Values() []S3MetadataDirective {
return []S3MetadataDirective{
"COPY",
"REPLACE",
}
}
type S3ObjectLockLegalHoldStatus string
// Enum values for S3ObjectLockLegalHoldStatus
const (
S3ObjectLockLegalHoldStatusOff S3ObjectLockLegalHoldStatus = "OFF"
S3ObjectLockLegalHoldStatusOn S3ObjectLockLegalHoldStatus = "ON"
)
// Values returns all known values for S3ObjectLockLegalHoldStatus. 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 (S3ObjectLockLegalHoldStatus) Values() []S3ObjectLockLegalHoldStatus {
return []S3ObjectLockLegalHoldStatus{
"OFF",
"ON",
}
}
type S3ObjectLockMode string
// Enum values for S3ObjectLockMode
const (
S3ObjectLockModeCompliance S3ObjectLockMode = "COMPLIANCE"
S3ObjectLockModeGovernance S3ObjectLockMode = "GOVERNANCE"
)
// Values returns all known values for S3ObjectLockMode. 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 (S3ObjectLockMode) Values() []S3ObjectLockMode {
return []S3ObjectLockMode{
"COMPLIANCE",
"GOVERNANCE",
}
}
type S3ObjectLockRetentionMode string
// Enum values for S3ObjectLockRetentionMode
const (
S3ObjectLockRetentionModeCompliance S3ObjectLockRetentionMode = "COMPLIANCE"
S3ObjectLockRetentionModeGovernance S3ObjectLockRetentionMode = "GOVERNANCE"
)
// Values returns all known values for S3ObjectLockRetentionMode. 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 (S3ObjectLockRetentionMode) Values() []S3ObjectLockRetentionMode {
return []S3ObjectLockRetentionMode{
"COMPLIANCE",
"GOVERNANCE",
}
}
type S3Permission string
// Enum values for S3Permission
const (
S3PermissionFullControl S3Permission = "FULL_CONTROL"
S3PermissionRead S3Permission = "READ"
S3PermissionWrite S3Permission = "WRITE"
S3PermissionReadAcp S3Permission = "READ_ACP"
S3PermissionWriteAcp S3Permission = "WRITE_ACP"
)
// Values returns all known values for S3Permission. 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 (S3Permission) Values() []S3Permission {
return []S3Permission{
"FULL_CONTROL",
"READ",
"WRITE",
"READ_ACP",
"WRITE_ACP",
}
}
type S3SSEAlgorithm string
// Enum values for S3SSEAlgorithm
const (
S3SSEAlgorithmAes256 S3SSEAlgorithm = "AES256"
S3SSEAlgorithmKms S3SSEAlgorithm = "KMS"
)
// Values returns all known values for S3SSEAlgorithm. 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 (S3SSEAlgorithm) Values() []S3SSEAlgorithm {
return []S3SSEAlgorithm{
"AES256",
"KMS",
}
}
type S3StorageClass string
// Enum values for S3StorageClass
const (
S3StorageClassStandard S3StorageClass = "STANDARD"
S3StorageClassStandardIa S3StorageClass = "STANDARD_IA"
S3StorageClassOnezoneIa S3StorageClass = "ONEZONE_IA"
S3StorageClassGlacier S3StorageClass = "GLACIER"
S3StorageClassIntelligentTiering S3StorageClass = "INTELLIGENT_TIERING"
S3StorageClassDeepArchive S3StorageClass = "DEEP_ARCHIVE"
S3StorageClassGlacierIr S3StorageClass = "GLACIER_IR"
)
// Values returns all known values for S3StorageClass. 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 (S3StorageClass) Values() []S3StorageClass {
return []S3StorageClass{
"STANDARD",
"STANDARD_IA",
"ONEZONE_IA",
"GLACIER",
"INTELLIGENT_TIERING",
"DEEP_ARCHIVE",
"GLACIER_IR",
}
}
type SseKmsEncryptedObjectsStatus string
// Enum values for SseKmsEncryptedObjectsStatus
const (
SseKmsEncryptedObjectsStatusEnabled SseKmsEncryptedObjectsStatus = "Enabled"
SseKmsEncryptedObjectsStatusDisabled SseKmsEncryptedObjectsStatus = "Disabled"
)
// Values returns all known values for SseKmsEncryptedObjectsStatus. 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 (SseKmsEncryptedObjectsStatus) Values() []SseKmsEncryptedObjectsStatus {
return []SseKmsEncryptedObjectsStatus{
"Enabled",
"Disabled",
}
}
type TransitionStorageClass string
// Enum values for TransitionStorageClass
const (
TransitionStorageClassGlacier TransitionStorageClass = "GLACIER"
TransitionStorageClassStandardIa TransitionStorageClass = "STANDARD_IA"
TransitionStorageClassOnezoneIa TransitionStorageClass = "ONEZONE_IA"
TransitionStorageClassIntelligentTiering TransitionStorageClass = "INTELLIGENT_TIERING"
TransitionStorageClassDeepArchive TransitionStorageClass = "DEEP_ARCHIVE"
)
// Values returns all known values for TransitionStorageClass. 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 (TransitionStorageClass) Values() []TransitionStorageClass {
return []TransitionStorageClass{
"GLACIER",
"STANDARD_IA",
"ONEZONE_IA",
"INTELLIGENT_TIERING",
"DEEP_ARCHIVE",
}
}
| 930 |
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"
)
type BadRequestException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *BadRequestException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *BadRequestException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *BadRequestException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "BadRequestException"
}
return *e.ErrorCodeOverride
}
func (e *BadRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The requested Outposts bucket name is not available. The bucket namespace is
// shared by all users of the Outposts in this Region. Select a different name and
// try again.
type BucketAlreadyExists struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *BucketAlreadyExists) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *BucketAlreadyExists) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *BucketAlreadyExists) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "BucketAlreadyExists"
}
return *e.ErrorCodeOverride
}
func (e *BucketAlreadyExists) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The Outposts bucket you tried to create already exists, and you own it.
type BucketAlreadyOwnedByYou struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *BucketAlreadyOwnedByYou) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *BucketAlreadyOwnedByYou) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *BucketAlreadyOwnedByYou) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "BucketAlreadyOwnedByYou"
}
return *e.ErrorCodeOverride
}
func (e *BucketAlreadyOwnedByYou) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
type IdempotencyException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *IdempotencyException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *IdempotencyException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *IdempotencyException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "IdempotencyException"
}
return *e.ErrorCodeOverride
}
func (e *IdempotencyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
type InternalServiceException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalServiceException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalServiceException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalServiceException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalServiceException"
}
return *e.ErrorCodeOverride
}
func (e *InternalServiceException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
type InvalidNextTokenException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidNextTokenException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidNextTokenException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidNextTokenException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidNextTokenException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidNextTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
type InvalidRequestException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidRequestException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidRequestException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidRequestException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidRequestException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
type JobStatusException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *JobStatusException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *JobStatusException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *JobStatusException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "JobStatusException"
}
return *e.ErrorCodeOverride
}
func (e *JobStatusException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Amazon S3 throws this exception if you make a GetPublicAccessBlock request
// against an account that doesn't have a PublicAccessBlockConfiguration set.
type NoSuchPublicAccessBlockConfiguration struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *NoSuchPublicAccessBlockConfiguration) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *NoSuchPublicAccessBlockConfiguration) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *NoSuchPublicAccessBlockConfiguration) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "NoSuchPublicAccessBlockConfiguration"
}
return *e.ErrorCodeOverride
}
func (e *NoSuchPublicAccessBlockConfiguration) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
type NotFoundException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *NotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *NotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *NotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "NotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *NotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
type TooManyRequestsException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *TooManyRequestsException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *TooManyRequestsException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *TooManyRequestsException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "TooManyRequestsException"
}
return *e.ErrorCodeOverride
}
func (e *TooManyRequestsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Amazon S3 throws this exception if you have too many tags in your tag set.
type TooManyTagsException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *TooManyTagsException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *TooManyTagsException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *TooManyTagsException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "TooManyTagsException"
}
return *e.ErrorCodeOverride
}
func (e *TooManyTagsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 318 |
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 container for abort incomplete multipart upload
type AbortIncompleteMultipartUpload struct {
// Specifies the number of days after which Amazon S3 aborts an incomplete
// multipart upload to the Outposts bucket.
DaysAfterInitiation int32
noSmithyDocumentSerde
}
// A container for information about access control for replicas. This is not
// supported by Amazon S3 on Outposts buckets.
type AccessControlTranslation struct {
// Specifies the replica ownership.
//
// This member is required.
Owner OwnerOverride
noSmithyDocumentSerde
}
// An access point used to access a bucket.
type AccessPoint struct {
// The name of the bucket associated with this access point.
//
// This member is required.
Bucket *string
// The name of this access point.
//
// This member is required.
Name *string
// Indicates whether this access point allows access from the public internet. If
// VpcConfiguration is specified for this access point, then NetworkOrigin is VPC ,
// and the access point doesn't allow access from the public internet. Otherwise,
// NetworkOrigin is Internet , and the access point allows access from the public
// internet, subject to the access point and bucket access policies.
//
// This member is required.
NetworkOrigin NetworkOrigin
// The ARN for the access point.
AccessPointArn *string
// The name or alias of the access point.
Alias *string
// The Amazon Web Services account ID associated with the S3 bucket associated
// with this access point.
BucketAccountId *string
// The virtual private cloud (VPC) configuration for this access point, if one
// exists. This element is empty if this access point is an Amazon S3 on Outposts
// access point that is used by other Amazon Web Services.
VpcConfiguration *VpcConfiguration
noSmithyDocumentSerde
}
// A container for the account-level Amazon S3 Storage Lens configuration. For
// more information about S3 Storage Lens, see Assessing your storage activity and
// usage with S3 Storage Lens (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens.html)
// in the Amazon S3 User Guide. For a complete list of S3 Storage Lens metrics, see
// S3 Storage Lens metrics glossary (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens_metrics_glossary.html)
// in the Amazon S3 User Guide.
type AccountLevel struct {
// A container for the S3 Storage Lens bucket-level configuration.
//
// This member is required.
BucketLevel *BucketLevel
// A container for S3 Storage Lens activity metrics.
ActivityMetrics *ActivityMetrics
// A container for S3 Storage Lens advanced cost-optimization metrics.
AdvancedCostOptimizationMetrics *AdvancedCostOptimizationMetrics
// A container for S3 Storage Lens advanced data-protection metrics.
AdvancedDataProtectionMetrics *AdvancedDataProtectionMetrics
// A container for detailed status code metrics.
DetailedStatusCodesMetrics *DetailedStatusCodesMetrics
noSmithyDocumentSerde
}
// The container element for Amazon S3 Storage Lens activity metrics. Activity
// metrics show details about how your storage is requested, such as requests (for
// example, All requests, Get requests, Put requests), bytes uploaded or
// downloaded, and errors. For more information about S3 Storage Lens, see
// Assessing your storage activity and usage with S3 Storage Lens (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens.html)
// in the Amazon S3 User Guide. For a complete list of S3 Storage Lens metrics, see
// S3 Storage Lens metrics glossary (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens_metrics_glossary.html)
// in the Amazon S3 User Guide.
type ActivityMetrics struct {
// A container that indicates whether activity metrics are enabled.
IsEnabled bool
noSmithyDocumentSerde
}
// The container element for Amazon S3 Storage Lens advanced cost-optimization
// metrics. Advanced cost-optimization metrics provide insights that you can use to
// manage and optimize your storage costs, for example, lifecycle rule counts for
// transitions, expirations, and incomplete multipart uploads. For more information
// about S3 Storage Lens, see Assessing your storage activity and usage with S3
// Storage Lens (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens.html)
// in the Amazon S3 User Guide. For a complete list of S3 Storage Lens metrics, see
// S3 Storage Lens metrics glossary (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens_metrics_glossary.html)
// in the Amazon S3 User Guide.
type AdvancedCostOptimizationMetrics struct {
// A container that indicates whether advanced cost-optimization metrics are
// enabled.
IsEnabled bool
noSmithyDocumentSerde
}
// The container element for Amazon S3 Storage Lens advanced data-protection
// metrics. Advanced data-protection metrics provide insights that you can use to
// perform audits and protect your data, for example replication rule counts within
// and across Regions. For more information about S3 Storage Lens, see Assessing
// your storage activity and usage with S3 Storage Lens (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens.html)
// in the Amazon S3 User Guide. For a complete list of S3 Storage Lens metrics, see
// S3 Storage Lens metrics glossary (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens_metrics_glossary.html)
// in the Amazon S3 User Guide.
type AdvancedDataProtectionMetrics struct {
// A container that indicates whether advanced data-protection metrics are enabled.
IsEnabled bool
noSmithyDocumentSerde
}
// Error details for the failed asynchronous operation.
type AsyncErrorDetails struct {
// A string that uniquely identifies the error condition.
Code *string
// A generic description of the error condition in English.
Message *string
// The ID of the request associated with the error.
RequestId *string
// The identifier of the resource associated with the error.
Resource *string
noSmithyDocumentSerde
}
// A container for the information about an asynchronous operation.
type AsyncOperation struct {
// The time that the request was sent to the service.
CreationTime *time.Time
// The specific operation for the asynchronous request.
Operation AsyncOperationName
// The parameters associated with the request.
RequestParameters *AsyncRequestParameters
// The current status of the request.
RequestStatus *string
// The request token associated with the request.
RequestTokenARN *string
// The details of the response.
ResponseDetails *AsyncResponseDetails
noSmithyDocumentSerde
}
// A container for the request parameters associated with an asynchronous request.
type AsyncRequestParameters struct {
// A container of the parameters for a CreateMultiRegionAccessPoint (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateMultiRegionAccessPoint.html)
// request.
CreateMultiRegionAccessPointRequest *CreateMultiRegionAccessPointInput
// A container of the parameters for a DeleteMultiRegionAccessPoint (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteMultiRegionAccessPoint.html)
// request.
DeleteMultiRegionAccessPointRequest *DeleteMultiRegionAccessPointInput
// A container of the parameters for a PutMultiRegionAccessPoint (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutMultiRegionAccessPoint.html)
// request.
PutMultiRegionAccessPointPolicyRequest *PutMultiRegionAccessPointPolicyInput
noSmithyDocumentSerde
}
// A container for the response details that are returned when querying about an
// asynchronous request.
type AsyncResponseDetails struct {
// Error details for an asynchronous request.
ErrorDetails *AsyncErrorDetails
// The details for the Multi-Region Access Point.
MultiRegionAccessPointDetails *MultiRegionAccessPointsAsyncResponse
noSmithyDocumentSerde
}
// Lambda function used to transform objects through an Object Lambda Access Point.
type AwsLambdaTransformation struct {
// The Amazon Resource Name (ARN) of the Lambda function.
//
// This member is required.
FunctionArn *string
// Additional JSON that provides supplemental data to the Lambda function used to
// transform objects.
FunctionPayload *string
noSmithyDocumentSerde
}
// A container for the bucket-level configuration for Amazon S3 Storage Lens. For
// more information about S3 Storage Lens, see Assessing your storage activity and
// usage with S3 Storage Lens (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens.html)
// in the Amazon S3 User Guide.
type BucketLevel struct {
// A container for the bucket-level activity metrics for S3 Storage Lens.
ActivityMetrics *ActivityMetrics
// A container for bucket-level advanced cost-optimization metrics for S3 Storage
// Lens.
AdvancedCostOptimizationMetrics *AdvancedCostOptimizationMetrics
// A container for bucket-level advanced data-protection metrics for S3 Storage
// Lens.
AdvancedDataProtectionMetrics *AdvancedDataProtectionMetrics
// A container for bucket-level detailed status code metrics for S3 Storage Lens.
DetailedStatusCodesMetrics *DetailedStatusCodesMetrics
// A container for the prefix-level metrics for S3 Storage Lens.
PrefixLevel *PrefixLevel
noSmithyDocumentSerde
}
// A container for enabling Amazon CloudWatch publishing for S3 Storage Lens
// metrics. For more information about publishing S3 Storage Lens metrics to
// CloudWatch, see Monitor S3 Storage Lens metrics in CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens_view_metrics_cloudwatch.html)
// in the Amazon S3 User Guide.
type CloudWatchMetrics struct {
// A container that indicates whether CloudWatch publishing for S3 Storage Lens
// metrics is enabled. A value of true indicates that CloudWatch publishing for S3
// Storage Lens metrics is enabled.
//
// This member is required.
IsEnabled bool
noSmithyDocumentSerde
}
// The container for the bucket configuration. This is not supported by Amazon S3
// on Outposts buckets.
type CreateBucketConfiguration struct {
// Specifies the Region where the bucket will be created. If you are creating a
// bucket on the US East (N. Virginia) Region (us-east-1), you do not need to
// specify the location. This is not supported by Amazon S3 on Outposts buckets.
LocationConstraint BucketLocationConstraint
noSmithyDocumentSerde
}
// A container for the information associated with a CreateMultiRegionAccessPoint (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateMultiRegionAccessPoint.html)
// request.
type CreateMultiRegionAccessPointInput struct {
// The name of the Multi-Region Access Point associated with this request.
//
// This member is required.
Name *string
// The buckets in different Regions that are associated with the Multi-Region
// Access Point.
//
// This member is required.
Regions []Region
// The PublicAccessBlock configuration that you want to apply to this Amazon S3
// account. You can enable the configuration options in any combination. For more
// information about when Amazon S3 considers a bucket or object public, see The
// Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status)
// in the Amazon S3 User Guide. This data type is not supported for Amazon S3 on
// Outposts.
PublicAccessBlock *PublicAccessBlockConfiguration
noSmithyDocumentSerde
}
// Specifies whether S3 on Outposts replicates delete markers. If you specify a
// Filter element in your replication configuration, you must also include a
// DeleteMarkerReplication element. If your Filter includes a Tag element, the
// DeleteMarkerReplication element's Status child element must be set to Disabled ,
// because S3 on Outposts does not support replicating delete markers for tag-based
// rules. For more information about delete marker replication, see How delete
// operations affect replication (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsReplication.html#outposts-replication-what-is-replicated)
// in the Amazon S3 User Guide.
type DeleteMarkerReplication struct {
// Indicates whether to replicate delete markers.
//
// This member is required.
Status DeleteMarkerReplicationStatus
noSmithyDocumentSerde
}
// A container for the information associated with a DeleteMultiRegionAccessPoint (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteMultiRegionAccessPoint.html)
// request.
type DeleteMultiRegionAccessPointInput struct {
// The name of the Multi-Region Access Point associated with this request.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
// Specifies information about the replication destination bucket and its settings
// for an S3 on Outposts replication configuration.
type Destination struct {
// The Amazon Resource Name (ARN) of the access point for the destination bucket
// where you want S3 on Outposts to store the replication results.
//
// This member is required.
Bucket *string
// Specify this property only in a cross-account scenario (where the source and
// destination bucket owners are not the same), and you want to change replica
// ownership to the Amazon Web Services account that owns the destination bucket.
// If this property is not specified in the replication configuration, the replicas
// are owned by same Amazon Web Services account that owns the source object. This
// is not supported by Amazon S3 on Outposts buckets.
AccessControlTranslation *AccessControlTranslation
// The destination bucket owner's account ID.
Account *string
// A container that provides information about encryption. If
// SourceSelectionCriteria is specified, you must specify this element. This is not
// supported by Amazon S3 on Outposts buckets.
EncryptionConfiguration *EncryptionConfiguration
// A container that specifies replication metrics-related settings.
Metrics *Metrics
// A container that specifies S3 Replication Time Control (S3 RTC) settings,
// including whether S3 RTC is enabled and the time when all objects and operations
// on objects must be replicated. Must be specified together with a Metrics block.
// This is not supported by Amazon S3 on Outposts buckets.
ReplicationTime *ReplicationTime
// The storage class to use when replicating objects. All objects stored on S3 on
// Outposts are stored in the OUTPOSTS storage class. S3 on Outposts uses the
// OUTPOSTS storage class to create the object replicas. Values other than OUTPOSTS
// are not supported by Amazon S3 on Outposts.
StorageClass ReplicationStorageClass
noSmithyDocumentSerde
}
// The container element for Amazon S3 Storage Lens detailed status code metrics.
// Detailed status code metrics generate metrics for HTTP status codes, such as
// 200 OK , 403 Forbidden , 503 Service Unavailable and others. For more
// information about S3 Storage Lens, see Assessing your storage activity and
// usage with S3 Storage Lens (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens.html)
// in the Amazon S3 User Guide. For a complete list of S3 Storage Lens metrics, see
// S3 Storage Lens metrics glossary (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens_metrics_glossary.html)
// in the Amazon S3 User Guide.
type DetailedStatusCodesMetrics struct {
// A container that indicates whether detailed status code metrics are enabled.
IsEnabled bool
noSmithyDocumentSerde
}
// Specifies encryption-related information for an Amazon S3 bucket that is a
// destination for replicated objects. This is not supported by Amazon S3 on
// Outposts buckets.
type EncryptionConfiguration struct {
// Specifies the ID of the customer managed KMS key that's stored in Key
// Management Service (KMS) for the destination bucket. This ID is either the
// Amazon Resource Name (ARN) for the KMS key or the alias ARN for the KMS key.
// Amazon S3 uses this KMS key to encrypt replica objects. Amazon S3 supports only
// symmetric encryption KMS keys. For more information, see Symmetric encryption
// KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#symmetric-cmks)
// in the Amazon Web Services Key Management Service Developer Guide.
ReplicaKmsKeyID *string
noSmithyDocumentSerde
}
// The last established access control policy for a Multi-Region Access Point.
// When you update the policy, the update is first listed as the proposed policy.
// After the update is finished and all Regions have been updated, the proposed
// policy is listed as the established policy. If both policies have the same
// version number, the proposed policy is the established policy.
type EstablishedMultiRegionAccessPointPolicy struct {
// The details of the last established policy.
Policy *string
noSmithyDocumentSerde
}
// A container for what Amazon S3 Storage Lens will exclude.
type Exclude struct {
// A container for the S3 Storage Lens bucket excludes.
Buckets []string
// A container for the S3 Storage Lens Region excludes.
Regions []string
noSmithyDocumentSerde
}
// An optional configuration to replicate existing source bucket objects. This is
// not supported by Amazon S3 on Outposts buckets.
type ExistingObjectReplication struct {
// Specifies whether Amazon S3 replicates existing source bucket objects.
//
// This member is required.
Status ExistingObjectReplicationStatus
noSmithyDocumentSerde
}
// The encryption configuration to use when storing the generated manifest.
type GeneratedManifestEncryption struct {
// Configuration details on how SSE-KMS is used to encrypt generated manifest
// objects.
SSEKMS *SSEKMSEncryption
// Specifies the use of SSE-S3 to encrypt generated manifest objects.
SSES3 *SSES3Encryption
noSmithyDocumentSerde
}
// A container for what Amazon S3 Storage Lens configuration includes.
type Include struct {
// A container for the S3 Storage Lens bucket includes.
Buckets []string
// A container for the S3 Storage Lens Region includes.
Regions []string
noSmithyDocumentSerde
}
// A container element for the job configuration and status information returned
// by a Describe Job request.
type JobDescriptor struct {
// Indicates whether confirmation is required before Amazon S3 begins running the
// specified job. Confirmation is required only for jobs created through the Amazon
// S3 console.
ConfirmationRequired *bool
// A timestamp indicating when this job was created.
CreationTime *time.Time
// The description for this job, if one was provided in this job's Create Job
// request.
Description *string
// If the specified job failed, this field contains information describing the
// failure.
FailureReasons []JobFailure
// The attribute of the JobDescriptor containing details about the job's generated
// manifest.
GeneratedManifestDescriptor *S3GeneratedManifestDescriptor
// The Amazon Resource Name (ARN) for this job.
JobArn *string
// The ID for the specified job.
JobId *string
// The configuration information for the specified job's manifest object.
Manifest *JobManifest
// The manifest generator that was used to generate a job manifest for this job.
ManifestGenerator JobManifestGenerator
// The operation that the specified job is configured to run on the objects listed
// in the manifest.
Operation *JobOperation
// The priority of the specified job.
Priority int32
// Describes the total number of tasks that the specified job has run, the number
// of tasks that succeeded, and the number of tasks that failed.
ProgressSummary *JobProgressSummary
// Contains the configuration information for the job-completion report if you
// requested one in the Create Job request.
Report *JobReport
// The Amazon Resource Name (ARN) for the Identity and Access Management (IAM)
// role assigned to run the tasks for this job.
RoleArn *string
// The current status of the specified job.
Status JobStatus
// The reason for updating the job.
StatusUpdateReason *string
// The reason why the specified job was suspended. A job is only suspended if you
// create it through the Amazon S3 console. When you create the job, it enters the
// Suspended state to await confirmation before running. After you confirm the job,
// it automatically exits the Suspended state.
SuspendedCause *string
// The timestamp when this job was suspended, if it has been suspended.
SuspendedDate *time.Time
// A timestamp indicating when this job terminated. A job's termination date is
// the date and time when it succeeded, failed, or was canceled.
TerminationDate *time.Time
noSmithyDocumentSerde
}
// If this job failed, this element indicates why the job failed.
type JobFailure struct {
// The failure code, if any, for the specified job.
FailureCode *string
// The failure reason, if any, for the specified job.
FailureReason *string
noSmithyDocumentSerde
}
// Contains the configuration and status information for a single job retrieved as
// part of a job list.
type JobListDescriptor struct {
// A timestamp indicating when the specified job was created.
CreationTime *time.Time
// The user-specified description that was included in the specified job's Create
// Job request.
Description *string
// The ID for the specified job.
JobId *string
// The operation that the specified job is configured to run on every object
// listed in the manifest.
Operation OperationName
// The current priority for the specified job.
Priority int32
// Describes the total number of tasks that the specified job has run, the number
// of tasks that succeeded, and the number of tasks that failed.
ProgressSummary *JobProgressSummary
// The specified job's current status.
Status JobStatus
// A timestamp indicating when the specified job terminated. A job's termination
// date is the date and time when it succeeded, failed, or was canceled.
TerminationDate *time.Time
noSmithyDocumentSerde
}
// Contains the configuration information for a job's manifest.
type JobManifest struct {
// Contains the information required to locate the specified job's manifest.
//
// This member is required.
Location *JobManifestLocation
// Describes the format of the specified job's manifest. If the manifest is in CSV
// format, also describes the columns contained within the manifest.
//
// This member is required.
Spec *JobManifestSpec
noSmithyDocumentSerde
}
// Configures the type of the job's ManifestGenerator.
//
// The following types satisfy this interface:
//
// JobManifestGeneratorMemberS3JobManifestGenerator
type JobManifestGenerator interface {
isJobManifestGenerator()
}
// The S3 job ManifestGenerator's configuration details.
type JobManifestGeneratorMemberS3JobManifestGenerator struct {
Value S3JobManifestGenerator
noSmithyDocumentSerde
}
func (*JobManifestGeneratorMemberS3JobManifestGenerator) isJobManifestGenerator() {}
// The filter used to describe a set of objects for the job's manifest.
type JobManifestGeneratorFilter struct {
// If provided, the generated manifest should include only source bucket objects
// that were created after this time.
CreatedAfter *time.Time
// If provided, the generated manifest should include only source bucket objects
// that were created before this time.
CreatedBefore *time.Time
// Include objects in the generated manifest only if they are eligible for
// replication according to the Replication configuration on the source bucket.
EligibleForReplication *bool
// If provided, the generated manifest should include only source bucket objects
// that have one of the specified Replication statuses.
ObjectReplicationStatuses []ReplicationStatus
noSmithyDocumentSerde
}
// Contains the information required to locate a manifest object.
type JobManifestLocation struct {
// The ETag for the specified manifest object.
//
// This member is required.
ETag *string
// The Amazon Resource Name (ARN) for a manifest object. When you're using XML
// requests, you must replace special characters (such as carriage returns) in
// object keys with their equivalent XML entity codes. For more information, see
// XML-related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints)
// in the Amazon S3 User Guide.
//
// This member is required.
ObjectArn *string
// The optional version ID to identify a specific version of the manifest object.
ObjectVersionId *string
noSmithyDocumentSerde
}
// Describes the format of a manifest. If the manifest is in CSV format, also
// describes the columns contained within the manifest.
type JobManifestSpec struct {
// Indicates which of the available formats the specified manifest uses.
//
// This member is required.
Format JobManifestFormat
// If the specified manifest object is in the S3BatchOperations_CSV_20180820
// format, this element describes which columns contain the required data.
Fields []JobManifestFieldName
noSmithyDocumentSerde
}
// The operation that you want this job to perform on every object listed in the
// manifest. For more information about the available operations, see Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-operations.html)
// in the Amazon S3 User Guide.
type JobOperation struct {
// Directs the specified job to invoke an Lambda function on every object in the
// manifest.
LambdaInvoke *LambdaInvokeOperation
// Directs the specified job to execute a DELETE Object tagging call on every
// object in the manifest.
S3DeleteObjectTagging *S3DeleteObjectTaggingOperation
// Directs the specified job to initiate restore requests for every archived
// object in the manifest.
S3InitiateRestoreObject *S3InitiateRestoreObjectOperation
// Directs the specified job to run a PutObjectAcl call on every object in the
// manifest.
S3PutObjectAcl *S3SetObjectAclOperation
// Directs the specified job to run a PUT Copy object call on every object in the
// manifest.
S3PutObjectCopy *S3CopyObjectOperation
// Contains the configuration for an S3 Object Lock legal hold operation that an
// S3 Batch Operations job passes to every object to the underlying
// PutObjectLegalHold API operation. For more information, see Using S3 Object
// Lock legal hold with S3 Batch Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-legal-hold.html)
// in the Amazon S3 User Guide.
S3PutObjectLegalHold *S3SetObjectLegalHoldOperation
// Contains the configuration parameters for the Object Lock retention action for
// an S3 Batch Operations job. Batch Operations passes every object to the
// underlying PutObjectRetention API operation. For more information, see Using S3
// Object Lock retention with S3 Batch Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-retention-date.html)
// in the Amazon S3 User Guide.
S3PutObjectRetention *S3SetObjectRetentionOperation
// Directs the specified job to run a PUT Object tagging call on every object in
// the manifest.
S3PutObjectTagging *S3SetObjectTaggingOperation
// Directs the specified job to invoke ReplicateObject on every object in the
// job's manifest.
S3ReplicateObject *S3ReplicateObjectOperation
noSmithyDocumentSerde
}
// Describes the total number of tasks that the specified job has started, the
// number of tasks that succeeded, and the number of tasks that failed.
type JobProgressSummary struct {
//
NumberOfTasksFailed *int64
//
NumberOfTasksSucceeded *int64
// The JobTimers attribute of a job's progress summary.
Timers *JobTimers
//
TotalNumberOfTasks *int64
noSmithyDocumentSerde
}
// Contains the configuration parameters for a job-completion report.
type JobReport struct {
// Indicates whether the specified job will generate a job-completion report.
//
// This member is required.
Enabled bool
// The Amazon Resource Name (ARN) for the bucket where specified job-completion
// report will be stored.
Bucket *string
// The format of the specified job-completion report.
Format JobReportFormat
// An optional prefix to describe where in the specified bucket the job-completion
// report will be stored. Amazon S3 stores the job-completion report at
// /job-/report.json .
Prefix *string
// Indicates whether the job-completion report will include details of all tasks
// or only failed tasks.
ReportScope JobReportScope
noSmithyDocumentSerde
}
// Provides timing details for the job.
type JobTimers struct {
// Indicates the elapsed time in seconds the job has been in the Active job state.
ElapsedTimeInActiveSeconds *int64
noSmithyDocumentSerde
}
// Contains the configuration parameters for a Lambda Invoke operation.
type LambdaInvokeOperation struct {
// The Amazon Resource Name (ARN) for the Lambda function that the specified job
// will invoke on every object in the manifest.
FunctionArn *string
noSmithyDocumentSerde
}
// The container for the Outposts bucket lifecycle configuration.
type LifecycleConfiguration struct {
// A lifecycle rule for individual objects in an Outposts bucket.
Rules []LifecycleRule
noSmithyDocumentSerde
}
// The container of the Outposts bucket lifecycle expiration.
type LifecycleExpiration struct {
// Indicates at what date the object is to be deleted. Should be in GMT ISO 8601
// format.
Date *time.Time
// Indicates the lifetime, in days, of the objects that are subject to the rule.
// The value must be a non-zero positive integer.
Days int32
// Indicates whether Amazon S3 will remove a delete marker with no noncurrent
// versions. If set to true, the delete marker will be expired. If set to false,
// the policy takes no action. This cannot be specified with Days or Date in a
// Lifecycle Expiration Policy.
ExpiredObjectDeleteMarker bool
noSmithyDocumentSerde
}
// The container for the Outposts bucket lifecycle rule.
type LifecycleRule struct {
// If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is
// not currently being applied.
//
// This member is required.
Status ExpirationStatus
// Specifies the days since the initiation of an incomplete multipart upload that
// Amazon S3 waits before permanently removing all parts of the upload. For more
// information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle
// Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config)
// in the Amazon S3 User Guide.
AbortIncompleteMultipartUpload *AbortIncompleteMultipartUpload
// Specifies the expiration for the lifecycle of the object in the form of date,
// days and, whether the object has a delete marker.
Expiration *LifecycleExpiration
// The container for the filter of lifecycle rule.
Filter *LifecycleRuleFilter
// Unique identifier for the rule. The value cannot be longer than 255 characters.
ID *string
// The noncurrent version expiration of the lifecycle rule.
NoncurrentVersionExpiration *NoncurrentVersionExpiration
// Specifies the transition rule for the lifecycle rule that describes when
// noncurrent objects transition to a specific storage class. If your bucket is
// versioning-enabled (or versioning is suspended), you can set this action to
// request that Amazon S3 transition noncurrent object versions to a specific
// storage class at a set period in the object's lifetime. This is not supported by
// Amazon S3 on Outposts buckets.
NoncurrentVersionTransitions []NoncurrentVersionTransition
// Specifies when an Amazon S3 object transitions to a specified storage class.
// This is not supported by Amazon S3 on Outposts buckets.
Transitions []Transition
noSmithyDocumentSerde
}
// The container for the Outposts bucket lifecycle rule and operator.
type LifecycleRuleAndOperator struct {
// Minimum object size to which the rule applies.
ObjectSizeGreaterThan *int64
// Maximum object size to which the rule applies.
ObjectSizeLessThan *int64
// Prefix identifying one or more objects to which the rule applies.
Prefix *string
// All of these tags must exist in the object's tag set in order for the rule to
// apply.
Tags []S3Tag
noSmithyDocumentSerde
}
// The container for the filter of the lifecycle rule.
type LifecycleRuleFilter struct {
// The container for the AND condition for the lifecycle rule.
And *LifecycleRuleAndOperator
// Minimum object size to which the rule applies.
ObjectSizeGreaterThan *int64
// Maximum object size to which the rule applies.
ObjectSizeLessThan *int64
// Prefix identifying one or more objects to which the rule applies. When you're
// using XML requests, you must replace special characters (such as carriage
// returns) in object keys with their equivalent XML entity codes. For more
// information, see XML-related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints)
// in the Amazon S3 User Guide.
Prefix *string
// A container for a key-value name pair.
Tag *S3Tag
noSmithyDocumentSerde
}
// Part of ListStorageLensConfigurationResult . Each entry includes the description
// of the S3 Storage Lens configuration, its home Region, whether it is enabled,
// its Amazon Resource Name (ARN), and config ID.
type ListStorageLensConfigurationEntry struct {
// A container for the S3 Storage Lens home Region. Your metrics data is stored
// and retained in your designated S3 Storage Lens home Region.
//
// This member is required.
HomeRegion *string
// A container for the S3 Storage Lens configuration ID.
//
// This member is required.
Id *string
// The ARN of the S3 Storage Lens configuration. This property is read-only.
//
// This member is required.
StorageLensArn *string
// A container for whether the S3 Storage Lens configuration is enabled. This
// property is required.
IsEnabled bool
noSmithyDocumentSerde
}
// A container that specifies replication metrics-related settings.
type Metrics struct {
// Specifies whether replication metrics are enabled.
//
// This member is required.
Status MetricsStatus
// A container that specifies the time threshold for emitting the
// s3:Replication:OperationMissedThreshold event. This is not supported by Amazon
// S3 on Outposts buckets.
EventThreshold *ReplicationTimeValue
noSmithyDocumentSerde
}
// The Multi-Region Access Point access control policy. When you update the
// policy, the update is first listed as the proposed policy. After the update is
// finished and all Regions have been updated, the proposed policy is listed as the
// established policy. If both policies have the same version number, the proposed
// policy is the established policy.
type MultiRegionAccessPointPolicyDocument struct {
// The last established policy for the Multi-Region Access Point.
Established *EstablishedMultiRegionAccessPointPolicy
// The proposed policy for the Multi-Region Access Point.
Proposed *ProposedMultiRegionAccessPointPolicy
noSmithyDocumentSerde
}
// Status information for a single Multi-Region Access Point Region.
type MultiRegionAccessPointRegionalResponse struct {
// The name of the Region in the Multi-Region Access Point.
Name *string
// The current status of the Multi-Region Access Point in this Region.
RequestStatus *string
noSmithyDocumentSerde
}
// A collection of statuses for a Multi-Region Access Point in the various Regions
// it supports.
type MultiRegionAccessPointReport struct {
// The alias for the Multi-Region Access Point. For more information about the
// distinction between the name and the alias of an Multi-Region Access Point, see
// Managing Multi-Region Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/CreatingMultiRegionAccessPoints.html#multi-region-access-point-naming)
// .
Alias *string
// When the Multi-Region Access Point create request was received.
CreatedAt *time.Time
// The name of the Multi-Region Access Point.
Name *string
// The PublicAccessBlock configuration that you want to apply to this Amazon S3
// account. You can enable the configuration options in any combination. For more
// information about when Amazon S3 considers a bucket or object public, see The
// Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status)
// in the Amazon S3 User Guide. This data type is not supported for Amazon S3 on
// Outposts.
PublicAccessBlock *PublicAccessBlockConfiguration
// A collection of the Regions and buckets associated with the Multi-Region Access
// Point.
Regions []RegionReport
// The current status of the Multi-Region Access Point. CREATING and DELETING are
// temporary states that exist while the request is propagating and being
// completed. If a Multi-Region Access Point has a status of PARTIALLY_CREATED ,
// you can retry creation or send a request to delete the Multi-Region Access
// Point. If a Multi-Region Access Point has a status of PARTIALLY_DELETED , you
// can retry a delete request to finish the deletion of the Multi-Region Access
// Point.
Status MultiRegionAccessPointStatus
noSmithyDocumentSerde
}
// A structure for a Multi-Region Access Point that indicates where Amazon S3
// traffic can be routed. Routes can be either active or passive. Active routes can
// process Amazon S3 requests through the Multi-Region Access Point, but passive
// routes are not eligible to process Amazon S3 requests. Each route contains the
// Amazon S3 bucket name and the Amazon Web Services Region that the bucket is
// located in. The route also includes the TrafficDialPercentage value, which
// shows whether the bucket and Region are active (indicated by a value of 100 ) or
// passive (indicated by a value of 0 ).
type MultiRegionAccessPointRoute struct {
// The traffic state for the specified bucket or Amazon Web Services Region. A
// value of 0 indicates a passive state, which means that no new traffic will be
// routed to the Region. A value of 100 indicates an active state, which means
// that traffic will be routed to the specified Region. When the routing
// configuration for a Region is changed from active to passive, any in-progress
// operations (uploads, copies, deletes, and so on) to the formerly active Region
// will continue to run to until a final success or failure status is reached. If
// all Regions in the routing configuration are designated as passive, you'll
// receive an InvalidRequest error.
//
// This member is required.
TrafficDialPercentage *int32
// The name of the Amazon S3 bucket for which you'll submit a routing
// configuration change. Either the Bucket or the Region value must be provided.
// If both are provided, the bucket must be in the specified Region.
Bucket *string
// The Amazon Web Services Region to which you'll be submitting a routing
// configuration change. Either the Bucket or the Region value must be provided.
// If both are provided, the bucket must be in the specified Region.
Region *string
noSmithyDocumentSerde
}
// The Multi-Region Access Point details that are returned when querying about an
// asynchronous request.
type MultiRegionAccessPointsAsyncResponse struct {
// A collection of status information for the different Regions that a
// Multi-Region Access Point supports.
Regions []MultiRegionAccessPointRegionalResponse
noSmithyDocumentSerde
}
// The container of the noncurrent version expiration.
type NoncurrentVersionExpiration struct {
// Specifies how many noncurrent versions S3 on Outposts will retain. If there are
// this many more recent noncurrent versions, S3 on Outposts will take the
// associated action. For more information about noncurrent versions, see
// Lifecycle configuration elements (https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html)
// in the Amazon S3 User Guide.
NewerNoncurrentVersions *int32
// Specifies the number of days an object is noncurrent before Amazon S3 can
// perform the associated action. For information about the noncurrent days
// calculations, see How Amazon S3 Calculates When an Object Became Noncurrent (https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations)
// in the Amazon S3 User Guide.
NoncurrentDays int32
noSmithyDocumentSerde
}
// The container for the noncurrent version transition.
type NoncurrentVersionTransition struct {
// Specifies the number of days an object is noncurrent before Amazon S3 can
// perform the associated action. For information about the noncurrent days
// calculations, see How Amazon S3 Calculates How Long an Object Has Been
// Noncurrent (https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations)
// in the Amazon S3 User Guide.
NoncurrentDays int32
// The class of storage used to store the object.
StorageClass TransitionStorageClass
noSmithyDocumentSerde
}
// An access point with an attached Lambda function used to access transformed
// data from an Amazon S3 bucket.
type ObjectLambdaAccessPoint struct {
// The name of the Object Lambda Access Point.
//
// This member is required.
Name *string
// The alias of the Object Lambda Access Point.
Alias *ObjectLambdaAccessPointAlias
// Specifies the ARN for the Object Lambda Access Point.
ObjectLambdaAccessPointArn *string
noSmithyDocumentSerde
}
// The alias of an Object Lambda Access Point. For more information, see How to
// use a bucket-style alias for your S3 bucket Object Lambda Access Point (https://docs.aws.amazon.com/AmazonS3/latest/userguide/olap-use.html#ol-access-points-alias)
// .
type ObjectLambdaAccessPointAlias struct {
// The status of the Object Lambda Access Point alias. If the status is
// PROVISIONING , the Object Lambda Access Point is provisioning the alias and the
// alias is not ready for use yet. If the status is READY , the Object Lambda
// Access Point alias is successfully provisioned and ready for use.
Status ObjectLambdaAccessPointAliasStatus
// The alias value of the Object Lambda Access Point.
Value *string
noSmithyDocumentSerde
}
// A configuration used when creating an Object Lambda Access Point.
type ObjectLambdaConfiguration struct {
// Standard access point associated with the Object Lambda Access Point.
//
// This member is required.
SupportingAccessPoint *string
// A container for transformation configurations for an Object Lambda Access Point.
//
// This member is required.
TransformationConfigurations []ObjectLambdaTransformationConfiguration
// A container for allowed features. Valid inputs are GetObject-Range ,
// GetObject-PartNumber , HeadObject-Range , and HeadObject-PartNumber .
AllowedFeatures []ObjectLambdaAllowedFeature
// A container for whether the CloudWatch metrics configuration is enabled.
CloudWatchMetricsEnabled bool
noSmithyDocumentSerde
}
// A container for AwsLambdaTransformation.
//
// The following types satisfy this interface:
//
// ObjectLambdaContentTransformationMemberAwsLambda
type ObjectLambdaContentTransformation interface {
isObjectLambdaContentTransformation()
}
// A container for an Lambda function.
type ObjectLambdaContentTransformationMemberAwsLambda struct {
Value AwsLambdaTransformation
noSmithyDocumentSerde
}
func (*ObjectLambdaContentTransformationMemberAwsLambda) isObjectLambdaContentTransformation() {}
// A configuration used when creating an Object Lambda Access Point transformation.
type ObjectLambdaTransformationConfiguration struct {
// A container for the action of an Object Lambda Access Point configuration.
// Valid inputs are GetObject , ListObjects , HeadObject , and ListObjectsV2 .
//
// This member is required.
Actions []ObjectLambdaTransformationConfigurationAction
// A container for the content transformation of an Object Lambda Access Point
// configuration.
//
// This member is required.
ContentTransformation ObjectLambdaContentTransformation
noSmithyDocumentSerde
}
// Indicates whether this access point policy is public. For more information
// about how Amazon S3 evaluates policies to determine whether they are public, see
// The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status)
// in the Amazon S3 User Guide.
type PolicyStatus struct {
//
IsPublic bool
noSmithyDocumentSerde
}
// A container for the prefix-level configuration.
type PrefixLevel struct {
// A container for the prefix-level storage metrics for S3 Storage Lens.
//
// This member is required.
StorageMetrics *PrefixLevelStorageMetrics
noSmithyDocumentSerde
}
// A container for the prefix-level storage metrics for S3 Storage Lens.
type PrefixLevelStorageMetrics struct {
// A container for whether prefix-level storage metrics are enabled.
IsEnabled bool
//
SelectionCriteria *SelectionCriteria
noSmithyDocumentSerde
}
// The proposed access control policy for the Multi-Region Access Point. When you
// update the policy, the update is first listed as the proposed policy. After the
// update is finished and all Regions have been updated, the proposed policy is
// listed as the established policy. If both policies have the same version number,
// the proposed policy is the established policy.
type ProposedMultiRegionAccessPointPolicy struct {
// The details of the proposed policy.
Policy *string
noSmithyDocumentSerde
}
// The PublicAccessBlock configuration that you want to apply to this Amazon S3
// account. You can enable the configuration options in any combination. For more
// information about when Amazon S3 considers a bucket or object public, see The
// Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status)
// in the Amazon S3 User Guide. This data type is not supported for Amazon S3 on
// Outposts.
type PublicAccessBlockConfiguration struct {
// Specifies whether Amazon S3 should block public access control lists (ACLs) for
// buckets in this account. Setting this element to TRUE causes the following
// behavior:
// - PutBucketAcl and PutObjectAcl calls fail if the specified ACL is public.
// - PUT Object calls fail if the request includes a public ACL.
// - PUT Bucket calls fail if the request includes a public ACL.
// Enabling this setting doesn't affect existing policies or ACLs. This property
// is not supported for Amazon S3 on Outposts.
BlockPublicAcls bool
// Specifies whether Amazon S3 should block public bucket policies for buckets in
// this account. Setting this element to TRUE causes Amazon S3 to reject calls to
// PUT Bucket policy if the specified bucket policy allows public access. Enabling
// this setting doesn't affect existing bucket policies. This property is not
// supported for Amazon S3 on Outposts.
BlockPublicPolicy bool
// Specifies whether Amazon S3 should ignore public ACLs for buckets in this
// account. Setting this element to TRUE causes Amazon S3 to ignore all public
// ACLs on buckets in this account and any objects that they contain. Enabling this
// setting doesn't affect the persistence of any existing ACLs and doesn't prevent
// new public ACLs from being set. This property is not supported for Amazon S3 on
// Outposts.
IgnorePublicAcls bool
// Specifies whether Amazon S3 should restrict public bucket policies for buckets
// in this account. Setting this element to TRUE restricts access to buckets with
// public policies to only Amazon Web Service principals and authorized users
// within this account. Enabling this setting doesn't affect previously stored
// bucket policies, except that public and cross-account access within any public
// bucket policy, including non-public delegation to specific accounts, is blocked.
// This property is not supported for Amazon S3 on Outposts.
RestrictPublicBuckets bool
noSmithyDocumentSerde
}
// A container for the information associated with a PutMultiRegionAccessPoint (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutMultiRegionAccessPoint.html)
// request.
type PutMultiRegionAccessPointPolicyInput struct {
// The name of the Multi-Region Access Point associated with the request.
//
// This member is required.
Name *string
// The policy details for the PutMultiRegionAccessPoint request.
//
// This member is required.
Policy *string
noSmithyDocumentSerde
}
// A Region that supports a Multi-Region Access Point as well as the associated
// bucket for the Region.
type Region struct {
// The name of the associated bucket for the Region.
//
// This member is required.
Bucket *string
// The Amazon Web Services account ID that owns the Amazon S3 bucket that's
// associated with this Multi-Region Access Point.
BucketAccountId *string
noSmithyDocumentSerde
}
// The container for the regional bucket.
type RegionalBucket struct {
//
//
// This member is required.
Bucket *string
// The creation date of the regional bucket
//
// This member is required.
CreationDate *time.Time
//
//
// This member is required.
PublicAccessBlockEnabled bool
// The Amazon Resource Name (ARN) for the regional bucket.
BucketArn *string
// The Outposts ID of the regional bucket.
OutpostId *string
noSmithyDocumentSerde
}
// A combination of a bucket and Region that's part of a Multi-Region Access Point.
type RegionReport struct {
// The name of the bucket.
Bucket *string
// The Amazon Web Services account ID that owns the Amazon S3 bucket that's
// associated with this Multi-Region Access Point.
BucketAccountId *string
// The name of the Region.
Region *string
noSmithyDocumentSerde
}
// A filter that you can use to specify whether replica modification sync is
// enabled. S3 on Outposts replica modification sync can help you keep object
// metadata synchronized between replicas and source objects. By default, S3 on
// Outposts replicates metadata from the source objects to the replicas only. When
// replica modification sync is enabled, S3 on Outposts replicates metadata changes
// made to the replica copies back to the source object, making the replication
// bidirectional. To replicate object metadata modifications on replicas, you can
// specify this element and set the Status of this element to Enabled . You must
// enable replica modification sync on the source and destination buckets to
// replicate replica metadata changes between the source and the replicas.
type ReplicaModifications struct {
// Specifies whether S3 on Outposts replicates modifications to object metadata on
// replicas.
//
// This member is required.
Status ReplicaModificationsStatus
noSmithyDocumentSerde
}
// A container for one or more replication rules. A replication configuration must
// have at least one rule and you can add up to 100 rules. The maximum size of a
// replication configuration is 128 KB.
type ReplicationConfiguration struct {
// The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role
// that S3 on Outposts assumes when replicating objects. For information about S3
// replication on Outposts configuration, see Setting up replication (https://docs.aws.amazon.com/AmazonS3/latest/userguide/outposts-replication-how-setup.html)
// in the Amazon S3 User Guide.
//
// This member is required.
Role *string
// A container for one or more replication rules. A replication configuration must
// have at least one rule and can contain an array of 100 rules at the most.
//
// This member is required.
Rules []ReplicationRule
noSmithyDocumentSerde
}
// Specifies which S3 on Outposts objects to replicate and where to store the
// replicas.
type ReplicationRule struct {
// The Amazon Resource Name (ARN) of the access point for the source Outposts
// bucket that you want S3 on Outposts to replicate the objects from.
//
// This member is required.
Bucket *string
// A container for information about the replication destination and its
// configurations.
//
// This member is required.
Destination *Destination
// Specifies whether the rule is enabled.
//
// This member is required.
Status ReplicationRuleStatus
// Specifies whether S3 on Outposts replicates delete markers. If you specify a
// Filter element in your replication configuration, you must also include a
// DeleteMarkerReplication element. If your Filter includes a Tag element, the
// DeleteMarkerReplication element's Status child element must be set to Disabled ,
// because S3 on Outposts doesn't support replicating delete markers for tag-based
// rules. For more information about delete marker replication, see How delete
// operations affect replication (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsReplication.html#outposts-replication-what-is-replicated)
// in the Amazon S3 User Guide.
DeleteMarkerReplication *DeleteMarkerReplication
// An optional configuration to replicate existing source bucket objects. This is
// not supported by Amazon S3 on Outposts buckets.
ExistingObjectReplication *ExistingObjectReplication
// A filter that identifies the subset of objects to which the replication rule
// applies. A Filter element must specify exactly one Prefix , Tag , or And child
// element.
Filter *ReplicationRuleFilter
// A unique identifier for the rule. The maximum value is 255 characters.
ID *string
// An object key name prefix that identifies the object or objects to which the
// rule applies. The maximum prefix length is 1,024 characters. To include all
// objects in an Outposts bucket, specify an empty string. When you're using XML
// requests, you must replace special characters (such as carriage returns) in
// object keys with their equivalent XML entity codes. For more information, see
// XML-related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints)
// in the Amazon S3 User Guide.
//
// Deprecated: Prefix has been deprecated
Prefix *string
// The priority indicates which rule has precedence whenever two or more
// replication rules conflict. S3 on Outposts attempts to replicate objects
// according to all replication rules. However, if there are two or more rules with
// the same destination Outposts bucket, then objects will be replicated according
// to the rule with the highest priority. The higher the number, the higher the
// priority. For more information, see Creating replication rules on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication-between-outposts.html)
// in the Amazon S3 User Guide.
Priority *int32
// A container that describes additional filters for identifying the source
// Outposts objects that you want to replicate. You can choose to enable or disable
// the replication of these objects.
SourceSelectionCriteria *SourceSelectionCriteria
noSmithyDocumentSerde
}
// A container for specifying rule filters. The filters determine the subset of
// objects to which the rule applies. This element is required only if you specify
// more than one filter. For example:
// - If you specify both a Prefix and a Tag filter, wrap these filters in an And
// element.
// - If you specify a filter based on multiple tags, wrap the Tag elements in an
// And element.
type ReplicationRuleAndOperator struct {
// An object key name prefix that identifies the subset of objects that the rule
// applies to.
Prefix *string
// An array of tags that contain key and value pairs.
Tags []S3Tag
noSmithyDocumentSerde
}
// A filter that identifies the subset of objects to which the replication rule
// applies. A Filter element must specify exactly one Prefix , Tag , or And child
// element.
type ReplicationRuleFilter struct {
// A container for specifying rule filters. The filters determine the subset of
// objects that the rule applies to. This element is required only if you specify
// more than one filter. For example:
// - If you specify both a Prefix and a Tag filter, wrap these filters in an And
// element.
// - If you specify a filter based on multiple tags, wrap the Tag elements in an
// And element.
And *ReplicationRuleAndOperator
// An object key name prefix that identifies the subset of objects that the rule
// applies to. When you're using XML requests, you must replace special characters
// (such as carriage returns) in object keys with their equivalent XML entity
// codes. For more information, see XML-related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints)
// in the Amazon S3 User Guide.
Prefix *string
// A container for a key-value name pair.
Tag *S3Tag
noSmithyDocumentSerde
}
// A container that specifies S3 Replication Time Control (S3 RTC) related
// information, including whether S3 RTC is enabled and the time when all objects
// and operations on objects must be replicated. This is not supported by Amazon S3
// on Outposts buckets.
type ReplicationTime struct {
// Specifies whether S3 Replication Time Control (S3 RTC) is enabled.
//
// This member is required.
Status ReplicationTimeStatus
// A container that specifies the time by which replication should be complete for
// all objects and operations on objects.
//
// This member is required.
Time *ReplicationTimeValue
noSmithyDocumentSerde
}
// A container that specifies the time value for S3 Replication Time Control (S3
// RTC). This value is also used for the replication metrics EventThreshold
// element. This is not supported by Amazon S3 on Outposts buckets.
type ReplicationTimeValue struct {
// Contains an integer that specifies the time period in minutes. Valid value: 15
Minutes *int32
noSmithyDocumentSerde
}
type S3AccessControlList struct {
//
//
// This member is required.
Owner *S3ObjectOwner
//
Grants []S3Grant
noSmithyDocumentSerde
}
type S3AccessControlPolicy struct {
//
AccessControlList *S3AccessControlList
//
CannedAccessControlList S3CannedAccessControlList
noSmithyDocumentSerde
}
// A container for the bucket where the Amazon S3 Storage Lens metrics export
// files are located.
type S3BucketDestination struct {
// The account ID of the owner of the S3 Storage Lens metrics export bucket.
//
// This member is required.
AccountId *string
// The Amazon Resource Name (ARN) of the bucket. This property is read-only and
// follows the following format:
// arn:aws:s3:us-east-1:example-account-id:bucket/your-destination-bucket-name
//
// This member is required.
Arn *string
//
//
// This member is required.
Format Format
// The schema version of the export file.
//
// This member is required.
OutputSchemaVersion OutputSchemaVersion
// The container for the type encryption of the metrics exports in this bucket.
Encryption *StorageLensDataExportEncryption
// The prefix of the destination bucket where the metrics export will be delivered.
Prefix *string
noSmithyDocumentSerde
}
// Contains the configuration parameters for a PUT Copy object operation. S3 Batch
// Operations passes every object to the underlying CopyObject API operation. For
// more information about the parameters for this operation, see CopyObject (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectCOPY.html)
// .
type S3CopyObjectOperation struct {
//
AccessControlGrants []S3Grant
// Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption
// with server-side encryption using Amazon Web Services KMS (SSE-KMS). Setting
// this header to true causes Amazon S3 to use an S3 Bucket Key for object
// encryption with SSE-KMS. Specifying this header with an object action doesn’t
// affect bucket-level settings for S3 Bucket Key.
BucketKeyEnabled bool
//
CannedAccessControlList S3CannedAccessControlList
// Indicates the algorithm that you want Amazon S3 to use to create the checksum.
// For more information, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/CheckingObjectIntegrity.xml)
// in the Amazon S3 User Guide.
ChecksumAlgorithm S3ChecksumAlgorithm
//
MetadataDirective S3MetadataDirective
//
ModifiedSinceConstraint *time.Time
// If you don't provide this parameter, Amazon S3 copies all the metadata from the
// original objects. If you specify an empty set, the new objects will have no
// tags. Otherwise, Amazon S3 assigns the supplied tags to the new objects.
NewObjectMetadata *S3ObjectMetadata
//
NewObjectTagging []S3Tag
// The legal hold status to be applied to all objects in the Batch Operations job.
ObjectLockLegalHoldStatus S3ObjectLockLegalHoldStatus
// The retention mode to be applied to all objects in the Batch Operations job.
ObjectLockMode S3ObjectLockMode
// The date when the applied object retention configuration expires on all objects
// in the Batch Operations job.
ObjectLockRetainUntilDate *time.Time
// Specifies an optional metadata property for website redirects,
// x-amz-website-redirect-location . Allows webpage redirects if the object is
// accessed through a website endpoint.
RedirectLocation *string
//
RequesterPays bool
//
SSEAwsKmsKeyId *string
//
StorageClass S3StorageClass
// Specifies the folder prefix that you want the objects to be copied into. For
// example, to copy objects into a folder named Folder1 in the destination bucket,
// set the TargetKeyPrefix property to Folder1 .
TargetKeyPrefix *string
// Specifies the destination bucket Amazon Resource Name (ARN) for the batch copy
// operation. For example, to copy objects to a bucket named destinationBucket ,
// set the TargetResource property to arn:aws:s3:::destinationBucket .
TargetResource *string
//
UnModifiedSinceConstraint *time.Time
noSmithyDocumentSerde
}
// Contains no configuration parameters because the DELETE Object tagging (
// DeleteObjectTagging ) API operation accepts only the bucket name and key name as
// parameters, which are defined in the job's manifest.
type S3DeleteObjectTaggingOperation struct {
noSmithyDocumentSerde
}
// Describes the specified job's generated manifest. Batch Operations jobs created
// with a ManifestGenerator populate details of this descriptor after execution of
// the ManifestGenerator.
type S3GeneratedManifestDescriptor struct {
// The format of the generated manifest.
Format GeneratedManifestFormat
// Contains the information required to locate a manifest object.
Location *JobManifestLocation
noSmithyDocumentSerde
}
type S3Grant struct {
//
Grantee *S3Grantee
//
Permission S3Permission
noSmithyDocumentSerde
}
type S3Grantee struct {
//
DisplayName *string
//
Identifier *string
//
TypeIdentifier S3GranteeTypeIdentifier
noSmithyDocumentSerde
}
// Contains the configuration parameters for a POST Object restore job. S3 Batch
// Operations passes every object to the underlying RestoreObject API operation.
// For more information about the parameters for this operation, see RestoreObject (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOSTrestore.html#RESTObjectPOSTrestore-restore-request)
// .
type S3InitiateRestoreObjectOperation struct {
// This argument specifies how long the S3 Glacier or S3 Glacier Deep Archive
// object remains available in Amazon S3. S3 Initiate Restore Object jobs that
// target S3 Glacier and S3 Glacier Deep Archive objects require ExpirationInDays
// set to 1 or greater. Conversely, do not set ExpirationInDays when creating S3
// Initiate Restore Object jobs that target S3 Intelligent-Tiering Archive Access
// and Deep Archive Access tier objects. Objects in S3 Intelligent-Tiering archive
// access tiers are not subject to restore expiry, so specifying ExpirationInDays
// results in restore request failure. S3 Batch Operations jobs can operate either
// on S3 Glacier and S3 Glacier Deep Archive storage class objects or on S3
// Intelligent-Tiering Archive Access and Deep Archive Access storage tier objects,
// but not both types in the same job. If you need to restore objects of both types
// you must create separate Batch Operations jobs.
ExpirationInDays *int32
// S3 Batch Operations supports STANDARD and BULK retrieval tiers, but not the
// EXPEDITED retrieval tier.
GlacierJobTier S3GlacierJobTier
noSmithyDocumentSerde
}
// The container for the service that will create the S3 manifest.
type S3JobManifestGenerator struct {
// Determines whether or not to write the job's generated manifest to a bucket.
//
// This member is required.
EnableManifestOutput bool
// The source bucket used by the ManifestGenerator.
//
// This member is required.
SourceBucket *string
// The Amazon Web Services account ID that owns the bucket the generated manifest
// is written to. If provided the generated manifest bucket's owner Amazon Web
// Services account ID must match this value, else the job fails.
ExpectedBucketOwner *string
// Specifies rules the S3JobManifestGenerator should use to use to decide whether
// an object in the source bucket should or should not be included in the generated
// job manifest.
Filter *JobManifestGeneratorFilter
// Specifies the location the generated manifest will be written to.
ManifestOutputLocation *S3ManifestOutputLocation
noSmithyDocumentSerde
}
// Location details for where the generated manifest should be written.
type S3ManifestOutputLocation struct {
// The bucket ARN the generated manifest should be written to.
//
// This member is required.
Bucket *string
// The format of the generated manifest.
//
// This member is required.
ManifestFormat GeneratedManifestFormat
// The Account ID that owns the bucket the generated manifest is written to.
ExpectedManifestBucketOwner *string
// Specifies what encryption should be used when the generated manifest objects
// are written.
ManifestEncryption *GeneratedManifestEncryption
// Prefix identifying one or more objects to which the manifest applies.
ManifestPrefix *string
noSmithyDocumentSerde
}
// Whether S3 Object Lock legal hold will be applied to objects in an S3 Batch
// Operations job.
type S3ObjectLockLegalHold struct {
// The Object Lock legal hold status to be applied to all objects in the Batch
// Operations job.
//
// This member is required.
Status S3ObjectLockLegalHoldStatus
noSmithyDocumentSerde
}
type S3ObjectMetadata struct {
//
CacheControl *string
//
ContentDisposition *string
//
ContentEncoding *string
//
ContentLanguage *string
//
ContentLength *int64
//
ContentMD5 *string
//
ContentType *string
//
HttpExpiresDate *time.Time
//
RequesterCharged bool
//
SSEAlgorithm S3SSEAlgorithm
//
UserMetadata map[string]string
noSmithyDocumentSerde
}
type S3ObjectOwner struct {
//
DisplayName *string
//
ID *string
noSmithyDocumentSerde
}
// Directs the specified job to invoke ReplicateObject on every object in the
// job's manifest.
type S3ReplicateObjectOperation struct {
noSmithyDocumentSerde
}
// Contains the S3 Object Lock retention mode to be applied to all objects in the
// S3 Batch Operations job. If you don't provide Mode and RetainUntilDate data
// types in your operation, you will remove the retention from your objects. For
// more information, see Using S3 Object Lock retention with S3 Batch Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-retention-date.html)
// in the Amazon S3 User Guide.
type S3Retention struct {
// The Object Lock retention mode to be applied to all objects in the Batch
// Operations job.
Mode S3ObjectLockRetentionMode
// The date when the applied Object Lock retention will expire on all objects set
// by the Batch Operations job.
RetainUntilDate *time.Time
noSmithyDocumentSerde
}
// Contains the configuration parameters for a PUT Object ACL operation. S3 Batch
// Operations passes every object to the underlying PutObjectAcl API operation.
// For more information about the parameters for this operation, see PutObjectAcl (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUTacl.html)
// .
type S3SetObjectAclOperation struct {
//
AccessControlPolicy *S3AccessControlPolicy
noSmithyDocumentSerde
}
// Contains the configuration for an S3 Object Lock legal hold operation that an
// S3 Batch Operations job passes to every object to the underlying
// PutObjectLegalHold API operation. For more information, see Using S3 Object
// Lock legal hold with S3 Batch Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-legal-hold.html)
// in the Amazon S3 User Guide.
type S3SetObjectLegalHoldOperation struct {
// Contains the Object Lock legal hold status to be applied to all objects in the
// Batch Operations job.
//
// This member is required.
LegalHold *S3ObjectLockLegalHold
noSmithyDocumentSerde
}
// Contains the configuration parameters for the Object Lock retention action for
// an S3 Batch Operations job. Batch Operations passes every object to the
// underlying PutObjectRetention API operation. For more information, see Using S3
// Object Lock retention with S3 Batch Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-retention-date.html)
// in the Amazon S3 User Guide.
type S3SetObjectRetentionOperation struct {
// Contains the Object Lock retention mode to be applied to all objects in the
// Batch Operations job. For more information, see Using S3 Object Lock retention
// with S3 Batch Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-retention-date.html)
// in the Amazon S3 User Guide.
//
// This member is required.
Retention *S3Retention
// Indicates if the action should be applied to objects in the Batch Operations
// job even if they have Object Lock GOVERNANCE type in place.
BypassGovernanceRetention *bool
noSmithyDocumentSerde
}
// Contains the configuration parameters for a PUT Object Tagging operation. S3
// Batch Operations passes every object to the underlying PutObjectTagging API
// operation. For more information about the parameters for this operation, see
// PutObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUTtagging.html)
// .
type S3SetObjectTaggingOperation struct {
//
TagSet []S3Tag
noSmithyDocumentSerde
}
// A container for a key-value name pair.
type S3Tag struct {
// Key of the tag
//
// This member is required.
Key *string
// Value of the tag
//
// This member is required.
Value *string
noSmithyDocumentSerde
}
type SelectionCriteria struct {
// A container for the delimiter of the selection criteria being used.
Delimiter *string
// The max depth of the selection criteria
MaxDepth int32
// The minimum number of storage bytes percentage whose metrics will be selected.
// You must choose a value greater than or equal to 1.0 .
MinStorageBytesPercentage float64
noSmithyDocumentSerde
}
// A container that describes additional filters for identifying the source
// objects that you want to replicate. You can choose to enable or disable the
// replication of these objects.
type SourceSelectionCriteria struct {
// A filter that you can use to specify whether replica modification sync is
// enabled. S3 on Outposts replica modification sync can help you keep object
// metadata synchronized between replicas and source objects. By default, S3 on
// Outposts replicates metadata from the source objects to the replicas only. When
// replica modification sync is enabled, S3 on Outposts replicates metadata changes
// made to the replica copies back to the source object, making the replication
// bidirectional. To replicate object metadata modifications on replicas, you can
// specify this element and set the Status of this element to Enabled . You must
// enable replica modification sync on the source and destination buckets to
// replicate replica metadata changes between the source and the replicas.
ReplicaModifications *ReplicaModifications
// A filter that you can use to select Amazon S3 objects that are encrypted with
// server-side encryption by using Key Management Service (KMS) keys. If you
// include SourceSelectionCriteria in the replication configuration, this element
// is required. This is not supported by Amazon S3 on Outposts buckets.
SseKmsEncryptedObjects *SseKmsEncryptedObjects
noSmithyDocumentSerde
}
type SSEKMS struct {
// A container for the ARN of the SSE-KMS encryption. This property is read-only
// and follows the following format:
// arn:aws:kms:us-east-1:example-account-id:key/example-9a73-4afc-8d29-8f5900cef44e
//
// This member is required.
KeyId *string
noSmithyDocumentSerde
}
// A container for filter information that you can use to select S3 objects that
// are encrypted with Key Management Service (KMS). This is not supported by Amazon
// S3 on Outposts buckets.
type SseKmsEncryptedObjects struct {
// Specifies whether Amazon S3 replicates objects that are created with
// server-side encryption by using an KMS key stored in Key Management Service.
//
// This member is required.
Status SseKmsEncryptedObjectsStatus
noSmithyDocumentSerde
}
// Configuration for the use of SSE-KMS to encrypt generated manifest objects.
type SSEKMSEncryption struct {
// Specifies the ID of the Amazon Web Services Key Management Service (Amazon Web
// Services KMS) symmetric encryption customer managed key to use for encrypting
// generated manifest objects.
//
// This member is required.
KeyId *string
noSmithyDocumentSerde
}
type SSES3 struct {
noSmithyDocumentSerde
}
// Configuration for the use of SSE-S3 to encrypt generated manifest objects.
type SSES3Encryption struct {
noSmithyDocumentSerde
}
// The Amazon Web Services organization for your S3 Storage Lens.
type StorageLensAwsOrg struct {
// A container for the Amazon Resource Name (ARN) of the Amazon Web Services
// organization. This property is read-only and follows the following format:
// arn:aws:organizations:us-east-1:example-account-id:organization/o-ex2l495dck
//
// This member is required.
Arn *string
noSmithyDocumentSerde
}
// A container for the Amazon S3 Storage Lens configuration.
type StorageLensConfiguration struct {
// A container for all the account-level configurations of your S3 Storage Lens
// configuration.
//
// This member is required.
AccountLevel *AccountLevel
// A container for the Amazon S3 Storage Lens configuration ID.
//
// This member is required.
Id *string
// A container for whether the S3 Storage Lens configuration is enabled.
//
// This member is required.
IsEnabled bool
// A container for the Amazon Web Services organization for this S3 Storage Lens
// configuration.
AwsOrg *StorageLensAwsOrg
// A container to specify the properties of your S3 Storage Lens metrics export
// including, the destination, schema and format.
DataExport *StorageLensDataExport
// A container for what is excluded in this configuration. This container can only
// be valid if there is no Include container submitted, and it's not empty.
Exclude *Exclude
// A container for what is included in this configuration. This container can only
// be valid if there is no Exclude container submitted, and it's not empty.
Include *Include
// The Amazon Resource Name (ARN) of the S3 Storage Lens configuration. This
// property is read-only and follows the following format:
// arn:aws:s3:us-east-1:example-account-id:storage-lens/your-dashboard-name
StorageLensArn *string
noSmithyDocumentSerde
}
// A container to specify the properties of your S3 Storage Lens metrics export,
// including the destination, schema, and format.
type StorageLensDataExport struct {
// A container for enabling Amazon CloudWatch publishing for S3 Storage Lens
// metrics.
CloudWatchMetrics *CloudWatchMetrics
// A container for the bucket where the S3 Storage Lens metrics export will be
// located. This bucket must be located in the same Region as the storage lens
// configuration.
S3BucketDestination *S3BucketDestination
noSmithyDocumentSerde
}
// A container for the encryption of the S3 Storage Lens metrics exports.
type StorageLensDataExportEncryption struct {
//
SSEKMS *SSEKMS
//
SSES3 *SSES3
noSmithyDocumentSerde
}
type StorageLensTag struct {
//
//
// This member is required.
Key *string
//
//
// This member is required.
Value *string
noSmithyDocumentSerde
}
type Tagging struct {
// A collection for a set of tags.
//
// This member is required.
TagSet []S3Tag
noSmithyDocumentSerde
}
// Specifies when an object transitions to a specified storage class. For more
// information about Amazon S3 Lifecycle configuration rules, see Transitioning
// objects using Amazon S3 Lifecycle (https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html)
// in the Amazon S3 User Guide.
type Transition struct {
// Indicates when objects are transitioned to the specified storage class. The
// date value must be in ISO 8601 format. The time is always midnight UTC.
Date *time.Time
// Indicates the number of days after creation when objects are transitioned to
// the specified storage class. The value must be a positive integer.
Days int32
// The storage class to which you want the object to transition.
StorageClass TransitionStorageClass
noSmithyDocumentSerde
}
// Describes the versioning state of an Amazon S3 on Outposts bucket. For more
// information, see PutBucketVersioning (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketVersioning.html)
// .
type VersioningConfiguration struct {
// Specifies whether MFA delete is enabled or disabled in the bucket versioning
// configuration for the S3 on Outposts bucket.
MFADelete MFADelete
// Sets the versioning state of the S3 on Outposts bucket.
Status BucketVersioningStatus
noSmithyDocumentSerde
}
// The virtual private cloud (VPC) configuration for an access point.
type VpcConfiguration struct {
// If this field is specified, this access point will only allow connections from
// the specified VPC ID.
//
// This member is required.
VpcId *string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
// UnknownUnionMember is returned when a union member is returned over the wire,
// but has an unknown tag.
type UnknownUnionMember struct {
Tag string
Value []byte
noSmithyDocumentSerde
}
func (*UnknownUnionMember) isJobManifestGenerator() {}
func (*UnknownUnionMember) isObjectLambdaContentTransformation() {}
| 2,275 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types_test
import (
"fmt"
"github.com/aws/aws-sdk-go-v2/service/s3control/types"
)
func ExampleJobManifestGenerator_outputUsage() {
var union types.JobManifestGenerator
// type switches can be used to check the union value
switch v := union.(type) {
case *types.JobManifestGeneratorMemberS3JobManifestGenerator:
_ = v.Value // Value is types.S3JobManifestGenerator
case *types.UnknownUnionMember:
fmt.Println("unknown tag:", v.Tag)
default:
fmt.Println("union is nil or unknown type")
}
}
var _ *types.S3JobManifestGenerator
func ExampleObjectLambdaContentTransformation_outputUsage() {
var union types.ObjectLambdaContentTransformation
// type switches can be used to check the union value
switch v := union.(type) {
case *types.ObjectLambdaContentTransformationMemberAwsLambda:
_ = v.Value // Value is types.AwsLambdaTransformation
case *types.UnknownUnionMember:
fmt.Println("unknown tag:", v.Tag)
default:
fmt.Println("union is nil or unknown type")
}
}
var _ *types.AwsLambdaTransformation
| 45 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3outposts
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 = "S3Outposts"
const ServiceAPIVersion = "2017-07-25"
// Client provides the API client to make operations call for Amazon S3 on
// Outposts.
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, "s3outposts", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 435 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3outposts
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 s3outposts
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/s3outposts/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an endpoint and associates it with the specified Outpost. It can take
// up to 5 minutes for this action to finish. Related actions include:
// - DeleteEndpoint (https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_DeleteEndpoint.html)
// - ListEndpoints (https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_ListEndpoints.html)
func (c *Client) CreateEndpoint(ctx context.Context, params *CreateEndpointInput, optFns ...func(*Options)) (*CreateEndpointOutput, error) {
if params == nil {
params = &CreateEndpointInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateEndpoint", params, optFns, c.addOperationCreateEndpointMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateEndpointOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateEndpointInput struct {
// The ID of the Outposts.
//
// This member is required.
OutpostId *string
// The ID of the security group to use with the endpoint.
//
// This member is required.
SecurityGroupId *string
// The ID of the subnet in the selected VPC. The endpoint subnet must belong to
// the Outpost that has Amazon S3 on Outposts provisioned.
//
// This member is required.
SubnetId *string
// The type of access for the network connectivity for the Amazon S3 on Outposts
// endpoint. To use the Amazon Web Services VPC, choose Private . To use the
// endpoint with an on-premises network, choose CustomerOwnedIp . If you choose
// CustomerOwnedIp , you must also provide the customer-owned IP address pool (CoIP
// pool). Private is the default access type value.
AccessType types.EndpointAccessType
// The ID of the customer-owned IPv4 address pool (CoIP pool) for the endpoint. IP
// addresses are allocated from this pool for the endpoint.
CustomerOwnedIpv4Pool *string
noSmithyDocumentSerde
}
type CreateEndpointOutput struct {
// The Amazon Resource Name (ARN) of the endpoint.
EndpointArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateEndpoint{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateEndpoint{}, 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 = addOpCreateEndpointValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateEndpoint(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_opCreateEndpoint(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3-outposts",
OperationName: "CreateEndpoint",
}
}
| 150 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3outposts
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 an endpoint. It can take up to 5 minutes for this action to finish.
// Related actions include:
// - CreateEndpoint (https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_CreateEndpoint.html)
// - ListEndpoints (https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_ListEndpoints.html)
func (c *Client) DeleteEndpoint(ctx context.Context, params *DeleteEndpointInput, optFns ...func(*Options)) (*DeleteEndpointOutput, error) {
if params == nil {
params = &DeleteEndpointInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteEndpoint", params, optFns, c.addOperationDeleteEndpointMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteEndpointOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteEndpointInput struct {
// The ID of the endpoint.
//
// This member is required.
EndpointId *string
// The ID of the Outposts.
//
// This member is required.
OutpostId *string
noSmithyDocumentSerde
}
type DeleteEndpointOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteEndpoint{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteEndpoint{}, 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 = addOpDeleteEndpointValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteEndpoint(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_opDeleteEndpoint(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3-outposts",
OperationName: "DeleteEndpoint",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3outposts
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/s3outposts/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists endpoints associated with the specified Outpost. Related actions include:
// - CreateEndpoint (https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_CreateEndpoint.html)
// - DeleteEndpoint (https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_DeleteEndpoint.html)
func (c *Client) ListEndpoints(ctx context.Context, params *ListEndpointsInput, optFns ...func(*Options)) (*ListEndpointsOutput, error) {
if params == nil {
params = &ListEndpointsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListEndpoints", params, optFns, c.addOperationListEndpointsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListEndpointsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListEndpointsInput struct {
// The maximum number of endpoints that will be returned in the response.
MaxResults int32
// If a previous response from this operation included a NextToken value, provide
// that value here to retrieve the next page of results.
NextToken *string
noSmithyDocumentSerde
}
type ListEndpointsOutput struct {
// The list of endpoints associated with the specified Outpost.
Endpoints []types.Endpoint
// If the number of endpoints associated with the specified Outpost exceeds
// MaxResults , you can include this value in subsequent calls to this operation to
// retrieve more results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListEndpoints{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListEndpoints{}, 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_opListEndpoints(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
}
// ListEndpointsAPIClient is a client that implements the ListEndpoints operation.
type ListEndpointsAPIClient interface {
ListEndpoints(context.Context, *ListEndpointsInput, ...func(*Options)) (*ListEndpointsOutput, error)
}
var _ ListEndpointsAPIClient = (*Client)(nil)
// ListEndpointsPaginatorOptions is the paginator options for ListEndpoints
type ListEndpointsPaginatorOptions struct {
// The maximum number of endpoints that will be returned in the response.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListEndpointsPaginator is a paginator for ListEndpoints
type ListEndpointsPaginator struct {
options ListEndpointsPaginatorOptions
client ListEndpointsAPIClient
params *ListEndpointsInput
nextToken *string
firstPage bool
}
// NewListEndpointsPaginator returns a new ListEndpointsPaginator
func NewListEndpointsPaginator(client ListEndpointsAPIClient, params *ListEndpointsInput, optFns ...func(*ListEndpointsPaginatorOptions)) *ListEndpointsPaginator {
if params == nil {
params = &ListEndpointsInput{}
}
options := ListEndpointsPaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListEndpointsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListEndpointsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListEndpoints page.
func (p *ListEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEndpointsOutput, 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.ListEndpoints(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListEndpoints(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3-outposts",
OperationName: "ListEndpoints",
}
}
| 217 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3outposts
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/s3outposts/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the Outposts with S3 on Outposts capacity for your Amazon Web Services
// account. Includes S3 on Outposts that you have access to as the Outposts owner,
// or as a shared user from Resource Access Manager (RAM).
func (c *Client) ListOutpostsWithS3(ctx context.Context, params *ListOutpostsWithS3Input, optFns ...func(*Options)) (*ListOutpostsWithS3Output, error) {
if params == nil {
params = &ListOutpostsWithS3Input{}
}
result, metadata, err := c.invokeOperation(ctx, "ListOutpostsWithS3", params, optFns, c.addOperationListOutpostsWithS3Middlewares)
if err != nil {
return nil, err
}
out := result.(*ListOutpostsWithS3Output)
out.ResultMetadata = metadata
return out, nil
}
type ListOutpostsWithS3Input struct {
// The maximum number of Outposts to return. The limit is 100.
MaxResults int32
// When you can get additional results from the ListOutpostsWithS3 call, a
// NextToken parameter is returned in the output. You can then pass in a subsequent
// command to the NextToken parameter to continue listing additional Outposts.
NextToken *string
noSmithyDocumentSerde
}
type ListOutpostsWithS3Output struct {
// Returns a token that you can use to call ListOutpostsWithS3 again and receive
// additional results, if there are any.
NextToken *string
// Returns the list of Outposts that have the following characteristics:
// - outposts that have S3 provisioned
// - outposts that are Active (not pending any provisioning nor decommissioned)
// - outposts to which the the calling Amazon Web Services account has access
Outposts []types.Outpost
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListOutpostsWithS3Middlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListOutpostsWithS3{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListOutpostsWithS3{}, 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_opListOutpostsWithS3(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
}
// ListOutpostsWithS3APIClient is a client that implements the ListOutpostsWithS3
// operation.
type ListOutpostsWithS3APIClient interface {
ListOutpostsWithS3(context.Context, *ListOutpostsWithS3Input, ...func(*Options)) (*ListOutpostsWithS3Output, error)
}
var _ ListOutpostsWithS3APIClient = (*Client)(nil)
// ListOutpostsWithS3PaginatorOptions is the paginator options for
// ListOutpostsWithS3
type ListOutpostsWithS3PaginatorOptions struct {
// The maximum number of Outposts to return. The limit is 100.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListOutpostsWithS3Paginator is a paginator for ListOutpostsWithS3
type ListOutpostsWithS3Paginator struct {
options ListOutpostsWithS3PaginatorOptions
client ListOutpostsWithS3APIClient
params *ListOutpostsWithS3Input
nextToken *string
firstPage bool
}
// NewListOutpostsWithS3Paginator returns a new ListOutpostsWithS3Paginator
func NewListOutpostsWithS3Paginator(client ListOutpostsWithS3APIClient, params *ListOutpostsWithS3Input, optFns ...func(*ListOutpostsWithS3PaginatorOptions)) *ListOutpostsWithS3Paginator {
if params == nil {
params = &ListOutpostsWithS3Input{}
}
options := ListOutpostsWithS3PaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListOutpostsWithS3Paginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListOutpostsWithS3Paginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListOutpostsWithS3 page.
func (p *ListOutpostsWithS3Paginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOutpostsWithS3Output, 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.ListOutpostsWithS3(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListOutpostsWithS3(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3-outposts",
OperationName: "ListOutpostsWithS3",
}
}
| 222 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3outposts
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/s3outposts/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all endpoints associated with an Outpost that has been shared by Amazon
// Web Services Resource Access Manager (RAM). Related actions include:
// - CreateEndpoint (https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_CreateEndpoint.html)
// - DeleteEndpoint (https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_DeleteEndpoint.html)
func (c *Client) ListSharedEndpoints(ctx context.Context, params *ListSharedEndpointsInput, optFns ...func(*Options)) (*ListSharedEndpointsOutput, error) {
if params == nil {
params = &ListSharedEndpointsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListSharedEndpoints", params, optFns, c.addOperationListSharedEndpointsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListSharedEndpointsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListSharedEndpointsInput struct {
// The ID of the Amazon Web Services Outpost.
//
// This member is required.
OutpostId *string
// The maximum number of endpoints that will be returned in the response.
MaxResults int32
// If a previous response from this operation included a NextToken value, you can
// provide that value here to retrieve the next page of results.
NextToken *string
noSmithyDocumentSerde
}
type ListSharedEndpointsOutput struct {
// The list of endpoints associated with the specified Outpost that have been
// shared by Amazon Web Services Resource Access Manager (RAM).
Endpoints []types.Endpoint
// If the number of endpoints associated with the specified Outpost exceeds
// MaxResults , you can include this value in subsequent calls to this operation to
// retrieve more results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListSharedEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListSharedEndpoints{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSharedEndpoints{}, 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 = addOpListSharedEndpointsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSharedEndpoints(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
}
// ListSharedEndpointsAPIClient is a client that implements the
// ListSharedEndpoints operation.
type ListSharedEndpointsAPIClient interface {
ListSharedEndpoints(context.Context, *ListSharedEndpointsInput, ...func(*Options)) (*ListSharedEndpointsOutput, error)
}
var _ ListSharedEndpointsAPIClient = (*Client)(nil)
// ListSharedEndpointsPaginatorOptions is the paginator options for
// ListSharedEndpoints
type ListSharedEndpointsPaginatorOptions struct {
// The maximum number of endpoints that will be returned in the response.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListSharedEndpointsPaginator is a paginator for ListSharedEndpoints
type ListSharedEndpointsPaginator struct {
options ListSharedEndpointsPaginatorOptions
client ListSharedEndpointsAPIClient
params *ListSharedEndpointsInput
nextToken *string
firstPage bool
}
// NewListSharedEndpointsPaginator returns a new ListSharedEndpointsPaginator
func NewListSharedEndpointsPaginator(client ListSharedEndpointsAPIClient, params *ListSharedEndpointsInput, optFns ...func(*ListSharedEndpointsPaginatorOptions)) *ListSharedEndpointsPaginator {
if params == nil {
params = &ListSharedEndpointsInput{}
}
options := ListSharedEndpointsPaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListSharedEndpointsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListSharedEndpointsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListSharedEndpoints page.
func (p *ListSharedEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSharedEndpointsOutput, 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.ListSharedEndpoints(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListSharedEndpoints(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3-outposts",
OperationName: "ListSharedEndpoints",
}
}
| 229 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3outposts
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/s3outposts/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"
"strings"
)
type awsRestjson1_deserializeOpCreateEndpoint struct {
}
func (*awsRestjson1_deserializeOpCreateEndpoint) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateEndpoint) 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_deserializeOpErrorCreateEndpoint(response, &metadata)
}
output := &CreateEndpointOutput{}
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_deserializeOpDocumentCreateEndpointOutput(&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_deserializeOpErrorCreateEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("OutpostOfflineException", errorCode):
return awsRestjson1_deserializeErrorOutpostOfflineException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateEndpointOutput(v **CreateEndpointOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateEndpointOutput
if *v == nil {
sv = &CreateEndpointOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EndpointArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EndpointArn to be of type string, got %T instead", value)
}
sv.EndpointArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteEndpoint struct {
}
func (*awsRestjson1_deserializeOpDeleteEndpoint) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteEndpoint) 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_deserializeOpErrorDeleteEndpoint(response, &metadata)
}
output := &DeleteEndpointOutput{}
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_deserializeOpErrorDeleteEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("OutpostOfflineException", errorCode):
return awsRestjson1_deserializeErrorOutpostOfflineException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpListEndpoints struct {
}
func (*awsRestjson1_deserializeOpListEndpoints) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListEndpoints) 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_deserializeOpErrorListEndpoints(response, &metadata)
}
output := &ListEndpointsOutput{}
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_deserializeOpDocumentListEndpointsOutput(&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_deserializeOpErrorListEndpoints(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListEndpointsOutput(v **ListEndpointsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListEndpointsOutput
if *v == nil {
sv = &ListEndpointsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Endpoints":
if err := awsRestjson1_deserializeDocumentEndpoints(&sv.Endpoints, 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_deserializeOpListOutpostsWithS3 struct {
}
func (*awsRestjson1_deserializeOpListOutpostsWithS3) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListOutpostsWithS3) 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_deserializeOpErrorListOutpostsWithS3(response, &metadata)
}
output := &ListOutpostsWithS3Output{}
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_deserializeOpDocumentListOutpostsWithS3Output(&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_deserializeOpErrorListOutpostsWithS3(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListOutpostsWithS3Output(v **ListOutpostsWithS3Output, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListOutpostsWithS3Output
if *v == nil {
sv = &ListOutpostsWithS3Output{}
} 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 "Outposts":
if err := awsRestjson1_deserializeDocumentOutposts(&sv.Outposts, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListSharedEndpoints struct {
}
func (*awsRestjson1_deserializeOpListSharedEndpoints) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListSharedEndpoints) 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_deserializeOpErrorListSharedEndpoints(response, &metadata)
}
output := &ListSharedEndpointsOutput{}
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_deserializeOpDocumentListSharedEndpointsOutput(&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_deserializeOpErrorListSharedEndpoints(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListSharedEndpointsOutput(v **ListSharedEndpointsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListSharedEndpointsOutput
if *v == nil {
sv = &ListSharedEndpointsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Endpoints":
if err := awsRestjson1_deserializeDocumentEndpoints(&sv.Endpoints, 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
}
func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.AccessDeniedException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ConflictException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentConflictException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InternalServerException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorOutpostOfflineException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.OutpostOfflineException{}
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_deserializeDocumentOutpostOfflineException(&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_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ThrottlingException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
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_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_deserializeDocumentEndpoint(v **types.Endpoint, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.Endpoint
if *v == nil {
sv = &types.Endpoint{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AccessType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EndpointAccessType to be of type string, got %T instead", value)
}
sv.AccessType = types.EndpointAccessType(jtv)
}
case "CidrBlock":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CidrBlock to be of type string, got %T instead", value)
}
sv.CidrBlock = ptr.String(jtv)
}
case "CreationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected CreationTime to be a JSON Number, got %T instead", value)
}
}
case "CustomerOwnedIpv4Pool":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CustomerOwnedIpv4Pool to be of type string, got %T instead", value)
}
sv.CustomerOwnedIpv4Pool = ptr.String(jtv)
}
case "EndpointArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EndpointArn to be of type string, got %T instead", value)
}
sv.EndpointArn = ptr.String(jtv)
}
case "FailedReason":
if err := awsRestjson1_deserializeDocumentFailedReason(&sv.FailedReason, value); err != nil {
return err
}
case "NetworkInterfaces":
if err := awsRestjson1_deserializeDocumentNetworkInterfaces(&sv.NetworkInterfaces, value); err != nil {
return err
}
case "OutpostsId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OutpostId to be of type string, got %T instead", value)
}
sv.OutpostsId = ptr.String(jtv)
}
case "SecurityGroupId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SecurityGroupId to be of type string, got %T instead", value)
}
sv.SecurityGroupId = ptr.String(jtv)
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EndpointStatus to be of type string, got %T instead", value)
}
sv.Status = types.EndpointStatus(jtv)
}
case "SubnetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SubnetId to be of type string, got %T instead", value)
}
sv.SubnetId = ptr.String(jtv)
}
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 awsRestjson1_deserializeDocumentEndpoints(v *[]types.Endpoint, 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.Endpoint
if *v == nil {
cv = []types.Endpoint{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Endpoint
destAddr := &col
if err := awsRestjson1_deserializeDocumentEndpoint(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentFailedReason(v **types.FailedReason, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.FailedReason
if *v == nil {
sv = &types.FailedReason{}
} 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 ErrorCode to be of type string, got %T instead", value)
}
sv.ErrorCode = 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_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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentNetworkInterface(v **types.NetworkInterface, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.NetworkInterface
if *v == nil {
sv = &types.NetworkInterface{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NetworkInterfaceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NetworkInterfaceId to be of type string, got %T instead", value)
}
sv.NetworkInterfaceId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentNetworkInterfaces(v *[]types.NetworkInterface, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.NetworkInterface
if *v == nil {
cv = []types.NetworkInterface{}
} else {
cv = *v
}
for _, value := range shape {
var col types.NetworkInterface
destAddr := &col
if err := awsRestjson1_deserializeDocumentNetworkInterface(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentOutpost(v **types.Outpost, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.Outpost
if *v == nil {
sv = &types.Outpost{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CapacityInBytes":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected CapacityInBytes to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.CapacityInBytes = i64
}
case "OutpostArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OutpostArn to be of type string, got %T instead", value)
}
sv.OutpostArn = ptr.String(jtv)
}
case "OutpostId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OutpostId to be of type string, got %T instead", value)
}
sv.OutpostId = ptr.String(jtv)
}
case "OwnerId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value)
}
sv.OwnerId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentOutpostOfflineException(v **types.OutpostOfflineException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.OutpostOfflineException
if *v == nil {
sv = &types.OutpostOfflineException{}
} 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_deserializeDocumentOutposts(v *[]types.Outpost, 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.Outpost
if *v == nil {
cv = []types.Outpost{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Outpost
destAddr := &col
if err := awsRestjson1_deserializeDocumentOutpost(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResourceNotFoundException
if *v == nil {
sv = &types.ResourceNotFoundException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "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_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ThrottlingException
if *v == nil {
sv = &types.ThrottlingException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ValidationException
if *v == nil {
sv = &types.ValidationException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "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
}
| 1,728 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package s3outposts provides the API client, operations, and parameter types for
// Amazon S3 on Outposts.
//
// Amazon S3 on Outposts provides access to S3 on Outposts operations.
package s3outposts
| 8 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3outposts
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/s3outposts/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 = "s3-outposts"
}
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 s3outposts
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.16.7"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3outposts
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3outposts
import (
"bytes"
"context"
"fmt"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
type awsRestjson1_serializeOpCreateEndpoint struct {
}
func (*awsRestjson1_serializeOpCreateEndpoint) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateEndpoint) 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.(*CreateEndpointInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/S3Outposts/CreateEndpoint")
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_serializeOpDocumentCreateEndpointInput(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_serializeOpHttpBindingsCreateEndpointInput(v *CreateEndpointInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateEndpointInput(v *CreateEndpointInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.AccessType) > 0 {
ok := object.Key("AccessType")
ok.String(string(v.AccessType))
}
if v.CustomerOwnedIpv4Pool != nil {
ok := object.Key("CustomerOwnedIpv4Pool")
ok.String(*v.CustomerOwnedIpv4Pool)
}
if v.OutpostId != nil {
ok := object.Key("OutpostId")
ok.String(*v.OutpostId)
}
if v.SecurityGroupId != nil {
ok := object.Key("SecurityGroupId")
ok.String(*v.SecurityGroupId)
}
if v.SubnetId != nil {
ok := object.Key("SubnetId")
ok.String(*v.SubnetId)
}
return nil
}
type awsRestjson1_serializeOpDeleteEndpoint struct {
}
func (*awsRestjson1_serializeOpDeleteEndpoint) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteEndpoint) 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.(*DeleteEndpointInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/S3Outposts/DeleteEndpoint")
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_serializeOpHttpBindingsDeleteEndpointInput(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_serializeOpHttpBindingsDeleteEndpointInput(v *DeleteEndpointInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.EndpointId != nil {
encoder.SetQuery("endpointId").String(*v.EndpointId)
}
if v.OutpostId != nil {
encoder.SetQuery("outpostId").String(*v.OutpostId)
}
return nil
}
type awsRestjson1_serializeOpListEndpoints struct {
}
func (*awsRestjson1_serializeOpListEndpoints) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListEndpoints) 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.(*ListEndpointsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/S3Outposts/ListEndpoints")
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_serializeOpHttpBindingsListEndpointsInput(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_serializeOpHttpBindingsListEndpointsInput(v *ListEndpointsInput, 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_serializeOpListOutpostsWithS3 struct {
}
func (*awsRestjson1_serializeOpListOutpostsWithS3) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListOutpostsWithS3) 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.(*ListOutpostsWithS3Input)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/S3Outposts/ListOutpostsWithS3")
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_serializeOpHttpBindingsListOutpostsWithS3Input(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_serializeOpHttpBindingsListOutpostsWithS3Input(v *ListOutpostsWithS3Input, 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_serializeOpListSharedEndpoints struct {
}
func (*awsRestjson1_serializeOpListSharedEndpoints) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListSharedEndpoints) 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.(*ListSharedEndpointsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/S3Outposts/ListSharedEndpoints")
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_serializeOpHttpBindingsListSharedEndpointsInput(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_serializeOpHttpBindingsListSharedEndpointsInput(v *ListSharedEndpointsInput, 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.OutpostId != nil {
encoder.SetQuery("outpostId").String(*v.OutpostId)
}
return nil
}
| 335 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package s3outposts
import (
"context"
"fmt"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpCreateEndpoint struct {
}
func (*validateOpCreateEndpoint) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateEndpointInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateEndpointInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteEndpoint struct {
}
func (*validateOpDeleteEndpoint) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteEndpointInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteEndpointInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListSharedEndpoints struct {
}
func (*validateOpListSharedEndpoints) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListSharedEndpoints) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListSharedEndpointsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListSharedEndpointsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpCreateEndpointValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateEndpoint{}, middleware.After)
}
func addOpDeleteEndpointValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteEndpoint{}, middleware.After)
}
func addOpListSharedEndpointsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListSharedEndpoints{}, middleware.After)
}
func validateOpCreateEndpointInput(v *CreateEndpointInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateEndpointInput"}
if v.OutpostId == nil {
invalidParams.Add(smithy.NewErrParamRequired("OutpostId"))
}
if v.SubnetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SubnetId"))
}
if v.SecurityGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SecurityGroupId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteEndpointInput(v *DeleteEndpointInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteEndpointInput"}
if v.EndpointId == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndpointId"))
}
if v.OutpostId == nil {
invalidParams.Add(smithy.NewErrParamRequired("OutpostId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListSharedEndpointsInput(v *ListSharedEndpointsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListSharedEndpointsInput"}
if v.OutpostId == nil {
invalidParams.Add(smithy.NewErrParamRequired("OutpostId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 137 |
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 S3Outposts 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: "s3-outposts.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-outposts-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-outposts-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "s3-outposts.{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-southeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
Variant: endpoints.FIPSVariant,
}: {},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-south-1",
}: 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-ca-central-1",
}: endpoints.Endpoint{
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-east-1",
}: endpoints.Endpoint{
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-east-2",
}: endpoints.Endpoint{
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-west-1",
}: endpoints.Endpoint{
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-west-2",
}: endpoints.Endpoint{
Deprecated: aws.TrueTernary,
},
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,
}: {},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant,
}: {},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.FIPSVariant,
}: {},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "s3-outposts.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-outposts-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-outposts-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "s3-outposts.{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: "s3-outposts-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "s3-outposts.{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: "s3-outposts-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "s3-outposts.{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: "s3-outposts-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "s3-outposts.{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: "s3-outposts-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "s3-outposts.{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: "s3-outposts.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "s3-outposts-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "s3-outposts-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "s3-outposts.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "fips-us-gov-east-1",
}: endpoints.Endpoint{
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-gov-west-1",
}: endpoints.Endpoint{
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-gov-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-east-1",
Variant: endpoints.FIPSVariant,
}: {},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {},
},
},
}
| 436 |
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 EndpointAccessType string
// Enum values for EndpointAccessType
const (
EndpointAccessTypePrivate EndpointAccessType = "Private"
EndpointAccessTypeCustomerOwnedIp EndpointAccessType = "CustomerOwnedIp"
)
// Values returns all known values for EndpointAccessType. 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 (EndpointAccessType) Values() []EndpointAccessType {
return []EndpointAccessType{
"Private",
"CustomerOwnedIp",
}
}
type EndpointStatus string
// Enum values for EndpointStatus
const (
EndpointStatusPending EndpointStatus = "Pending"
EndpointStatusAvailable EndpointStatus = "Available"
EndpointStatusDeleting EndpointStatus = "Deleting"
EndpointStatusCreateFailed EndpointStatus = "Create_Failed"
EndpointStatusDeleteFailed EndpointStatus = "Delete_Failed"
)
// Values returns all known values for EndpointStatus. 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 (EndpointStatus) Values() []EndpointStatus {
return []EndpointStatus{
"Pending",
"Available",
"Deleting",
"Create_Failed",
"Delete_Failed",
}
}
| 46 |
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"
)
// Access was denied for this action.
type AccessDeniedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *AccessDeniedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AccessDeniedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AccessDeniedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AccessDeniedException"
}
return *e.ErrorCodeOverride
}
func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// There was a conflict with this action, and it could not be completed.
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 }
// There was an exception with the internal server.
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 }
// The service link connection to your Outposts home Region is down. Check your
// connection and try again.
type OutpostOfflineException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *OutpostOfflineException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *OutpostOfflineException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *OutpostOfflineException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "OutpostOfflineException"
}
return *e.ErrorCodeOverride
}
func (e *OutpostOfflineException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The requested resource was not found.
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 }
// The request was denied due to request throttling.
type ThrottlingException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ThrottlingException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ThrottlingException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ThrottlingException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ThrottlingException"
}
return *e.ErrorCodeOverride
}
func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// There was an exception validating this data.
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 }
| 192 |
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"
)
// Amazon S3 on Outposts Access Points simplify managing data access at scale for
// shared datasets in S3 on Outposts. S3 on Outposts uses endpoints to connect to
// Outposts buckets so that you can perform actions within your virtual private
// cloud (VPC). For more information, see Accessing S3 on Outposts using VPC-only
// access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/WorkingWithS3Outposts.html)
// in the Amazon Simple Storage Service User Guide.
type Endpoint struct {
// The type of connectivity used to access the Amazon S3 on Outposts endpoint.
AccessType EndpointAccessType
// The VPC CIDR committed by this endpoint.
CidrBlock *string
// The time the endpoint was created.
CreationTime *time.Time
// The ID of the customer-owned IPv4 address pool used for the endpoint.
CustomerOwnedIpv4Pool *string
// The Amazon Resource Name (ARN) of the endpoint.
EndpointArn *string
// The failure reason, if any, for a create or delete endpoint operation.
FailedReason *FailedReason
// The network interface of the endpoint.
NetworkInterfaces []NetworkInterface
// The ID of the Outposts.
OutpostsId *string
// The ID of the security group used for the endpoint.
SecurityGroupId *string
// The status of the endpoint.
Status EndpointStatus
// The ID of the subnet used for the endpoint.
SubnetId *string
// The ID of the VPC used for the endpoint.
VpcId *string
noSmithyDocumentSerde
}
// The failure reason, if any, for a create or delete endpoint operation.
type FailedReason struct {
// The failure code, if any, for a create or delete endpoint operation.
ErrorCode *string
// Additional error details describing the endpoint failure and recommended action.
Message *string
noSmithyDocumentSerde
}
// The container for the network interface.
type NetworkInterface struct {
// The ID for the network interface.
NetworkInterfaceId *string
noSmithyDocumentSerde
}
// Contains the details for the Outpost object.
type Outpost struct {
// The Amazon S3 capacity of the outpost in bytes.
CapacityInBytes int64
// Specifies the unique Amazon Resource Name (ARN) for the outpost.
OutpostArn *string
// Specifies the unique identifier for the outpost.
OutpostId *string
// Returns the Amazon Web Services account ID of the outpost owner. Useful for
// comparing owned versus shared outposts.
OwnerId *string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 98 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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 = "SageMaker"
const ServiceAPIVersion = "2017-07-24"
// Client provides the API client to make operations call for Amazon SageMaker
// Service.
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, "sagemaker", 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 sagemaker
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 sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an association between the source and the destination. A source can be
// associated with multiple destinations, and a destination can be associated with
// multiple sources. An association is a lineage tracking entity. For more
// information, see Amazon SageMaker ML Lineage Tracking (https://docs.aws.amazon.com/sagemaker/latest/dg/lineage-tracking.html)
// .
func (c *Client) AddAssociation(ctx context.Context, params *AddAssociationInput, optFns ...func(*Options)) (*AddAssociationOutput, error) {
if params == nil {
params = &AddAssociationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddAssociation", params, optFns, c.addOperationAddAssociationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddAssociationOutput)
out.ResultMetadata = metadata
return out, nil
}
type AddAssociationInput struct {
// The Amazon Resource Name (ARN) of the destination.
//
// This member is required.
DestinationArn *string
// The ARN of the source.
//
// This member is required.
SourceArn *string
// The type of association. The following are suggested uses for each type. Amazon
// SageMaker places no restrictions on their use.
// - ContributedTo - The source contributed to the destination or had a part in
// enabling the destination. For example, the training data contributed to the
// training job.
// - AssociatedWith - The source is connected to the destination. For example,
// an approval workflow is associated with a model deployment.
// - DerivedFrom - The destination is a modification of the source. For example,
// a digest output of a channel input for a processing job is derived from the
// original inputs.
// - Produced - The source generated the destination. For example, a training
// job produced a model artifact.
AssociationType types.AssociationEdgeType
noSmithyDocumentSerde
}
type AddAssociationOutput struct {
// The Amazon Resource Name (ARN) of the destination.
DestinationArn *string
// The ARN of the source.
SourceArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddAssociation{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddAssociation{}, 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 = addOpAddAssociationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddAssociation(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_opAddAssociation(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "AddAssociation",
}
}
| 151 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds or overwrites one or more tags for the specified SageMaker resource. You
// can add tags to notebook instances, training jobs, hyperparameter tuning jobs,
// batch transform jobs, models, labeling jobs, work teams, endpoint
// configurations, and endpoints. Each tag consists of a key and an optional value.
// Tag keys must be unique per resource. For more information about tags, see For
// more information, see Amazon Web Services Tagging Strategies (https://aws.amazon.com/answers/account-management/aws-tagging-strategies/)
// . Tags that you add to a hyperparameter tuning job by calling this API are also
// added to any training jobs that the hyperparameter tuning job launches after you
// call this API, but not to training jobs that the hyperparameter tuning job
// launched before you called this API. To make sure that the tags associated with
// a hyperparameter tuning job are also added to all training jobs that the
// hyperparameter tuning job launches, add the tags when you first create the
// tuning job by specifying them in the Tags parameter of
// CreateHyperParameterTuningJob (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateHyperParameterTuningJob.html)
// Tags that you add to a SageMaker Studio Domain or User Profile by calling this
// API are also added to any Apps that the Domain or User Profile launches after
// you call this API, but not to Apps that the Domain or User Profile launched
// before you called this API. To make sure that the tags associated with a Domain
// or User Profile are also added to all Apps that the Domain or User Profile
// launches, add the tags when you first create the Domain or User Profile by
// specifying them in the Tags parameter of CreateDomain (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateDomain.html)
// or CreateUserProfile (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateUserProfile.html)
// .
func (c *Client) AddTags(ctx context.Context, params *AddTagsInput, optFns ...func(*Options)) (*AddTagsOutput, error) {
if params == nil {
params = &AddTagsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddTags", params, optFns, c.addOperationAddTagsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddTagsOutput)
out.ResultMetadata = metadata
return out, nil
}
type AddTagsInput struct {
// The Amazon Resource Name (ARN) of the resource that you want to tag.
//
// This member is required.
ResourceArn *string
// An array of key-value pairs. You can use tags to categorize your Amazon Web
// Services resources in different ways, for example, by purpose, owner, or
// environment. For more information, see Tagging Amazon Web Services Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html)
// .
//
// This member is required.
Tags []types.Tag
noSmithyDocumentSerde
}
type AddTagsOutput struct {
// A list of tags associated with the SageMaker resource.
Tags []types.Tag
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddTagsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddTags{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddTags{}, 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 = addOpAddTagsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddTags(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_opAddTags(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "AddTags",
}
}
| 155 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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 a trial component with a trial. A trial component can be associated
// with multiple trials. To disassociate a trial component from a trial, call the
// DisassociateTrialComponent (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DisassociateTrialComponent.html)
// API.
func (c *Client) AssociateTrialComponent(ctx context.Context, params *AssociateTrialComponentInput, optFns ...func(*Options)) (*AssociateTrialComponentOutput, error) {
if params == nil {
params = &AssociateTrialComponentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssociateTrialComponent", params, optFns, c.addOperationAssociateTrialComponentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssociateTrialComponentOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssociateTrialComponentInput struct {
// The name of the component to associated with the trial.
//
// This member is required.
TrialComponentName *string
// The name of the trial to associate with.
//
// This member is required.
TrialName *string
noSmithyDocumentSerde
}
type AssociateTrialComponentOutput struct {
// The Amazon Resource Name (ARN) of the trial.
TrialArn *string
// The Amazon Resource Name (ARN) of the trial component.
TrialComponentArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssociateTrialComponentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateTrialComponent{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateTrialComponent{}, 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 = addOpAssociateTrialComponentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateTrialComponent(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_opAssociateTrialComponent(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "AssociateTrialComponent",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// This action batch describes a list of versioned model packages
func (c *Client) BatchDescribeModelPackage(ctx context.Context, params *BatchDescribeModelPackageInput, optFns ...func(*Options)) (*BatchDescribeModelPackageOutput, error) {
if params == nil {
params = &BatchDescribeModelPackageInput{}
}
result, metadata, err := c.invokeOperation(ctx, "BatchDescribeModelPackage", params, optFns, c.addOperationBatchDescribeModelPackageMiddlewares)
if err != nil {
return nil, err
}
out := result.(*BatchDescribeModelPackageOutput)
out.ResultMetadata = metadata
return out, nil
}
type BatchDescribeModelPackageInput struct {
// The list of Amazon Resource Name (ARN) of the model package groups.
//
// This member is required.
ModelPackageArnList []string
noSmithyDocumentSerde
}
type BatchDescribeModelPackageOutput struct {
// A map of the resource and BatchDescribeModelPackageError objects reporting the
// error associated with describing the model package.
BatchDescribeModelPackageErrorMap map[string]types.BatchDescribeModelPackageError
// The summaries for the model package versions
ModelPackageSummaries map[string]types.BatchDescribeModelPackageSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationBatchDescribeModelPackageMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchDescribeModelPackage{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchDescribeModelPackage{}, 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 = addOpBatchDescribeModelPackageValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchDescribeModelPackage(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_opBatchDescribeModelPackage(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "BatchDescribeModelPackage",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an action. An action is a lineage tracking entity that represents an
// action or activity. For example, a model deployment or an HPO job. Generally, an
// action involves at least one input or output artifact. For more information, see
// Amazon SageMaker ML Lineage Tracking (https://docs.aws.amazon.com/sagemaker/latest/dg/lineage-tracking.html)
// .
func (c *Client) CreateAction(ctx context.Context, params *CreateActionInput, optFns ...func(*Options)) (*CreateActionOutput, error) {
if params == nil {
params = &CreateActionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateAction", params, optFns, c.addOperationCreateActionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateActionOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateActionInput struct {
// The name of the action. Must be unique to your account in an Amazon Web
// Services Region.
//
// This member is required.
ActionName *string
// The action type.
//
// This member is required.
ActionType *string
// The source type, ID, and URI.
//
// This member is required.
Source *types.ActionSource
// The description of the action.
Description *string
// Metadata properties of the tracking entity, trial, or trial component.
MetadataProperties *types.MetadataProperties
// A list of properties to add to the action.
Properties map[string]string
// The status of the action.
Status types.ActionStatus
// A list of tags to apply to the action.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateActionOutput struct {
// The Amazon Resource Name (ARN) of the action.
ActionArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateActionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAction{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAction{}, 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 = addOpCreateActionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAction(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_opCreateAction(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateAction",
}
}
| 155 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Create a machine learning algorithm that you can use in SageMaker and list in
// the Amazon Web Services Marketplace.
func (c *Client) CreateAlgorithm(ctx context.Context, params *CreateAlgorithmInput, optFns ...func(*Options)) (*CreateAlgorithmOutput, error) {
if params == nil {
params = &CreateAlgorithmInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateAlgorithm", params, optFns, c.addOperationCreateAlgorithmMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateAlgorithmOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateAlgorithmInput struct {
// The name of the algorithm.
//
// This member is required.
AlgorithmName *string
// Specifies details about training jobs run by this algorithm, including the
// following:
// - The Amazon ECR path of the container and the version digest of the
// algorithm.
// - The hyperparameters that the algorithm supports.
// - The instance types that the algorithm supports for training.
// - Whether the algorithm supports distributed training.
// - The metrics that the algorithm emits to Amazon CloudWatch.
// - Which metrics that the algorithm emits can be used as the objective metric
// for hyperparameter tuning jobs.
// - The input channels that the algorithm supports for training data. For
// example, an algorithm might support train , validation , and test channels.
//
// This member is required.
TrainingSpecification *types.TrainingSpecification
// A description of the algorithm.
AlgorithmDescription *string
// Whether to certify the algorithm so that it can be listed in Amazon Web
// Services Marketplace.
CertifyForMarketplace bool
// Specifies details about inference jobs that the algorithm runs, including the
// following:
// - The Amazon ECR paths of containers that contain the inference code and
// model artifacts.
// - The instance types that the algorithm supports for transform jobs and
// real-time endpoints used for inference.
// - The input and output content formats that the algorithm supports for
// inference.
InferenceSpecification *types.InferenceSpecification
// An array of key-value pairs. You can use tags to categorize your Amazon Web
// Services resources in different ways, for example, by purpose, owner, or
// environment. For more information, see Tagging Amazon Web Services Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html)
// .
Tags []types.Tag
// Specifies configurations for one or more training jobs and that SageMaker runs
// to test the algorithm's training code and, optionally, one or more batch
// transform jobs that SageMaker runs to test the algorithm's inference code.
ValidationSpecification *types.AlgorithmValidationSpecification
noSmithyDocumentSerde
}
type CreateAlgorithmOutput struct {
// The Amazon Resource Name (ARN) of the new algorithm.
//
// This member is required.
AlgorithmArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateAlgorithmMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAlgorithm{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAlgorithm{}, 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 = addOpCreateAlgorithmValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAlgorithm(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_opCreateAlgorithm(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateAlgorithm",
}
}
| 172 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a running app for the specified UserProfile. This operation is
// automatically invoked by Amazon SageMaker Studio upon access to the associated
// Domain, and when new kernel configurations are selected by the user. A user may
// have multiple Apps active simultaneously.
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 name of the app.
//
// This member is required.
AppName *string
// The type of app.
//
// This member is required.
AppType types.AppType
// The domain ID.
//
// This member is required.
DomainId *string
// The instance type and the Amazon Resource Name (ARN) of the SageMaker image
// created on the instance. The value of InstanceType passed as part of the
// ResourceSpec in the CreateApp call overrides the value passed as part of the
// ResourceSpec configured for the user profile or the domain. If InstanceType is
// not specified in any of those three ResourceSpec values for a KernelGateway
// app, the CreateApp call fails with a request validation error.
ResourceSpec *types.ResourceSpec
// The name of the space. If this value is not set, then UserProfileName must be
// set.
SpaceName *string
// Each tag consists of a key and an optional value. Tag keys must be unique per
// resource.
Tags []types.Tag
// The user profile name. If this value is not set, then SpaceName must be set.
UserProfileName *string
noSmithyDocumentSerde
}
type CreateAppOutput struct {
// The Amazon Resource Name (ARN) of the app.
AppArn *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: "sagemaker",
OperationName: "CreateApp",
}
}
| 157 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a configuration for running a SageMaker image as a KernelGateway app.
// The configuration specifies the Amazon Elastic File System (EFS) storage volume
// on the image, and a list of the kernels in the image.
func (c *Client) CreateAppImageConfig(ctx context.Context, params *CreateAppImageConfigInput, optFns ...func(*Options)) (*CreateAppImageConfigOutput, error) {
if params == nil {
params = &CreateAppImageConfigInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateAppImageConfig", params, optFns, c.addOperationCreateAppImageConfigMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateAppImageConfigOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateAppImageConfigInput struct {
// The name of the AppImageConfig. Must be unique to your account.
//
// This member is required.
AppImageConfigName *string
// The KernelGatewayImageConfig. You can only specify one image kernel in the
// AppImageConfig API. This kernel will be shown to users before the image starts.
// Once the image runs, all kernels are visible in JupyterLab.
KernelGatewayImageConfig *types.KernelGatewayImageConfig
// A list of tags to apply to the AppImageConfig.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateAppImageConfigOutput struct {
// The Amazon Resource Name (ARN) of the AppImageConfig.
AppImageConfigArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateAppImageConfigMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAppImageConfig{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAppImageConfig{}, 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 = addOpCreateAppImageConfigValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAppImageConfig(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_opCreateAppImageConfig(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateAppImageConfig",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an artifact. An artifact is a lineage tracking entity that represents a
// URI addressable object or data. Some examples are the S3 URI of a dataset and
// the ECR registry path of an image. For more information, see Amazon SageMaker
// ML Lineage Tracking (https://docs.aws.amazon.com/sagemaker/latest/dg/lineage-tracking.html)
// .
func (c *Client) CreateArtifact(ctx context.Context, params *CreateArtifactInput, optFns ...func(*Options)) (*CreateArtifactOutput, error) {
if params == nil {
params = &CreateArtifactInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateArtifact", params, optFns, c.addOperationCreateArtifactMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateArtifactOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateArtifactInput struct {
// The artifact type.
//
// This member is required.
ArtifactType *string
// The ID, ID type, and URI of the source.
//
// This member is required.
Source *types.ArtifactSource
// The name of the artifact. Must be unique to your account in an Amazon Web
// Services Region.
ArtifactName *string
// Metadata properties of the tracking entity, trial, or trial component.
MetadataProperties *types.MetadataProperties
// A list of properties to add to the artifact.
Properties map[string]string
// A list of tags to apply to the artifact.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateArtifactOutput struct {
// The Amazon Resource Name (ARN) of the artifact.
ArtifactArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateArtifactMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateArtifact{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateArtifact{}, 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 = addOpCreateArtifactValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateArtifact(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_opCreateArtifact(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateArtifact",
}
}
| 147 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an Autopilot job also referred to as Autopilot experiment or AutoML
// job. We recommend using the new versions CreateAutoMLJobV2 (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateAutoMLJobV2.html)
// and DescribeAutoMLJobV2 (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeAutoMLJobV2.html)
// , which offer backward compatibility. CreateAutoMLJobV2 can manage tabular
// problem types identical to those of its previous version CreateAutoMLJob , as
// well as non-tabular problem types such as image or text classification. Find
// guidelines about how to migrate a CreateAutoMLJob to CreateAutoMLJobV2 in
// Migrate a CreateAutoMLJob to CreateAutoMLJobV2 (https://docs.aws.amazon.com/sagemaker/latest/dg/autopilot-automate-model-development-create-experiment-api.html#autopilot-create-experiment-api-migrate-v1-v2)
// . You can find the best-performing model after you run an AutoML job by calling
// DescribeAutoMLJobV2 (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeAutoMLJobV2.html)
// (recommended) or DescribeAutoMLJob (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeAutoMLJob.html)
// .
func (c *Client) CreateAutoMLJob(ctx context.Context, params *CreateAutoMLJobInput, optFns ...func(*Options)) (*CreateAutoMLJobOutput, error) {
if params == nil {
params = &CreateAutoMLJobInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateAutoMLJob", params, optFns, c.addOperationCreateAutoMLJobMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateAutoMLJobOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateAutoMLJobInput struct {
// Identifies an Autopilot job. The name must be unique to your account and is
// case insensitive.
//
// This member is required.
AutoMLJobName *string
// An array of channel objects that describes the input data and its location.
// Each channel is a named input source. Similar to InputDataConfig supported by
// HyperParameterTrainingJobDefinition (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_HyperParameterTrainingJobDefinition.html)
// . Format(s) supported: CSV, Parquet. A minimum of 500 rows is required for the
// training dataset. There is not a minimum number of rows required for the
// validation dataset.
//
// This member is required.
InputDataConfig []types.AutoMLChannel
// Provides information about encryption and the Amazon S3 output path needed to
// store artifacts from an AutoML job. Format(s) supported: CSV.
//
// This member is required.
OutputDataConfig *types.AutoMLOutputDataConfig
// The ARN of the role that is used to access the data.
//
// This member is required.
RoleArn *string
// A collection of settings used to configure an AutoML job.
AutoMLJobConfig *types.AutoMLJobConfig
// Specifies a metric to minimize or maximize as the objective of a job. If not
// specified, the default objective metric depends on the problem type. See
// AutoMLJobObjective (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AutoMLJobObjective.html)
// for the default values.
AutoMLJobObjective *types.AutoMLJobObjective
// Generates possible candidates without training the models. A candidate is a
// combination of data preprocessors, algorithms, and algorithm parameter settings.
GenerateCandidateDefinitionsOnly bool
// Specifies how to generate the endpoint name for an automatic one-click
// Autopilot model deployment.
ModelDeployConfig *types.ModelDeployConfig
// Defines the type of supervised learning problem available for the candidates.
// For more information, see Amazon SageMaker Autopilot problem types (https://docs.aws.amazon.com/sagemaker/latest/dg/autopilot-datasets-problem-types.html#autopilot-problem-types)
// .
ProblemType types.ProblemType
// An array of key-value pairs. You can use tags to categorize your Amazon Web
// Services resources in different ways, for example, by purpose, owner, or
// environment. For more information, see Tagging Amazon Web ServicesResources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html)
// . Tag keys must be unique per resource.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateAutoMLJobOutput struct {
// The unique ARN assigned to the AutoML job when it is created.
//
// This member is required.
AutoMLJobArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateAutoMLJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAutoMLJob{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAutoMLJob{}, 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 = addOpCreateAutoMLJobValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAutoMLJob(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_opCreateAutoMLJob(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateAutoMLJob",
}
}
| 188 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an Autopilot job also referred to as Autopilot experiment or AutoML job
// V2. CreateAutoMLJobV2 (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateAutoMLJobV2.html)
// and DescribeAutoMLJobV2 (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeAutoMLJobV2.html)
// are new versions of CreateAutoMLJob (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateAutoMLJob.html)
// and DescribeAutoMLJob (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeAutoMLJob.html)
// which offer backward compatibility. CreateAutoMLJobV2 can manage tabular
// problem types identical to those of its previous version CreateAutoMLJob , as
// well as non-tabular problem types such as image or text classification. Find
// guidelines about how to migrate a CreateAutoMLJob to CreateAutoMLJobV2 in
// Migrate a CreateAutoMLJob to CreateAutoMLJobV2 (https://docs.aws.amazon.com/sagemaker/latest/dg/autopilot-automate-model-development-create-experiment-api.html#autopilot-create-experiment-api-migrate-v1-v2)
// . For the list of available problem types supported by CreateAutoMLJobV2 , see
// AutoMLProblemTypeConfig (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AutoMLProblemTypeConfig.html)
// . You can find the best-performing model after you run an AutoML job V2 by
// calling DescribeAutoMLJobV2 (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeAutoMLJobV2.html)
// .
func (c *Client) CreateAutoMLJobV2(ctx context.Context, params *CreateAutoMLJobV2Input, optFns ...func(*Options)) (*CreateAutoMLJobV2Output, error) {
if params == nil {
params = &CreateAutoMLJobV2Input{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateAutoMLJobV2", params, optFns, c.addOperationCreateAutoMLJobV2Middlewares)
if err != nil {
return nil, err
}
out := result.(*CreateAutoMLJobV2Output)
out.ResultMetadata = metadata
return out, nil
}
type CreateAutoMLJobV2Input struct {
// An array of channel objects describing the input data and their location. Each
// channel is a named input source. Similar to the InputDataConfig (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateAutoMLJob.html#sagemaker-CreateAutoMLJob-request-InputDataConfig)
// attribute in the CreateAutoMLJob input parameters. The supported formats depend
// on the problem type:
// - For tabular problem types: S3Prefix , ManifestFile .
// - For image classification: S3Prefix , ManifestFile , AugmentedManifestFile .
// - For text classification: S3Prefix .
// - For time-series forecasting: S3Prefix .
//
// This member is required.
AutoMLJobInputDataConfig []types.AutoMLJobChannel
// Identifies an Autopilot job. The name must be unique to your account and is
// case insensitive.
//
// This member is required.
AutoMLJobName *string
// Defines the configuration settings of one of the supported problem types.
//
// This member is required.
AutoMLProblemTypeConfig types.AutoMLProblemTypeConfig
// Provides information about encryption and the Amazon S3 output path needed to
// store artifacts from an AutoML job.
//
// This member is required.
OutputDataConfig *types.AutoMLOutputDataConfig
// The ARN of the role that is used to access the data.
//
// This member is required.
RoleArn *string
// Specifies a metric to minimize or maximize as the objective of a job. If not
// specified, the default objective metric depends on the problem type. For the
// list of default values per problem type, see AutoMLJobObjective (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AutoMLJobObjective.html)
// . For tabular problem types, you must either provide both the AutoMLJobObjective
// and indicate the type of supervised learning problem in AutoMLProblemTypeConfig
// ( TabularJobConfig.ProblemType ), or none at all.
AutoMLJobObjective *types.AutoMLJobObjective
// This structure specifies how to split the data into train and validation
// datasets. The validation and training datasets must contain the same headers.
// For jobs created by calling CreateAutoMLJob , the validation dataset must be
// less than 2 GB in size. This attribute must not be set for the time-series
// forecasting problem type, as Autopilot automatically splits the input dataset
// into training and validation sets.
DataSplitConfig *types.AutoMLDataSplitConfig
// Specifies how to generate the endpoint name for an automatic one-click
// Autopilot model deployment.
ModelDeployConfig *types.ModelDeployConfig
// The security configuration for traffic encryption or Amazon VPC settings.
SecurityConfig *types.AutoMLSecurityConfig
// An array of key-value pairs. You can use tags to categorize your Amazon Web
// Services resources in different ways, such as by purpose, owner, or environment.
// For more information, see Tagging Amazon Web ServicesResources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html)
// . Tag keys must be unique per resource.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateAutoMLJobV2Output struct {
// The unique ARN assigned to the AutoMLJob when it is created.
//
// This member is required.
AutoMLJobArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateAutoMLJobV2Middlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAutoMLJobV2{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAutoMLJobV2{}, 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 = addOpCreateAutoMLJobV2ValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAutoMLJobV2(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_opCreateAutoMLJobV2(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateAutoMLJobV2",
}
}
| 199 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a Git repository as a resource in your SageMaker account. You can
// associate the repository with notebook instances so that you can use Git source
// control for the notebooks you create. The Git repository is a resource in your
// SageMaker account, so it can be associated with more than one notebook instance,
// and it persists independently from the lifecycle of any notebook instances it is
// associated with. The repository can be hosted either in Amazon Web Services
// CodeCommit (https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html)
// or in any other Git repository.
func (c *Client) CreateCodeRepository(ctx context.Context, params *CreateCodeRepositoryInput, optFns ...func(*Options)) (*CreateCodeRepositoryOutput, error) {
if params == nil {
params = &CreateCodeRepositoryInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateCodeRepository", params, optFns, c.addOperationCreateCodeRepositoryMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateCodeRepositoryOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateCodeRepositoryInput struct {
// The name of the Git repository. The name must have 1 to 63 characters. Valid
// characters are a-z, A-Z, 0-9, and - (hyphen).
//
// This member is required.
CodeRepositoryName *string
// Specifies details about the repository, including the URL where the repository
// is located, the default branch, and credentials to use to access the repository.
//
// This member is required.
GitConfig *types.GitConfig
// An array of key-value pairs. You can use tags to categorize your Amazon Web
// Services resources in different ways, for example, by purpose, owner, or
// environment. For more information, see Tagging Amazon Web Services Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html)
// .
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateCodeRepositoryOutput struct {
// The Amazon Resource Name (ARN) of the new repository.
//
// This member is required.
CodeRepositoryArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateCodeRepositoryMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateCodeRepository{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateCodeRepository{}, 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 = addOpCreateCodeRepositoryValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCodeRepository(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_opCreateCodeRepository(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateCodeRepository",
}
}
| 147 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Starts a model compilation job. After the model has been compiled, Amazon
// SageMaker saves the resulting model artifacts to an Amazon Simple Storage
// Service (Amazon S3) bucket that you specify. If you choose to host your model
// using Amazon SageMaker hosting services, you can use the resulting model
// artifacts as part of the model. You can also use the artifacts with Amazon Web
// Services IoT Greengrass. In that case, deploy them as an ML resource. In the
// request body, you provide the following:
// - A name for the compilation job
// - Information about the input model artifacts
// - The output location for the compiled model and the device (target) that the
// model runs on
// - The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker
// assumes to perform the model compilation job.
//
// You can also provide a Tag to track the model compilation job's resource use
// and costs. The response body contains the CompilationJobArn for the compiled
// job. To stop a model compilation job, use StopCompilationJob (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_StopCompilationJob.html)
// . To get information about a particular model compilation job, use
// DescribeCompilationJob (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeCompilationJob.html)
// . To get information about multiple model compilation jobs, use
// ListCompilationJobs (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ListCompilationJobs.html)
// .
func (c *Client) CreateCompilationJob(ctx context.Context, params *CreateCompilationJobInput, optFns ...func(*Options)) (*CreateCompilationJobOutput, error) {
if params == nil {
params = &CreateCompilationJobInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateCompilationJob", params, optFns, c.addOperationCreateCompilationJobMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateCompilationJobOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateCompilationJobInput struct {
// A name for the model compilation job. The name must be unique within the Amazon
// Web Services Region and within your Amazon Web Services account.
//
// This member is required.
CompilationJobName *string
// Provides information about the output location for the compiled model and the
// target device the model runs on.
//
// This member is required.
OutputConfig *types.OutputConfig
// The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to
// perform tasks on your behalf. During model compilation, Amazon SageMaker needs
// your permission to:
// - Read input data from an S3 bucket
// - Write model artifacts to an S3 bucket
// - Write logs to Amazon CloudWatch Logs
// - Publish metrics to Amazon CloudWatch
// You grant permissions for all of these tasks to an IAM role. To pass this role
// to Amazon SageMaker, the caller of this API must have the iam:PassRole
// permission. For more information, see Amazon SageMaker Roles. (https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html)
//
// This member is required.
RoleArn *string
// Specifies a limit to how long a model compilation job can run. When the job
// reaches the time limit, Amazon SageMaker ends the compilation job. Use this API
// to cap model training costs.
//
// This member is required.
StoppingCondition *types.StoppingCondition
// Provides information about the location of input model artifacts, the name and
// shape of the expected data inputs, and the framework in which the model was
// trained.
InputConfig *types.InputConfig
// The Amazon Resource Name (ARN) of a versioned model package. Provide either a
// ModelPackageVersionArn or an InputConfig object in the request syntax. The
// presence of both objects in the CreateCompilationJob request will return an
// exception.
ModelPackageVersionArn *string
// An array of key-value pairs. You can use tags to categorize your Amazon Web
// Services resources in different ways, for example, by purpose, owner, or
// environment. For more information, see Tagging Amazon Web Services Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html)
// .
Tags []types.Tag
// A VpcConfig (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VpcConfig.html)
// object that specifies the VPC that you want your compilation job to connect to.
// Control access to your models by configuring the VPC. For more information, see
// Protect Compilation Jobs by Using an Amazon Virtual Private Cloud (https://docs.aws.amazon.com/sagemaker/latest/dg/neo-vpc.html)
// .
VpcConfig *types.NeoVpcConfig
noSmithyDocumentSerde
}
type CreateCompilationJobOutput struct {
// If the action is successful, the service sends back an HTTP 200 response.
// Amazon SageMaker returns the following data in JSON format:
// - CompilationJobArn : The Amazon Resource Name (ARN) of the compiled job.
//
// This member is required.
CompilationJobArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateCompilationJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateCompilationJob{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateCompilationJob{}, 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 = addOpCreateCompilationJobValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCompilationJob(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_opCreateCompilationJob(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateCompilationJob",
}
}
| 202 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a context. A context is a lineage tracking entity that represents a
// logical grouping of other tracking or experiment entities. Some examples are an
// endpoint and a model package. For more information, see Amazon SageMaker ML
// Lineage Tracking (https://docs.aws.amazon.com/sagemaker/latest/dg/lineage-tracking.html)
// .
func (c *Client) CreateContext(ctx context.Context, params *CreateContextInput, optFns ...func(*Options)) (*CreateContextOutput, error) {
if params == nil {
params = &CreateContextInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateContext", params, optFns, c.addOperationCreateContextMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateContextOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateContextInput struct {
// The name of the context. Must be unique to your account in an Amazon Web
// Services Region.
//
// This member is required.
ContextName *string
// The context type.
//
// This member is required.
ContextType *string
// The source type, ID, and URI.
//
// This member is required.
Source *types.ContextSource
// The description of the context.
Description *string
// A list of properties to add to the context.
Properties map[string]string
// A list of tags to apply to the context.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateContextOutput struct {
// The Amazon Resource Name (ARN) of the context.
ContextArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateContextMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateContext{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateContext{}, 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 = addOpCreateContextValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateContext(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_opCreateContext(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateContext",
}
}
| 149 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a definition for a job that monitors data quality and drift. For
// information about model monitor, see Amazon SageMaker Model Monitor (https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor.html)
// .
func (c *Client) CreateDataQualityJobDefinition(ctx context.Context, params *CreateDataQualityJobDefinitionInput, optFns ...func(*Options)) (*CreateDataQualityJobDefinitionOutput, error) {
if params == nil {
params = &CreateDataQualityJobDefinitionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateDataQualityJobDefinition", params, optFns, c.addOperationCreateDataQualityJobDefinitionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateDataQualityJobDefinitionOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateDataQualityJobDefinitionInput struct {
// Specifies the container that runs the monitoring job.
//
// This member is required.
DataQualityAppSpecification *types.DataQualityAppSpecification
// A list of inputs for the monitoring job. Currently endpoints are supported as
// monitoring inputs.
//
// This member is required.
DataQualityJobInput *types.DataQualityJobInput
// The output configuration for monitoring jobs.
//
// This member is required.
DataQualityJobOutputConfig *types.MonitoringOutputConfig
// The name for the monitoring job definition.
//
// This member is required.
JobDefinitionName *string
// Identifies the resources to deploy for a monitoring job.
//
// This member is required.
JobResources *types.MonitoringResources
// The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume
// to perform tasks on your behalf.
//
// This member is required.
RoleArn *string
// Configures the constraints and baselines for the monitoring job.
DataQualityBaselineConfig *types.DataQualityBaselineConfig
// Specifies networking configuration for the monitoring job.
NetworkConfig *types.MonitoringNetworkConfig
// A time limit for how long the monitoring job is allowed to run before stopping.
StoppingCondition *types.MonitoringStoppingCondition
// (Optional) An array of key-value pairs. For more information, see Using Cost
// Allocation Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-whatURL)
// in the Amazon Web Services Billing and Cost Management User Guide.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateDataQualityJobDefinitionOutput struct {
// The Amazon Resource Name (ARN) of the job definition.
//
// This member is required.
JobDefinitionArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateDataQualityJobDefinitionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateDataQualityJobDefinition{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateDataQualityJobDefinition{}, 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 = addOpCreateDataQualityJobDefinitionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDataQualityJobDefinition(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_opCreateDataQualityJobDefinition(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateDataQualityJobDefinition",
}
}
| 170 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a device fleet.
func (c *Client) CreateDeviceFleet(ctx context.Context, params *CreateDeviceFleetInput, optFns ...func(*Options)) (*CreateDeviceFleetOutput, error) {
if params == nil {
params = &CreateDeviceFleetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateDeviceFleet", params, optFns, c.addOperationCreateDeviceFleetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateDeviceFleetOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateDeviceFleetInput struct {
// The name of the fleet that the device belongs to.
//
// This member is required.
DeviceFleetName *string
// The output configuration for storing sample data collected by the fleet.
//
// This member is required.
OutputConfig *types.EdgeOutputConfig
// A description of the fleet.
Description *string
// Whether to create an Amazon Web Services IoT Role Alias during device fleet
// creation. The name of the role alias generated will match this pattern:
// "SageMakerEdge-{DeviceFleetName}". For example, if your device fleet is called
// "demo-fleet", the name of the role alias will be "SageMakerEdge-demo-fleet".
EnableIotRoleAlias *bool
// The Amazon Resource Name (ARN) that has access to Amazon Web Services Internet
// of Things (IoT).
RoleArn *string
// Creates tags for the specified fleet.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateDeviceFleetOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateDeviceFleetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateDeviceFleet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateDeviceFleet{}, 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 = addOpCreateDeviceFleetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDeviceFleet(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_opCreateDeviceFleet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateDeviceFleet",
}
}
| 142 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a Domain used by Amazon SageMaker Studio. A domain consists of an
// associated Amazon Elastic File System (EFS) volume, a list of authorized users,
// and a variety of security, application, policy, and Amazon Virtual Private Cloud
// (VPC) configurations. Users within a domain can share notebook files and other
// artifacts with each other. EFS storage When a domain is created, an EFS volume
// is created for use by all of the users within the domain. Each user receives a
// private home directory within the EFS volume for notebooks, Git repositories,
// and data files. SageMaker uses the Amazon Web Services Key Management Service
// (Amazon Web Services KMS) to encrypt the EFS volume attached to the domain with
// an Amazon Web Services managed key by default. For more control, you can specify
// a customer managed key. For more information, see Protect Data at Rest Using
// Encryption (https://docs.aws.amazon.com/sagemaker/latest/dg/encryption-at-rest.html)
// . VPC configuration All SageMaker Studio traffic between the domain and the EFS
// volume is through the specified VPC and subnets. For other Studio traffic, you
// can specify the AppNetworkAccessType parameter. AppNetworkAccessType
// corresponds to the network access type that you choose when you onboard to
// Studio. The following options are available:
// - PublicInternetOnly - Non-EFS traffic goes through a VPC managed by Amazon
// SageMaker, which allows internet access. This is the default value.
// - VpcOnly - All Studio traffic is through the specified VPC and subnets.
// Internet access is disabled by default. To allow internet access, you must
// specify a NAT gateway. When internet access is disabled, you won't be able to
// run a Studio notebook or to train or host models unless your VPC has an
// interface endpoint to the SageMaker API and runtime or a NAT gateway and your
// security groups allow outbound connections.
//
// NFS traffic over TCP on port 2049 needs to be allowed in both inbound and
// outbound rules in order to launch a SageMaker Studio app successfully. For more
// information, see Connect SageMaker Studio Notebooks to Resources in a VPC (https://docs.aws.amazon.com/sagemaker/latest/dg/studio-notebooks-and-internet-access.html)
// .
func (c *Client) CreateDomain(ctx context.Context, params *CreateDomainInput, optFns ...func(*Options)) (*CreateDomainOutput, error) {
if params == nil {
params = &CreateDomainInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateDomain", params, optFns, c.addOperationCreateDomainMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateDomainOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateDomainInput struct {
// The mode of authentication that members use to access the domain.
//
// This member is required.
AuthMode types.AuthMode
// The default settings to use to create a user profile when UserSettings isn't
// specified in the call to the CreateUserProfile API. SecurityGroups is
// aggregated when specified in both calls. For all other settings in UserSettings
// , the values specified in CreateUserProfile take precedence over those
// specified in CreateDomain .
//
// This member is required.
DefaultUserSettings *types.UserSettings
// A name for the domain.
//
// This member is required.
DomainName *string
// The VPC subnets that Studio uses for communication.
//
// This member is required.
SubnetIds []string
// The ID of the Amazon Virtual Private Cloud (VPC) that Studio uses for
// communication.
//
// This member is required.
VpcId *string
// Specifies the VPC used for non-EFS traffic. The default value is
// PublicInternetOnly .
// - PublicInternetOnly - Non-EFS traffic is through a VPC managed by Amazon
// SageMaker, which allows direct internet access
// - VpcOnly - All Studio traffic is through the specified VPC and subnets
AppNetworkAccessType types.AppNetworkAccessType
// The entity that creates and manages the required security groups for inter-app
// communication in VPCOnly mode. Required when CreateDomain.AppNetworkAccessType
// is VPCOnly and
// DomainSettings.RStudioServerProDomainSettings.DomainExecutionRoleArn is
// provided. If setting up the domain for use with RStudio, this value must be set
// to Service .
AppSecurityGroupManagement types.AppSecurityGroupManagement
// The default settings used to create a space.
DefaultSpaceSettings *types.DefaultSpaceSettings
// A collection of Domain settings.
DomainSettings *types.DomainSettings
// Use KmsKeyId .
//
// Deprecated: This property is deprecated, use KmsKeyId instead.
HomeEfsFileSystemKmsKeyId *string
// SageMaker uses Amazon Web Services KMS to encrypt the EFS volume attached to
// the domain with an Amazon Web Services managed key by default. For more control,
// specify a customer managed key.
KmsKeyId *string
// Tags to associated with the Domain. Each tag consists of a key and an optional
// value. Tag keys must be unique per resource. Tags are searchable using the
// Search API. Tags that you specify for the Domain are also added to all Apps that
// the Domain launches.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateDomainOutput struct {
// The Amazon Resource Name (ARN) of the created domain.
DomainArn *string
// The URL to the created domain.
Url *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateDomainMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateDomain{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateDomain{}, 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 = addOpCreateDomainValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDomain(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_opCreateDomain(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateDomain",
}
}
| 219 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an edge deployment plan, consisting of multiple stages. Each stage may
// have a different deployment configuration and devices.
func (c *Client) CreateEdgeDeploymentPlan(ctx context.Context, params *CreateEdgeDeploymentPlanInput, optFns ...func(*Options)) (*CreateEdgeDeploymentPlanOutput, error) {
if params == nil {
params = &CreateEdgeDeploymentPlanInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateEdgeDeploymentPlan", params, optFns, c.addOperationCreateEdgeDeploymentPlanMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateEdgeDeploymentPlanOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateEdgeDeploymentPlanInput struct {
// The device fleet used for this edge deployment plan.
//
// This member is required.
DeviceFleetName *string
// The name of the edge deployment plan.
//
// This member is required.
EdgeDeploymentPlanName *string
// List of models associated with the edge deployment plan.
//
// This member is required.
ModelConfigs []types.EdgeDeploymentModelConfig
// List of stages of the edge deployment plan. The number of stages is limited to
// 10 per deployment.
Stages []types.DeploymentStage
// List of tags with which to tag the edge deployment plan.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateEdgeDeploymentPlanOutput struct {
// The ARN of the edge deployment plan.
//
// This member is required.
EdgeDeploymentPlanArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateEdgeDeploymentPlanMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateEdgeDeploymentPlan{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateEdgeDeploymentPlan{}, 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 = addOpCreateEdgeDeploymentPlanValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateEdgeDeploymentPlan(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_opCreateEdgeDeploymentPlan(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateEdgeDeploymentPlan",
}
}
| 145 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a new stage in an existing edge deployment plan.
func (c *Client) CreateEdgeDeploymentStage(ctx context.Context, params *CreateEdgeDeploymentStageInput, optFns ...func(*Options)) (*CreateEdgeDeploymentStageOutput, error) {
if params == nil {
params = &CreateEdgeDeploymentStageInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateEdgeDeploymentStage", params, optFns, c.addOperationCreateEdgeDeploymentStageMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateEdgeDeploymentStageOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateEdgeDeploymentStageInput struct {
// The name of the edge deployment plan.
//
// This member is required.
EdgeDeploymentPlanName *string
// List of stages to be added to the edge deployment plan.
//
// This member is required.
Stages []types.DeploymentStage
noSmithyDocumentSerde
}
type CreateEdgeDeploymentStageOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateEdgeDeploymentStageMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateEdgeDeploymentStage{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateEdgeDeploymentStage{}, 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 = addOpCreateEdgeDeploymentStageValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateEdgeDeploymentStage(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_opCreateEdgeDeploymentStage(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateEdgeDeploymentStage",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Starts a SageMaker Edge Manager model packaging job. Edge Manager will use the
// model artifacts from the Amazon Simple Storage Service bucket that you specify.
// After the model has been packaged, Amazon SageMaker saves the resulting
// artifacts to an S3 bucket that you specify.
func (c *Client) CreateEdgePackagingJob(ctx context.Context, params *CreateEdgePackagingJobInput, optFns ...func(*Options)) (*CreateEdgePackagingJobOutput, error) {
if params == nil {
params = &CreateEdgePackagingJobInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateEdgePackagingJob", params, optFns, c.addOperationCreateEdgePackagingJobMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateEdgePackagingJobOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateEdgePackagingJobInput struct {
// The name of the SageMaker Neo compilation job that will be used to locate model
// artifacts for packaging.
//
// This member is required.
CompilationJobName *string
// The name of the edge packaging job.
//
// This member is required.
EdgePackagingJobName *string
// The name of the model.
//
// This member is required.
ModelName *string
// The version of the model.
//
// This member is required.
ModelVersion *string
// Provides information about the output location for the packaged model.
//
// This member is required.
OutputConfig *types.EdgeOutputConfig
// The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to
// download and upload the model, and to contact SageMaker Neo.
//
// This member is required.
RoleArn *string
// The Amazon Web Services KMS key to use when encrypting the EBS volume the edge
// packaging job runs on.
ResourceKey *string
// Creates tags for the packaging job.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateEdgePackagingJobOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateEdgePackagingJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateEdgePackagingJob{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateEdgePackagingJob{}, 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 = addOpCreateEdgePackagingJobValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateEdgePackagingJob(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_opCreateEdgePackagingJob(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateEdgePackagingJob",
}
}
| 158 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an endpoint using the endpoint configuration specified in the request.
// SageMaker uses the endpoint to provision resources and deploy models. You create
// the endpoint configuration with the CreateEndpointConfig (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateEndpointConfig.html)
// API. Use this API to deploy models using SageMaker hosting services. For an
// example that calls this method when deploying a model to SageMaker hosting
// services, see the Create Endpoint example notebook. (https://github.com/aws/amazon-sagemaker-examples/blob/master/sagemaker-fundamentals/create-endpoint/create_endpoint.ipynb)
// You must not delete an EndpointConfig that is in use by an endpoint that is
// live or while the UpdateEndpoint or CreateEndpoint operations are being
// performed on the endpoint. To update an endpoint, you must create a new
// EndpointConfig . The endpoint name must be unique within an Amazon Web Services
// Region in your Amazon Web Services account. When it receives the request,
// SageMaker creates the endpoint, launches the resources (ML compute instances),
// and deploys the model(s) on them. When you call CreateEndpoint (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateEndpoint.html)
// , a load call is made to DynamoDB to verify that your endpoint configuration
// exists. When you read data from a DynamoDB table supporting Eventually
// Consistent Reads (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadConsistency.html)
// , the response might not reflect the results of a recently completed write
// operation. The response might include some stale data. If the dependent entities
// are not yet in DynamoDB, this causes a validation error. If you repeat your read
// request after a short time, the response should return the latest data. So retry
// logic is recommended to handle these possible issues. We also recommend that
// customers call DescribeEndpointConfig (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeEndpointConfig.html)
// before calling CreateEndpoint (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateEndpoint.html)
// to minimize the potential impact of a DynamoDB eventually consistent read. When
// SageMaker receives the request, it sets the endpoint status to Creating . After
// it creates the endpoint, it sets the status to InService . SageMaker can then
// process incoming requests for inferences. To check the status of an endpoint,
// use the DescribeEndpoint (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeEndpoint.html)
// API. If any of the models hosted at this endpoint get model data from an Amazon
// S3 location, SageMaker uses Amazon Web Services Security Token Service to
// download model artifacts from the S3 path you provided. Amazon Web Services STS
// is activated in your Amazon Web Services account by default. If you previously
// deactivated Amazon Web Services STS for a region, you need to reactivate Amazon
// Web Services STS for that region. For more information, see Activating and
// Deactivating Amazon Web Services STS in an Amazon Web Services Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
// in the Amazon Web Services Identity and Access Management User Guide. To add the
// IAM role policies for using this API operation, go to the IAM console (https://console.aws.amazon.com/iam/)
// , and choose Roles in the left navigation pane. Search the IAM role that you
// want to grant access to use the CreateEndpoint (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateEndpoint.html)
// and CreateEndpointConfig (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateEndpointConfig.html)
// API operations, add the following policies to the role.
// - Option 1: For a full SageMaker access, search and attach the
// AmazonSageMakerFullAccess policy.
// - Option 2: For granting a limited access to an IAM role, paste the following
// Action elements manually into the JSON file of the IAM role: "Action":
// ["sagemaker:CreateEndpoint", "sagemaker:CreateEndpointConfig"] "Resource": [
// "arn:aws:sagemaker:region:account-id:endpoint/endpointName"
// "arn:aws:sagemaker:region:account-id:endpoint-config/endpointConfigName" ] For
// more information, see SageMaker API Permissions: Actions, Permissions, and
// Resources Reference (https://docs.aws.amazon.com/sagemaker/latest/dg/api-permissions-reference.html)
// .
func (c *Client) CreateEndpoint(ctx context.Context, params *CreateEndpointInput, optFns ...func(*Options)) (*CreateEndpointOutput, error) {
if params == nil {
params = &CreateEndpointInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateEndpoint", params, optFns, c.addOperationCreateEndpointMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateEndpointOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateEndpointInput struct {
// The name of an endpoint configuration. For more information, see
// CreateEndpointConfig (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateEndpointConfig.html)
// .
//
// This member is required.
EndpointConfigName *string
// The name of the endpoint.The name must be unique within an Amazon Web Services
// Region in your Amazon Web Services account. The name is case-insensitive in
// CreateEndpoint , but the case is preserved and must be matched in InvokeEndpoint (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_runtime_InvokeEndpoint.html)
// .
//
// This member is required.
EndpointName *string
// The deployment configuration for an endpoint, which contains the desired
// deployment strategy and rollback configurations.
DeploymentConfig *types.DeploymentConfig
// An array of key-value pairs. You can use tags to categorize your Amazon Web
// Services resources in different ways, for example, by purpose, owner, or
// environment. For more information, see Tagging Amazon Web Services Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html)
// .
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateEndpointOutput struct {
// The Amazon Resource Name (ARN) of the endpoint.
//
// This member is required.
EndpointArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateEndpoint{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateEndpoint{}, 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 = addOpCreateEndpointValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateEndpoint(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_opCreateEndpoint(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateEndpoint",
}
}
| 197 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an endpoint configuration that SageMaker hosting services uses to
// deploy models. In the configuration, you identify one or more models, created
// using the CreateModel API, to deploy and the resources that you want SageMaker
// to provision. Then you call the CreateEndpoint (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateEndpoint.html)
// API. Use this API if you want to use SageMaker hosting services to deploy models
// into production. In the request, you define a ProductionVariant , for each model
// that you want to deploy. Each ProductionVariant parameter also describes the
// resources that you want SageMaker to provision. This includes the number and
// type of ML compute instances to deploy. If you are hosting multiple models, you
// also assign a VariantWeight to specify how much traffic you want to allocate to
// each model. For example, suppose that you want to host two models, A and B, and
// you assign traffic weight 2 for model A and 1 for model B. SageMaker distributes
// two-thirds of the traffic to Model A, and one-third to model B. When you call
// CreateEndpoint (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateEndpoint.html)
// , a load call is made to DynamoDB to verify that your endpoint configuration
// exists. When you read data from a DynamoDB table supporting Eventually
// Consistent Reads (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadConsistency.html)
// , the response might not reflect the results of a recently completed write
// operation. The response might include some stale data. If the dependent entities
// are not yet in DynamoDB, this causes a validation error. If you repeat your read
// request after a short time, the response should return the latest data. So retry
// logic is recommended to handle these possible issues. We also recommend that
// customers call DescribeEndpointConfig (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeEndpointConfig.html)
// before calling CreateEndpoint (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateEndpoint.html)
// to minimize the potential impact of a DynamoDB eventually consistent read.
func (c *Client) CreateEndpointConfig(ctx context.Context, params *CreateEndpointConfigInput, optFns ...func(*Options)) (*CreateEndpointConfigOutput, error) {
if params == nil {
params = &CreateEndpointConfigInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateEndpointConfig", params, optFns, c.addOperationCreateEndpointConfigMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateEndpointConfigOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateEndpointConfigInput struct {
// The name of the endpoint configuration. You specify this name in a
// CreateEndpoint (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateEndpoint.html)
// request.
//
// This member is required.
EndpointConfigName *string
// An array of ProductionVariant objects, one for each model that you want to host
// at this endpoint.
//
// This member is required.
ProductionVariants []types.ProductionVariant
// Specifies configuration for how an endpoint performs asynchronous inference.
// This is a required field in order for your Endpoint to be invoked using
// InvokeEndpointAsync (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_runtime_InvokeEndpointAsync.html)
// .
AsyncInferenceConfig *types.AsyncInferenceConfig
// Configuration to control how SageMaker captures inference data.
DataCaptureConfig *types.DataCaptureConfig
// A member of CreateEndpointConfig that enables explainers.
ExplainerConfig *types.ExplainerConfig
// The Amazon Resource Name (ARN) of a Amazon Web Services Key Management Service
// key that SageMaker uses to encrypt data on the storage volume attached to the ML
// compute instance that hosts the endpoint. The KmsKeyId can be any of the
// following formats:
// - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
// - Key ARN:
// arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
// - Alias name: alias/ExampleAlias
// - Alias name ARN: arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias
// The KMS key policy must grant permission to the IAM role that you specify in
// your CreateEndpoint , UpdateEndpoint requests. For more information, refer to
// the Amazon Web Services Key Management Service section Using Key Policies in
// Amazon Web Services KMS (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html)
// Certain Nitro-based instances include local storage, dependent on the instance
// type. Local storage volumes are encrypted using a hardware module on the
// instance. You can't request a KmsKeyId when using an instance type with local
// storage. If any of the models that you specify in the ProductionVariants
// parameter use nitro-based instances with local storage, do not specify a value
// for the KmsKeyId parameter. If you specify a value for KmsKeyId when using any
// nitro-based instances with local storage, the call to CreateEndpointConfig
// fails. For a list of instance types that support local instance storage, see
// Instance Store Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#instance-store-volumes)
// . For more information about local instance storage encryption, see SSD
// Instance Store Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ssd-instance-store.html)
// .
KmsKeyId *string
// An array of ProductionVariant objects, one for each model that you want to host
// at this endpoint in shadow mode with production traffic replicated from the
// model specified on ProductionVariants . If you use this field, you can only
// specify one variant for ProductionVariants and one variant for
// ShadowProductionVariants .
ShadowProductionVariants []types.ProductionVariant
// An array of key-value pairs. You can use tags to categorize your Amazon Web
// Services resources in different ways, for example, by purpose, owner, or
// environment. For more information, see Tagging Amazon Web Services Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html)
// .
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateEndpointConfigOutput struct {
// The Amazon Resource Name (ARN) of the endpoint configuration.
//
// This member is required.
EndpointConfigArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateEndpointConfigMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateEndpointConfig{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateEndpointConfig{}, 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 = addOpCreateEndpointConfigValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateEndpointConfig(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_opCreateEndpointConfig(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateEndpointConfig",
}
}
| 211 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a SageMaker experiment. An experiment is a collection of trials that
// are observed, compared and evaluated as a group. A trial is a set of steps,
// called trial components, that produce a machine learning model. In the Studio
// UI, trials are referred to as run groups and trial components are referred to as
// runs. The goal of an experiment is to determine the components that produce the
// best model. Multiple trials are performed, each one isolating and measuring the
// impact of a change to one or more inputs, while keeping the remaining inputs
// constant. When you use SageMaker Studio or the SageMaker Python SDK, all
// experiments, trials, and trial components are automatically tracked, logged, and
// indexed. When you use the Amazon Web Services SDK for Python (Boto), you must
// use the logging APIs provided by the SDK. You can add tags to experiments,
// trials, trial components and then use the Search (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_Search.html)
// API to search for the tags. To add a description to an experiment, specify the
// optional Description parameter. To add a description later, or to change the
// description, call the UpdateExperiment (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_UpdateExperiment.html)
// API. To get a list of all your experiments, call the ListExperiments (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ListExperiments.html)
// API. To view an experiment's properties, call the DescribeExperiment (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeExperiment.html)
// API. To get a list of all the trials associated with an experiment, call the
// ListTrials (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ListTrials.html)
// API. To create a trial call the CreateTrial (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrial.html)
// API.
func (c *Client) CreateExperiment(ctx context.Context, params *CreateExperimentInput, optFns ...func(*Options)) (*CreateExperimentOutput, error) {
if params == nil {
params = &CreateExperimentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateExperiment", params, optFns, c.addOperationCreateExperimentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateExperimentOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateExperimentInput struct {
// The name of the experiment. The name must be unique in your Amazon Web Services
// account and is not case-sensitive.
//
// This member is required.
ExperimentName *string
// The description of the experiment.
Description *string
// The name of the experiment as displayed. The name doesn't need to be unique. If
// you don't specify DisplayName , the value in ExperimentName is displayed.
DisplayName *string
// A list of tags to associate with the experiment. You can use Search (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_Search.html)
// API to search on the tags.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateExperimentOutput struct {
// The Amazon Resource Name (ARN) of the experiment.
ExperimentArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateExperimentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateExperiment{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateExperiment{}, 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 = addOpCreateExperimentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateExperiment(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_opCreateExperiment(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateExperiment",
}
}
| 157 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Create a new FeatureGroup . A FeatureGroup is a group of Features defined in
// the FeatureStore to describe a Record . The FeatureGroup defines the schema and
// features contained in the FeatureGroup. A FeatureGroup definition is composed
// of a list of Features , a RecordIdentifierFeatureName , an EventTimeFeatureName
// and configurations for its OnlineStore and OfflineStore . Check Amazon Web
// Services service quotas (https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html)
// to see the FeatureGroup s quota for your Amazon Web Services account. You must
// include at least one of OnlineStoreConfig and OfflineStoreConfig to create a
// FeatureGroup .
func (c *Client) CreateFeatureGroup(ctx context.Context, params *CreateFeatureGroupInput, optFns ...func(*Options)) (*CreateFeatureGroupOutput, error) {
if params == nil {
params = &CreateFeatureGroupInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateFeatureGroup", params, optFns, c.addOperationCreateFeatureGroupMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateFeatureGroupOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateFeatureGroupInput struct {
// The name of the feature that stores the EventTime of a Record in a FeatureGroup
// . An EventTime is a point in time when a new event occurs that corresponds to
// the creation or update of a Record in a FeatureGroup . All Records in the
// FeatureGroup must have a corresponding EventTime . An EventTime can be a String
// or Fractional .
// - Fractional : EventTime feature values must be a Unix timestamp in seconds.
// - String : EventTime feature values must be an ISO-8601 string in the format.
// The following formats are supported yyyy-MM-dd'T'HH:mm:ssZ and
// yyyy-MM-dd'T'HH:mm:ss.SSSZ where yyyy , MM , and dd represent the year, month,
// and day respectively and HH , mm , ss , and if applicable, SSS represent the
// hour, month, second and milliseconds respsectively. 'T' and Z are constants.
//
// This member is required.
EventTimeFeatureName *string
// A list of Feature names and types. Name and Type is compulsory per Feature .
// Valid feature FeatureType s are Integral , Fractional and String . FeatureName s
// cannot be any of the following: is_deleted , write_time , api_invocation_time
// You can create up to 2,500 FeatureDefinition s per FeatureGroup .
//
// This member is required.
FeatureDefinitions []types.FeatureDefinition
// The name of the FeatureGroup . The name must be unique within an Amazon Web
// Services Region in an Amazon Web Services account. The name:
// - Must start and end with an alphanumeric character.
// - Can only contain alphanumeric character and hyphens. Spaces are not
// allowed.
//
// This member is required.
FeatureGroupName *string
// The name of the Feature whose value uniquely identifies a Record defined in the
// FeatureStore . Only the latest record per identifier value will be stored in the
// OnlineStore . RecordIdentifierFeatureName must be one of feature definitions'
// names. You use the RecordIdentifierFeatureName to access data in a FeatureStore
// . This name:
// - Must start and end with an alphanumeric character.
// - Can only contains alphanumeric characters, hyphens, underscores. Spaces are
// not allowed.
//
// This member is required.
RecordIdentifierFeatureName *string
// A free-form description of a FeatureGroup .
Description *string
// Use this to configure an OfflineFeatureStore . This parameter allows you to
// specify:
// - The Amazon Simple Storage Service (Amazon S3) location of an OfflineStore .
// - A configuration for an Amazon Web Services Glue or Amazon Web Services Hive
// data catalog.
// - An KMS encryption key to encrypt the Amazon S3 location used for
// OfflineStore . If KMS encryption key is not specified, by default we encrypt
// all data at rest using Amazon Web Services KMS key. By defining your
// bucket-level key (https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucket-key.html)
// for SSE, you can reduce Amazon Web Services KMS requests costs by up to 99
// percent.
// - Format for the offline store table. Supported formats are Glue (Default)
// and Apache Iceberg (https://iceberg.apache.org/) .
// To learn more about this parameter, see OfflineStoreConfig (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_OfflineStoreConfig.html)
// .
OfflineStoreConfig *types.OfflineStoreConfig
// You can turn the OnlineStore on or off by specifying True for the
// EnableOnlineStore flag in OnlineStoreConfig . You can also include an Amazon Web
// Services KMS key ID ( KMSKeyId ) for at-rest encryption of the OnlineStore . The
// default value is False .
OnlineStoreConfig *types.OnlineStoreConfig
// The Amazon Resource Name (ARN) of the IAM execution role used to persist data
// into the OfflineStore if an OfflineStoreConfig is provided.
RoleArn *string
// Tags used to identify Features in each FeatureGroup .
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateFeatureGroupOutput struct {
// The Amazon Resource Name (ARN) of the FeatureGroup . This is a unique identifier
// for the feature group.
//
// This member is required.
FeatureGroupArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateFeatureGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateFeatureGroup{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateFeatureGroup{}, 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 = addOpCreateFeatureGroupValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateFeatureGroup(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_opCreateFeatureGroup(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateFeatureGroup",
}
}
| 208 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a flow definition.
func (c *Client) CreateFlowDefinition(ctx context.Context, params *CreateFlowDefinitionInput, optFns ...func(*Options)) (*CreateFlowDefinitionOutput, error) {
if params == nil {
params = &CreateFlowDefinitionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateFlowDefinition", params, optFns, c.addOperationCreateFlowDefinitionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateFlowDefinitionOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateFlowDefinitionInput struct {
// The name of your flow definition.
//
// This member is required.
FlowDefinitionName *string
// An object containing information about the tasks the human reviewers will
// perform.
//
// This member is required.
HumanLoopConfig *types.HumanLoopConfig
// An object containing information about where the human review results will be
// uploaded.
//
// This member is required.
OutputConfig *types.FlowDefinitionOutputConfig
// The Amazon Resource Name (ARN) of the role needed to call other services on
// your behalf. For example,
// arn:aws:iam::1234567890:role/service-role/AmazonSageMaker-ExecutionRole-20180111T151298
// .
//
// This member is required.
RoleArn *string
// An object containing information about the events that trigger a human workflow.
HumanLoopActivationConfig *types.HumanLoopActivationConfig
// Container for configuring the source of human task requests. Use to specify if
// Amazon Rekognition or Amazon Textract is used as an integration source.
HumanLoopRequestSource *types.HumanLoopRequestSource
// An array of key-value pairs that contain metadata to help you categorize and
// organize a flow definition. Each tag consists of a key and a value, both of
// which you define.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateFlowDefinitionOutput struct {
// The Amazon Resource Name (ARN) of the flow definition you create.
//
// This member is required.
FlowDefinitionArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateFlowDefinitionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateFlowDefinition{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateFlowDefinition{}, 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 = addOpCreateFlowDefinitionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateFlowDefinition(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_opCreateFlowDefinition(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateFlowDefinition",
}
}
| 159 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Create a hub. Hub APIs are only callable through SageMaker Studio.
func (c *Client) CreateHub(ctx context.Context, params *CreateHubInput, optFns ...func(*Options)) (*CreateHubOutput, error) {
if params == nil {
params = &CreateHubInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateHub", params, optFns, c.addOperationCreateHubMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateHubOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateHubInput struct {
// A description of the hub.
//
// This member is required.
HubDescription *string
// The name of the hub to create.
//
// This member is required.
HubName *string
// The display name of the hub.
HubDisplayName *string
// The searchable keywords for the hub.
HubSearchKeywords []string
// The Amazon S3 storage configuration for the hub.
S3StorageConfig *types.HubS3StorageConfig
// Any tags to associate with the hub.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateHubOutput struct {
// The Amazon Resource Name (ARN) of the hub.
//
// This member is required.
HubArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateHubMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateHub{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateHub{}, 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 = addOpCreateHubValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateHub(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_opCreateHub(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateHub",
}
}
| 144 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Defines the settings you will use for the human review workflow user interface.
// Reviewers will see a three-panel interface with an instruction area, the item to
// review, and an input area.
func (c *Client) CreateHumanTaskUi(ctx context.Context, params *CreateHumanTaskUiInput, optFns ...func(*Options)) (*CreateHumanTaskUiOutput, error) {
if params == nil {
params = &CreateHumanTaskUiInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateHumanTaskUi", params, optFns, c.addOperationCreateHumanTaskUiMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateHumanTaskUiOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateHumanTaskUiInput struct {
// The name of the user interface you are creating.
//
// This member is required.
HumanTaskUiName *string
// The Liquid template for the worker user interface.
//
// This member is required.
UiTemplate *types.UiTemplate
// An array of key-value pairs that contain metadata to help you categorize and
// organize a human review workflow user interface. Each tag consists of a key and
// a value, both of which you define.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateHumanTaskUiOutput struct {
// The Amazon Resource Name (ARN) of the human review workflow user interface you
// create.
//
// This member is required.
HumanTaskUiArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateHumanTaskUiMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateHumanTaskUi{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateHumanTaskUi{}, 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 = addOpCreateHumanTaskUiValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateHumanTaskUi(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_opCreateHumanTaskUi(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateHumanTaskUi",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Starts a hyperparameter tuning job. A hyperparameter tuning job finds the best
// version of a model by running many training jobs on your dataset using the
// algorithm you choose and values for hyperparameters within ranges that you
// specify. It then chooses the hyperparameter values that result in a model that
// performs the best, as measured by an objective metric that you choose. A
// hyperparameter tuning job automatically creates Amazon SageMaker experiments,
// trials, and trial components for each training job that it runs. You can view
// these entities in Amazon SageMaker Studio. For more information, see View
// Experiments, Trials, and Trial Components (https://docs.aws.amazon.com/sagemaker/latest/dg/experiments-view-compare.html#experiments-view)
// . Do not include any security-sensitive information including account access
// IDs, secrets or tokens in any hyperparameter field. If the use of
// security-sensitive credentials are detected, SageMaker will reject your training
// job request and return an exception error.
func (c *Client) CreateHyperParameterTuningJob(ctx context.Context, params *CreateHyperParameterTuningJobInput, optFns ...func(*Options)) (*CreateHyperParameterTuningJobOutput, error) {
if params == nil {
params = &CreateHyperParameterTuningJobInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateHyperParameterTuningJob", params, optFns, c.addOperationCreateHyperParameterTuningJobMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateHyperParameterTuningJobOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateHyperParameterTuningJobInput struct {
// The HyperParameterTuningJobConfig (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_HyperParameterTuningJobConfig.html)
// object that describes the tuning job, including the search strategy, the
// objective metric used to evaluate training jobs, ranges of parameters to search,
// and resource limits for the tuning job. For more information, see How
// Hyperparameter Tuning Works (https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-how-it-works.html)
// .
//
// This member is required.
HyperParameterTuningJobConfig *types.HyperParameterTuningJobConfig
// The name of the tuning job. This name is the prefix for the names of all
// training jobs that this tuning job launches. The name must be unique within the
// same Amazon Web Services account and Amazon Web Services Region. The name must
// have 1 to 32 characters. Valid characters are a-z, A-Z, 0-9, and : + = @ _ % -
// (hyphen). The name is not case sensitive.
//
// This member is required.
HyperParameterTuningJobName *string
// Configures SageMaker Automatic model tuning (AMT) to automatically find optimal
// parameters for the following fields:
// - ParameterRanges (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_HyperParameterTuningJobConfig.html#sagemaker-Type-HyperParameterTuningJobConfig-ParameterRanges)
// : The names and ranges of parameters that a hyperparameter tuning job can
// optimize.
// - ResourceLimits (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ResourceLimits.html)
// : The maximum resources that can be used for a training job. These resources
// include the maximum number of training jobs, the maximum runtime of a tuning
// job, and the maximum number of training jobs to run at the same time.
// - TrainingJobEarlyStoppingType (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_HyperParameterTuningJobConfig.html#sagemaker-Type-HyperParameterTuningJobConfig-TrainingJobEarlyStoppingType)
// : A flag that specifies whether or not to use early stopping for training jobs
// launched by a hyperparameter tuning job.
// - RetryStrategy (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_HyperParameterTrainingJobDefinition.html#sagemaker-Type-HyperParameterTrainingJobDefinition-RetryStrategy)
// : The number of times to retry a training job.
// - Strategy (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_HyperParameterTuningJobConfig.html)
// : Specifies how hyperparameter tuning chooses the combinations of hyperparameter
// values to use for the training jobs that it launches.
// - ConvergenceDetected (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ConvergenceDetected.html)
// : A flag to indicate that Automatic model tuning (AMT) has detected model
// convergence.
Autotune *types.Autotune
// An array of key-value pairs. You can use tags to categorize your Amazon Web
// Services resources in different ways, for example, by purpose, owner, or
// environment. For more information, see Tagging Amazon Web Services Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html)
// . Tags that you specify for the tuning job are also added to all training jobs
// that the tuning job launches.
Tags []types.Tag
// The HyperParameterTrainingJobDefinition (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_HyperParameterTrainingJobDefinition.html)
// object that describes the training jobs that this tuning job launches, including
// static hyperparameters, input data configuration, output data configuration,
// resource configuration, and stopping condition.
TrainingJobDefinition *types.HyperParameterTrainingJobDefinition
// A list of the HyperParameterTrainingJobDefinition (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_HyperParameterTrainingJobDefinition.html)
// objects launched for this tuning job.
TrainingJobDefinitions []types.HyperParameterTrainingJobDefinition
// Specifies the configuration for starting the hyperparameter tuning job using
// one or more previous tuning jobs as a starting point. The results of previous
// tuning jobs are used to inform which combinations of hyperparameters to search
// over in the new tuning job. All training jobs launched by the new hyperparameter
// tuning job are evaluated by using the objective metric. If you specify
// IDENTICAL_DATA_AND_ALGORITHM as the WarmStartType value for the warm start
// configuration, the training job that performs the best in the new tuning job is
// compared to the best training jobs from the parent tuning jobs. From these, the
// training job that performs the best as measured by the objective metric is
// returned as the overall best training job. All training jobs launched by parent
// hyperparameter tuning jobs and the new hyperparameter tuning jobs count against
// the limit of training jobs for the tuning job.
WarmStartConfig *types.HyperParameterTuningJobWarmStartConfig
noSmithyDocumentSerde
}
type CreateHyperParameterTuningJobOutput struct {
// The Amazon Resource Name (ARN) of the tuning job. SageMaker assigns an ARN to a
// hyperparameter tuning job when you create it.
//
// This member is required.
HyperParameterTuningJobArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateHyperParameterTuningJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateHyperParameterTuningJob{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateHyperParameterTuningJob{}, 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 = addOpCreateHyperParameterTuningJobValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateHyperParameterTuningJob(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_opCreateHyperParameterTuningJob(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateHyperParameterTuningJob",
}
}
| 207 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a custom SageMaker image. A SageMaker image is a set of image versions.
// Each image version represents a container image stored in Amazon Elastic
// Container Registry (ECR). For more information, see Bring your own SageMaker
// image (https://docs.aws.amazon.com/sagemaker/latest/dg/studio-byoi.html) .
func (c *Client) CreateImage(ctx context.Context, params *CreateImageInput, optFns ...func(*Options)) (*CreateImageOutput, error) {
if params == nil {
params = &CreateImageInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateImage", params, optFns, c.addOperationCreateImageMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateImageOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateImageInput struct {
// The name of the image. Must be unique to your account.
//
// This member is required.
ImageName *string
// The ARN of an IAM role that enables Amazon SageMaker to perform tasks on your
// behalf.
//
// This member is required.
RoleArn *string
// The description of the image.
Description *string
// The display name of the image. If not provided, ImageName is displayed.
DisplayName *string
// A list of tags to apply to the image.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateImageOutput struct {
// The ARN of the image.
ImageArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateImageMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateImage{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateImage{}, 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 = addOpCreateImageValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateImage(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_opCreateImage(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateImage",
}
}
| 143 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a version of the SageMaker image specified by ImageName . The version
// represents the Amazon Elastic Container Registry (ECR) container image specified
// by BaseImage .
func (c *Client) CreateImageVersion(ctx context.Context, params *CreateImageVersionInput, optFns ...func(*Options)) (*CreateImageVersionOutput, error) {
if params == nil {
params = &CreateImageVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateImageVersion", params, optFns, c.addOperationCreateImageVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateImageVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateImageVersionInput struct {
// The registry path of the container image to use as the starting point for this
// version. The path is an Amazon Elastic Container Registry (ECR) URI in the
// following format: .dkr.ecr..amazonaws.com/
//
// This member is required.
BaseImage *string
// A unique ID. If not specified, the Amazon Web Services CLI and Amazon Web
// Services SDKs, such as the SDK for Python (Boto3), add a unique value to the
// call.
//
// This member is required.
ClientToken *string
// The ImageName of the Image to create a version of.
//
// This member is required.
ImageName *string
// A list of aliases created with the image version.
Aliases []string
// Indicates Horovod compatibility.
Horovod bool
// Indicates SageMaker job type compatibility.
// - TRAINING : The image version is compatible with SageMaker training jobs.
// - INFERENCE : The image version is compatible with SageMaker inference jobs.
// - NOTEBOOK_KERNEL : The image version is compatible with SageMaker notebook
// kernels.
JobType types.JobType
// The machine learning framework vended in the image version.
MLFramework *string
// Indicates CPU or GPU compatibility.
// - CPU : The image version is compatible with CPU.
// - GPU : The image version is compatible with GPU.
Processor types.Processor
// The supported programming language and its version.
ProgrammingLang *string
// The maintainer description of the image version.
ReleaseNotes *string
// The stability of the image version, specified by the maintainer.
// - NOT_PROVIDED : The maintainers did not provide a status for image version
// stability.
// - STABLE : The image version is stable.
// - TO_BE_ARCHIVED : The image version is set to be archived. Custom image
// versions that are set to be archived are automatically archived after three
// months.
// - ARCHIVED : The image version is archived. Archived image versions are not
// searchable and are no longer actively supported.
VendorGuidance types.VendorGuidance
noSmithyDocumentSerde
}
type CreateImageVersionOutput struct {
// The ARN of the image version.
ImageVersionArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateImageVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateImageVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateImageVersion{}, 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_opCreateImageVersionMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateImageVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateImageVersion(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_initializeOpCreateImageVersion struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateImageVersion) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateImageVersion) 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.(*CreateImageVersionInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateImageVersionInput ")
}
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_opCreateImageVersionMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateImageVersion{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateImageVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateImageVersion",
}
}
| 216 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an inference experiment using the configurations specified in the
// request. Use this API to setup and schedule an experiment to compare model
// variants on a Amazon SageMaker inference endpoint. For more information about
// inference experiments, see Shadow tests (https://docs.aws.amazon.com/sagemaker/latest/dg/shadow-tests.html)
// . Amazon SageMaker begins your experiment at the scheduled time and routes
// traffic to your endpoint's model variants based on your specified configuration.
// While the experiment is in progress or after it has concluded, you can view
// metrics that compare your model variants. For more information, see View,
// monitor, and edit shadow tests (https://docs.aws.amazon.com/sagemaker/latest/dg/shadow-tests-view-monitor-edit.html)
// .
func (c *Client) CreateInferenceExperiment(ctx context.Context, params *CreateInferenceExperimentInput, optFns ...func(*Options)) (*CreateInferenceExperimentOutput, error) {
if params == nil {
params = &CreateInferenceExperimentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateInferenceExperiment", params, optFns, c.addOperationCreateInferenceExperimentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateInferenceExperimentOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateInferenceExperimentInput struct {
// The name of the Amazon SageMaker endpoint on which you want to run the
// inference experiment.
//
// This member is required.
EndpointName *string
// An array of ModelVariantConfig objects. There is one for each variant in the
// inference experiment. Each ModelVariantConfig object in the array describes the
// infrastructure configuration for the corresponding variant.
//
// This member is required.
ModelVariants []types.ModelVariantConfig
// The name for the inference experiment.
//
// This member is required.
Name *string
// The ARN of the IAM role that Amazon SageMaker can assume to access model
// artifacts and container images, and manage Amazon SageMaker Inference endpoints
// for model deployment.
//
// This member is required.
RoleArn *string
// The configuration of ShadowMode inference experiment type. Use this field to
// specify a production variant which takes all the inference requests, and a
// shadow variant to which Amazon SageMaker replicates a percentage of the
// inference requests. For the shadow variant also specify the percentage of
// requests that Amazon SageMaker replicates.
//
// This member is required.
ShadowModeConfig *types.ShadowModeConfig
// The type of the inference experiment that you want to run. The following types
// of experiments are possible:
// - ShadowMode : You can use this type to validate a shadow variant. For more
// information, see Shadow tests (https://docs.aws.amazon.com/sagemaker/latest/dg/shadow-tests.html)
// .
//
// This member is required.
Type types.InferenceExperimentType
// The Amazon S3 location and configuration for storing inference request and
// response data. This is an optional parameter that you can use for data capture.
// For more information, see Capture data (https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor-data-capture.html)
// .
DataStorageConfig *types.InferenceExperimentDataStorageConfig
// A description for the inference experiment.
Description *string
// The Amazon Web Services Key Management Service (Amazon Web Services KMS) key
// that Amazon SageMaker uses to encrypt data on the storage volume attached to the
// ML compute instance that hosts the endpoint. The KmsKey can be any of the
// following formats:
// - KMS key ID "1234abcd-12ab-34cd-56ef-1234567890ab"
// - Amazon Resource Name (ARN) of a KMS key
// "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
// - KMS key Alias "alias/ExampleAlias"
// - Amazon Resource Name (ARN) of a KMS key Alias
// "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias"
// If you use a KMS key ID or an alias of your KMS key, the Amazon SageMaker
// execution role must include permissions to call kms:Encrypt . If you don't
// provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon S3
// for your role's account. Amazon SageMaker uses server-side encryption with KMS
// managed keys for OutputDataConfig . If you use a bucket policy with an
// s3:PutObject permission that only allows objects with server-side encryption,
// set the condition key of s3:x-amz-server-side-encryption to "aws:kms" . For more
// information, see KMS managed Encryption Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html)
// in the Amazon Simple Storage Service Developer Guide. The KMS key policy must
// grant permission to the IAM role that you specify in your CreateEndpoint and
// UpdateEndpoint requests. For more information, see Using Key Policies in Amazon
// Web Services KMS (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html)
// in the Amazon Web Services Key Management Service Developer Guide.
KmsKey *string
// The duration for which you want the inference experiment to run. If you don't
// specify this field, the experiment automatically starts immediately upon
// creation and concludes after 7 days.
Schedule *types.InferenceExperimentSchedule
// Array of key-value pairs. You can use tags to categorize your Amazon Web
// Services resources in different ways, for example, by purpose, owner, or
// environment. For more information, see Tagging your Amazon Web Services
// Resources (https://docs.aws.amazon.com/ARG/latest/userguide/tagging.html) .
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateInferenceExperimentOutput struct {
// The ARN for your inference experiment.
//
// This member is required.
InferenceExperimentArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateInferenceExperimentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateInferenceExperiment{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateInferenceExperiment{}, 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 = addOpCreateInferenceExperimentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateInferenceExperiment(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_opCreateInferenceExperiment(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateInferenceExperiment",
}
}
| 219 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
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/sagemaker/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Starts a recommendation job. You can create either an instance recommendation
// or load test job.
func (c *Client) CreateInferenceRecommendationsJob(ctx context.Context, params *CreateInferenceRecommendationsJobInput, optFns ...func(*Options)) (*CreateInferenceRecommendationsJobOutput, error) {
if params == nil {
params = &CreateInferenceRecommendationsJobInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateInferenceRecommendationsJob", params, optFns, c.addOperationCreateInferenceRecommendationsJobMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateInferenceRecommendationsJobOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateInferenceRecommendationsJobInput struct {
// Provides information about the versioned model package Amazon Resource Name
// (ARN), the traffic pattern, and endpoint configurations.
//
// This member is required.
InputConfig *types.RecommendationJobInputConfig
// A name for the recommendation job. The name must be unique within the Amazon
// Web Services Region and within your Amazon Web Services account. The job name is
// passed down to the resources created by the recommendation job. The names of
// resources (such as the model, endpoint configuration, endpoint, and compilation)
// that are prefixed with the job name are truncated at 40 characters.
//
// This member is required.
JobName *string
// Defines the type of recommendation job. Specify Default to initiate an instance
// recommendation and Advanced to initiate a load test. If left unspecified,
// Amazon SageMaker Inference Recommender will run an instance recommendation (
// DEFAULT ) job.
//
// This member is required.
JobType types.RecommendationJobType
// The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to
// perform tasks on your behalf.
//
// This member is required.
RoleArn *string
// Description of the recommendation job.
JobDescription *string
// Provides information about the output artifacts and the KMS key to use for
// Amazon S3 server-side encryption.
OutputConfig *types.RecommendationJobOutputConfig
// A set of conditions for stopping a recommendation job. If any of the conditions
// are met, the job is automatically stopped.
StoppingConditions *types.RecommendationJobStoppingConditions
// The metadata that you apply to Amazon Web Services resources to help you
// categorize and organize them. Each tag consists of a key and a value, both of
// which you define. For more information, see Tagging Amazon Web Services
// Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in
// the Amazon Web Services General Reference.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateInferenceRecommendationsJobOutput struct {
// The Amazon Resource Name (ARN) of the recommendation job.
//
// This member is required.
JobArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateInferenceRecommendationsJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateInferenceRecommendationsJob{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateInferenceRecommendationsJob{}, 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 = addOpCreateInferenceRecommendationsJobValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateInferenceRecommendationsJob(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_opCreateInferenceRecommendationsJob(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "CreateInferenceRecommendationsJob",
}
}
| 170 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.