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 sns
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sns import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/query" "github.com/aws/aws-sdk-go-v2/service/sns/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "path" "sort" ) type awsAwsquery_serializeOpAddPermission struct { } func (*awsAwsquery_serializeOpAddPermission) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpAddPermission) 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.(*AddPermissionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("AddPermission") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentAddPermissionInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpCheckIfPhoneNumberIsOptedOut struct { } func (*awsAwsquery_serializeOpCheckIfPhoneNumberIsOptedOut) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpCheckIfPhoneNumberIsOptedOut) 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.(*CheckIfPhoneNumberIsOptedOutInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("CheckIfPhoneNumberIsOptedOut") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentCheckIfPhoneNumberIsOptedOutInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpConfirmSubscription struct { } func (*awsAwsquery_serializeOpConfirmSubscription) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpConfirmSubscription) 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.(*ConfirmSubscriptionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("ConfirmSubscription") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentConfirmSubscriptionInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpCreatePlatformApplication struct { } func (*awsAwsquery_serializeOpCreatePlatformApplication) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpCreatePlatformApplication) 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.(*CreatePlatformApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("CreatePlatformApplication") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentCreatePlatformApplicationInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpCreatePlatformEndpoint struct { } func (*awsAwsquery_serializeOpCreatePlatformEndpoint) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpCreatePlatformEndpoint) 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.(*CreatePlatformEndpointInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("CreatePlatformEndpoint") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentCreatePlatformEndpointInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpCreateSMSSandboxPhoneNumber struct { } func (*awsAwsquery_serializeOpCreateSMSSandboxPhoneNumber) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpCreateSMSSandboxPhoneNumber) 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.(*CreateSMSSandboxPhoneNumberInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("CreateSMSSandboxPhoneNumber") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentCreateSMSSandboxPhoneNumberInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpCreateTopic struct { } func (*awsAwsquery_serializeOpCreateTopic) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpCreateTopic) 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.(*CreateTopicInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("CreateTopic") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentCreateTopicInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpDeleteEndpoint struct { } func (*awsAwsquery_serializeOpDeleteEndpoint) ID() string { return "OperationSerializer" } func (m *awsAwsquery_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)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("DeleteEndpoint") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentDeleteEndpointInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpDeletePlatformApplication struct { } func (*awsAwsquery_serializeOpDeletePlatformApplication) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpDeletePlatformApplication) 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.(*DeletePlatformApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("DeletePlatformApplication") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentDeletePlatformApplicationInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpDeleteSMSSandboxPhoneNumber struct { } func (*awsAwsquery_serializeOpDeleteSMSSandboxPhoneNumber) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpDeleteSMSSandboxPhoneNumber) 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.(*DeleteSMSSandboxPhoneNumberInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("DeleteSMSSandboxPhoneNumber") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentDeleteSMSSandboxPhoneNumberInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpDeleteTopic struct { } func (*awsAwsquery_serializeOpDeleteTopic) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpDeleteTopic) 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.(*DeleteTopicInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("DeleteTopic") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentDeleteTopicInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpGetDataProtectionPolicy struct { } func (*awsAwsquery_serializeOpGetDataProtectionPolicy) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpGetDataProtectionPolicy) 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.(*GetDataProtectionPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("GetDataProtectionPolicy") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentGetDataProtectionPolicyInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpGetEndpointAttributes struct { } func (*awsAwsquery_serializeOpGetEndpointAttributes) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpGetEndpointAttributes) 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.(*GetEndpointAttributesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("GetEndpointAttributes") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentGetEndpointAttributesInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpGetPlatformApplicationAttributes struct { } func (*awsAwsquery_serializeOpGetPlatformApplicationAttributes) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpGetPlatformApplicationAttributes) 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.(*GetPlatformApplicationAttributesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("GetPlatformApplicationAttributes") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentGetPlatformApplicationAttributesInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpGetSMSAttributes struct { } func (*awsAwsquery_serializeOpGetSMSAttributes) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpGetSMSAttributes) 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.(*GetSMSAttributesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("GetSMSAttributes") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentGetSMSAttributesInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpGetSMSSandboxAccountStatus struct { } func (*awsAwsquery_serializeOpGetSMSSandboxAccountStatus) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpGetSMSSandboxAccountStatus) 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.(*GetSMSSandboxAccountStatusInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("GetSMSSandboxAccountStatus") body.Key("Version").String("2010-03-31") err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpGetSubscriptionAttributes struct { } func (*awsAwsquery_serializeOpGetSubscriptionAttributes) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpGetSubscriptionAttributes) 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.(*GetSubscriptionAttributesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("GetSubscriptionAttributes") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentGetSubscriptionAttributesInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpGetTopicAttributes struct { } func (*awsAwsquery_serializeOpGetTopicAttributes) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpGetTopicAttributes) 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.(*GetTopicAttributesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("GetTopicAttributes") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentGetTopicAttributesInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpListEndpointsByPlatformApplication struct { } func (*awsAwsquery_serializeOpListEndpointsByPlatformApplication) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpListEndpointsByPlatformApplication) 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.(*ListEndpointsByPlatformApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("ListEndpointsByPlatformApplication") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentListEndpointsByPlatformApplicationInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpListOriginationNumbers struct { } func (*awsAwsquery_serializeOpListOriginationNumbers) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpListOriginationNumbers) 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.(*ListOriginationNumbersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("ListOriginationNumbers") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentListOriginationNumbersInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpListPhoneNumbersOptedOut struct { } func (*awsAwsquery_serializeOpListPhoneNumbersOptedOut) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpListPhoneNumbersOptedOut) 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.(*ListPhoneNumbersOptedOutInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("ListPhoneNumbersOptedOut") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentListPhoneNumbersOptedOutInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpListPlatformApplications struct { } func (*awsAwsquery_serializeOpListPlatformApplications) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpListPlatformApplications) 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.(*ListPlatformApplicationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("ListPlatformApplications") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentListPlatformApplicationsInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpListSMSSandboxPhoneNumbers struct { } func (*awsAwsquery_serializeOpListSMSSandboxPhoneNumbers) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpListSMSSandboxPhoneNumbers) 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.(*ListSMSSandboxPhoneNumbersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("ListSMSSandboxPhoneNumbers") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentListSMSSandboxPhoneNumbersInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpListSubscriptions struct { } func (*awsAwsquery_serializeOpListSubscriptions) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpListSubscriptions) 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.(*ListSubscriptionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("ListSubscriptions") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentListSubscriptionsInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpListSubscriptionsByTopic struct { } func (*awsAwsquery_serializeOpListSubscriptionsByTopic) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpListSubscriptionsByTopic) 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.(*ListSubscriptionsByTopicInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("ListSubscriptionsByTopic") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentListSubscriptionsByTopicInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpListTagsForResource struct { } func (*awsAwsquery_serializeOpListTagsForResource) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListTagsForResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("ListTagsForResource") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentListTagsForResourceInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpListTopics struct { } func (*awsAwsquery_serializeOpListTopics) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpListTopics) 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.(*ListTopicsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("ListTopics") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentListTopicsInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpOptInPhoneNumber struct { } func (*awsAwsquery_serializeOpOptInPhoneNumber) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpOptInPhoneNumber) 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.(*OptInPhoneNumberInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("OptInPhoneNumber") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentOptInPhoneNumberInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpPublish struct { } func (*awsAwsquery_serializeOpPublish) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpPublish) 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.(*PublishInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("Publish") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentPublishInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpPublishBatch struct { } func (*awsAwsquery_serializeOpPublishBatch) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpPublishBatch) 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.(*PublishBatchInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("PublishBatch") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentPublishBatchInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpPutDataProtectionPolicy struct { } func (*awsAwsquery_serializeOpPutDataProtectionPolicy) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpPutDataProtectionPolicy) 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.(*PutDataProtectionPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("PutDataProtectionPolicy") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentPutDataProtectionPolicyInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpRemovePermission struct { } func (*awsAwsquery_serializeOpRemovePermission) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpRemovePermission) 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.(*RemovePermissionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("RemovePermission") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentRemovePermissionInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpSetEndpointAttributes struct { } func (*awsAwsquery_serializeOpSetEndpointAttributes) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpSetEndpointAttributes) 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.(*SetEndpointAttributesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("SetEndpointAttributes") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentSetEndpointAttributesInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpSetPlatformApplicationAttributes struct { } func (*awsAwsquery_serializeOpSetPlatformApplicationAttributes) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpSetPlatformApplicationAttributes) 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.(*SetPlatformApplicationAttributesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("SetPlatformApplicationAttributes") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentSetPlatformApplicationAttributesInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpSetSMSAttributes struct { } func (*awsAwsquery_serializeOpSetSMSAttributes) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpSetSMSAttributes) 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.(*SetSMSAttributesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("SetSMSAttributes") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentSetSMSAttributesInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpSetSubscriptionAttributes struct { } func (*awsAwsquery_serializeOpSetSubscriptionAttributes) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpSetSubscriptionAttributes) 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.(*SetSubscriptionAttributesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("SetSubscriptionAttributes") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentSetSubscriptionAttributesInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpSetTopicAttributes struct { } func (*awsAwsquery_serializeOpSetTopicAttributes) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpSetTopicAttributes) 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.(*SetTopicAttributesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("SetTopicAttributes") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentSetTopicAttributesInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpSubscribe struct { } func (*awsAwsquery_serializeOpSubscribe) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpSubscribe) 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.(*SubscribeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("Subscribe") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentSubscribeInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpTagResource struct { } func (*awsAwsquery_serializeOpTagResource) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*TagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("TagResource") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentTagResourceInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpUnsubscribe struct { } func (*awsAwsquery_serializeOpUnsubscribe) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpUnsubscribe) 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.(*UnsubscribeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("Unsubscribe") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentUnsubscribeInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpUntagResource struct { } func (*awsAwsquery_serializeOpUntagResource) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UntagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("UntagResource") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentUntagResourceInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpVerifySMSSandboxPhoneNumber struct { } func (*awsAwsquery_serializeOpVerifySMSSandboxPhoneNumber) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpVerifySMSSandboxPhoneNumber) 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.(*VerifySMSSandboxPhoneNumberInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("VerifySMSSandboxPhoneNumber") body.Key("Version").String("2010-03-31") if err := awsAwsquery_serializeOpDocumentVerifySMSSandboxPhoneNumberInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsAwsquery_serializeDocumentActionsList(v []string, value query.Value) error { array := value.Array("member") for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsAwsquery_serializeDocumentDelegatesList(v []string, value query.Value) error { array := value.Array("member") for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsAwsquery_serializeDocumentListString(v []string, value query.Value) error { array := value.Array("member") for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsAwsquery_serializeDocumentMapStringToString(v map[string]string, value query.Value) error { if len(v) == 0 { return nil } object := value.Map("key", "value") keys := make([]string, 0, len(v)) for key := range v { keys = append(keys, key) } sort.Strings(keys) for _, key := range keys { om := object.Key(key) om.String(v[key]) } return nil } func awsAwsquery_serializeDocumentMessageAttributeMap(v map[string]types.MessageAttributeValue, value query.Value) error { if len(v) == 0 { return nil } object := value.Map("Name", "Value") keys := make([]string, 0, len(v)) for key := range v { keys = append(keys, key) } sort.Strings(keys) for _, key := range keys { om := object.Key(key) mapVar := v[key] if err := awsAwsquery_serializeDocumentMessageAttributeValue(&mapVar, om); err != nil { return err } } return nil } func awsAwsquery_serializeDocumentMessageAttributeValue(v *types.MessageAttributeValue, value query.Value) error { object := value.Object() _ = object if v.BinaryValue != nil { objectKey := object.Key("BinaryValue") objectKey.Base64EncodeBytes(v.BinaryValue) } if v.DataType != nil { objectKey := object.Key("DataType") objectKey.String(*v.DataType) } if v.StringValue != nil { objectKey := object.Key("StringValue") objectKey.String(*v.StringValue) } return nil } func awsAwsquery_serializeDocumentPublishBatchRequestEntry(v *types.PublishBatchRequestEntry, value query.Value) error { object := value.Object() _ = object if v.Id != nil { objectKey := object.Key("Id") objectKey.String(*v.Id) } if v.Message != nil { objectKey := object.Key("Message") objectKey.String(*v.Message) } if v.MessageAttributes != nil { objectKey := object.Key("MessageAttributes") if err := awsAwsquery_serializeDocumentMessageAttributeMap(v.MessageAttributes, objectKey); err != nil { return err } } if v.MessageDeduplicationId != nil { objectKey := object.Key("MessageDeduplicationId") objectKey.String(*v.MessageDeduplicationId) } if v.MessageGroupId != nil { objectKey := object.Key("MessageGroupId") objectKey.String(*v.MessageGroupId) } if v.MessageStructure != nil { objectKey := object.Key("MessageStructure") objectKey.String(*v.MessageStructure) } if v.Subject != nil { objectKey := object.Key("Subject") objectKey.String(*v.Subject) } return nil } func awsAwsquery_serializeDocumentPublishBatchRequestEntryList(v []types.PublishBatchRequestEntry, value query.Value) error { array := value.Array("member") for i := range v { av := array.Value() if err := awsAwsquery_serializeDocumentPublishBatchRequestEntry(&v[i], av); err != nil { return err } } return nil } func awsAwsquery_serializeDocumentSubscriptionAttributesMap(v map[string]string, value query.Value) error { if len(v) == 0 { return nil } object := value.Map("key", "value") keys := make([]string, 0, len(v)) for key := range v { keys = append(keys, key) } sort.Strings(keys) for _, key := range keys { om := object.Key(key) om.String(v[key]) } return nil } func awsAwsquery_serializeDocumentTag(v *types.Tag, value query.Value) error { object := value.Object() _ = object if v.Key != nil { objectKey := object.Key("Key") objectKey.String(*v.Key) } if v.Value != nil { objectKey := object.Key("Value") objectKey.String(*v.Value) } return nil } func awsAwsquery_serializeDocumentTagKeyList(v []string, value query.Value) error { array := value.Array("member") for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsAwsquery_serializeDocumentTagList(v []types.Tag, value query.Value) error { array := value.Array("member") for i := range v { av := array.Value() if err := awsAwsquery_serializeDocumentTag(&v[i], av); err != nil { return err } } return nil } func awsAwsquery_serializeDocumentTopicAttributesMap(v map[string]string, value query.Value) error { if len(v) == 0 { return nil } object := value.Map("key", "value") keys := make([]string, 0, len(v)) for key := range v { keys = append(keys, key) } sort.Strings(keys) for _, key := range keys { om := object.Key(key) om.String(v[key]) } return nil } func awsAwsquery_serializeOpDocumentAddPermissionInput(v *AddPermissionInput, value query.Value) error { object := value.Object() _ = object if v.ActionName != nil { objectKey := object.Key("ActionName") if err := awsAwsquery_serializeDocumentActionsList(v.ActionName, objectKey); err != nil { return err } } if v.AWSAccountId != nil { objectKey := object.Key("AWSAccountId") if err := awsAwsquery_serializeDocumentDelegatesList(v.AWSAccountId, objectKey); err != nil { return err } } if v.Label != nil { objectKey := object.Key("Label") objectKey.String(*v.Label) } if v.TopicArn != nil { objectKey := object.Key("TopicArn") objectKey.String(*v.TopicArn) } return nil } func awsAwsquery_serializeOpDocumentCheckIfPhoneNumberIsOptedOutInput(v *CheckIfPhoneNumberIsOptedOutInput, value query.Value) error { object := value.Object() _ = object if v.PhoneNumber != nil { objectKey := object.Key("phoneNumber") objectKey.String(*v.PhoneNumber) } return nil } func awsAwsquery_serializeOpDocumentConfirmSubscriptionInput(v *ConfirmSubscriptionInput, value query.Value) error { object := value.Object() _ = object if v.AuthenticateOnUnsubscribe != nil { objectKey := object.Key("AuthenticateOnUnsubscribe") objectKey.String(*v.AuthenticateOnUnsubscribe) } if v.Token != nil { objectKey := object.Key("Token") objectKey.String(*v.Token) } if v.TopicArn != nil { objectKey := object.Key("TopicArn") objectKey.String(*v.TopicArn) } return nil } func awsAwsquery_serializeOpDocumentCreatePlatformApplicationInput(v *CreatePlatformApplicationInput, value query.Value) error { object := value.Object() _ = object if v.Attributes != nil { objectKey := object.Key("Attributes") if err := awsAwsquery_serializeDocumentMapStringToString(v.Attributes, objectKey); err != nil { return err } } if v.Name != nil { objectKey := object.Key("Name") objectKey.String(*v.Name) } if v.Platform != nil { objectKey := object.Key("Platform") objectKey.String(*v.Platform) } return nil } func awsAwsquery_serializeOpDocumentCreatePlatformEndpointInput(v *CreatePlatformEndpointInput, value query.Value) error { object := value.Object() _ = object if v.Attributes != nil { objectKey := object.Key("Attributes") if err := awsAwsquery_serializeDocumentMapStringToString(v.Attributes, objectKey); err != nil { return err } } if v.CustomUserData != nil { objectKey := object.Key("CustomUserData") objectKey.String(*v.CustomUserData) } if v.PlatformApplicationArn != nil { objectKey := object.Key("PlatformApplicationArn") objectKey.String(*v.PlatformApplicationArn) } if v.Token != nil { objectKey := object.Key("Token") objectKey.String(*v.Token) } return nil } func awsAwsquery_serializeOpDocumentCreateSMSSandboxPhoneNumberInput(v *CreateSMSSandboxPhoneNumberInput, value query.Value) error { object := value.Object() _ = object if len(v.LanguageCode) > 0 { objectKey := object.Key("LanguageCode") objectKey.String(string(v.LanguageCode)) } if v.PhoneNumber != nil { objectKey := object.Key("PhoneNumber") objectKey.String(*v.PhoneNumber) } return nil } func awsAwsquery_serializeOpDocumentCreateTopicInput(v *CreateTopicInput, value query.Value) error { object := value.Object() _ = object if v.Attributes != nil { objectKey := object.Key("Attributes") if err := awsAwsquery_serializeDocumentTopicAttributesMap(v.Attributes, objectKey); err != nil { return err } } if v.DataProtectionPolicy != nil { objectKey := object.Key("DataProtectionPolicy") objectKey.String(*v.DataProtectionPolicy) } if v.Name != nil { objectKey := object.Key("Name") objectKey.String(*v.Name) } if v.Tags != nil { objectKey := object.Key("Tags") if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { return err } } return nil } func awsAwsquery_serializeOpDocumentDeleteEndpointInput(v *DeleteEndpointInput, value query.Value) error { object := value.Object() _ = object if v.EndpointArn != nil { objectKey := object.Key("EndpointArn") objectKey.String(*v.EndpointArn) } return nil } func awsAwsquery_serializeOpDocumentDeletePlatformApplicationInput(v *DeletePlatformApplicationInput, value query.Value) error { object := value.Object() _ = object if v.PlatformApplicationArn != nil { objectKey := object.Key("PlatformApplicationArn") objectKey.String(*v.PlatformApplicationArn) } return nil } func awsAwsquery_serializeOpDocumentDeleteSMSSandboxPhoneNumberInput(v *DeleteSMSSandboxPhoneNumberInput, value query.Value) error { object := value.Object() _ = object if v.PhoneNumber != nil { objectKey := object.Key("PhoneNumber") objectKey.String(*v.PhoneNumber) } return nil } func awsAwsquery_serializeOpDocumentDeleteTopicInput(v *DeleteTopicInput, value query.Value) error { object := value.Object() _ = object if v.TopicArn != nil { objectKey := object.Key("TopicArn") objectKey.String(*v.TopicArn) } return nil } func awsAwsquery_serializeOpDocumentGetDataProtectionPolicyInput(v *GetDataProtectionPolicyInput, value query.Value) error { object := value.Object() _ = object if v.ResourceArn != nil { objectKey := object.Key("ResourceArn") objectKey.String(*v.ResourceArn) } return nil } func awsAwsquery_serializeOpDocumentGetEndpointAttributesInput(v *GetEndpointAttributesInput, value query.Value) error { object := value.Object() _ = object if v.EndpointArn != nil { objectKey := object.Key("EndpointArn") objectKey.String(*v.EndpointArn) } return nil } func awsAwsquery_serializeOpDocumentGetPlatformApplicationAttributesInput(v *GetPlatformApplicationAttributesInput, value query.Value) error { object := value.Object() _ = object if v.PlatformApplicationArn != nil { objectKey := object.Key("PlatformApplicationArn") objectKey.String(*v.PlatformApplicationArn) } return nil } func awsAwsquery_serializeOpDocumentGetSMSAttributesInput(v *GetSMSAttributesInput, value query.Value) error { object := value.Object() _ = object if v.Attributes != nil { objectKey := object.Key("attributes") if err := awsAwsquery_serializeDocumentListString(v.Attributes, objectKey); err != nil { return err } } return nil } func awsAwsquery_serializeOpDocumentGetSMSSandboxAccountStatusInput(v *GetSMSSandboxAccountStatusInput, value query.Value) error { object := value.Object() _ = object return nil } func awsAwsquery_serializeOpDocumentGetSubscriptionAttributesInput(v *GetSubscriptionAttributesInput, value query.Value) error { object := value.Object() _ = object if v.SubscriptionArn != nil { objectKey := object.Key("SubscriptionArn") objectKey.String(*v.SubscriptionArn) } return nil } func awsAwsquery_serializeOpDocumentGetTopicAttributesInput(v *GetTopicAttributesInput, value query.Value) error { object := value.Object() _ = object if v.TopicArn != nil { objectKey := object.Key("TopicArn") objectKey.String(*v.TopicArn) } return nil } func awsAwsquery_serializeOpDocumentListEndpointsByPlatformApplicationInput(v *ListEndpointsByPlatformApplicationInput, value query.Value) error { object := value.Object() _ = object if v.NextToken != nil { objectKey := object.Key("NextToken") objectKey.String(*v.NextToken) } if v.PlatformApplicationArn != nil { objectKey := object.Key("PlatformApplicationArn") objectKey.String(*v.PlatformApplicationArn) } return nil } func awsAwsquery_serializeOpDocumentListOriginationNumbersInput(v *ListOriginationNumbersInput, value query.Value) error { object := value.Object() _ = object if v.MaxResults != nil { objectKey := object.Key("MaxResults") objectKey.Integer(*v.MaxResults) } if v.NextToken != nil { objectKey := object.Key("NextToken") objectKey.String(*v.NextToken) } return nil } func awsAwsquery_serializeOpDocumentListPhoneNumbersOptedOutInput(v *ListPhoneNumbersOptedOutInput, value query.Value) error { object := value.Object() _ = object if v.NextToken != nil { objectKey := object.Key("nextToken") objectKey.String(*v.NextToken) } return nil } func awsAwsquery_serializeOpDocumentListPlatformApplicationsInput(v *ListPlatformApplicationsInput, value query.Value) error { object := value.Object() _ = object if v.NextToken != nil { objectKey := object.Key("NextToken") objectKey.String(*v.NextToken) } return nil } func awsAwsquery_serializeOpDocumentListSMSSandboxPhoneNumbersInput(v *ListSMSSandboxPhoneNumbersInput, value query.Value) error { object := value.Object() _ = object if v.MaxResults != nil { objectKey := object.Key("MaxResults") objectKey.Integer(*v.MaxResults) } if v.NextToken != nil { objectKey := object.Key("NextToken") objectKey.String(*v.NextToken) } return nil } func awsAwsquery_serializeOpDocumentListSubscriptionsByTopicInput(v *ListSubscriptionsByTopicInput, value query.Value) error { object := value.Object() _ = object if v.NextToken != nil { objectKey := object.Key("NextToken") objectKey.String(*v.NextToken) } if v.TopicArn != nil { objectKey := object.Key("TopicArn") objectKey.String(*v.TopicArn) } return nil } func awsAwsquery_serializeOpDocumentListSubscriptionsInput(v *ListSubscriptionsInput, value query.Value) error { object := value.Object() _ = object if v.NextToken != nil { objectKey := object.Key("NextToken") objectKey.String(*v.NextToken) } return nil } func awsAwsquery_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value query.Value) error { object := value.Object() _ = object if v.ResourceArn != nil { objectKey := object.Key("ResourceArn") objectKey.String(*v.ResourceArn) } return nil } func awsAwsquery_serializeOpDocumentListTopicsInput(v *ListTopicsInput, value query.Value) error { object := value.Object() _ = object if v.NextToken != nil { objectKey := object.Key("NextToken") objectKey.String(*v.NextToken) } return nil } func awsAwsquery_serializeOpDocumentOptInPhoneNumberInput(v *OptInPhoneNumberInput, value query.Value) error { object := value.Object() _ = object if v.PhoneNumber != nil { objectKey := object.Key("phoneNumber") objectKey.String(*v.PhoneNumber) } return nil } func awsAwsquery_serializeOpDocumentPublishBatchInput(v *PublishBatchInput, value query.Value) error { object := value.Object() _ = object if v.PublishBatchRequestEntries != nil { objectKey := object.Key("PublishBatchRequestEntries") if err := awsAwsquery_serializeDocumentPublishBatchRequestEntryList(v.PublishBatchRequestEntries, objectKey); err != nil { return err } } if v.TopicArn != nil { objectKey := object.Key("TopicArn") objectKey.String(*v.TopicArn) } return nil } func awsAwsquery_serializeOpDocumentPublishInput(v *PublishInput, value query.Value) error { object := value.Object() _ = object if v.Message != nil { objectKey := object.Key("Message") objectKey.String(*v.Message) } if v.MessageAttributes != nil { objectKey := object.Key("MessageAttributes") if err := awsAwsquery_serializeDocumentMessageAttributeMap(v.MessageAttributes, objectKey); err != nil { return err } } if v.MessageDeduplicationId != nil { objectKey := object.Key("MessageDeduplicationId") objectKey.String(*v.MessageDeduplicationId) } if v.MessageGroupId != nil { objectKey := object.Key("MessageGroupId") objectKey.String(*v.MessageGroupId) } if v.MessageStructure != nil { objectKey := object.Key("MessageStructure") objectKey.String(*v.MessageStructure) } if v.PhoneNumber != nil { objectKey := object.Key("PhoneNumber") objectKey.String(*v.PhoneNumber) } if v.Subject != nil { objectKey := object.Key("Subject") objectKey.String(*v.Subject) } if v.TargetArn != nil { objectKey := object.Key("TargetArn") objectKey.String(*v.TargetArn) } if v.TopicArn != nil { objectKey := object.Key("TopicArn") objectKey.String(*v.TopicArn) } return nil } func awsAwsquery_serializeOpDocumentPutDataProtectionPolicyInput(v *PutDataProtectionPolicyInput, value query.Value) error { object := value.Object() _ = object if v.DataProtectionPolicy != nil { objectKey := object.Key("DataProtectionPolicy") objectKey.String(*v.DataProtectionPolicy) } if v.ResourceArn != nil { objectKey := object.Key("ResourceArn") objectKey.String(*v.ResourceArn) } return nil } func awsAwsquery_serializeOpDocumentRemovePermissionInput(v *RemovePermissionInput, value query.Value) error { object := value.Object() _ = object if v.Label != nil { objectKey := object.Key("Label") objectKey.String(*v.Label) } if v.TopicArn != nil { objectKey := object.Key("TopicArn") objectKey.String(*v.TopicArn) } return nil } func awsAwsquery_serializeOpDocumentSetEndpointAttributesInput(v *SetEndpointAttributesInput, value query.Value) error { object := value.Object() _ = object if v.Attributes != nil { objectKey := object.Key("Attributes") if err := awsAwsquery_serializeDocumentMapStringToString(v.Attributes, objectKey); err != nil { return err } } if v.EndpointArn != nil { objectKey := object.Key("EndpointArn") objectKey.String(*v.EndpointArn) } return nil } func awsAwsquery_serializeOpDocumentSetPlatformApplicationAttributesInput(v *SetPlatformApplicationAttributesInput, value query.Value) error { object := value.Object() _ = object if v.Attributes != nil { objectKey := object.Key("Attributes") if err := awsAwsquery_serializeDocumentMapStringToString(v.Attributes, objectKey); err != nil { return err } } if v.PlatformApplicationArn != nil { objectKey := object.Key("PlatformApplicationArn") objectKey.String(*v.PlatformApplicationArn) } return nil } func awsAwsquery_serializeOpDocumentSetSMSAttributesInput(v *SetSMSAttributesInput, value query.Value) error { object := value.Object() _ = object if v.Attributes != nil { objectKey := object.Key("attributes") if err := awsAwsquery_serializeDocumentMapStringToString(v.Attributes, objectKey); err != nil { return err } } return nil } func awsAwsquery_serializeOpDocumentSetSubscriptionAttributesInput(v *SetSubscriptionAttributesInput, value query.Value) error { object := value.Object() _ = object if v.AttributeName != nil { objectKey := object.Key("AttributeName") objectKey.String(*v.AttributeName) } if v.AttributeValue != nil { objectKey := object.Key("AttributeValue") objectKey.String(*v.AttributeValue) } if v.SubscriptionArn != nil { objectKey := object.Key("SubscriptionArn") objectKey.String(*v.SubscriptionArn) } return nil } func awsAwsquery_serializeOpDocumentSetTopicAttributesInput(v *SetTopicAttributesInput, value query.Value) error { object := value.Object() _ = object if v.AttributeName != nil { objectKey := object.Key("AttributeName") objectKey.String(*v.AttributeName) } if v.AttributeValue != nil { objectKey := object.Key("AttributeValue") objectKey.String(*v.AttributeValue) } if v.TopicArn != nil { objectKey := object.Key("TopicArn") objectKey.String(*v.TopicArn) } return nil } func awsAwsquery_serializeOpDocumentSubscribeInput(v *SubscribeInput, value query.Value) error { object := value.Object() _ = object if v.Attributes != nil { objectKey := object.Key("Attributes") if err := awsAwsquery_serializeDocumentSubscriptionAttributesMap(v.Attributes, objectKey); err != nil { return err } } if v.Endpoint != nil { objectKey := object.Key("Endpoint") objectKey.String(*v.Endpoint) } if v.Protocol != nil { objectKey := object.Key("Protocol") objectKey.String(*v.Protocol) } if v.ReturnSubscriptionArn { objectKey := object.Key("ReturnSubscriptionArn") objectKey.Boolean(v.ReturnSubscriptionArn) } if v.TopicArn != nil { objectKey := object.Key("TopicArn") objectKey.String(*v.TopicArn) } return nil } func awsAwsquery_serializeOpDocumentTagResourceInput(v *TagResourceInput, value query.Value) error { object := value.Object() _ = object if v.ResourceArn != nil { objectKey := object.Key("ResourceArn") objectKey.String(*v.ResourceArn) } if v.Tags != nil { objectKey := object.Key("Tags") if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { return err } } return nil } func awsAwsquery_serializeOpDocumentUnsubscribeInput(v *UnsubscribeInput, value query.Value) error { object := value.Object() _ = object if v.SubscriptionArn != nil { objectKey := object.Key("SubscriptionArn") objectKey.String(*v.SubscriptionArn) } return nil } func awsAwsquery_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value query.Value) error { object := value.Object() _ = object if v.ResourceArn != nil { objectKey := object.Key("ResourceArn") objectKey.String(*v.ResourceArn) } if v.TagKeys != nil { objectKey := object.Key("TagKeys") if err := awsAwsquery_serializeDocumentTagKeyList(v.TagKeys, objectKey); err != nil { return err } } return nil } func awsAwsquery_serializeOpDocumentVerifySMSSandboxPhoneNumberInput(v *VerifySMSSandboxPhoneNumberInput, value query.Value) error { object := value.Object() _ = object if v.OneTimePassword != nil { objectKey := object.Key("OneTimePassword") objectKey.String(*v.OneTimePassword) } if v.PhoneNumber != nil { objectKey := object.Key("PhoneNumber") objectKey.String(*v.PhoneNumber) } return nil }
3,666
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sns import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/sns/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpAddPermission struct { } func (*validateOpAddPermission) ID() string { return "OperationInputValidation" } func (m *validateOpAddPermission) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AddPermissionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAddPermissionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCheckIfPhoneNumberIsOptedOut struct { } func (*validateOpCheckIfPhoneNumberIsOptedOut) ID() string { return "OperationInputValidation" } func (m *validateOpCheckIfPhoneNumberIsOptedOut) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CheckIfPhoneNumberIsOptedOutInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCheckIfPhoneNumberIsOptedOutInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpConfirmSubscription struct { } func (*validateOpConfirmSubscription) ID() string { return "OperationInputValidation" } func (m *validateOpConfirmSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ConfirmSubscriptionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpConfirmSubscriptionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreatePlatformApplication struct { } func (*validateOpCreatePlatformApplication) ID() string { return "OperationInputValidation" } func (m *validateOpCreatePlatformApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreatePlatformApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreatePlatformApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreatePlatformEndpoint struct { } func (*validateOpCreatePlatformEndpoint) ID() string { return "OperationInputValidation" } func (m *validateOpCreatePlatformEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreatePlatformEndpointInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreatePlatformEndpointInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateSMSSandboxPhoneNumber struct { } func (*validateOpCreateSMSSandboxPhoneNumber) ID() string { return "OperationInputValidation" } func (m *validateOpCreateSMSSandboxPhoneNumber) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateSMSSandboxPhoneNumberInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateSMSSandboxPhoneNumberInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateTopic struct { } func (*validateOpCreateTopic) ID() string { return "OperationInputValidation" } func (m *validateOpCreateTopic) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateTopicInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateTopicInput(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 validateOpDeletePlatformApplication struct { } func (*validateOpDeletePlatformApplication) ID() string { return "OperationInputValidation" } func (m *validateOpDeletePlatformApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeletePlatformApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeletePlatformApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteSMSSandboxPhoneNumber struct { } func (*validateOpDeleteSMSSandboxPhoneNumber) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteSMSSandboxPhoneNumber) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteSMSSandboxPhoneNumberInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteSMSSandboxPhoneNumberInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteTopic struct { } func (*validateOpDeleteTopic) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteTopic) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteTopicInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteTopicInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetDataProtectionPolicy struct { } func (*validateOpGetDataProtectionPolicy) ID() string { return "OperationInputValidation" } func (m *validateOpGetDataProtectionPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetDataProtectionPolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetDataProtectionPolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetEndpointAttributes struct { } func (*validateOpGetEndpointAttributes) ID() string { return "OperationInputValidation" } func (m *validateOpGetEndpointAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetEndpointAttributesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetEndpointAttributesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetPlatformApplicationAttributes struct { } func (*validateOpGetPlatformApplicationAttributes) ID() string { return "OperationInputValidation" } func (m *validateOpGetPlatformApplicationAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetPlatformApplicationAttributesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetPlatformApplicationAttributesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetSubscriptionAttributes struct { } func (*validateOpGetSubscriptionAttributes) ID() string { return "OperationInputValidation" } func (m *validateOpGetSubscriptionAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetSubscriptionAttributesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetSubscriptionAttributesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetTopicAttributes struct { } func (*validateOpGetTopicAttributes) ID() string { return "OperationInputValidation" } func (m *validateOpGetTopicAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetTopicAttributesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetTopicAttributesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListEndpointsByPlatformApplication struct { } func (*validateOpListEndpointsByPlatformApplication) ID() string { return "OperationInputValidation" } func (m *validateOpListEndpointsByPlatformApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListEndpointsByPlatformApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListEndpointsByPlatformApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListSubscriptionsByTopic struct { } func (*validateOpListSubscriptionsByTopic) ID() string { return "OperationInputValidation" } func (m *validateOpListSubscriptionsByTopic) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListSubscriptionsByTopicInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListSubscriptionsByTopicInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListTagsForResource struct { } func (*validateOpListTagsForResource) ID() string { return "OperationInputValidation" } func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListTagsForResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListTagsForResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpOptInPhoneNumber struct { } func (*validateOpOptInPhoneNumber) ID() string { return "OperationInputValidation" } func (m *validateOpOptInPhoneNumber) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*OptInPhoneNumberInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpOptInPhoneNumberInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpPublishBatch struct { } func (*validateOpPublishBatch) ID() string { return "OperationInputValidation" } func (m *validateOpPublishBatch) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PublishBatchInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPublishBatchInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpPublish struct { } func (*validateOpPublish) ID() string { return "OperationInputValidation" } func (m *validateOpPublish) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PublishInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPublishInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpPutDataProtectionPolicy struct { } func (*validateOpPutDataProtectionPolicy) ID() string { return "OperationInputValidation" } func (m *validateOpPutDataProtectionPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PutDataProtectionPolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPutDataProtectionPolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRemovePermission struct { } func (*validateOpRemovePermission) ID() string { return "OperationInputValidation" } func (m *validateOpRemovePermission) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RemovePermissionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRemovePermissionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpSetEndpointAttributes struct { } func (*validateOpSetEndpointAttributes) ID() string { return "OperationInputValidation" } func (m *validateOpSetEndpointAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*SetEndpointAttributesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpSetEndpointAttributesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpSetPlatformApplicationAttributes struct { } func (*validateOpSetPlatformApplicationAttributes) ID() string { return "OperationInputValidation" } func (m *validateOpSetPlatformApplicationAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*SetPlatformApplicationAttributesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpSetPlatformApplicationAttributesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpSetSMSAttributes struct { } func (*validateOpSetSMSAttributes) ID() string { return "OperationInputValidation" } func (m *validateOpSetSMSAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*SetSMSAttributesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpSetSMSAttributesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpSetSubscriptionAttributes struct { } func (*validateOpSetSubscriptionAttributes) ID() string { return "OperationInputValidation" } func (m *validateOpSetSubscriptionAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*SetSubscriptionAttributesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpSetSubscriptionAttributesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpSetTopicAttributes struct { } func (*validateOpSetTopicAttributes) ID() string { return "OperationInputValidation" } func (m *validateOpSetTopicAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*SetTopicAttributesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpSetTopicAttributesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpSubscribe struct { } func (*validateOpSubscribe) ID() string { return "OperationInputValidation" } func (m *validateOpSubscribe) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*SubscribeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpSubscribeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpTagResource struct { } func (*validateOpTagResource) ID() string { return "OperationInputValidation" } func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUnsubscribe struct { } func (*validateOpUnsubscribe) ID() string { return "OperationInputValidation" } func (m *validateOpUnsubscribe) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UnsubscribeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUnsubscribeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUntagResource struct { } func (*validateOpUntagResource) ID() string { return "OperationInputValidation" } func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UntagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUntagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpVerifySMSSandboxPhoneNumber struct { } func (*validateOpVerifySMSSandboxPhoneNumber) ID() string { return "OperationInputValidation" } func (m *validateOpVerifySMSSandboxPhoneNumber) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*VerifySMSSandboxPhoneNumberInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpVerifySMSSandboxPhoneNumberInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpAddPermissionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAddPermission{}, middleware.After) } func addOpCheckIfPhoneNumberIsOptedOutValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCheckIfPhoneNumberIsOptedOut{}, middleware.After) } func addOpConfirmSubscriptionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpConfirmSubscription{}, middleware.After) } func addOpCreatePlatformApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreatePlatformApplication{}, middleware.After) } func addOpCreatePlatformEndpointValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreatePlatformEndpoint{}, middleware.After) } func addOpCreateSMSSandboxPhoneNumberValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateSMSSandboxPhoneNumber{}, middleware.After) } func addOpCreateTopicValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateTopic{}, middleware.After) } func addOpDeleteEndpointValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteEndpoint{}, middleware.After) } func addOpDeletePlatformApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeletePlatformApplication{}, middleware.After) } func addOpDeleteSMSSandboxPhoneNumberValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteSMSSandboxPhoneNumber{}, middleware.After) } func addOpDeleteTopicValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteTopic{}, middleware.After) } func addOpGetDataProtectionPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDataProtectionPolicy{}, middleware.After) } func addOpGetEndpointAttributesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetEndpointAttributes{}, middleware.After) } func addOpGetPlatformApplicationAttributesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetPlatformApplicationAttributes{}, middleware.After) } func addOpGetSubscriptionAttributesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetSubscriptionAttributes{}, middleware.After) } func addOpGetTopicAttributesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetTopicAttributes{}, middleware.After) } func addOpListEndpointsByPlatformApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListEndpointsByPlatformApplication{}, middleware.After) } func addOpListSubscriptionsByTopicValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListSubscriptionsByTopic{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } func addOpOptInPhoneNumberValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpOptInPhoneNumber{}, middleware.After) } func addOpPublishBatchValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPublishBatch{}, middleware.After) } func addOpPublishValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPublish{}, middleware.After) } func addOpPutDataProtectionPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutDataProtectionPolicy{}, middleware.After) } func addOpRemovePermissionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRemovePermission{}, middleware.After) } func addOpSetEndpointAttributesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSetEndpointAttributes{}, middleware.After) } func addOpSetPlatformApplicationAttributesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSetPlatformApplicationAttributes{}, middleware.After) } func addOpSetSMSAttributesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSetSMSAttributes{}, middleware.After) } func addOpSetSubscriptionAttributesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSetSubscriptionAttributes{}, middleware.After) } func addOpSetTopicAttributesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSetTopicAttributes{}, middleware.After) } func addOpSubscribeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSubscribe{}, middleware.After) } func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } func addOpUnsubscribeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUnsubscribe{}, middleware.After) } func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } func addOpVerifySMSSandboxPhoneNumberValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpVerifySMSSandboxPhoneNumber{}, middleware.After) } func validateMessageAttributeMap(v map[string]types.MessageAttributeValue) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "MessageAttributeMap"} for key := range v { value := v[key] if err := validateMessageAttributeValue(&value); err != nil { invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateMessageAttributeValue(v *types.MessageAttributeValue) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "MessageAttributeValue"} if v.DataType == nil { invalidParams.Add(smithy.NewErrParamRequired("DataType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validatePublishBatchRequestEntry(v *types.PublishBatchRequestEntry) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PublishBatchRequestEntry"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if v.Message == nil { invalidParams.Add(smithy.NewErrParamRequired("Message")) } if v.MessageAttributes != nil { if err := validateMessageAttributeMap(v.MessageAttributes); err != nil { invalidParams.AddNested("MessageAttributes", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validatePublishBatchRequestEntryList(v []types.PublishBatchRequestEntry) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PublishBatchRequestEntryList"} for i := range v { if err := validatePublishBatchRequestEntry(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTag(v *types.Tag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Tag"} if v.Key == nil { invalidParams.Add(smithy.NewErrParamRequired("Key")) } if v.Value == nil { invalidParams.Add(smithy.NewErrParamRequired("Value")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTagList(v []types.Tag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagList"} for i := range v { if err := validateTag(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAddPermissionInput(v *AddPermissionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AddPermissionInput"} if v.TopicArn == nil { invalidParams.Add(smithy.NewErrParamRequired("TopicArn")) } if v.Label == nil { invalidParams.Add(smithy.NewErrParamRequired("Label")) } if v.AWSAccountId == nil { invalidParams.Add(smithy.NewErrParamRequired("AWSAccountId")) } if v.ActionName == nil { invalidParams.Add(smithy.NewErrParamRequired("ActionName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCheckIfPhoneNumberIsOptedOutInput(v *CheckIfPhoneNumberIsOptedOutInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CheckIfPhoneNumberIsOptedOutInput"} if v.PhoneNumber == nil { invalidParams.Add(smithy.NewErrParamRequired("PhoneNumber")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpConfirmSubscriptionInput(v *ConfirmSubscriptionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ConfirmSubscriptionInput"} if v.TopicArn == nil { invalidParams.Add(smithy.NewErrParamRequired("TopicArn")) } if v.Token == nil { invalidParams.Add(smithy.NewErrParamRequired("Token")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreatePlatformApplicationInput(v *CreatePlatformApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreatePlatformApplicationInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Platform == nil { invalidParams.Add(smithy.NewErrParamRequired("Platform")) } if v.Attributes == nil { invalidParams.Add(smithy.NewErrParamRequired("Attributes")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreatePlatformEndpointInput(v *CreatePlatformEndpointInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreatePlatformEndpointInput"} if v.PlatformApplicationArn == nil { invalidParams.Add(smithy.NewErrParamRequired("PlatformApplicationArn")) } if v.Token == nil { invalidParams.Add(smithy.NewErrParamRequired("Token")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateSMSSandboxPhoneNumberInput(v *CreateSMSSandboxPhoneNumberInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateSMSSandboxPhoneNumberInput"} if v.PhoneNumber == nil { invalidParams.Add(smithy.NewErrParamRequired("PhoneNumber")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateTopicInput(v *CreateTopicInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateTopicInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Tags != nil { if err := validateTagList(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } 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.EndpointArn == nil { invalidParams.Add(smithy.NewErrParamRequired("EndpointArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeletePlatformApplicationInput(v *DeletePlatformApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeletePlatformApplicationInput"} if v.PlatformApplicationArn == nil { invalidParams.Add(smithy.NewErrParamRequired("PlatformApplicationArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteSMSSandboxPhoneNumberInput(v *DeleteSMSSandboxPhoneNumberInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteSMSSandboxPhoneNumberInput"} if v.PhoneNumber == nil { invalidParams.Add(smithy.NewErrParamRequired("PhoneNumber")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteTopicInput(v *DeleteTopicInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteTopicInput"} if v.TopicArn == nil { invalidParams.Add(smithy.NewErrParamRequired("TopicArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetDataProtectionPolicyInput(v *GetDataProtectionPolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetDataProtectionPolicyInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetEndpointAttributesInput(v *GetEndpointAttributesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetEndpointAttributesInput"} if v.EndpointArn == nil { invalidParams.Add(smithy.NewErrParamRequired("EndpointArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetPlatformApplicationAttributesInput(v *GetPlatformApplicationAttributesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetPlatformApplicationAttributesInput"} if v.PlatformApplicationArn == nil { invalidParams.Add(smithy.NewErrParamRequired("PlatformApplicationArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetSubscriptionAttributesInput(v *GetSubscriptionAttributesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetSubscriptionAttributesInput"} if v.SubscriptionArn == nil { invalidParams.Add(smithy.NewErrParamRequired("SubscriptionArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetTopicAttributesInput(v *GetTopicAttributesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetTopicAttributesInput"} if v.TopicArn == nil { invalidParams.Add(smithy.NewErrParamRequired("TopicArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListEndpointsByPlatformApplicationInput(v *ListEndpointsByPlatformApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListEndpointsByPlatformApplicationInput"} if v.PlatformApplicationArn == nil { invalidParams.Add(smithy.NewErrParamRequired("PlatformApplicationArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListSubscriptionsByTopicInput(v *ListSubscriptionsByTopicInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListSubscriptionsByTopicInput"} if v.TopicArn == nil { invalidParams.Add(smithy.NewErrParamRequired("TopicArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpOptInPhoneNumberInput(v *OptInPhoneNumberInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "OptInPhoneNumberInput"} if v.PhoneNumber == nil { invalidParams.Add(smithy.NewErrParamRequired("PhoneNumber")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpPublishBatchInput(v *PublishBatchInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PublishBatchInput"} if v.TopicArn == nil { invalidParams.Add(smithy.NewErrParamRequired("TopicArn")) } if v.PublishBatchRequestEntries == nil { invalidParams.Add(smithy.NewErrParamRequired("PublishBatchRequestEntries")) } else if v.PublishBatchRequestEntries != nil { if err := validatePublishBatchRequestEntryList(v.PublishBatchRequestEntries); err != nil { invalidParams.AddNested("PublishBatchRequestEntries", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpPublishInput(v *PublishInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PublishInput"} if v.Message == nil { invalidParams.Add(smithy.NewErrParamRequired("Message")) } if v.MessageAttributes != nil { if err := validateMessageAttributeMap(v.MessageAttributes); err != nil { invalidParams.AddNested("MessageAttributes", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpPutDataProtectionPolicyInput(v *PutDataProtectionPolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PutDataProtectionPolicyInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.DataProtectionPolicy == nil { invalidParams.Add(smithy.NewErrParamRequired("DataProtectionPolicy")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRemovePermissionInput(v *RemovePermissionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RemovePermissionInput"} if v.TopicArn == nil { invalidParams.Add(smithy.NewErrParamRequired("TopicArn")) } if v.Label == nil { invalidParams.Add(smithy.NewErrParamRequired("Label")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpSetEndpointAttributesInput(v *SetEndpointAttributesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SetEndpointAttributesInput"} if v.EndpointArn == nil { invalidParams.Add(smithy.NewErrParamRequired("EndpointArn")) } if v.Attributes == nil { invalidParams.Add(smithy.NewErrParamRequired("Attributes")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpSetPlatformApplicationAttributesInput(v *SetPlatformApplicationAttributesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SetPlatformApplicationAttributesInput"} if v.PlatformApplicationArn == nil { invalidParams.Add(smithy.NewErrParamRequired("PlatformApplicationArn")) } if v.Attributes == nil { invalidParams.Add(smithy.NewErrParamRequired("Attributes")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpSetSMSAttributesInput(v *SetSMSAttributesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SetSMSAttributesInput"} if v.Attributes == nil { invalidParams.Add(smithy.NewErrParamRequired("Attributes")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpSetSubscriptionAttributesInput(v *SetSubscriptionAttributesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SetSubscriptionAttributesInput"} if v.SubscriptionArn == nil { invalidParams.Add(smithy.NewErrParamRequired("SubscriptionArn")) } if v.AttributeName == nil { invalidParams.Add(smithy.NewErrParamRequired("AttributeName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpSetTopicAttributesInput(v *SetTopicAttributesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SetTopicAttributesInput"} if v.TopicArn == nil { invalidParams.Add(smithy.NewErrParamRequired("TopicArn")) } if v.AttributeName == nil { invalidParams.Add(smithy.NewErrParamRequired("AttributeName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpSubscribeInput(v *SubscribeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SubscribeInput"} if v.TopicArn == nil { invalidParams.Add(smithy.NewErrParamRequired("TopicArn")) } if v.Protocol == nil { invalidParams.Add(smithy.NewErrParamRequired("Protocol")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.Tags == nil { invalidParams.Add(smithy.NewErrParamRequired("Tags")) } else if v.Tags != nil { if err := validateTagList(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUnsubscribeInput(v *UnsubscribeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UnsubscribeInput"} if v.SubscriptionArn == nil { invalidParams.Add(smithy.NewErrParamRequired("SubscriptionArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUntagResourceInput(v *UntagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.TagKeys == nil { invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpVerifySMSSandboxPhoneNumberInput(v *VerifySMSSandboxPhoneNumberInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "VerifySMSSandboxPhoneNumberInput"} if v.PhoneNumber == nil { invalidParams.Add(smithy.NewErrParamRequired("PhoneNumber")) } if v.OneTimePassword == nil { invalidParams.Add(smithy.NewErrParamRequired("OneTimePassword")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
1,518
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 SNS 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: "sns.{region}.api.aws", Protocols: []string{"http", "https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "sns-fips.{region}.amazonaws.com", Protocols: []string{"http", "https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "sns-fips.{region}.api.aws", Protocols: []string{"http", "https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sns.{region}.amazonaws.com", Protocols: []string{"http", "https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "af-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-4", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-south-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "fips-us-east-1", }: endpoints.Endpoint{ Hostname: "sns-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: "sns-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: "sns-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: "sns-fips.us-west-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-2", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "me-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "sa-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", Variant: endpoints.FIPSVariant, }: { Hostname: "sns-fips.us-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", Variant: endpoints.FIPSVariant, }: { Hostname: "sns-fips.us-east-2.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "sns-fips.us-west-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", Variant: endpoints.FIPSVariant, }: { Hostname: "sns-fips.us-west-2.amazonaws.com", }, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "sns.{region}.api.amazonwebservices.com.cn", Protocols: []string{"http", "https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "sns-fips.{region}.amazonaws.com.cn", Protocols: []string{"http", "https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "sns-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"http", "https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sns.{region}.amazonaws.com.cn", Protocols: []string{"http", "https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "cn-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "cn-northwest-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-iso", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "sns-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sns.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "us-iso-east-1", }: endpoints.Endpoint{ Protocols: []string{"http", "https"}, }, endpoints.EndpointKey{ Region: "us-iso-west-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-iso-b", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "sns-fips.{region}.sc2s.sgov.gov", Protocols: []string{"http", "https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sns.{region}.sc2s.sgov.gov", Protocols: []string{"http", "https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "us-isob-east-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-iso-e", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "sns-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sns.{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: "sns-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sns.{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: "sns.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "sns-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "sns-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sns.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "fips-us-gov-east-1", }: endpoints.Endpoint{ Hostname: "sns.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: "sns.us-gov-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-west-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "us-gov-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-gov-east-1", Variant: endpoints.FIPSVariant, }: { Hostname: "sns.us-gov-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{ Protocols: []string{"https"}, }, endpoints.EndpointKey{ Region: "us-gov-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "sns.us-gov-west-1.amazonaws.com", Protocols: []string{"https"}, }, }, }, }
504
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 LanguageCodeString string // Enum values for LanguageCodeString const ( LanguageCodeStringEnUs LanguageCodeString = "en-US" LanguageCodeStringEnGb LanguageCodeString = "en-GB" LanguageCodeStringEs419 LanguageCodeString = "es-419" LanguageCodeStringEsEs LanguageCodeString = "es-ES" LanguageCodeStringDeDe LanguageCodeString = "de-DE" LanguageCodeStringFrCa LanguageCodeString = "fr-CA" LanguageCodeStringFrFr LanguageCodeString = "fr-FR" LanguageCodeStringItIt LanguageCodeString = "it-IT" LanguageCodeStringJpJp LanguageCodeString = "ja-JP" LanguageCodeStringPtBr LanguageCodeString = "pt-BR" LanguageCodeStringKrKr LanguageCodeString = "kr-KR" LanguageCodeStringZhCn LanguageCodeString = "zh-CN" LanguageCodeStringZhTw LanguageCodeString = "zh-TW" ) // Values returns all known values for LanguageCodeString. 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 (LanguageCodeString) Values() []LanguageCodeString { return []LanguageCodeString{ "en-US", "en-GB", "es-419", "es-ES", "de-DE", "fr-CA", "fr-FR", "it-IT", "ja-JP", "pt-BR", "kr-KR", "zh-CN", "zh-TW", } } type NumberCapability string // Enum values for NumberCapability const ( NumberCapabilitySms NumberCapability = "SMS" NumberCapabilityMms NumberCapability = "MMS" NumberCapabilityVoice NumberCapability = "VOICE" ) // Values returns all known values for NumberCapability. 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 (NumberCapability) Values() []NumberCapability { return []NumberCapability{ "SMS", "MMS", "VOICE", } } type RouteType string // Enum values for RouteType const ( RouteTypeTransactional RouteType = "Transactional" RouteTypePromotional RouteType = "Promotional" RouteTypePremium RouteType = "Premium" ) // Values returns all known values for RouteType. 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 (RouteType) Values() []RouteType { return []RouteType{ "Transactional", "Promotional", "Premium", } } type SMSSandboxPhoneNumberVerificationStatus string // Enum values for SMSSandboxPhoneNumberVerificationStatus const ( SMSSandboxPhoneNumberVerificationStatusPending SMSSandboxPhoneNumberVerificationStatus = "Pending" SMSSandboxPhoneNumberVerificationStatusVerified SMSSandboxPhoneNumberVerificationStatus = "Verified" ) // Values returns all known values for SMSSandboxPhoneNumberVerificationStatus. // 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 (SMSSandboxPhoneNumberVerificationStatus) Values() []SMSSandboxPhoneNumberVerificationStatus { return []SMSSandboxPhoneNumberVerificationStatus{ "Pending", "Verified", } }
103
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" ) // Indicates that the user has been denied access to the requested resource. type AuthorizationErrorException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AuthorizationErrorException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AuthorizationErrorException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AuthorizationErrorException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AuthorizationError" } return *e.ErrorCodeOverride } func (e *AuthorizationErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Two or more batch entries in the request have the same Id . type BatchEntryIdsNotDistinctException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *BatchEntryIdsNotDistinctException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *BatchEntryIdsNotDistinctException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *BatchEntryIdsNotDistinctException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "BatchEntryIdsNotDistinct" } return *e.ErrorCodeOverride } func (e *BatchEntryIdsNotDistinctException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The length of all the batch messages put together is more than the limit. type BatchRequestTooLongException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *BatchRequestTooLongException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *BatchRequestTooLongException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *BatchRequestTooLongException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "BatchRequestTooLong" } return *e.ErrorCodeOverride } func (e *BatchRequestTooLongException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Can't perform multiple operations on a tag simultaneously. Perform the // operations sequentially. type ConcurrentAccessException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ConcurrentAccessException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ConcurrentAccessException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ConcurrentAccessException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ConcurrentAccess" } return *e.ErrorCodeOverride } func (e *ConcurrentAccessException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The batch request doesn't contain any entries. type EmptyBatchRequestException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *EmptyBatchRequestException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *EmptyBatchRequestException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *EmptyBatchRequestException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "EmptyBatchRequest" } return *e.ErrorCodeOverride } func (e *EmptyBatchRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Exception error indicating endpoint disabled. type EndpointDisabledException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *EndpointDisabledException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *EndpointDisabledException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *EndpointDisabledException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "EndpointDisabled" } return *e.ErrorCodeOverride } func (e *EndpointDisabledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Indicates that the number of filter polices in your Amazon Web Services account // exceeds the limit. To add more filter polices, submit an Amazon SNS Limit // Increase case in the Amazon Web Services Support Center. type FilterPolicyLimitExceededException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *FilterPolicyLimitExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *FilterPolicyLimitExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *FilterPolicyLimitExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "FilterPolicyLimitExceeded" } return *e.ErrorCodeOverride } func (e *FilterPolicyLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Indicates an internal service error. type InternalErrorException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InternalErrorException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalErrorException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalErrorException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalError" } return *e.ErrorCodeOverride } func (e *InternalErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // The Id of a batch entry in a batch request doesn't abide by the specification. type InvalidBatchEntryIdException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidBatchEntryIdException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidBatchEntryIdException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidBatchEntryIdException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidBatchEntryId" } return *e.ErrorCodeOverride } func (e *InvalidBatchEntryIdException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Indicates that a request parameter does not comply with the associated // constraints. type InvalidParameterException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidParameterException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidParameterException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidParameterException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidParameter" } return *e.ErrorCodeOverride } func (e *InvalidParameterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Indicates that a request parameter does not comply with the associated // constraints. type InvalidParameterValueException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidParameterValueException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidParameterValueException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidParameterValueException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ParameterValueInvalid" } return *e.ErrorCodeOverride } func (e *InvalidParameterValueException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The credential signature isn't valid. You must use an HTTPS endpoint and sign // your request using Signature Version 4. type InvalidSecurityException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidSecurityException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidSecurityException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidSecurityException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidSecurity" } return *e.ErrorCodeOverride } func (e *InvalidSecurityException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The ciphertext references a key that doesn't exist or that you don't have // access to. type KMSAccessDeniedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *KMSAccessDeniedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *KMSAccessDeniedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *KMSAccessDeniedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "KMSAccessDenied" } return *e.ErrorCodeOverride } func (e *KMSAccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request was rejected because the specified customer master key (CMK) isn't // enabled. type KMSDisabledException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *KMSDisabledException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *KMSDisabledException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *KMSDisabledException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "KMSDisabled" } return *e.ErrorCodeOverride } func (e *KMSDisabledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request was rejected because the state of the specified resource isn't // valid for this request. For more information, see How Key State Affects Use of // a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the Key Management Service Developer Guide. type KMSInvalidStateException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *KMSInvalidStateException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *KMSInvalidStateException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *KMSInvalidStateException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "KMSInvalidState" } return *e.ErrorCodeOverride } func (e *KMSInvalidStateException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request was rejected because the specified entity or resource can't be // found. type KMSNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *KMSNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *KMSNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *KMSNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "KMSNotFound" } return *e.ErrorCodeOverride } func (e *KMSNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The Amazon Web Services access key ID needs a subscription for the service. type KMSOptInRequired struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *KMSOptInRequired) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *KMSOptInRequired) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *KMSOptInRequired) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "KMSOptInRequired" } return *e.ErrorCodeOverride } func (e *KMSOptInRequired) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request was denied due to request throttling. For more information about // throttling, see Limits (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html#requests-per-second) // in the Key Management Service Developer Guide. type KMSThrottlingException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *KMSThrottlingException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *KMSThrottlingException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *KMSThrottlingException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "KMSThrottling" } return *e.ErrorCodeOverride } func (e *KMSThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Indicates that the requested resource does not exist. 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 "NotFound" } return *e.ErrorCodeOverride } func (e *NotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Indicates that the specified phone number opted out of receiving SMS messages // from your Amazon Web Services account. You can't send SMS messages to phone // numbers that opt out. type OptedOutException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *OptedOutException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *OptedOutException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *OptedOutException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "OptedOut" } return *e.ErrorCodeOverride } func (e *OptedOutException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Exception error indicating platform application disabled. type PlatformApplicationDisabledException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *PlatformApplicationDisabledException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *PlatformApplicationDisabledException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *PlatformApplicationDisabledException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "PlatformApplicationDisabled" } return *e.ErrorCodeOverride } func (e *PlatformApplicationDisabledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Can’t perform the action on the specified resource. Make sure that the resource // exists. 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 "ResourceNotFound" } return *e.ErrorCodeOverride } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // A tag has been added to a resource with the same ARN as a deleted resource. // Wait a short while and then retry the operation. type StaleTagException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *StaleTagException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *StaleTagException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *StaleTagException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "StaleTag" } return *e.ErrorCodeOverride } func (e *StaleTagException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Indicates that the customer already owns the maximum allowed number of // subscriptions. type SubscriptionLimitExceededException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *SubscriptionLimitExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *SubscriptionLimitExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *SubscriptionLimitExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "SubscriptionLimitExceeded" } return *e.ErrorCodeOverride } func (e *SubscriptionLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Can't add more than 50 tags to a topic. type TagLimitExceededException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *TagLimitExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TagLimitExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TagLimitExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "TagLimitExceeded" } return *e.ErrorCodeOverride } func (e *TagLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request doesn't comply with the IAM tag policy. Correct your request and // then retry it. type TagPolicyException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *TagPolicyException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TagPolicyException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TagPolicyException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "TagPolicy" } return *e.ErrorCodeOverride } func (e *TagPolicyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Indicates that the rate at which requests have been submitted for this action // exceeds the limit for your Amazon Web Services account. type ThrottledException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ThrottledException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ThrottledException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ThrottledException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "Throttled" } return *e.ErrorCodeOverride } func (e *ThrottledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The batch request contains more entries than permissible. type TooManyEntriesInBatchRequestException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *TooManyEntriesInBatchRequestException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TooManyEntriesInBatchRequestException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TooManyEntriesInBatchRequestException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "TooManyEntriesInBatchRequest" } return *e.ErrorCodeOverride } func (e *TooManyEntriesInBatchRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Indicates that the customer already owns the maximum allowed number of topics. type TopicLimitExceededException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *TopicLimitExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TopicLimitExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TopicLimitExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "TopicLimitExceeded" } return *e.ErrorCodeOverride } func (e *TopicLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Indicates that a request parameter does not comply with the associated // constraints. type UserErrorException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *UserErrorException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *UserErrorException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *UserErrorException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "UserError" } return *e.ErrorCodeOverride } func (e *UserErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Indicates that a parameter in the request is invalid. 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 } // Indicates that the one-time password (OTP) used for verification is invalid. type VerificationException struct { Message *string ErrorCodeOverride *string Status *string noSmithyDocumentSerde } func (e *VerificationException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *VerificationException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *VerificationException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "VerificationException" } return *e.ErrorCodeOverride } func (e *VerificationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
873
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" ) // Gives a detailed description of failed messages in the batch. type BatchResultErrorEntry struct { // An error code representing why the action failed on this entry. // // This member is required. Code *string // The Id of an entry in a batch request // // This member is required. Id *string // Specifies whether the error happened due to the caller of the batch API action. // // This member is required. SenderFault bool // A message explaining why the action failed on this entry. Message *string noSmithyDocumentSerde } // The endpoint for mobile app and device. type Endpoint struct { // Attributes for endpoint. Attributes map[string]string // The EndpointArn for mobile app and device. EndpointArn *string noSmithyDocumentSerde } // The user-specified message attribute value. For string data types, the value // attribute has the same restrictions on the content as the message body. For more // information, see Publish (https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) // . Name, type, and value must not be empty or null. In addition, the message body // should not be empty or null. All parts of the message attribute, including name, // type, and value, are included in the message size restriction, which is // currently 256 KB (262,144 bytes). For more information, see Amazon SNS message // attributes (https://docs.aws.amazon.com/sns/latest/dg/SNSMessageAttributes.html) // and Publishing to a mobile phone (https://docs.aws.amazon.com/sns/latest/dg/sms_publish-to-phone.html) // in the Amazon SNS Developer Guide. type MessageAttributeValue struct { // Amazon SNS supports the following logical data types: String, String.Array, // Number, and Binary. For more information, see Message Attribute Data Types (https://docs.aws.amazon.com/sns/latest/dg/SNSMessageAttributes.html#SNSMessageAttributes.DataTypes) // . // // This member is required. DataType *string // Binary type attributes can store any binary data, for example, compressed data, // encrypted data, or images. BinaryValue []byte // Strings are Unicode with UTF8 binary encoding. For a list of code values, see // ASCII Printable Characters (https://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters) // . StringValue *string noSmithyDocumentSerde } // A list of phone numbers and their metadata. type PhoneNumberInformation struct { // The date and time when the phone number was created. CreatedAt *time.Time // The two-character code for the country or region, in ISO 3166-1 alpha-2 format. Iso2CountryCode *string // The capabilities of each phone number. NumberCapabilities []NumberCapability // The phone number. PhoneNumber *string // The list of supported routes. RouteType RouteType // The status of the phone number. Status *string noSmithyDocumentSerde } // Platform application object. type PlatformApplication struct { // Attributes for platform application object. Attributes map[string]string // PlatformApplicationArn for platform application object. PlatformApplicationArn *string noSmithyDocumentSerde } // Contains the details of a single Amazon SNS message along with an Id that // identifies a message within the batch. type PublishBatchRequestEntry struct { // An identifier for the message in this batch. The Ids of a batch request must be // unique within a request. This identifier can have up to 80 characters. The // following characters are accepted: alphanumeric characters, hyphens(-), and // underscores (_). // // This member is required. Id *string // The body of the message. // // This member is required. Message *string // Each message attribute consists of a Name , Type , and Value . For more // information, see Amazon SNS message attributes (https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html) // in the Amazon SNS Developer Guide. MessageAttributes map[string]MessageAttributeValue // This parameter applies only to FIFO (first-in-first-out) topics. The token used // for deduplication of messages within a 5-minute minimum deduplication interval. // If a message with a particular MessageDeduplicationId is sent successfully, // subsequent messages with the same MessageDeduplicationId are accepted // successfully but aren't delivered. // - Every message must have a unique MessageDeduplicationId . // - You may provide a MessageDeduplicationId explicitly. // - If you aren't able to provide a MessageDeduplicationId and you enable // ContentBasedDeduplication for your topic, Amazon SNS uses a SHA-256 hash to // generate the MessageDeduplicationId using the body of the message (but not the // attributes of the message). // - If you don't provide a MessageDeduplicationId and the topic doesn't have // ContentBasedDeduplication set, the action fails with an error. // - If the topic has a ContentBasedDeduplication set, your // MessageDeduplicationId overrides the generated one. // - When ContentBasedDeduplication is in effect, messages with identical content // sent within the deduplication interval are treated as duplicates and only one // copy of the message is delivered. // - If you send one message with ContentBasedDeduplication enabled, and then // another message with a MessageDeduplicationId that is the same as the one // generated for the first MessageDeduplicationId , the two messages are treated // as duplicates and only one copy of the message is delivered. // The MessageDeduplicationId is available to the consumer of the message (this // can be useful for troubleshooting delivery issues). If a message is sent // successfully but the acknowledgement is lost and the message is resent with the // same MessageDeduplicationId after the deduplication interval, Amazon SNS can't // detect duplicate messages. Amazon SNS continues to keep track of the message // deduplication ID even after the message is received and deleted. The length of // MessageDeduplicationId is 128 characters. MessageDeduplicationId can contain // alphanumeric characters (a-z, A-Z, 0-9) and punctuation // (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~) . MessageDeduplicationId *string // This parameter applies only to FIFO (first-in-first-out) topics. The tag that // specifies that a message belongs to a specific message group. Messages that // belong to the same message group are processed in a FIFO manner (however, // messages in different message groups might be processed out of order). To // interleave multiple ordered streams within a single topic, use MessageGroupId // values (for example, session data for multiple users). In this scenario, // multiple consumers can process the topic, but the session data of each user is // processed in a FIFO fashion. You must associate a non-empty MessageGroupId with // a message. If you don't provide a MessageGroupId , the action fails. The length // of MessageGroupId is 128 characters. MessageGroupId can contain alphanumeric // characters (a-z, A-Z, 0-9) and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~) . // MessageGroupId is required for FIFO topics. You can't use it for standard topics. MessageGroupId *string // Set MessageStructure to json if you want to send a different message for each // protocol. For example, using one publish action, you can send a short message to // your SMS subscribers and a longer message to your email subscribers. If you set // MessageStructure to json , the value of the Message parameter must: // - be a syntactically valid JSON object; and // - contain at least a top-level JSON key of "default" with a value that is a // string. // You can define other top-level keys that define the message you want to send to // a specific transport protocol (e.g. http). MessageStructure *string // The subject of the batch message. Subject *string noSmithyDocumentSerde } // Encloses data related to a successful message in a batch request for topic. type PublishBatchResultEntry struct { // The Id of an entry in a batch request. Id *string // An identifier for the message. MessageId *string // This parameter applies only to FIFO (first-in-first-out) topics. The large, // non-consecutive number that Amazon SNS assigns to each message. The length of // SequenceNumber is 128 bits. SequenceNumber continues to increase for a // particular MessageGroupId . SequenceNumber *string noSmithyDocumentSerde } // A verified or pending destination phone number in the SMS sandbox. When you // start using Amazon SNS to send SMS messages, your Amazon Web Services account is // in the SMS sandbox. The SMS sandbox provides a safe environment for you to try // Amazon SNS features without risking your reputation as an SMS sender. While your // Amazon Web Services account is in the SMS sandbox, you can use all of the // features of Amazon SNS. However, you can send SMS messages only to verified // destination phone numbers. For more information, including how to move out of // the sandbox to send messages without restrictions, see SMS sandbox (https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html) // in the Amazon SNS Developer Guide. type SMSSandboxPhoneNumber struct { // The destination phone number. PhoneNumber *string // The destination phone number's verification status. Status SMSSandboxPhoneNumberVerificationStatus noSmithyDocumentSerde } // A wrapper type for the attributes of an Amazon SNS subscription. type Subscription struct { // The subscription's endpoint (format depends on the protocol). Endpoint *string // The subscription's owner. Owner *string // The subscription's protocol. Protocol *string // The subscription's ARN. SubscriptionArn *string // The ARN of the subscription's topic. TopicArn *string noSmithyDocumentSerde } // The list of tags to be added to the specified topic. type Tag struct { // The required key portion of the tag. // // This member is required. Key *string // The optional value portion of the tag. // // This member is required. Value *string noSmithyDocumentSerde } // A wrapper type for the topic's Amazon Resource Name (ARN). To retrieve a // topic's attributes, use GetTopicAttributes . type Topic struct { // The topic's ARN. TopicArn *string noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
285
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs 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 = "SQS" const ServiceAPIVersion = "2012-11-05" // Client provides the API client to make operations call for Amazon Simple Queue // 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) 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 // Allows you to disable the client's validation of response message checksums. // Enabled by default. Used by SendMessage, SendMessageBatch, and ReceiveMessage. DisableMessageChecksumValidation bool // 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, "sqs", 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) }
439
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs 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 sqs import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Adds a permission to a queue for a specific principal (https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P) // . This allows sharing access to the queue. When you create a queue, you have // full control access rights for the queue. Only you, the owner of the queue, can // grant or deny permissions to the queue. For more information about these // permissions, see Allow Developers to Write Messages to a Shared Queue (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-writing-an-sqs-policy.html#write-messages-to-shared-queue) // in the Amazon SQS Developer Guide. // - AddPermission generates a policy for you. You can use SetQueueAttributes to // upload your policy. For more information, see Using Custom Policies with the // Amazon SQS Access Policy Language (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-creating-custom-policies.html) // in the Amazon SQS Developer Guide. // - An Amazon SQS policy can have a maximum of seven actions per statement. // - To remove the ability to change queue permissions, you must deny permission // to the AddPermission , RemovePermission , and SetQueueAttributes actions in // your IAM policy. // - Amazon SQS AddPermission does not support adding a non-account principal. // // Cross-account permissions don't apply to this action. For more information, see // Grant cross-account permissions to a role and a username (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) // in the Amazon SQS Developer Guide. func (c *Client) AddPermission(ctx context.Context, params *AddPermissionInput, optFns ...func(*Options)) (*AddPermissionOutput, error) { if params == nil { params = &AddPermissionInput{} } result, metadata, err := c.invokeOperation(ctx, "AddPermission", params, optFns, c.addOperationAddPermissionMiddlewares) if err != nil { return nil, err } out := result.(*AddPermissionOutput) out.ResultMetadata = metadata return out, nil } type AddPermissionInput struct { // The Amazon Web Services account numbers of the principals (https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P) // who are to receive permission. For information about locating the Amazon Web // Services account identification, see Your Amazon Web Services Identifiers (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-making-api-requests.html#sqs-api-request-authentication) // in the Amazon SQS Developer Guide. // // This member is required. AWSAccountIds []string // The action the client wants to allow for the specified principal. Valid values: // the name of any action or * . For more information about these actions, see // Overview of Managing Access Permissions to Your Amazon Simple Queue Service // Resource (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-overview-of-managing-access.html) // in the Amazon SQS Developer Guide. Specifying SendMessage , DeleteMessage , or // ChangeMessageVisibility for ActionName.n also grants permissions for the // corresponding batch versions of those actions: SendMessageBatch , // DeleteMessageBatch , and ChangeMessageVisibilityBatch . // // This member is required. Actions []string // The unique identification of the permission you're setting (for example, // AliceSendMessage ). Maximum 80 characters. Allowed characters include // alphanumeric characters, hyphens ( - ), and underscores ( _ ). // // This member is required. Label *string // The URL of the Amazon SQS queue to which permissions are added. Queue URLs and // names are case-sensitive. // // This member is required. QueueUrl *string noSmithyDocumentSerde } type AddPermissionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAddPermissionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpAddPermission{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAddPermission{}, 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 = addOpAddPermissionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddPermission(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_opAddPermission(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "AddPermission", } }
166
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs 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" ) // Cancels a specified message movement task. // - A message movement can only be cancelled when the current status is // RUNNING. // - Cancelling a message movement task does not revert the messages that have // already been moved. It can only stop the messages that have not been moved yet. func (c *Client) CancelMessageMoveTask(ctx context.Context, params *CancelMessageMoveTaskInput, optFns ...func(*Options)) (*CancelMessageMoveTaskOutput, error) { if params == nil { params = &CancelMessageMoveTaskInput{} } result, metadata, err := c.invokeOperation(ctx, "CancelMessageMoveTask", params, optFns, c.addOperationCancelMessageMoveTaskMiddlewares) if err != nil { return nil, err } out := result.(*CancelMessageMoveTaskOutput) out.ResultMetadata = metadata return out, nil } type CancelMessageMoveTaskInput struct { // An identifier associated with a message movement task. // // This member is required. TaskHandle *string noSmithyDocumentSerde } type CancelMessageMoveTaskOutput struct { // The approximate number of messages already moved to the destination queue. ApproximateNumberOfMessagesMoved int64 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCancelMessageMoveTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpCancelMessageMoveTask{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCancelMessageMoveTask{}, 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 = addOpCancelMessageMoveTaskValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelMessageMoveTask(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_opCancelMessageMoveTask(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "CancelMessageMoveTask", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs 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" ) // Changes the visibility timeout of a specified message in a queue to a new // value. The default visibility timeout for a message is 30 seconds. The minimum // is 0 seconds. The maximum is 12 hours. For more information, see Visibility // Timeout (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) // in the Amazon SQS Developer Guide. For example, if the default timeout for a // queue is 60 seconds, 15 seconds have elapsed since you received the message, and // you send a ChangeMessageVisibility call with VisibilityTimeout set to 10 // seconds, the 10 seconds begin to count from the time that you make the // ChangeMessageVisibility call. Thus, any attempt to change the visibility timeout // or to delete that message 10 seconds after you initially change the visibility // timeout (a total of 25 seconds) might result in an error. An Amazon SQS message // has three basic states: // - Sent to a queue by a producer. // - Received from the queue by a consumer. // - Deleted from the queue. // // A message is considered to be stored after it is sent to a queue by a producer, // but not yet received from the queue by a consumer (that is, between states 1 and // 2). There is no limit to the number of stored messages. A message is considered // to be in flight after it is received from a queue by a consumer, but not yet // deleted from the queue (that is, between states 2 and 3). There is a limit to // the number of in flight messages. Limits that apply to in flight messages are // unrelated to the unlimited number of stored messages. For most standard queues // (depending on queue traffic and message backlog), there can be a maximum of // approximately 120,000 in flight messages (received from a queue by a consumer, // but not yet deleted from the queue). If you reach this limit, Amazon SQS returns // the OverLimit error message. To avoid reaching the limit, you should delete // messages from the queue after they're processed. You can also increase the // number of queues you use to process your messages. To request a limit increase, // file a support request (https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-sqs) // . For FIFO queues, there can be a maximum of 20,000 in flight messages (received // from a queue by a consumer, but not yet deleted from the queue). If you reach // this limit, Amazon SQS returns no error messages. If you attempt to set the // VisibilityTimeout to a value greater than the maximum time left, Amazon SQS // returns an error. Amazon SQS doesn't automatically recalculate and increase the // timeout to the maximum remaining time. Unlike with a queue, when you change the // visibility timeout for a specific message the timeout value is applied // immediately but isn't saved in memory for that message. If you don't delete a // message after it is received, the visibility timeout for the message reverts to // the original timeout value (not to the value you set using the // ChangeMessageVisibility action) the next time the message is received. func (c *Client) ChangeMessageVisibility(ctx context.Context, params *ChangeMessageVisibilityInput, optFns ...func(*Options)) (*ChangeMessageVisibilityOutput, error) { if params == nil { params = &ChangeMessageVisibilityInput{} } result, metadata, err := c.invokeOperation(ctx, "ChangeMessageVisibility", params, optFns, c.addOperationChangeMessageVisibilityMiddlewares) if err != nil { return nil, err } out := result.(*ChangeMessageVisibilityOutput) out.ResultMetadata = metadata return out, nil } type ChangeMessageVisibilityInput struct { // The URL of the Amazon SQS queue whose message's visibility is changed. Queue // URLs and names are case-sensitive. // // This member is required. QueueUrl *string // The receipt handle associated with the message, whose visibility timeout is // changed. This parameter is returned by the ReceiveMessage action. // // This member is required. ReceiptHandle *string // The new value for the message's visibility timeout (in seconds). Values range: 0 // to 43200 . Maximum: 12 hours. // // This member is required. VisibilityTimeout int32 noSmithyDocumentSerde } type ChangeMessageVisibilityOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationChangeMessageVisibilityMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpChangeMessageVisibility{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpChangeMessageVisibility{}, 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 = addOpChangeMessageVisibilityValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opChangeMessageVisibility(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_opChangeMessageVisibility(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "ChangeMessageVisibility", } }
173
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs 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/sqs/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Changes the visibility timeout of multiple messages. This is a batch version of // ChangeMessageVisibility . The result of the action on each message is reported // individually in the response. You can send up to 10 ChangeMessageVisibility // requests with each ChangeMessageVisibilityBatch action. Because the batch // request can result in a combination of successful and unsuccessful actions, you // should check for batch errors even when the call returns an HTTP status code of // 200 . func (c *Client) ChangeMessageVisibilityBatch(ctx context.Context, params *ChangeMessageVisibilityBatchInput, optFns ...func(*Options)) (*ChangeMessageVisibilityBatchOutput, error) { if params == nil { params = &ChangeMessageVisibilityBatchInput{} } result, metadata, err := c.invokeOperation(ctx, "ChangeMessageVisibilityBatch", params, optFns, c.addOperationChangeMessageVisibilityBatchMiddlewares) if err != nil { return nil, err } out := result.(*ChangeMessageVisibilityBatchOutput) out.ResultMetadata = metadata return out, nil } type ChangeMessageVisibilityBatchInput struct { // Lists the receipt handles of the messages for which the visibility timeout must // be changed. // // This member is required. Entries []types.ChangeMessageVisibilityBatchRequestEntry // The URL of the Amazon SQS queue whose messages' visibility is changed. Queue // URLs and names are case-sensitive. // // This member is required. QueueUrl *string noSmithyDocumentSerde } // For each message in the batch, the response contains a // ChangeMessageVisibilityBatchResultEntry tag if the message succeeds or a // BatchResultErrorEntry tag if the message fails. type ChangeMessageVisibilityBatchOutput struct { // A list of BatchResultErrorEntry items. // // This member is required. Failed []types.BatchResultErrorEntry // A list of ChangeMessageVisibilityBatchResultEntry items. // // This member is required. Successful []types.ChangeMessageVisibilityBatchResultEntry // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationChangeMessageVisibilityBatchMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpChangeMessageVisibilityBatch{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpChangeMessageVisibilityBatch{}, 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 = addOpChangeMessageVisibilityBatchValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opChangeMessageVisibilityBatch(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_opChangeMessageVisibilityBatch(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "ChangeMessageVisibilityBatch", } }
148
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new standard or FIFO queue. You can pass one or more attributes in // the request. Keep the following in mind: // - If you don't specify the FifoQueue attribute, Amazon SQS creates a standard // queue. You can't change the queue type after you create it and you can't convert // an existing standard queue into a FIFO queue. You must either create a new FIFO // queue for your application or delete your existing standard queue and recreate // it as a FIFO queue. For more information, see Moving From a Standard Queue to // a FIFO Queue (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-moving) // in the Amazon SQS Developer Guide. // - If you don't provide a value for an attribute, the queue is created with // the default value for the attribute. // - If you delete a queue, you must wait at least 60 seconds before creating a // queue with the same name. // // To successfully create a new queue, you must provide a queue name that adheres // to the limits related to queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/limits-queues.html) // and is unique within the scope of your queues. After you create a queue, you // must wait at least one second after the queue is created to be able to use the // queue. To get the queue URL, use the GetQueueUrl action. GetQueueUrl requires // only the QueueName parameter. be aware of existing queue names: // - If you provide the name of an existing queue along with the exact names and // values of all the queue's attributes, CreateQueue returns the queue URL for // the existing queue. // - If the queue name, attribute names, or attribute values don't match an // existing queue, CreateQueue returns an error. // // Cross-account permissions don't apply to this action. For more information, see // Grant cross-account permissions to a role and a username (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) // in the Amazon SQS Developer Guide. func (c *Client) CreateQueue(ctx context.Context, params *CreateQueueInput, optFns ...func(*Options)) (*CreateQueueOutput, error) { if params == nil { params = &CreateQueueInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateQueue", params, optFns, c.addOperationCreateQueueMiddlewares) if err != nil { return nil, err } out := result.(*CreateQueueOutput) out.ResultMetadata = metadata return out, nil } type CreateQueueInput struct { // The name of the new queue. The following limits apply to this name: // - A queue name can have up to 80 characters. // - Valid values: alphanumeric characters, hyphens ( - ), and underscores ( _ ). // - A FIFO queue name must end with the .fifo suffix. // Queue URLs and names are case-sensitive. // // This member is required. QueueName *string // A map of attributes with their corresponding values. The following lists the // names, descriptions, and values of the special request parameters that the // CreateQueue action uses: // - DelaySeconds – The length of time, in seconds, for which the delivery of all // messages in the queue is delayed. Valid values: An integer from 0 to 900 seconds // (15 minutes). Default: 0. // - MaximumMessageSize – The limit of how many bytes a message can contain // before Amazon SQS rejects it. Valid values: An integer from 1,024 bytes (1 KiB) // to 262,144 bytes (256 KiB). Default: 262,144 (256 KiB). // - MessageRetentionPeriod – The length of time, in seconds, for which Amazon // SQS retains a message. Valid values: An integer from 60 seconds (1 minute) to // 1,209,600 seconds (14 days). Default: 345,600 (4 days). When you change a // queue's attributes, the change can take up to 60 seconds for most of the // attributes to propagate throughout the Amazon SQS system. Changes made to the // MessageRetentionPeriod attribute can take up to 15 minutes and will impact // existing messages in the queue potentially causing them to be expired and // deleted if the MessageRetentionPeriod is reduced below the age of existing // messages. // - Policy – The queue's policy. A valid Amazon Web Services policy. For more // information about policy structure, see Overview of Amazon Web Services IAM // Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html) // in the IAM User Guide. // - ReceiveMessageWaitTimeSeconds – The length of time, in seconds, for which a // ReceiveMessage action waits for a message to arrive. Valid values: An integer // from 0 to 20 (seconds). Default: 0. // - VisibilityTimeout – The visibility timeout for the queue, in seconds. Valid // values: An integer from 0 to 43,200 (12 hours). Default: 30. For more // information about the visibility timeout, see Visibility Timeout (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) // in the Amazon SQS Developer Guide. // The following attributes apply only to dead-letter queues: (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) // - RedrivePolicy – The string that includes the parameters for the dead-letter // queue functionality of the source queue as a JSON object. The parameters are as // follows: // - deadLetterTargetArn – The Amazon Resource Name (ARN) of the dead-letter // queue to which Amazon SQS moves messages after the value of maxReceiveCount is // exceeded. // - maxReceiveCount – The number of times a message is delivered to the source // queue before being moved to the dead-letter queue. Default: 10. When the // ReceiveCount for a message exceeds the maxReceiveCount for a queue, Amazon SQS // moves the message to the dead-letter-queue. // - RedriveAllowPolicy – The string that includes the parameters for the // permissions for the dead-letter queue redrive permission and which source queues // can specify dead-letter queues as a JSON object. The parameters are as follows: // - redrivePermission – The permission type that defines which source queues can // specify the current queue as the dead-letter queue. Valid values are: // - allowAll – (Default) Any source queues in this Amazon Web Services account // in the same Region can specify this queue as the dead-letter queue. // - denyAll – No source queues can specify this queue as the dead-letter queue. // - byQueue – Only queues specified by the sourceQueueArns parameter can specify // this queue as the dead-letter queue. // - sourceQueueArns – The Amazon Resource Names (ARN)s of the source queues that // can specify this queue as the dead-letter queue and redrive messages. You can // specify this parameter only when the redrivePermission parameter is set to // byQueue . You can specify up to 10 source queue ARNs. To allow more than 10 // source queues to specify dead-letter queues, set the redrivePermission // parameter to allowAll . // The dead-letter queue of a FIFO queue must also be a FIFO queue. Similarly, the // dead-letter queue of a standard queue must also be a standard queue. The // following attributes apply only to server-side-encryption (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html) // : // - KmsMasterKeyId – The ID of an Amazon Web Services managed customer master // key (CMK) for Amazon SQS or a custom CMK. For more information, see Key Terms (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms) // . While the alias of the Amazon Web Services managed CMK for Amazon SQS is // always alias/aws/sqs , the alias of a custom CMK can, for example, be // alias/MyAlias . For more examples, see KeyId (https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) // in the Key Management Service API Reference. // - KmsDataKeyReusePeriodSeconds – The length of time, in seconds, for which // Amazon SQS can reuse a data key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys) // to encrypt or decrypt messages before calling KMS again. An integer representing // seconds, between 60 seconds (1 minute) and 86,400 seconds (24 hours). Default: // 300 (5 minutes). A shorter time period provides better security but results in // more calls to KMS which might incur charges after Free Tier. For more // information, see How Does the Data Key Reuse Period Work? (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work) // - SqsManagedSseEnabled – Enables server-side queue encryption using SQS owned // encryption keys. Only one server-side encryption option is supported per queue // (for example, SSE-KMS (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html) // or SSE-SQS (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html) // ). // The following attributes apply only to FIFO (first-in-first-out) queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html) // : // - FifoQueue – Designates a queue as FIFO. Valid values are true and false . If // you don't specify the FifoQueue attribute, Amazon SQS creates a standard // queue. You can provide this attribute only during queue creation. You can't // change it for an existing queue. When you set this attribute, you must also // provide the MessageGroupId for your messages explicitly. For more information, // see FIFO queue logic (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-understanding-logic.html) // in the Amazon SQS Developer Guide. // - ContentBasedDeduplication – Enables content-based deduplication. Valid // values are true and false . For more information, see Exactly-once processing (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html) // in the Amazon SQS Developer Guide. Note the following: // - Every message must have a unique MessageDeduplicationId . // - You may provide a MessageDeduplicationId explicitly. // - If you aren't able to provide a MessageDeduplicationId and you enable // ContentBasedDeduplication for your queue, Amazon SQS uses a SHA-256 hash to // generate the MessageDeduplicationId using the body of the message (but not the // attributes of the message). // - If you don't provide a MessageDeduplicationId and the queue doesn't have // ContentBasedDeduplication set, the action fails with an error. // - If the queue has ContentBasedDeduplication set, your MessageDeduplicationId // overrides the generated one. // - When ContentBasedDeduplication is in effect, messages with identical content // sent within the deduplication interval are treated as duplicates and only one // copy of the message is delivered. // - If you send one message with ContentBasedDeduplication enabled and then // another message with a MessageDeduplicationId that is the same as the one // generated for the first MessageDeduplicationId , the two messages are treated // as duplicates and only one copy of the message is delivered. // The following attributes apply only to high throughput for FIFO queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html) // : // - DeduplicationScope – Specifies whether message deduplication occurs at the // message group or queue level. Valid values are messageGroup and queue . // - FifoThroughputLimit – Specifies whether the FIFO queue throughput quota // applies to the entire queue or per message group. Valid values are perQueue // and perMessageGroupId . The perMessageGroupId value is allowed only when the // value for DeduplicationScope is messageGroup . // To enable high throughput for FIFO queues, do the following: // - Set DeduplicationScope to messageGroup . // - Set FifoThroughputLimit to perMessageGroupId . // If you set these attributes to anything other than the values shown for // enabling high throughput, normal throughput is in effect and deduplication // occurs as specified. For information on throughput quotas, see Quotas related // to messages (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) // in the Amazon SQS Developer Guide. Attributes map[string]string // Add cost allocation tags to the specified Amazon SQS queue. For an overview, // see Tagging Your Amazon SQS Queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html) // in the Amazon SQS Developer Guide. When you use queue tags, keep the following // guidelines in mind: // - Adding more than 50 tags to a queue isn't recommended. // - Tags don't have any semantic meaning. Amazon SQS interprets tags as // character strings. // - Tags are case-sensitive. // - A new tag with a key identical to that of an existing tag overwrites the // existing tag. // For a full list of tag restrictions, see Quotas related to queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-limits.html#limits-queues) // in the Amazon SQS Developer Guide. To be able to tag a queue on creation, you // must have the sqs:CreateQueue and sqs:TagQueue permissions. Cross-account // permissions don't apply to this action. For more information, see Grant // cross-account permissions to a role and a username (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) // in the Amazon SQS Developer Guide. Tags map[string]string noSmithyDocumentSerde } // Returns the QueueUrl attribute of the created queue. type CreateQueueOutput struct { // The URL of the created Amazon SQS queue. QueueUrl *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateQueueMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateQueue{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateQueue{}, 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 = addOpCreateQueueValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateQueue(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_opCreateQueue(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "CreateQueue", } }
300
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes the specified message from the specified queue. To select the message // to delete, use the ReceiptHandle of the message (not the MessageId which you // receive when you send the message). Amazon SQS can delete a message from a queue // even if a visibility timeout setting causes the message to be locked by another // consumer. Amazon SQS automatically deletes messages left in a queue longer than // the retention period configured for the queue. The ReceiptHandle is associated // with a specific instance of receiving a message. If you receive a message more // than once, the ReceiptHandle is different each time you receive a message. When // you use the DeleteMessage action, you must provide the most recently received // ReceiptHandle for the message (otherwise, the request succeeds, but the message // will not be deleted). For standard queues, it is possible to receive a message // even after you delete it. This might happen on rare occasions if one of the // servers which stores a copy of the message is unavailable when you send the // request to delete the message. The copy remains on the server and might be // returned to you during a subsequent receive request. You should ensure that your // application is idempotent, so that receiving a message more than once does not // cause issues. func (c *Client) DeleteMessage(ctx context.Context, params *DeleteMessageInput, optFns ...func(*Options)) (*DeleteMessageOutput, error) { if params == nil { params = &DeleteMessageInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteMessage", params, optFns, c.addOperationDeleteMessageMiddlewares) if err != nil { return nil, err } out := result.(*DeleteMessageOutput) out.ResultMetadata = metadata return out, nil } type DeleteMessageInput struct { // The URL of the Amazon SQS queue from which messages are deleted. Queue URLs and // names are case-sensitive. // // This member is required. QueueUrl *string // The receipt handle associated with the message to delete. // // This member is required. ReceiptHandle *string noSmithyDocumentSerde } type DeleteMessageOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteMessageMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteMessage{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteMessage{}, 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 = addOpDeleteMessageValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteMessage(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_opDeleteMessage(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "DeleteMessage", } }
142
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs 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/sqs/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes up to ten messages from the specified queue. This is a batch version of // DeleteMessage . The result of the action on each message is reported // individually in the response. Because the batch request can result in a // combination of successful and unsuccessful actions, you should check for batch // errors even when the call returns an HTTP status code of 200 . func (c *Client) DeleteMessageBatch(ctx context.Context, params *DeleteMessageBatchInput, optFns ...func(*Options)) (*DeleteMessageBatchOutput, error) { if params == nil { params = &DeleteMessageBatchInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteMessageBatch", params, optFns, c.addOperationDeleteMessageBatchMiddlewares) if err != nil { return nil, err } out := result.(*DeleteMessageBatchOutput) out.ResultMetadata = metadata return out, nil } type DeleteMessageBatchInput struct { // Lists the receipt handles for the messages to be deleted. // // This member is required. Entries []types.DeleteMessageBatchRequestEntry // The URL of the Amazon SQS queue from which messages are deleted. Queue URLs and // names are case-sensitive. // // This member is required. QueueUrl *string noSmithyDocumentSerde } // For each message in the batch, the response contains a // DeleteMessageBatchResultEntry tag if the message is deleted or a // BatchResultErrorEntry tag if the message can't be deleted. type DeleteMessageBatchOutput struct { // A list of BatchResultErrorEntry items. // // This member is required. Failed []types.BatchResultErrorEntry // A list of DeleteMessageBatchResultEntry items. // // This member is required. Successful []types.DeleteMessageBatchResultEntry // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteMessageBatchMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteMessageBatch{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteMessageBatch{}, 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 = addOpDeleteMessageBatchValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteMessageBatch(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_opDeleteMessageBatch(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "DeleteMessageBatch", } }
145
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes the queue specified by the QueueUrl , regardless of the queue's // contents. Be careful with the DeleteQueue action: When you delete a queue, any // messages in the queue are no longer available. When you delete a queue, the // deletion process takes up to 60 seconds. Requests you send involving that queue // during the 60 seconds might succeed. For example, a SendMessage request might // succeed, but after 60 seconds the queue and the message you sent no longer // exist. When you delete a queue, you must wait at least 60 seconds before // creating a queue with the same name. Cross-account permissions don't apply to // this action. For more information, see Grant cross-account permissions to a // role and a username (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) // in the Amazon SQS Developer Guide. The delete operation uses the HTTP GET verb. func (c *Client) DeleteQueue(ctx context.Context, params *DeleteQueueInput, optFns ...func(*Options)) (*DeleteQueueOutput, error) { if params == nil { params = &DeleteQueueInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteQueue", params, optFns, c.addOperationDeleteQueueMiddlewares) if err != nil { return nil, err } out := result.(*DeleteQueueOutput) out.ResultMetadata = metadata return out, nil } type DeleteQueueInput struct { // The URL of the Amazon SQS queue to delete. Queue URLs and names are // case-sensitive. // // This member is required. QueueUrl *string noSmithyDocumentSerde } type DeleteQueueOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteQueueMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteQueue{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteQueue{}, 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 = addOpDeleteQueueValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteQueue(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_opDeleteQueue(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "DeleteQueue", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs 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/sqs/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets attributes for the specified queue. To determine whether a queue is FIFO (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html) // , you can check whether QueueName ends with the .fifo suffix. func (c *Client) GetQueueAttributes(ctx context.Context, params *GetQueueAttributesInput, optFns ...func(*Options)) (*GetQueueAttributesOutput, error) { if params == nil { params = &GetQueueAttributesInput{} } result, metadata, err := c.invokeOperation(ctx, "GetQueueAttributes", params, optFns, c.addOperationGetQueueAttributesMiddlewares) if err != nil { return nil, err } out := result.(*GetQueueAttributesOutput) out.ResultMetadata = metadata return out, nil } type GetQueueAttributesInput struct { // The URL of the Amazon SQS queue whose attribute information is retrieved. Queue // URLs and names are case-sensitive. // // This member is required. QueueUrl *string // A list of attributes for which to retrieve information. The AttributeNames // parameter is optional, but if you don't specify values for this parameter, the // request returns empty results. In the future, new attributes might be added. If // you write code that calls this action, we recommend that you structure your code // so that it can handle new attributes gracefully. The following attributes are // supported: The ApproximateNumberOfMessagesDelayed , // ApproximateNumberOfMessagesNotVisible , and ApproximateNumberOfMessages metrics // may not achieve consistency until at least 1 minute after the producers stop // sending messages. This period is required for the queue metadata to reach // eventual consistency. // - All – Returns all values. // - ApproximateNumberOfMessages – Returns the approximate number of messages // available for retrieval from the queue. // - ApproximateNumberOfMessagesDelayed – Returns the approximate number of // messages in the queue that are delayed and not available for reading // immediately. This can happen when the queue is configured as a delay queue or // when a message has been sent with a delay parameter. // - ApproximateNumberOfMessagesNotVisible – Returns the approximate number of // messages that are in flight. Messages are considered to be in flight if they // have been sent to a client but have not yet been deleted or have not yet reached // the end of their visibility window. // - CreatedTimestamp – Returns the time when the queue was created in seconds ( // epoch time (http://en.wikipedia.org/wiki/Unix_time) ). // - DelaySeconds – Returns the default delay on the queue in seconds. // - LastModifiedTimestamp – Returns the time when the queue was last changed in // seconds ( epoch time (http://en.wikipedia.org/wiki/Unix_time) ). // - MaximumMessageSize – Returns the limit of how many bytes a message can // contain before Amazon SQS rejects it. // - MessageRetentionPeriod – Returns the length of time, in seconds, for which // Amazon SQS retains a message. When you change a queue's attributes, the change // can take up to 60 seconds for most of the attributes to propagate throughout the // Amazon SQS system. Changes made to the MessageRetentionPeriod attribute can // take up to 15 minutes and will impact existing messages in the queue potentially // causing them to be expired and deleted if the MessageRetentionPeriod is // reduced below the age of existing messages. // - Policy – Returns the policy of the queue. // - QueueArn – Returns the Amazon resource name (ARN) of the queue. // - ReceiveMessageWaitTimeSeconds – Returns the length of time, in seconds, for // which the ReceiveMessage action waits for a message to arrive. // - VisibilityTimeout – Returns the visibility timeout for the queue. For more // information about the visibility timeout, see Visibility Timeout (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) // in the Amazon SQS Developer Guide. // The following attributes apply only to dead-letter queues: (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) // - RedrivePolicy – The string that includes the parameters for the dead-letter // queue functionality of the source queue as a JSON object. The parameters are as // follows: // - deadLetterTargetArn – The Amazon Resource Name (ARN) of the dead-letter // queue to which Amazon SQS moves messages after the value of maxReceiveCount is // exceeded. // - maxReceiveCount – The number of times a message is delivered to the source // queue before being moved to the dead-letter queue. Default: 10. When the // ReceiveCount for a message exceeds the maxReceiveCount for a queue, Amazon SQS // moves the message to the dead-letter-queue. // - RedriveAllowPolicy – The string that includes the parameters for the // permissions for the dead-letter queue redrive permission and which source queues // can specify dead-letter queues as a JSON object. The parameters are as follows: // - redrivePermission – The permission type that defines which source queues can // specify the current queue as the dead-letter queue. Valid values are: // - allowAll – (Default) Any source queues in this Amazon Web Services account // in the same Region can specify this queue as the dead-letter queue. // - denyAll – No source queues can specify this queue as the dead-letter queue. // - byQueue – Only queues specified by the sourceQueueArns parameter can specify // this queue as the dead-letter queue. // - sourceQueueArns – The Amazon Resource Names (ARN)s of the source queues that // can specify this queue as the dead-letter queue and redrive messages. You can // specify this parameter only when the redrivePermission parameter is set to // byQueue . You can specify up to 10 source queue ARNs. To allow more than 10 // source queues to specify dead-letter queues, set the redrivePermission // parameter to allowAll . // The dead-letter queue of a FIFO queue must also be a FIFO queue. Similarly, the // dead-letter queue of a standard queue must also be a standard queue. The // following attributes apply only to server-side-encryption (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html) // : // - KmsMasterKeyId – Returns the ID of an Amazon Web Services managed customer // master key (CMK) for Amazon SQS or a custom CMK. For more information, see // Key Terms (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms) // . // - KmsDataKeyReusePeriodSeconds – Returns the length of time, in seconds, for // which Amazon SQS can reuse a data key to encrypt or decrypt messages before // calling KMS again. For more information, see How Does the Data Key Reuse // Period Work? (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work) // . // - SqsManagedSseEnabled – Returns information about whether the queue is using // SSE-SQS encryption using SQS owned encryption keys. Only one server-side // encryption option is supported per queue (for example, SSE-KMS (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html) // or SSE-SQS (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html) // ). // The following attributes apply only to FIFO (first-in-first-out) queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html) // : // - FifoQueue – Returns information about whether the queue is FIFO. For more // information, see FIFO queue logic (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-understanding-logic.html) // in the Amazon SQS Developer Guide. To determine whether a queue is FIFO (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html) // , you can check whether QueueName ends with the .fifo suffix. // - ContentBasedDeduplication – Returns whether content-based deduplication is // enabled for the queue. For more information, see Exactly-once processing (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html) // in the Amazon SQS Developer Guide. // The following attributes apply only to high throughput for FIFO queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html) // : // - DeduplicationScope – Specifies whether message deduplication occurs at the // message group or queue level. Valid values are messageGroup and queue . // - FifoThroughputLimit – Specifies whether the FIFO queue throughput quota // applies to the entire queue or per message group. Valid values are perQueue // and perMessageGroupId . The perMessageGroupId value is allowed only when the // value for DeduplicationScope is messageGroup . // To enable high throughput for FIFO queues, do the following: // - Set DeduplicationScope to messageGroup . // - Set FifoThroughputLimit to perMessageGroupId . // If you set these attributes to anything other than the values shown for // enabling high throughput, normal throughput is in effect and deduplication // occurs as specified. For information on throughput quotas, see Quotas related // to messages (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) // in the Amazon SQS Developer Guide. AttributeNames []types.QueueAttributeName noSmithyDocumentSerde } // A list of returned queue attributes. type GetQueueAttributesOutput struct { // A map of attributes to their respective values. Attributes map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetQueueAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpGetQueueAttributes{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetQueueAttributes{}, 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 = addOpGetQueueAttributesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetQueueAttributes(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_opGetQueueAttributes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "GetQueueAttributes", } }
242
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the URL of an existing Amazon SQS queue. To access a queue that belongs // to another AWS account, use the QueueOwnerAWSAccountId parameter to specify the // account ID of the queue's owner. The queue's owner must grant you permission to // access the queue. For more information about shared queue access, see // AddPermission or see Allow Developers to Write Messages to a Shared Queue (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-writing-an-sqs-policy.html#write-messages-to-shared-queue) // in the Amazon SQS Developer Guide. func (c *Client) GetQueueUrl(ctx context.Context, params *GetQueueUrlInput, optFns ...func(*Options)) (*GetQueueUrlOutput, error) { if params == nil { params = &GetQueueUrlInput{} } result, metadata, err := c.invokeOperation(ctx, "GetQueueUrl", params, optFns, c.addOperationGetQueueUrlMiddlewares) if err != nil { return nil, err } out := result.(*GetQueueUrlOutput) out.ResultMetadata = metadata return out, nil } type GetQueueUrlInput struct { // The name of the queue whose URL must be fetched. Maximum 80 characters. Valid // values: alphanumeric characters, hyphens ( - ), and underscores ( _ ). Queue // URLs and names are case-sensitive. // // This member is required. QueueName *string // The Amazon Web Services account ID of the account that created the queue. QueueOwnerAWSAccountId *string noSmithyDocumentSerde } // For more information, see Interpreting Responses (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-api-responses.html) // in the Amazon SQS Developer Guide. type GetQueueUrlOutput struct { // The URL of the queue. QueueUrl *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetQueueUrlMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpGetQueueUrl{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetQueueUrl{}, 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 = addOpGetQueueUrlValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetQueueUrl(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_opGetQueueUrl(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "GetQueueUrl", } }
136
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of your queues that have the RedrivePolicy queue attribute // configured with a dead-letter queue. The ListDeadLetterSourceQueues methods // supports pagination. Set parameter MaxResults in the request to specify the // maximum number of results to be returned in the response. If you do not set // MaxResults , the response includes a maximum of 1,000 results. If you set // MaxResults and there are additional results to display, the response includes a // value for NextToken . Use NextToken as a parameter in your next request to // ListDeadLetterSourceQueues to receive the next page of results. For more // information about using dead-letter queues, see Using Amazon SQS Dead-Letter // Queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) // in the Amazon SQS Developer Guide. func (c *Client) ListDeadLetterSourceQueues(ctx context.Context, params *ListDeadLetterSourceQueuesInput, optFns ...func(*Options)) (*ListDeadLetterSourceQueuesOutput, error) { if params == nil { params = &ListDeadLetterSourceQueuesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListDeadLetterSourceQueues", params, optFns, c.addOperationListDeadLetterSourceQueuesMiddlewares) if err != nil { return nil, err } out := result.(*ListDeadLetterSourceQueuesOutput) out.ResultMetadata = metadata return out, nil } type ListDeadLetterSourceQueuesInput struct { // The URL of a dead-letter queue. Queue URLs and names are case-sensitive. // // This member is required. QueueUrl *string // Maximum number of results to include in the response. Value range is 1 to 1000. // You must set MaxResults to receive a value for NextToken in the response. MaxResults *int32 // Pagination token to request the next set of results. NextToken *string noSmithyDocumentSerde } // A list of your dead letter source queues. type ListDeadLetterSourceQueuesOutput struct { // A list of source queue URLs that have the RedrivePolicy queue attribute // configured with a dead-letter queue. // // This member is required. QueueUrls []string // Pagination token to include in the next request. Token value is null if there // are no additional results to request, or if you did not set MaxResults in the // request. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListDeadLetterSourceQueuesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpListDeadLetterSourceQueues{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpListDeadLetterSourceQueues{}, 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 = addOpListDeadLetterSourceQueuesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDeadLetterSourceQueues(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 } // ListDeadLetterSourceQueuesAPIClient is a client that implements the // ListDeadLetterSourceQueues operation. type ListDeadLetterSourceQueuesAPIClient interface { ListDeadLetterSourceQueues(context.Context, *ListDeadLetterSourceQueuesInput, ...func(*Options)) (*ListDeadLetterSourceQueuesOutput, error) } var _ ListDeadLetterSourceQueuesAPIClient = (*Client)(nil) // ListDeadLetterSourceQueuesPaginatorOptions is the paginator options for // ListDeadLetterSourceQueues type ListDeadLetterSourceQueuesPaginatorOptions struct { // Maximum number of results to include in the response. Value range is 1 to 1000. // You must set MaxResults to receive a value for NextToken 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 } // ListDeadLetterSourceQueuesPaginator is a paginator for // ListDeadLetterSourceQueues type ListDeadLetterSourceQueuesPaginator struct { options ListDeadLetterSourceQueuesPaginatorOptions client ListDeadLetterSourceQueuesAPIClient params *ListDeadLetterSourceQueuesInput nextToken *string firstPage bool } // NewListDeadLetterSourceQueuesPaginator returns a new // ListDeadLetterSourceQueuesPaginator func NewListDeadLetterSourceQueuesPaginator(client ListDeadLetterSourceQueuesAPIClient, params *ListDeadLetterSourceQueuesInput, optFns ...func(*ListDeadLetterSourceQueuesPaginatorOptions)) *ListDeadLetterSourceQueuesPaginator { if params == nil { params = &ListDeadLetterSourceQueuesInput{} } options := ListDeadLetterSourceQueuesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListDeadLetterSourceQueuesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListDeadLetterSourceQueuesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListDeadLetterSourceQueues page. func (p *ListDeadLetterSourceQueuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeadLetterSourceQueuesOutput, 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.ListDeadLetterSourceQueues(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListDeadLetterSourceQueues(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "ListDeadLetterSourceQueues", } }
245
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs 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/sqs/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets the most recent message movement tasks (up to 10) under a specific source // queue. func (c *Client) ListMessageMoveTasks(ctx context.Context, params *ListMessageMoveTasksInput, optFns ...func(*Options)) (*ListMessageMoveTasksOutput, error) { if params == nil { params = &ListMessageMoveTasksInput{} } result, metadata, err := c.invokeOperation(ctx, "ListMessageMoveTasks", params, optFns, c.addOperationListMessageMoveTasksMiddlewares) if err != nil { return nil, err } out := result.(*ListMessageMoveTasksOutput) out.ResultMetadata = metadata return out, nil } type ListMessageMoveTasksInput struct { // The ARN of the queue whose message movement tasks are to be listed. // // This member is required. SourceArn *string // The maximum number of results to include in the response. The default is 1, // which provides the most recent message movement task. The upper limit is 10. MaxResults int32 noSmithyDocumentSerde } type ListMessageMoveTasksOutput struct { // A list of message movement tasks and their attributes. Results []types.ListMessageMoveTasksResultEntry // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListMessageMoveTasksMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpListMessageMoveTasks{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpListMessageMoveTasks{}, 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 = addOpListMessageMoveTasksValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListMessageMoveTasks(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_opListMessageMoveTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "ListMessageMoveTasks", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of your queues in the current region. The response includes a // maximum of 1,000 results. If you specify a value for the optional // QueueNamePrefix parameter, only queues with a name that begins with the // specified value are returned. The listQueues methods supports pagination. Set // parameter MaxResults in the request to specify the maximum number of results to // be returned in the response. If you do not set MaxResults , the response // includes a maximum of 1,000 results. If you set MaxResults and there are // additional results to display, the response includes a value for NextToken . Use // NextToken as a parameter in your next request to listQueues to receive the next // page of results. Cross-account permissions don't apply to this action. For more // information, see Grant cross-account permissions to a role and a username (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) // in the Amazon SQS Developer Guide. func (c *Client) ListQueues(ctx context.Context, params *ListQueuesInput, optFns ...func(*Options)) (*ListQueuesOutput, error) { if params == nil { params = &ListQueuesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListQueues", params, optFns, c.addOperationListQueuesMiddlewares) if err != nil { return nil, err } out := result.(*ListQueuesOutput) out.ResultMetadata = metadata return out, nil } type ListQueuesInput struct { // Maximum number of results to include in the response. Value range is 1 to 1000. // You must set MaxResults to receive a value for NextToken in the response. MaxResults *int32 // Pagination token to request the next set of results. NextToken *string // A string to use for filtering the list results. Only those queues whose name // begins with the specified string are returned. Queue URLs and names are // case-sensitive. QueueNamePrefix *string noSmithyDocumentSerde } // A list of your queues. type ListQueuesOutput struct { // Pagination token to include in the next request. Token value is null if there // are no additional results to request, or if you did not set MaxResults in the // request. NextToken *string // A list of queue URLs, up to 1,000 entries, or the value of MaxResults that you // sent in the request. QueueUrls []string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListQueuesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpListQueues{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpListQueues{}, 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_opListQueues(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 } // ListQueuesAPIClient is a client that implements the ListQueues operation. type ListQueuesAPIClient interface { ListQueues(context.Context, *ListQueuesInput, ...func(*Options)) (*ListQueuesOutput, error) } var _ ListQueuesAPIClient = (*Client)(nil) // ListQueuesPaginatorOptions is the paginator options for ListQueues type ListQueuesPaginatorOptions struct { // Maximum number of results to include in the response. Value range is 1 to 1000. // You must set MaxResults to receive a value for NextToken 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 } // ListQueuesPaginator is a paginator for ListQueues type ListQueuesPaginator struct { options ListQueuesPaginatorOptions client ListQueuesAPIClient params *ListQueuesInput nextToken *string firstPage bool } // NewListQueuesPaginator returns a new ListQueuesPaginator func NewListQueuesPaginator(client ListQueuesAPIClient, params *ListQueuesInput, optFns ...func(*ListQueuesPaginatorOptions)) *ListQueuesPaginator { if params == nil { params = &ListQueuesInput{} } options := ListQueuesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListQueuesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListQueuesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListQueues page. func (p *ListQueuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListQueuesOutput, 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.ListQueues(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListQueues(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "ListQueues", } }
237
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // List all cost allocation tags added to the specified Amazon SQS queue. For an // overview, see Tagging Your Amazon SQS Queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html) // in the Amazon SQS Developer Guide. Cross-account permissions don't apply to this // action. For more information, see Grant cross-account permissions to a role and // a username (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) // in the Amazon SQS Developer Guide. func (c *Client) ListQueueTags(ctx context.Context, params *ListQueueTagsInput, optFns ...func(*Options)) (*ListQueueTagsOutput, error) { if params == nil { params = &ListQueueTagsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListQueueTags", params, optFns, c.addOperationListQueueTagsMiddlewares) if err != nil { return nil, err } out := result.(*ListQueueTagsOutput) out.ResultMetadata = metadata return out, nil } type ListQueueTagsInput struct { // The URL of the queue. // // This member is required. QueueUrl *string noSmithyDocumentSerde } type ListQueueTagsOutput struct { // The list of all tags added to the specified queue. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListQueueTagsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpListQueueTags{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpListQueueTags{}, 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 = addOpListQueueTagsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListQueueTags(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_opListQueueTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "ListQueueTags", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes the messages in a queue specified by the QueueURL parameter. When you // use the PurgeQueue action, you can't retrieve any messages deleted from a // queue. The message deletion process takes up to 60 seconds. We recommend waiting // for 60 seconds regardless of your queue's size. Messages sent to the queue // before you call PurgeQueue might be received but are deleted within the next // minute. Messages sent to the queue after you call PurgeQueue might be deleted // while the queue is being purged. func (c *Client) PurgeQueue(ctx context.Context, params *PurgeQueueInput, optFns ...func(*Options)) (*PurgeQueueOutput, error) { if params == nil { params = &PurgeQueueInput{} } result, metadata, err := c.invokeOperation(ctx, "PurgeQueue", params, optFns, c.addOperationPurgeQueueMiddlewares) if err != nil { return nil, err } out := result.(*PurgeQueueOutput) out.ResultMetadata = metadata return out, nil } type PurgeQueueInput struct { // The URL of the queue from which the PurgeQueue action deletes messages. Queue // URLs and names are case-sensitive. // // This member is required. QueueUrl *string noSmithyDocumentSerde } type PurgeQueueOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationPurgeQueueMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpPurgeQueue{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpPurgeQueue{}, 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 = addOpPurgeQueueValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPurgeQueue(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_opPurgeQueue(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "PurgeQueue", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs 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/sqs/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves one or more messages (up to 10), from the specified queue. Using the // WaitTimeSeconds parameter enables long-poll support. For more information, see // Amazon SQS Long Polling (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-long-polling.html) // in the Amazon SQS Developer Guide. Short poll is the default behavior where a // weighted random set of machines is sampled on a ReceiveMessage call. Thus, only // the messages on the sampled machines are returned. If the number of messages in // the queue is small (fewer than 1,000), you most likely get fewer messages than // you requested per ReceiveMessage call. If the number of messages in the queue // is extremely small, you might not receive any messages in a particular // ReceiveMessage response. If this happens, repeat the request. For each message // returned, the response includes the following: // - The message body. // - An MD5 digest of the message body. For information about MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt) // . // - The MessageId you received when you sent the message to the queue. // - The receipt handle. // - The message attributes. // - An MD5 digest of the message attributes. // // The receipt handle is the identifier you must provide when deleting the // message. For more information, see Queue and Message Identifiers (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-message-identifiers.html) // in the Amazon SQS Developer Guide. You can provide the VisibilityTimeout // parameter in your request. The parameter is applied to the messages that Amazon // SQS returns in the response. If you don't include the parameter, the overall // visibility timeout for the queue is used for the returned messages. For more // information, see Visibility Timeout (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) // in the Amazon SQS Developer Guide. A message that isn't deleted or a message // whose visibility isn't extended before the visibility timeout expires counts as // a failed receive. Depending on the configuration of the queue, the message might // be sent to the dead-letter queue. In the future, new attributes might be added. // If you write code that calls this action, we recommend that you structure your // code so that it can handle new attributes gracefully. func (c *Client) ReceiveMessage(ctx context.Context, params *ReceiveMessageInput, optFns ...func(*Options)) (*ReceiveMessageOutput, error) { if params == nil { params = &ReceiveMessageInput{} } result, metadata, err := c.invokeOperation(ctx, "ReceiveMessage", params, optFns, c.addOperationReceiveMessageMiddlewares) if err != nil { return nil, err } out := result.(*ReceiveMessageOutput) out.ResultMetadata = metadata return out, nil } type ReceiveMessageInput struct { // The URL of the Amazon SQS queue from which messages are received. Queue URLs // and names are case-sensitive. // // This member is required. QueueUrl *string // A list of attributes that need to be returned along with each message. These // attributes include: // - All – Returns all values. // - ApproximateFirstReceiveTimestamp – Returns the time the message was first // received from the queue ( epoch time (http://en.wikipedia.org/wiki/Unix_time) // in milliseconds). // - ApproximateReceiveCount – Returns the number of times a message has been // received across all queues but not deleted. // - AWSTraceHeader – Returns the X-Ray trace header string. // - SenderId // - For a user, returns the user ID, for example ABCDEFGHI1JKLMNOPQ23R . // - For an IAM role, returns the IAM role ID, for example // ABCDE1F2GH3I4JK5LMNOP:i-a123b456 . // - SentTimestamp – Returns the time the message was sent to the queue ( epoch // time (http://en.wikipedia.org/wiki/Unix_time) in milliseconds). // - SqsManagedSseEnabled – Enables server-side queue encryption using SQS owned // encryption keys. Only one server-side encryption option is supported per queue // (for example, SSE-KMS (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html) // or SSE-SQS (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html) // ). // - MessageDeduplicationId – Returns the value provided by the producer that // calls the SendMessage action. // - MessageGroupId – Returns the value provided by the producer that calls the // SendMessage action. Messages with the same MessageGroupId are returned in // sequence. // - SequenceNumber – Returns the value provided by Amazon SQS. AttributeNames []types.QueueAttributeName // The maximum number of messages to return. Amazon SQS never returns more // messages than this value (however, fewer messages might be returned). Valid // values: 1 to 10. Default: 1. MaxNumberOfMessages int32 // The name of the message attribute, where N is the index. // - The name can contain alphanumeric characters and the underscore ( _ ), // hyphen ( - ), and period ( . ). // - The name is case-sensitive and must be unique among all attribute names for // the message. // - The name must not start with AWS-reserved prefixes such as AWS. or Amazon. // (or any casing variants). // - The name must not start or end with a period ( . ), and it should not have // periods in succession ( .. ). // - The name can be up to 256 characters long. // When using ReceiveMessage , you can send a list of attribute names to receive, // or you can return all of the attributes by specifying All or .* in your // request. You can also use all message attributes starting with a prefix, for // example bar.* . MessageAttributeNames []string // This parameter applies only to FIFO (first-in-first-out) queues. The token used // for deduplication of ReceiveMessage calls. If a networking issue occurs after a // ReceiveMessage action, and instead of a response you receive a generic error, it // is possible to retry the same action with an identical ReceiveRequestAttemptId // to retrieve the same set of messages, even if their visibility timeout has not // yet expired. // - You can use ReceiveRequestAttemptId only for 5 minutes after a // ReceiveMessage action. // - When you set FifoQueue , a caller of the ReceiveMessage action can provide a // ReceiveRequestAttemptId explicitly. // - If a caller of the ReceiveMessage action doesn't provide a // ReceiveRequestAttemptId , Amazon SQS generates a ReceiveRequestAttemptId . // - It is possible to retry the ReceiveMessage action with the same // ReceiveRequestAttemptId if none of the messages have been modified (deleted or // had their visibility changes). // - During a visibility timeout, subsequent calls with the same // ReceiveRequestAttemptId return the same messages and receipt handles. If a // retry occurs within the deduplication interval, it resets the visibility // timeout. For more information, see Visibility Timeout (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) // in the Amazon SQS Developer Guide. If a caller of the ReceiveMessage action // still processes messages when the visibility timeout expires and messages become // visible, another worker consuming from the same queue can receive the same // messages and therefore process duplicates. Also, if a consumer whose message // processing time is longer than the visibility timeout tries to delete the // processed messages, the action fails with an error. To mitigate this effect, // ensure that your application observes a safe threshold before the visibility // timeout expires and extend the visibility timeout as necessary. // - While messages with a particular MessageGroupId are invisible, no more // messages belonging to the same MessageGroupId are returned until the // visibility timeout expires. You can still receive messages with another // MessageGroupId as long as it is also visible. // - If a caller of ReceiveMessage can't track the ReceiveRequestAttemptId , no // retries work until the original visibility timeout expires. As a result, delays // might occur but the messages in the queue remain in a strict order. // The maximum length of ReceiveRequestAttemptId is 128 characters. // ReceiveRequestAttemptId can contain alphanumeric characters ( a-z , A-Z , 0-9 ) // and punctuation ( !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ ). For best practices of // using ReceiveRequestAttemptId , see Using the ReceiveRequestAttemptId Request // Parameter (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-receiverequestattemptid-request-parameter.html) // in the Amazon SQS Developer Guide. ReceiveRequestAttemptId *string // The duration (in seconds) that the received messages are hidden from subsequent // retrieve requests after being retrieved by a ReceiveMessage request. VisibilityTimeout int32 // The duration (in seconds) for which the call waits for a message to arrive in // the queue before returning. If a message is available, the call returns sooner // than WaitTimeSeconds . If no messages are available and the wait time expires, // the call returns successfully with an empty list of messages. To avoid HTTP // errors, ensure that the HTTP response timeout for ReceiveMessage requests is // longer than the WaitTimeSeconds parameter. For example, with the Java SDK, you // can set HTTP transport settings using the NettyNioAsyncHttpClient (https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClient.html) // for asynchronous clients, or the ApacheHttpClient (https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/apache/ApacheHttpClient.html) // for synchronous clients. WaitTimeSeconds int32 noSmithyDocumentSerde } // A list of received messages. type ReceiveMessageOutput struct { // A list of messages. Messages []types.Message // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationReceiveMessageMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpReceiveMessage{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpReceiveMessage{}, 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 = addValidateReceiveMessageChecksum(stack, options); err != nil { return err } if err = addOpReceiveMessageValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opReceiveMessage(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_opReceiveMessage(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "ReceiveMessage", } }
267
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Revokes any permissions in the queue policy that matches the specified Label // parameter. // - Only the owner of a queue can remove permissions from it. // - Cross-account permissions don't apply to this action. For more information, // see Grant cross-account permissions to a role and a username (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) // in the Amazon SQS Developer Guide. // - To remove the ability to change queue permissions, you must deny permission // to the AddPermission , RemovePermission , and SetQueueAttributes actions in // your IAM policy. func (c *Client) RemovePermission(ctx context.Context, params *RemovePermissionInput, optFns ...func(*Options)) (*RemovePermissionOutput, error) { if params == nil { params = &RemovePermissionInput{} } result, metadata, err := c.invokeOperation(ctx, "RemovePermission", params, optFns, c.addOperationRemovePermissionMiddlewares) if err != nil { return nil, err } out := result.(*RemovePermissionOutput) out.ResultMetadata = metadata return out, nil } type RemovePermissionInput struct { // The identification of the permission to remove. This is the label added using // the AddPermission action. // // This member is required. Label *string // The URL of the Amazon SQS queue from which permissions are removed. Queue URLs // and names are case-sensitive. // // This member is required. QueueUrl *string noSmithyDocumentSerde } type RemovePermissionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRemovePermissionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpRemovePermission{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRemovePermission{}, 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 = addOpRemovePermissionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemovePermission(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_opRemovePermission(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "RemovePermission", } }
135
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs 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/sqs/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Delivers a message to the specified queue. A message can include only XML, // JSON, and unformatted text. The following Unicode characters are allowed: #x9 | // #xA | #xD | #x20 to #xD7FF | #xE000 to #xFFFD | #x10000 to #x10FFFF Any // characters not included in this list will be rejected. For more information, see // the W3C specification for characters (http://www.w3.org/TR/REC-xml/#charsets) . func (c *Client) SendMessage(ctx context.Context, params *SendMessageInput, optFns ...func(*Options)) (*SendMessageOutput, error) { if params == nil { params = &SendMessageInput{} } result, metadata, err := c.invokeOperation(ctx, "SendMessage", params, optFns, c.addOperationSendMessageMiddlewares) if err != nil { return nil, err } out := result.(*SendMessageOutput) out.ResultMetadata = metadata return out, nil } type SendMessageInput struct { // The message to send. The minimum size is one character. The maximum size is 256 // KiB. A message can include only XML, JSON, and unformatted text. The following // Unicode characters are allowed: #x9 | #xA | #xD | #x20 to #xD7FF | #xE000 to // #xFFFD | #x10000 to #x10FFFF Any characters not included in this list will be // rejected. For more information, see the W3C specification for characters (http://www.w3.org/TR/REC-xml/#charsets) // . // // This member is required. MessageBody *string // The URL of the Amazon SQS queue to which a message is sent. Queue URLs and // names are case-sensitive. // // This member is required. QueueUrl *string // The length of time, in seconds, for which to delay a specific message. Valid // values: 0 to 900. Maximum: 15 minutes. Messages with a positive DelaySeconds // value become available for processing after the delay period is finished. If you // don't specify a value, the default value for the queue applies. When you set // FifoQueue , you can't set DelaySeconds per message. You can set this parameter // only on a queue level. DelaySeconds int32 // Each message attribute consists of a Name , Type , and Value . For more // information, see Amazon SQS message attributes (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) // in the Amazon SQS Developer Guide. MessageAttributes map[string]types.MessageAttributeValue // This parameter applies only to FIFO (first-in-first-out) queues. The token used // for deduplication of sent messages. If a message with a particular // MessageDeduplicationId is sent successfully, any messages sent with the same // MessageDeduplicationId are accepted successfully but aren't delivered during the // 5-minute deduplication interval. For more information, see Exactly-once // processing (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html) // in the Amazon SQS Developer Guide. // - Every message must have a unique MessageDeduplicationId , // - You may provide a MessageDeduplicationId explicitly. // - If you aren't able to provide a MessageDeduplicationId and you enable // ContentBasedDeduplication for your queue, Amazon SQS uses a SHA-256 hash to // generate the MessageDeduplicationId using the body of the message (but not the // attributes of the message). // - If you don't provide a MessageDeduplicationId and the queue doesn't have // ContentBasedDeduplication set, the action fails with an error. // - If the queue has ContentBasedDeduplication set, your MessageDeduplicationId // overrides the generated one. // - When ContentBasedDeduplication is in effect, messages with identical content // sent within the deduplication interval are treated as duplicates and only one // copy of the message is delivered. // - If you send one message with ContentBasedDeduplication enabled and then // another message with a MessageDeduplicationId that is the same as the one // generated for the first MessageDeduplicationId , the two messages are treated // as duplicates and only one copy of the message is delivered. // The MessageDeduplicationId is available to the consumer of the message (this // can be useful for troubleshooting delivery issues). If a message is sent // successfully but the acknowledgement is lost and the message is resent with the // same MessageDeduplicationId after the deduplication interval, Amazon SQS can't // detect duplicate messages. Amazon SQS continues to keep track of the message // deduplication ID even after the message is received and deleted. The maximum // length of MessageDeduplicationId is 128 characters. MessageDeduplicationId can // contain alphanumeric characters ( a-z , A-Z , 0-9 ) and punctuation ( // !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ ). For best practices of using // MessageDeduplicationId , see Using the MessageDeduplicationId Property (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html) // in the Amazon SQS Developer Guide. MessageDeduplicationId *string // This parameter applies only to FIFO (first-in-first-out) queues. The tag that // specifies that a message belongs to a specific message group. Messages that // belong to the same message group are processed in a FIFO manner (however, // messages in different message groups might be processed out of order). To // interleave multiple ordered streams within a single queue, use MessageGroupId // values (for example, session data for multiple users). In this scenario, // multiple consumers can process the queue, but the session data of each user is // processed in a FIFO fashion. // - You must associate a non-empty MessageGroupId with a message. If you don't // provide a MessageGroupId , the action fails. // - ReceiveMessage might return messages with multiple MessageGroupId values. // For each MessageGroupId , the messages are sorted by time sent. The caller // can't specify a MessageGroupId . // The length of MessageGroupId is 128 characters. Valid values: alphanumeric // characters and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~) . For best // practices of using MessageGroupId , see Using the MessageGroupId Property (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html) // in the Amazon SQS Developer Guide. MessageGroupId is required for FIFO queues. // You can't use it for Standard queues. MessageGroupId *string // The message system attribute to send. Each message system attribute consists of // a Name , Type , and Value . // - Currently, the only supported message system attribute is AWSTraceHeader . // Its type must be String and its value must be a correctly formatted X-Ray // trace header string. // - The size of a message system attribute doesn't count towards the total size // of a message. MessageSystemAttributes map[string]types.MessageSystemAttributeValue noSmithyDocumentSerde } // The MD5OfMessageBody and MessageId elements. type SendMessageOutput struct { // An MD5 digest of the non-URL-encoded message attribute string. You can use this // attribute to verify that Amazon SQS received the message correctly. Amazon SQS // URL-decodes the message before creating the MD5 digest. For information about // MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt) . MD5OfMessageAttributes *string // An MD5 digest of the non-URL-encoded message body string. You can use this // attribute to verify that Amazon SQS received the message correctly. Amazon SQS // URL-decodes the message before creating the MD5 digest. For information about // MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt) . MD5OfMessageBody *string // An MD5 digest of the non-URL-encoded message system attribute string. You can // use this attribute to verify that Amazon SQS received the message correctly. // Amazon SQS URL-decodes the message before creating the MD5 digest. MD5OfMessageSystemAttributes *string // An attribute containing the MessageId of the message sent to the queue. For // more information, see Queue and Message Identifiers (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-message-identifiers.html) // in the Amazon SQS Developer Guide. MessageId *string // This parameter applies only to FIFO (first-in-first-out) queues. The large, // non-consecutive number that Amazon SQS assigns to each message. The length of // SequenceNumber is 128 bits. SequenceNumber continues to increase for a // particular MessageGroupId . SequenceNumber *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationSendMessageMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpSendMessage{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSendMessage{}, 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 = addValidateSendMessageChecksum(stack, options); err != nil { return err } if err = addOpSendMessageValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendMessage(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_opSendMessage(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "SendMessage", } }
248
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs 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/sqs/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // You can use SendMessageBatch to send up to 10 messages to the specified queue // by assigning either identical or different values to each message (or by not // assigning values at all). This is a batch version of SendMessage . For a FIFO // queue, multiple messages within a single batch are enqueued in the order they // are sent. The result of sending each message is reported individually in the // response. Because the batch request can result in a combination of successful // and unsuccessful actions, you should check for batch errors even when the call // returns an HTTP status code of 200 . The maximum allowed individual message size // and the maximum total payload size (the sum of the individual lengths of all of // the batched messages) are both 256 KiB (262,144 bytes). A message can include // only XML, JSON, and unformatted text. The following Unicode characters are // allowed: #x9 | #xA | #xD | #x20 to #xD7FF | #xE000 to #xFFFD | #x10000 to // #x10FFFF Any characters not included in this list will be rejected. For more // information, see the W3C specification for characters (http://www.w3.org/TR/REC-xml/#charsets) // . If you don't specify the DelaySeconds parameter for an entry, Amazon SQS uses // the default value for the queue. func (c *Client) SendMessageBatch(ctx context.Context, params *SendMessageBatchInput, optFns ...func(*Options)) (*SendMessageBatchOutput, error) { if params == nil { params = &SendMessageBatchInput{} } result, metadata, err := c.invokeOperation(ctx, "SendMessageBatch", params, optFns, c.addOperationSendMessageBatchMiddlewares) if err != nil { return nil, err } out := result.(*SendMessageBatchOutput) out.ResultMetadata = metadata return out, nil } type SendMessageBatchInput struct { // A list of SendMessageBatchRequestEntry items. // // This member is required. Entries []types.SendMessageBatchRequestEntry // The URL of the Amazon SQS queue to which batched messages are sent. Queue URLs // and names are case-sensitive. // // This member is required. QueueUrl *string noSmithyDocumentSerde } // For each message in the batch, the response contains a // SendMessageBatchResultEntry tag if the message succeeds or a // BatchResultErrorEntry tag if the message fails. type SendMessageBatchOutput struct { // A list of BatchResultErrorEntry items with error details about each message // that can't be enqueued. // // This member is required. Failed []types.BatchResultErrorEntry // A list of SendMessageBatchResultEntry items. // // This member is required. Successful []types.SendMessageBatchResultEntry // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationSendMessageBatchMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpSendMessageBatch{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSendMessageBatch{}, 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 = addValidateSendMessageBatchChecksum(stack, options); err != nil { return err } if err = addOpSendMessageBatchValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendMessageBatch(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_opSendMessageBatch(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "SendMessageBatch", } }
160
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs 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" ) // Sets the value of one or more queue attributes. When you change a queue's // attributes, the change can take up to 60 seconds for most of the attributes to // propagate throughout the Amazon SQS system. Changes made to the // MessageRetentionPeriod attribute can take up to 15 minutes and will impact // existing messages in the queue potentially causing them to be expired and // deleted if the MessageRetentionPeriod is reduced below the age of existing // messages. // - In the future, new attributes might be added. If you write code that calls // this action, we recommend that you structure your code so that it can handle new // attributes gracefully. // - Cross-account permissions don't apply to this action. For more information, // see Grant cross-account permissions to a role and a username (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) // in the Amazon SQS Developer Guide. // - To remove the ability to change queue permissions, you must deny permission // to the AddPermission , RemovePermission , and SetQueueAttributes actions in // your IAM policy. func (c *Client) SetQueueAttributes(ctx context.Context, params *SetQueueAttributesInput, optFns ...func(*Options)) (*SetQueueAttributesOutput, error) { if params == nil { params = &SetQueueAttributesInput{} } result, metadata, err := c.invokeOperation(ctx, "SetQueueAttributes", params, optFns, c.addOperationSetQueueAttributesMiddlewares) if err != nil { return nil, err } out := result.(*SetQueueAttributesOutput) out.ResultMetadata = metadata return out, nil } type SetQueueAttributesInput struct { // A map of attributes to set. The following lists the names, descriptions, and // values of the special request parameters that the SetQueueAttributes action // uses: // - DelaySeconds – The length of time, in seconds, for which the delivery of all // messages in the queue is delayed. Valid values: An integer from 0 to 900 (15 // minutes). Default: 0. // - MaximumMessageSize – The limit of how many bytes a message can contain // before Amazon SQS rejects it. Valid values: An integer from 1,024 bytes (1 KiB) // up to 262,144 bytes (256 KiB). Default: 262,144 (256 KiB). // - MessageRetentionPeriod – The length of time, in seconds, for which Amazon // SQS retains a message. Valid values: An integer representing seconds, from 60 (1 // minute) to 1,209,600 (14 days). Default: 345,600 (4 days). When you change a // queue's attributes, the change can take up to 60 seconds for most of the // attributes to propagate throughout the Amazon SQS system. Changes made to the // MessageRetentionPeriod attribute can take up to 15 minutes and will impact // existing messages in the queue potentially causing them to be expired and // deleted if the MessageRetentionPeriod is reduced below the age of existing // messages. // - Policy – The queue's policy. A valid Amazon Web Services policy. For more // information about policy structure, see Overview of Amazon Web Services IAM // Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html) // in the Identity and Access Management User Guide. // - ReceiveMessageWaitTimeSeconds – The length of time, in seconds, for which a // ReceiveMessage action waits for a message to arrive. Valid values: An integer // from 0 to 20 (seconds). Default: 0. // - VisibilityTimeout – The visibility timeout for the queue, in seconds. Valid // values: An integer from 0 to 43,200 (12 hours). Default: 30. For more // information about the visibility timeout, see Visibility Timeout (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) // in the Amazon SQS Developer Guide. // The following attributes apply only to dead-letter queues: (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) // - RedrivePolicy – The string that includes the parameters for the dead-letter // queue functionality of the source queue as a JSON object. The parameters are as // follows: // - deadLetterTargetArn – The Amazon Resource Name (ARN) of the dead-letter // queue to which Amazon SQS moves messages after the value of maxReceiveCount is // exceeded. // - maxReceiveCount – The number of times a message is delivered to the source // queue before being moved to the dead-letter queue. Default: 10. When the // ReceiveCount for a message exceeds the maxReceiveCount for a queue, Amazon SQS // moves the message to the dead-letter-queue. // - RedriveAllowPolicy – The string that includes the parameters for the // permissions for the dead-letter queue redrive permission and which source queues // can specify dead-letter queues as a JSON object. The parameters are as follows: // - redrivePermission – The permission type that defines which source queues can // specify the current queue as the dead-letter queue. Valid values are: // - allowAll – (Default) Any source queues in this Amazon Web Services account // in the same Region can specify this queue as the dead-letter queue. // - denyAll – No source queues can specify this queue as the dead-letter queue. // - byQueue – Only queues specified by the sourceQueueArns parameter can specify // this queue as the dead-letter queue. // - sourceQueueArns – The Amazon Resource Names (ARN)s of the source queues that // can specify this queue as the dead-letter queue and redrive messages. You can // specify this parameter only when the redrivePermission parameter is set to // byQueue . You can specify up to 10 source queue ARNs. To allow more than 10 // source queues to specify dead-letter queues, set the redrivePermission // parameter to allowAll . // The dead-letter queue of a FIFO queue must also be a FIFO queue. Similarly, the // dead-letter queue of a standard queue must also be a standard queue. The // following attributes apply only to server-side-encryption (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html) // : // - KmsMasterKeyId – The ID of an Amazon Web Services managed customer master // key (CMK) for Amazon SQS or a custom CMK. For more information, see Key Terms (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms) // . While the alias of the AWS-managed CMK for Amazon SQS is always // alias/aws/sqs , the alias of a custom CMK can, for example, be alias/MyAlias // . For more examples, see KeyId (https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) // in the Key Management Service API Reference. // - KmsDataKeyReusePeriodSeconds – The length of time, in seconds, for which // Amazon SQS can reuse a data key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys) // to encrypt or decrypt messages before calling KMS again. An integer representing // seconds, between 60 seconds (1 minute) and 86,400 seconds (24 hours). Default: // 300 (5 minutes). A shorter time period provides better security but results in // more calls to KMS which might incur charges after Free Tier. For more // information, see How Does the Data Key Reuse Period Work? (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work) // . // - SqsManagedSseEnabled – Enables server-side queue encryption using SQS owned // encryption keys. Only one server-side encryption option is supported per queue // (for example, SSE-KMS (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html) // or SSE-SQS (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html) // ). // The following attribute applies only to FIFO (first-in-first-out) queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html) // : // - ContentBasedDeduplication – Enables content-based deduplication. For more // information, see Exactly-once processing (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html) // in the Amazon SQS Developer Guide. Note the following: // - Every message must have a unique MessageDeduplicationId . // - You may provide a MessageDeduplicationId explicitly. // - If you aren't able to provide a MessageDeduplicationId and you enable // ContentBasedDeduplication for your queue, Amazon SQS uses a SHA-256 hash to // generate the MessageDeduplicationId using the body of the message (but not the // attributes of the message). // - If you don't provide a MessageDeduplicationId and the queue doesn't have // ContentBasedDeduplication set, the action fails with an error. // - If the queue has ContentBasedDeduplication set, your MessageDeduplicationId // overrides the generated one. // - When ContentBasedDeduplication is in effect, messages with identical content // sent within the deduplication interval are treated as duplicates and only one // copy of the message is delivered. // - If you send one message with ContentBasedDeduplication enabled and then // another message with a MessageDeduplicationId that is the same as the one // generated for the first MessageDeduplicationId , the two messages are treated // as duplicates and only one copy of the message is delivered. // The following attributes apply only to high throughput for FIFO queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html) // : // - DeduplicationScope – Specifies whether message deduplication occurs at the // message group or queue level. Valid values are messageGroup and queue . // - FifoThroughputLimit – Specifies whether the FIFO queue throughput quota // applies to the entire queue or per message group. Valid values are perQueue // and perMessageGroupId . The perMessageGroupId value is allowed only when the // value for DeduplicationScope is messageGroup . // To enable high throughput for FIFO queues, do the following: // - Set DeduplicationScope to messageGroup . // - Set FifoThroughputLimit to perMessageGroupId . // If you set these attributes to anything other than the values shown for // enabling high throughput, normal throughput is in effect and deduplication // occurs as specified. For information on throughput quotas, see Quotas related // to messages (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) // in the Amazon SQS Developer Guide. // // This member is required. Attributes map[string]string // The URL of the Amazon SQS queue whose attributes are set. Queue URLs and names // are case-sensitive. // // This member is required. QueueUrl *string noSmithyDocumentSerde } type SetQueueAttributesOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationSetQueueAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpSetQueueAttributes{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSetQueueAttributes{}, 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 = addOpSetQueueAttributesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetQueueAttributes(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_opSetQueueAttributes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "SetQueueAttributes", } }
257
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs 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" ) // Starts an asynchronous task to move messages from a specified source queue to a // specified destination queue. // - This action is currently limited to supporting message redrive from // dead-letter queues (DLQs) only. In this context, the source queue is the // dead-letter queue (DLQ), while the destination queue can be the original source // queue (from which the messages were driven to the dead-letter-queue), or a // custom destination queue. // - Currently, only standard queues are supported. // - Only one active message movement task is supported per queue at any given // time. func (c *Client) StartMessageMoveTask(ctx context.Context, params *StartMessageMoveTaskInput, optFns ...func(*Options)) (*StartMessageMoveTaskOutput, error) { if params == nil { params = &StartMessageMoveTaskInput{} } result, metadata, err := c.invokeOperation(ctx, "StartMessageMoveTask", params, optFns, c.addOperationStartMessageMoveTaskMiddlewares) if err != nil { return nil, err } out := result.(*StartMessageMoveTaskOutput) out.ResultMetadata = metadata return out, nil } type StartMessageMoveTaskInput struct { // The ARN of the queue that contains the messages to be moved to another queue. // Currently, only dead-letter queue (DLQ) ARNs are accepted. // // This member is required. SourceArn *string // The ARN of the queue that receives the moved messages. You can use this field // to specify the destination queue where you would like to redrive messages. If // this field is left blank, the messages will be redriven back to their respective // original source queues. DestinationArn *string // The number of messages to be moved per second (the message movement rate). You // can use this field to define a fixed message movement rate. The maximum value // for messages per second is 500. If this field is left blank, the system will // optimize the rate based on the queue message backlog size, which may vary // throughout the duration of the message movement task. MaxNumberOfMessagesPerSecond int32 noSmithyDocumentSerde } type StartMessageMoveTaskOutput struct { // An identifier associated with a message movement task. You can use this // identifier to cancel a specified message movement task using the // CancelMessageMoveTask action. TaskHandle *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartMessageMoveTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpStartMessageMoveTask{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpStartMessageMoveTask{}, 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 = addOpStartMessageMoveTaskValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartMessageMoveTask(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_opStartMessageMoveTask(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "StartMessageMoveTask", } }
149
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs 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" ) // Add cost allocation tags to the specified Amazon SQS queue. For an overview, // see Tagging Your Amazon SQS Queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html) // in the Amazon SQS Developer Guide. When you use queue tags, keep the following // guidelines in mind: // - Adding more than 50 tags to a queue isn't recommended. // - Tags don't have any semantic meaning. Amazon SQS interprets tags as // character strings. // - Tags are case-sensitive. // - A new tag with a key identical to that of an existing tag overwrites the // existing tag. // // For a full list of tag restrictions, see Quotas related to queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-limits.html#limits-queues) // in the Amazon SQS Developer Guide. Cross-account permissions don't apply to this // action. For more information, see Grant cross-account permissions to a role and // a username (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) // in the Amazon SQS Developer Guide. func (c *Client) TagQueue(ctx context.Context, params *TagQueueInput, optFns ...func(*Options)) (*TagQueueOutput, error) { if params == nil { params = &TagQueueInput{} } result, metadata, err := c.invokeOperation(ctx, "TagQueue", params, optFns, c.addOperationTagQueueMiddlewares) if err != nil { return nil, err } out := result.(*TagQueueOutput) out.ResultMetadata = metadata return out, nil } type TagQueueInput struct { // The URL of the queue. // // This member is required. QueueUrl *string // The list of tags to be added to the specified queue. // // This member is required. Tags map[string]string noSmithyDocumentSerde } type TagQueueOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationTagQueueMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpTagQueue{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpTagQueue{}, 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 = addOpTagQueueValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagQueue(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_opTagQueue(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "TagQueue", } }
140
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Remove cost allocation tags from the specified Amazon SQS queue. For an // overview, see Tagging Your Amazon SQS Queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html) // in the Amazon SQS Developer Guide. Cross-account permissions don't apply to this // action. For more information, see Grant cross-account permissions to a role and // a username (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) // in the Amazon SQS Developer Guide. func (c *Client) UntagQueue(ctx context.Context, params *UntagQueueInput, optFns ...func(*Options)) (*UntagQueueOutput, error) { if params == nil { params = &UntagQueueInput{} } result, metadata, err := c.invokeOperation(ctx, "UntagQueue", params, optFns, c.addOperationUntagQueueMiddlewares) if err != nil { return nil, err } out := result.(*UntagQueueOutput) out.ResultMetadata = metadata return out, nil } type UntagQueueInput struct { // The URL of the queue. // // This member is required. QueueUrl *string // The list of tags to be removed from the specified queue. // // This member is required. TagKeys []string noSmithyDocumentSerde } type UntagQueueOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUntagQueueMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpUntagQueue{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpUntagQueue{}, 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 = addOpUntagQueueValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagQueue(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_opUntagQueue(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sqs", OperationName: "UntagQueue", } }
130
aws-sdk-go-v2
aws
Go
package sqs import ( "context" "crypto/md5" "encoding/hex" "fmt" "strings" "github.com/aws/aws-sdk-go-v2/aws" sqstypes "github.com/aws/aws-sdk-go-v2/service/sqs/types" "github.com/aws/smithy-go/middleware" ) // addValidateSendMessageChecksum adds the ValidateMessageChecksum middleware // to the stack configured for the SendMessage Operation. func addValidateSendMessageChecksum(stack *middleware.Stack, o Options) error { return addValidateMessageChecksum(stack, o, validateSendMessageChecksum) } // validateSendMessageChecksum validates the SendMessage operation's input // message payload MD5 checksum matches that returned by the API. // // The input and output types must match the SendMessage operation. func validateSendMessageChecksum(input, output interface{}) error { in, ok := input.(*SendMessageInput) if !ok { return fmt.Errorf("wrong input type, expect %T, got %T", in, input) } out, ok := output.(*SendMessageOutput) if !ok { return fmt.Errorf("wrong output type, expect %T, got %T", out, output) } // Nothing to validate if the members aren't populated. if in.MessageBody == nil || out.MD5OfMessageBody == nil { return nil } if err := validateMessageChecksum(*in.MessageBody, *out.MD5OfMessageBody); err != nil { return messageChecksumError{ MessageID: aws.ToString(out.MessageId), Err: err, } } return nil } // addValidateSendMessageBatchChecksum adds the ValidateMessagechecksum // middleware to the stack configured for the SendMessageBatch operation. func addValidateSendMessageBatchChecksum(stack *middleware.Stack, o Options) error { return addValidateMessageChecksum(stack, o, validateSendMessageBatchChecksum) } // validateSendMessageBatchChecksum validates the SendMessageBatch operation's // input messages body MD5 checksum matches those returned by the API. // // The input and output types must match the SendMessageBatch operation. func validateSendMessageBatchChecksum(input, output interface{}) error { in, ok := input.(*SendMessageBatchInput) if !ok { return fmt.Errorf("wrong input type, expect %T, got %T", in, input) } out, ok := output.(*SendMessageBatchOutput) if !ok { return fmt.Errorf("wrong output type, expect %T, got %T", out, output) } outEntries := map[string]sqstypes.SendMessageBatchResultEntry{} for _, e := range out.Successful { outEntries[*e.Id] = e } var failedMessageErrs []messageChecksumError for _, inEntry := range in.Entries { outEntry, ok := outEntries[*inEntry.Id] // Nothing to validate if the members aren't populated. if !ok || inEntry.MessageBody == nil || outEntry.MD5OfMessageBody == nil { continue } if err := validateMessageChecksum(*inEntry.MessageBody, *outEntry.MD5OfMessageBody); err != nil { failedMessageErrs = append(failedMessageErrs, messageChecksumError{ MessageID: aws.ToString(outEntry.MessageId), Err: err, }) } } if len(failedMessageErrs) != 0 { return batchMessageChecksumError{ Errs: failedMessageErrs, } } return nil } // addValidateReceiveMessageChecksum adds the ValidateMessagechecksum // middleware to the stack configured for the ReceiveMessage operation. func addValidateReceiveMessageChecksum(stack *middleware.Stack, o Options) error { return addValidateMessageChecksum(stack, o, validateReceiveMessageChecksum) } // validateReceiveMessageChecksum validates the ReceiveMessage operation's // input messages body MD5 checksum matches those returned by the API. // // The input and output types must match the ReceiveMessage operation. func validateReceiveMessageChecksum(_, output interface{}) error { out, ok := output.(*ReceiveMessageOutput) if !ok { return fmt.Errorf("wrong output type, expect %T, got %T", out, output) } var failedMessageErrs []messageChecksumError for _, msg := range out.Messages { // Nothing to validate if the members aren't populated. if msg.Body == nil || msg.MD5OfBody == nil { continue } if err := validateMessageChecksum(*msg.Body, *msg.MD5OfBody); err != nil { failedMessageErrs = append(failedMessageErrs, messageChecksumError{ MessageID: aws.ToString(msg.MessageId), Err: err, }) } } if len(failedMessageErrs) != 0 { return batchMessageChecksumError{ Errs: failedMessageErrs, } } return nil } // messageChecksumValidator provides the function signature for the operation's // validator. type messageChecksumValidator func(input, output interface{}) error // addValidateMessageChecksum adds the ValidateMessageChecksum middleware to // the stack with the passed in validator specified. func addValidateMessageChecksum(stack *middleware.Stack, o Options, validate messageChecksumValidator) error { if o.DisableMessageChecksumValidation { return nil } m := validateMessageChecksumMiddleware{ validate: validate, } err := stack.Initialize.Add(m, middleware.Before) if err != nil { return fmt.Errorf("failed to add %s middleware, %w", m.ID(), err) } return nil } // validateMessageChecksumMiddleware provides the Initialize middleware for // validating an operation's message checksum is validate. Needs to b // configured with the operation's validator. type validateMessageChecksumMiddleware struct { validate messageChecksumValidator } // ID returns the Middleware ID. func (validateMessageChecksumMiddleware) ID() string { return "SQSValidateMessageChecksum" } // HandleInitialize implements the InitializeMiddleware interface providing a // middleware that will validate an operation's message checksum based on // calling the validate member. func (m validateMessageChecksumMiddleware) HandleInitialize( ctx context.Context, input middleware.InitializeInput, next middleware.InitializeHandler, ) ( out middleware.InitializeOutput, meta middleware.Metadata, err error, ) { out, meta, err = next.HandleInitialize(ctx, input) if err != nil { return out, meta, err } err = m.validate(input.Parameters, out.Result) if err != nil { return out, meta, fmt.Errorf("message checksum validation failed, %w", err) } return out, meta, nil } // validateMessageChecksum compares the MD5 checksums of value parameter with // the expected MD5 value. Returns an error if the computed checksum does not // match the expected value. func validateMessageChecksum(value, expect string) error { msum := md5.Sum([]byte(value)) sum := hex.EncodeToString(msum[:]) if sum != expect { return fmt.Errorf("expected MD5 checksum %s, got %s", expect, sum) } return nil } // messageChecksumError provides an error type for invalid message checksums. type messageChecksumError struct { MessageID string Err error } func (e messageChecksumError) Error() string { prefix := "message" if e.MessageID != "" { prefix += " " + e.MessageID } return fmt.Sprintf("%s has invalid checksum, %v", prefix, e.Err.Error()) } // batchMessageChecksumError provides an error type for a collection of invalid // message checksum errors. type batchMessageChecksumError struct { Errs []messageChecksumError } func (e batchMessageChecksumError) Error() string { var w strings.Builder fmt.Fprintf(&w, "message checksum errors") for _, err := range e.Errs { fmt.Fprintf(&w, "\n\t%s", err.Error()) } return w.String() }
235
aws-sdk-go-v2
aws
Go
package sqs import ( "context" "fmt" "strings" "testing" "github.com/aws/aws-sdk-go-v2/aws" sqstypes "github.com/aws/aws-sdk-go-v2/service/sqs/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) func TestValidateSendMessageChecksum(t *testing.T) { cases := map[string]struct { input *SendMessageInput output *SendMessageOutput handlerErr error expectErr string }{ "success": { input: &SendMessageInput{ MessageBody: aws.String("test"), }, output: &SendMessageOutput{ MD5OfMessageBody: aws.String("098f6bcd4621d373cade4e832627b4f6"), MessageId: aws.String("id"), }, }, "no input message": { input: &SendMessageInput{}, output: &SendMessageOutput{ MD5OfMessageBody: aws.String("098f6bcd4621d373cade4e832627b4f6"), MessageId: aws.String("id"), }, }, "no md5": { input: &SendMessageInput{ MessageBody: aws.String("test"), }, output: &SendMessageOutput{ MessageId: aws.String("id"), }, }, "no message id": { input: &SendMessageInput{ MessageBody: aws.String("test"), }, output: &SendMessageOutput{ MD5OfMessageBody: aws.String("098f6bcd4621d373cade4e832627b4f6"), }, }, "invalid checksum": { input: &SendMessageInput{ MessageBody: aws.String("test"), }, output: &SendMessageOutput{ MD5OfMessageBody: aws.String("01234556"), MessageId: aws.String("id"), }, expectErr: "message id has invalid checksum", }, "response error": { input: &SendMessageInput{ MessageBody: aws.String("test"), }, handlerErr: fmt.Errorf("some error"), expectErr: "some error", }, } for name, c := range cases { t.Run(name, func(t *testing.T) { m := validateMessageChecksumMiddleware{ validate: validateSendMessageChecksum, } next := mockInitializeHandler{ Output: middleware.InitializeOutput{Result: c.output}, Err: c.handlerErr, } input := middleware.InitializeInput{ Parameters: c.input, } _, _, err := m.HandleInitialize(context.Background(), input, next) if c.expectErr != "" { if err == nil { t.Fatalf("expect %v error, got none", c.expectErr) } if e, a := c.expectErr, err.Error(); !strings.Contains(a, e) { t.Fatalf("expect %v error, got %v", e, a) } return } if err != nil { t.Fatalf("expect no error, got %v", err) } }) } } func TestValidateSendMessageBatchChecksum(t *testing.T) { successMD5 := "098f6bcd4621d373cade4e832627b4f6" invalidMD5 := "11111111111111111111111111111111" cases := map[string]struct { input *SendMessageBatchInput output *SendMessageBatchOutput handlerErr error expectErrs []string }{ "success": { input: &SendMessageBatchInput{ Entries: []sqstypes.SendMessageBatchRequestEntry{ {Id: aws.String("1"), MessageBody: aws.String("test")}, {Id: aws.String("2"), MessageBody: aws.String("test")}, {Id: aws.String("3"), MessageBody: aws.String("test")}, {Id: aws.String("4"), MessageBody: aws.String("test")}, }, }, output: &SendMessageBatchOutput{ Successful: []sqstypes.SendMessageBatchResultEntry{ {MD5OfMessageBody: &successMD5, MessageId: aws.String("123"), Id: aws.String("1")}, {MD5OfMessageBody: &successMD5, MessageId: aws.String("456"), Id: aws.String("2")}, {MD5OfMessageBody: &successMD5, MessageId: aws.String("789"), Id: aws.String("3")}, {MD5OfMessageBody: &successMD5, MessageId: aws.String("012"), Id: aws.String("4")}, }, }, }, "no input body": { input: &SendMessageBatchInput{ Entries: []sqstypes.SendMessageBatchRequestEntry{ {Id: aws.String("1")}, }, }, output: &SendMessageBatchOutput{ Successful: []sqstypes.SendMessageBatchResultEntry{ {MD5OfMessageBody: &invalidMD5, MessageId: aws.String("123"), Id: aws.String("1")}, }, }, }, "no md5": { input: &SendMessageBatchInput{ Entries: []sqstypes.SendMessageBatchRequestEntry{ {Id: aws.String("1"), MessageBody: aws.String("test")}, }, }, output: &SendMessageBatchOutput{ Successful: []sqstypes.SendMessageBatchResultEntry{ {MessageId: aws.String("123"), Id: aws.String("1")}, }, }, }, "server side failure": { input: &SendMessageBatchInput{ Entries: []sqstypes.SendMessageBatchRequestEntry{ {Id: aws.String("1"), MessageBody: aws.String("test")}, {Id: aws.String("2"), MessageBody: aws.String("test")}, {Id: aws.String("3"), MessageBody: aws.String("test")}, {Id: aws.String("4"), MessageBody: aws.String("test")}, }, }, output: &SendMessageBatchOutput{ Successful: []sqstypes.SendMessageBatchResultEntry{ {MD5OfMessageBody: &successMD5, MessageId: aws.String("123"), Id: aws.String("1")}, {MD5OfMessageBody: &successMD5, MessageId: aws.String("456"), Id: aws.String("2")}, {MD5OfMessageBody: &successMD5, MessageId: aws.String("012"), Id: aws.String("4")}, }, Failed: []sqstypes.BatchResultErrorEntry{ {Id: aws.String("3"), Code: aws.String("test"), Message: aws.String("test")}, }, }, }, "partial invalid checksum": { input: &SendMessageBatchInput{ Entries: []sqstypes.SendMessageBatchRequestEntry{ {Id: aws.String("1"), MessageBody: aws.String("test")}, {Id: aws.String("2"), MessageBody: aws.String("test")}, {Id: aws.String("3"), MessageBody: aws.String("test")}, {Id: aws.String("4"), MessageBody: aws.String("test")}, }, }, output: &SendMessageBatchOutput{ Successful: []sqstypes.SendMessageBatchResultEntry{ {MD5OfMessageBody: &successMD5, MessageId: aws.String("123"), Id: aws.String("1")}, {MD5OfMessageBody: &successMD5, MessageId: aws.String("456"), Id: aws.String("2")}, {MD5OfMessageBody: &invalidMD5, MessageId: aws.String("789"), Id: aws.String("3")}, {MD5OfMessageBody: &successMD5, MessageId: aws.String("012"), Id: aws.String("4")}, }, }, expectErrs: []string{"message 789 has invalid checksum"}, }, "complete invalid checksum": { input: &SendMessageBatchInput{ Entries: []sqstypes.SendMessageBatchRequestEntry{ {Id: aws.String("1"), MessageBody: aws.String("test")}, {Id: aws.String("2"), MessageBody: aws.String("test")}, {Id: aws.String("3"), MessageBody: aws.String("test")}, {Id: aws.String("4"), MessageBody: aws.String("test")}, }, }, output: &SendMessageBatchOutput{ Successful: []sqstypes.SendMessageBatchResultEntry{ {MD5OfMessageBody: &invalidMD5, MessageId: aws.String("123"), Id: aws.String("1")}, {MD5OfMessageBody: &invalidMD5, MessageId: aws.String("456"), Id: aws.String("2")}, {MD5OfMessageBody: &invalidMD5, MessageId: aws.String("789"), Id: aws.String("3")}, {MD5OfMessageBody: &invalidMD5, MessageId: aws.String("012"), Id: aws.String("4")}, }, }, expectErrs: []string{ "message 123 has invalid checksum", "message 456 has invalid checksum", "message 789 has invalid checksum", "message 012 has invalid checksum", }, }, "invalid checksum no message id": { input: &SendMessageBatchInput{ Entries: []sqstypes.SendMessageBatchRequestEntry{ {Id: aws.String("1"), MessageBody: aws.String("test")}, }, }, output: &SendMessageBatchOutput{ Successful: []sqstypes.SendMessageBatchResultEntry{ {MD5OfMessageBody: &invalidMD5, Id: aws.String("1")}, }, }, expectErrs: []string{"message has invalid checksum"}, }, "response error": { input: &SendMessageBatchInput{ Entries: []sqstypes.SendMessageBatchRequestEntry{ {Id: aws.String("1"), MessageBody: aws.String("test")}, }, }, handlerErr: fmt.Errorf("some error"), expectErrs: []string{"some error"}, }, } for name, c := range cases { t.Run(name, func(t *testing.T) { m := validateMessageChecksumMiddleware{ validate: validateSendMessageBatchChecksum, } next := mockInitializeHandler{ Output: middleware.InitializeOutput{Result: c.output}, Err: c.handlerErr, } input := middleware.InitializeInput{ Parameters: c.input, } _, _, err := m.HandleInitialize(context.Background(), input, next) if len(c.expectErrs) != 0 { if err == nil { t.Fatalf("expect error(s), got none") } for i, expectErr := range c.expectErrs { if e, a := expectErr, err.Error(); !strings.Contains(a, e) { t.Errorf("%d expect %v error, got %v", i, e, a) } } return } if err != nil { t.Fatalf("expect no error, got %v", err) } }) } } func TestValidateReceiveMessageChecksum(t *testing.T) { successMD5 := "098f6bcd4621d373cade4e832627b4f6" invalidMD5 := "11111111111111111111111111111111" cases := map[string]struct { output *ReceiveMessageOutput handlerErr error expectErrs []string }{ "success": { output: &ReceiveMessageOutput{ Messages: []sqstypes.Message{ {Body: aws.String("test"), MD5OfBody: &successMD5}, {Body: aws.String("test"), MD5OfBody: &successMD5}, {Body: aws.String("test"), MD5OfBody: &successMD5}, {Body: aws.String("test"), MD5OfBody: &successMD5}, }, }, }, "no body": { output: &ReceiveMessageOutput{ Messages: []sqstypes.Message{ {MD5OfBody: &successMD5}, }, }, }, "no md5": { output: &ReceiveMessageOutput{ Messages: []sqstypes.Message{ {Body: aws.String("test")}, }, }, }, "message with no ID partial invalid checksum": { output: &ReceiveMessageOutput{ Messages: []sqstypes.Message{ {Body: aws.String("test"), MD5OfBody: &successMD5}, {Body: aws.String("test"), MD5OfBody: &successMD5}, {Body: aws.String("test"), MD5OfBody: &invalidMD5}, {Body: aws.String("test"), MD5OfBody: &successMD5}, }, }, expectErrs: []string{"message has invalid checksum"}, }, "message with ID partial invalid checksum": { output: &ReceiveMessageOutput{ Messages: []sqstypes.Message{ {Body: aws.String("test"), MD5OfBody: &successMD5}, {Body: aws.String("test"), MD5OfBody: &successMD5}, {Body: aws.String("test"), MD5OfBody: &invalidMD5, MessageId: aws.String("123")}, {Body: aws.String("test"), MD5OfBody: &successMD5}, }, }, expectErrs: []string{"message 123 has invalid checksum"}, }, "complete invalid checksum": { output: &ReceiveMessageOutput{ Messages: []sqstypes.Message{ {Body: aws.String("test"), MD5OfBody: &invalidMD5}, {Body: aws.String("test"), MD5OfBody: &invalidMD5, MessageId: aws.String("123")}, {Body: aws.String("test"), MD5OfBody: &invalidMD5, MessageId: aws.String("456")}, {Body: aws.String("test"), MD5OfBody: &invalidMD5}, }, }, expectErrs: []string{ "message has invalid checksum", "message 123 has invalid checksum", "message 456 has invalid checksum", "message has invalid checksum", }, }, "response error": { handlerErr: fmt.Errorf("some error"), expectErrs: []string{"some error"}, }, } for name, c := range cases { t.Run(name, func(t *testing.T) { m := validateMessageChecksumMiddleware{ validate: validateReceiveMessageChecksum, } next := mockInitializeHandler{ Output: middleware.InitializeOutput{Result: c.output}, Err: c.handlerErr, } input := middleware.InitializeInput{ Parameters: &ReceiveMessageInput{}, } _, _, err := m.HandleInitialize(context.Background(), input, next) if len(c.expectErrs) != 0 { if err == nil { t.Fatalf("expect error(s), got none") } for i, expectErr := range c.expectErrs { if e, a := expectErr, err.Error(); !strings.Contains(a, e) { t.Errorf("%d expect %v error, got %v", i, e, a) } } return } if err != nil { t.Fatalf("expect no error, got %v", err) } }) } } func TestAddValidateSendMessageChecksum(t *testing.T) { cases := map[string]map[string]struct { options Options fn func(*middleware.Stack, Options) error expectInStack bool }{ "SendMessage": { "enabled": { options: Options{}, fn: addValidateSendMessageChecksum, expectInStack: true, }, "disabled": { options: Options{ DisableMessageChecksumValidation: true, }, fn: addValidateSendMessageChecksum, expectInStack: false, }, }, "SendMessageBatch": { "enabled": { options: Options{}, fn: addValidateSendMessageBatchChecksum, expectInStack: true, }, "disabled": { options: Options{ DisableMessageChecksumValidation: true, }, fn: addValidateSendMessageBatchChecksum, expectInStack: false, }, }, "ReceiveMessage": { "enabled": { options: Options{}, fn: addValidateReceiveMessageChecksum, expectInStack: true, }, "disabled": { options: Options{ DisableMessageChecksumValidation: true, }, fn: addValidateReceiveMessageChecksum, expectInStack: false, }, }, } for opName, opCases := range cases { t.Run(opName, func(t *testing.T) { for name, c := range opCases { t.Run(name, func(t *testing.T) { options := c.options.Copy() stack := middleware.NewStack("test", smithyhttp.NewStackRequest) err := c.fn(stack, options) if err != nil { t.Fatalf("expect no error, got %v", err) } expectID := validateMessageChecksumMiddleware{}.ID() if e, a := expectID, stack.String(); c.expectInStack != strings.Contains(a, e) { t.Errorf("expect %v in stack %v:\n%s", e, c.expectInStack, a) } }) } }) } } // ****************** // Testing Utilities // ****************** type mockInitializeHandler struct { Output middleware.InitializeOutput Err error } func (m mockInitializeHandler) HandleInitialize( ctx context.Context, in middleware.InitializeInput, ) ( out middleware.InitializeOutput, meta middleware.Metadata, err error, ) { return m.Output, meta, m.Err }
474
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs import ( "bytes" "context" "encoding/base64" "encoding/xml" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" awsxml "github.com/aws/aws-sdk-go-v2/aws/protocol/xml" "github.com/aws/aws-sdk-go-v2/service/sqs/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" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "io/ioutil" "strconv" "strings" ) type awsAwsquery_deserializeOpAddPermission struct { } func (*awsAwsquery_deserializeOpAddPermission) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpAddPermission) 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, awsAwsquery_deserializeOpErrorAddPermission(response, &metadata) } output := &AddPermissionOutput{} 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 awsAwsquery_deserializeOpErrorAddPermission(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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("OverLimit", errorCode): return awsAwsquery_deserializeErrorOverLimit(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsquery_deserializeOpCancelMessageMoveTask struct { } func (*awsAwsquery_deserializeOpCancelMessageMoveTask) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpCancelMessageMoveTask) 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, awsAwsquery_deserializeOpErrorCancelMessageMoveTask(response, &metadata) } output := &CancelMessageMoveTaskOutput{} 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) t, err = decoder.GetElement("CancelMessageMoveTaskResult") if err != nil { var 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 } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) err = awsAwsquery_deserializeOpDocumentCancelMessageMoveTaskOutput(&output, 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 out, metadata, err } return out, metadata, err } func awsAwsquery_deserializeOpErrorCancelMessageMoveTask(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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("AWS.SimpleQueueService.UnsupportedOperation", errorCode): return awsAwsquery_deserializeErrorUnsupportedOperation(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsquery_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsquery_deserializeOpChangeMessageVisibility struct { } func (*awsAwsquery_deserializeOpChangeMessageVisibility) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpChangeMessageVisibility) 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, awsAwsquery_deserializeOpErrorChangeMessageVisibility(response, &metadata) } output := &ChangeMessageVisibilityOutput{} 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 awsAwsquery_deserializeOpErrorChangeMessageVisibility(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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("AWS.SimpleQueueService.MessageNotInflight", errorCode): return awsAwsquery_deserializeErrorMessageNotInflight(response, errorBody) case strings.EqualFold("ReceiptHandleIsInvalid", errorCode): return awsAwsquery_deserializeErrorReceiptHandleIsInvalid(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsquery_deserializeOpChangeMessageVisibilityBatch struct { } func (*awsAwsquery_deserializeOpChangeMessageVisibilityBatch) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpChangeMessageVisibilityBatch) 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, awsAwsquery_deserializeOpErrorChangeMessageVisibilityBatch(response, &metadata) } output := &ChangeMessageVisibilityBatchOutput{} 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) t, err = decoder.GetElement("ChangeMessageVisibilityBatchResult") if err != nil { var 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 } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) err = awsAwsquery_deserializeOpDocumentChangeMessageVisibilityBatchOutput(&output, 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 out, metadata, err } return out, metadata, err } func awsAwsquery_deserializeOpErrorChangeMessageVisibilityBatch(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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("AWS.SimpleQueueService.BatchEntryIdsNotDistinct", errorCode): return awsAwsquery_deserializeErrorBatchEntryIdsNotDistinct(response, errorBody) case strings.EqualFold("AWS.SimpleQueueService.EmptyBatchRequest", errorCode): return awsAwsquery_deserializeErrorEmptyBatchRequest(response, errorBody) case strings.EqualFold("AWS.SimpleQueueService.InvalidBatchEntryId", errorCode): return awsAwsquery_deserializeErrorInvalidBatchEntryId(response, errorBody) case strings.EqualFold("AWS.SimpleQueueService.TooManyEntriesInBatchRequest", errorCode): return awsAwsquery_deserializeErrorTooManyEntriesInBatchRequest(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsquery_deserializeOpCreateQueue struct { } func (*awsAwsquery_deserializeOpCreateQueue) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpCreateQueue) 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, awsAwsquery_deserializeOpErrorCreateQueue(response, &metadata) } output := &CreateQueueOutput{} 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) t, err = decoder.GetElement("CreateQueueResult") if err != nil { var 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 } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) err = awsAwsquery_deserializeOpDocumentCreateQueueOutput(&output, 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 out, metadata, err } return out, metadata, err } func awsAwsquery_deserializeOpErrorCreateQueue(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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("AWS.SimpleQueueService.QueueDeletedRecently", errorCode): return awsAwsquery_deserializeErrorQueueDeletedRecently(response, errorBody) case strings.EqualFold("QueueAlreadyExists", errorCode): return awsAwsquery_deserializeErrorQueueNameExists(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsquery_deserializeOpDeleteMessage struct { } func (*awsAwsquery_deserializeOpDeleteMessage) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpDeleteMessage) 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, awsAwsquery_deserializeOpErrorDeleteMessage(response, &metadata) } output := &DeleteMessageOutput{} 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 awsAwsquery_deserializeOpErrorDeleteMessage(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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("InvalidIdFormat", errorCode): return awsAwsquery_deserializeErrorInvalidIdFormat(response, errorBody) case strings.EqualFold("ReceiptHandleIsInvalid", errorCode): return awsAwsquery_deserializeErrorReceiptHandleIsInvalid(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsquery_deserializeOpDeleteMessageBatch struct { } func (*awsAwsquery_deserializeOpDeleteMessageBatch) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpDeleteMessageBatch) 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, awsAwsquery_deserializeOpErrorDeleteMessageBatch(response, &metadata) } output := &DeleteMessageBatchOutput{} 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) t, err = decoder.GetElement("DeleteMessageBatchResult") if err != nil { var 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 } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) err = awsAwsquery_deserializeOpDocumentDeleteMessageBatchOutput(&output, 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 out, metadata, err } return out, metadata, err } func awsAwsquery_deserializeOpErrorDeleteMessageBatch(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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("AWS.SimpleQueueService.BatchEntryIdsNotDistinct", errorCode): return awsAwsquery_deserializeErrorBatchEntryIdsNotDistinct(response, errorBody) case strings.EqualFold("AWS.SimpleQueueService.EmptyBatchRequest", errorCode): return awsAwsquery_deserializeErrorEmptyBatchRequest(response, errorBody) case strings.EqualFold("AWS.SimpleQueueService.InvalidBatchEntryId", errorCode): return awsAwsquery_deserializeErrorInvalidBatchEntryId(response, errorBody) case strings.EqualFold("AWS.SimpleQueueService.TooManyEntriesInBatchRequest", errorCode): return awsAwsquery_deserializeErrorTooManyEntriesInBatchRequest(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsquery_deserializeOpDeleteQueue struct { } func (*awsAwsquery_deserializeOpDeleteQueue) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpDeleteQueue) 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, awsAwsquery_deserializeOpErrorDeleteQueue(response, &metadata) } output := &DeleteQueueOutput{} 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 awsAwsquery_deserializeOpErrorDeleteQueue(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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 awsAwsquery_deserializeOpGetQueueAttributes struct { } func (*awsAwsquery_deserializeOpGetQueueAttributes) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpGetQueueAttributes) 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, awsAwsquery_deserializeOpErrorGetQueueAttributes(response, &metadata) } output := &GetQueueAttributesOutput{} 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) t, err = decoder.GetElement("GetQueueAttributesResult") if err != nil { var 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 } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) err = awsAwsquery_deserializeOpDocumentGetQueueAttributesOutput(&output, 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 out, metadata, err } return out, metadata, err } func awsAwsquery_deserializeOpErrorGetQueueAttributes(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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("InvalidAttributeName", errorCode): return awsAwsquery_deserializeErrorInvalidAttributeName(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsquery_deserializeOpGetQueueUrl struct { } func (*awsAwsquery_deserializeOpGetQueueUrl) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpGetQueueUrl) 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, awsAwsquery_deserializeOpErrorGetQueueUrl(response, &metadata) } output := &GetQueueUrlOutput{} 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) t, err = decoder.GetElement("GetQueueUrlResult") if err != nil { var 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 } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) err = awsAwsquery_deserializeOpDocumentGetQueueUrlOutput(&output, 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 out, metadata, err } return out, metadata, err } func awsAwsquery_deserializeOpErrorGetQueueUrl(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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("AWS.SimpleQueueService.NonExistentQueue", errorCode): return awsAwsquery_deserializeErrorQueueDoesNotExist(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsquery_deserializeOpListDeadLetterSourceQueues struct { } func (*awsAwsquery_deserializeOpListDeadLetterSourceQueues) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpListDeadLetterSourceQueues) 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, awsAwsquery_deserializeOpErrorListDeadLetterSourceQueues(response, &metadata) } output := &ListDeadLetterSourceQueuesOutput{} 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) t, err = decoder.GetElement("ListDeadLetterSourceQueuesResult") if err != nil { var 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 } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) err = awsAwsquery_deserializeOpDocumentListDeadLetterSourceQueuesOutput(&output, 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 out, metadata, err } return out, metadata, err } func awsAwsquery_deserializeOpErrorListDeadLetterSourceQueues(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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("AWS.SimpleQueueService.NonExistentQueue", errorCode): return awsAwsquery_deserializeErrorQueueDoesNotExist(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsquery_deserializeOpListMessageMoveTasks struct { } func (*awsAwsquery_deserializeOpListMessageMoveTasks) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpListMessageMoveTasks) 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, awsAwsquery_deserializeOpErrorListMessageMoveTasks(response, &metadata) } output := &ListMessageMoveTasksOutput{} 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) t, err = decoder.GetElement("ListMessageMoveTasksResult") if err != nil { var 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 } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) err = awsAwsquery_deserializeOpDocumentListMessageMoveTasksOutput(&output, 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 out, metadata, err } return out, metadata, err } func awsAwsquery_deserializeOpErrorListMessageMoveTasks(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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("AWS.SimpleQueueService.UnsupportedOperation", errorCode): return awsAwsquery_deserializeErrorUnsupportedOperation(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsquery_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsquery_deserializeOpListQueues struct { } func (*awsAwsquery_deserializeOpListQueues) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpListQueues) 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, awsAwsquery_deserializeOpErrorListQueues(response, &metadata) } output := &ListQueuesOutput{} 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) t, err = decoder.GetElement("ListQueuesResult") if err != nil { var 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 } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) err = awsAwsquery_deserializeOpDocumentListQueuesOutput(&output, 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 out, metadata, err } return out, metadata, err } func awsAwsquery_deserializeOpErrorListQueues(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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 awsAwsquery_deserializeOpListQueueTags struct { } func (*awsAwsquery_deserializeOpListQueueTags) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpListQueueTags) 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, awsAwsquery_deserializeOpErrorListQueueTags(response, &metadata) } output := &ListQueueTagsOutput{} 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) t, err = decoder.GetElement("ListQueueTagsResult") if err != nil { var 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 } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) err = awsAwsquery_deserializeOpDocumentListQueueTagsOutput(&output, 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 out, metadata, err } return out, metadata, err } func awsAwsquery_deserializeOpErrorListQueueTags(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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 awsAwsquery_deserializeOpPurgeQueue struct { } func (*awsAwsquery_deserializeOpPurgeQueue) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpPurgeQueue) 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, awsAwsquery_deserializeOpErrorPurgeQueue(response, &metadata) } output := &PurgeQueueOutput{} 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 awsAwsquery_deserializeOpErrorPurgeQueue(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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("AWS.SimpleQueueService.NonExistentQueue", errorCode): return awsAwsquery_deserializeErrorQueueDoesNotExist(response, errorBody) case strings.EqualFold("AWS.SimpleQueueService.PurgeQueueInProgress", errorCode): return awsAwsquery_deserializeErrorPurgeQueueInProgress(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsquery_deserializeOpReceiveMessage struct { } func (*awsAwsquery_deserializeOpReceiveMessage) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpReceiveMessage) 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, awsAwsquery_deserializeOpErrorReceiveMessage(response, &metadata) } output := &ReceiveMessageOutput{} 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) t, err = decoder.GetElement("ReceiveMessageResult") if err != nil { var 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 } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) err = awsAwsquery_deserializeOpDocumentReceiveMessageOutput(&output, 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 out, metadata, err } return out, metadata, err } func awsAwsquery_deserializeOpErrorReceiveMessage(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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("OverLimit", errorCode): return awsAwsquery_deserializeErrorOverLimit(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsquery_deserializeOpRemovePermission struct { } func (*awsAwsquery_deserializeOpRemovePermission) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpRemovePermission) 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, awsAwsquery_deserializeOpErrorRemovePermission(response, &metadata) } output := &RemovePermissionOutput{} 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 awsAwsquery_deserializeOpErrorRemovePermission(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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 awsAwsquery_deserializeOpSendMessage struct { } func (*awsAwsquery_deserializeOpSendMessage) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpSendMessage) 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, awsAwsquery_deserializeOpErrorSendMessage(response, &metadata) } output := &SendMessageOutput{} 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) t, err = decoder.GetElement("SendMessageResult") if err != nil { var 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 } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) err = awsAwsquery_deserializeOpDocumentSendMessageOutput(&output, 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 out, metadata, err } return out, metadata, err } func awsAwsquery_deserializeOpErrorSendMessage(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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("AWS.SimpleQueueService.UnsupportedOperation", errorCode): return awsAwsquery_deserializeErrorUnsupportedOperation(response, errorBody) case strings.EqualFold("InvalidMessageContents", errorCode): return awsAwsquery_deserializeErrorInvalidMessageContents(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsquery_deserializeOpSendMessageBatch struct { } func (*awsAwsquery_deserializeOpSendMessageBatch) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpSendMessageBatch) 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, awsAwsquery_deserializeOpErrorSendMessageBatch(response, &metadata) } output := &SendMessageBatchOutput{} 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) t, err = decoder.GetElement("SendMessageBatchResult") if err != nil { var 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 } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) err = awsAwsquery_deserializeOpDocumentSendMessageBatchOutput(&output, 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 out, metadata, err } return out, metadata, err } func awsAwsquery_deserializeOpErrorSendMessageBatch(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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("AWS.SimpleQueueService.BatchEntryIdsNotDistinct", errorCode): return awsAwsquery_deserializeErrorBatchEntryIdsNotDistinct(response, errorBody) case strings.EqualFold("AWS.SimpleQueueService.BatchRequestTooLong", errorCode): return awsAwsquery_deserializeErrorBatchRequestTooLong(response, errorBody) case strings.EqualFold("AWS.SimpleQueueService.EmptyBatchRequest", errorCode): return awsAwsquery_deserializeErrorEmptyBatchRequest(response, errorBody) case strings.EqualFold("AWS.SimpleQueueService.InvalidBatchEntryId", errorCode): return awsAwsquery_deserializeErrorInvalidBatchEntryId(response, errorBody) case strings.EqualFold("AWS.SimpleQueueService.TooManyEntriesInBatchRequest", errorCode): return awsAwsquery_deserializeErrorTooManyEntriesInBatchRequest(response, errorBody) case strings.EqualFold("AWS.SimpleQueueService.UnsupportedOperation", errorCode): return awsAwsquery_deserializeErrorUnsupportedOperation(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsquery_deserializeOpSetQueueAttributes struct { } func (*awsAwsquery_deserializeOpSetQueueAttributes) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpSetQueueAttributes) 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, awsAwsquery_deserializeOpErrorSetQueueAttributes(response, &metadata) } output := &SetQueueAttributesOutput{} 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 awsAwsquery_deserializeOpErrorSetQueueAttributes(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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("InvalidAttributeName", errorCode): return awsAwsquery_deserializeErrorInvalidAttributeName(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsquery_deserializeOpStartMessageMoveTask struct { } func (*awsAwsquery_deserializeOpStartMessageMoveTask) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpStartMessageMoveTask) 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, awsAwsquery_deserializeOpErrorStartMessageMoveTask(response, &metadata) } output := &StartMessageMoveTaskOutput{} 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) t, err = decoder.GetElement("StartMessageMoveTaskResult") if err != nil { var 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 } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) err = awsAwsquery_deserializeOpDocumentStartMessageMoveTaskOutput(&output, 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 out, metadata, err } return out, metadata, err } func awsAwsquery_deserializeOpErrorStartMessageMoveTask(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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("AWS.SimpleQueueService.UnsupportedOperation", errorCode): return awsAwsquery_deserializeErrorUnsupportedOperation(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsquery_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsquery_deserializeOpTagQueue struct { } func (*awsAwsquery_deserializeOpTagQueue) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpTagQueue) 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, awsAwsquery_deserializeOpErrorTagQueue(response, &metadata) } output := &TagQueueOutput{} 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 awsAwsquery_deserializeOpErrorTagQueue(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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 awsAwsquery_deserializeOpUntagQueue struct { } func (*awsAwsquery_deserializeOpUntagQueue) ID() string { return "OperationDeserializer" } func (m *awsAwsquery_deserializeOpUntagQueue) 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, awsAwsquery_deserializeOpErrorUntagQueue(response, &metadata) } output := &UntagQueueOutput{} 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 awsAwsquery_deserializeOpErrorUntagQueue(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 := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { return err } 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 awsAwsquery_deserializeErrorBatchEntryIdsNotDistinct(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.BatchEntryIdsNotDistinct{} return output } func awsAwsquery_deserializeErrorBatchRequestTooLong(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.BatchRequestTooLong{} return output } func awsAwsquery_deserializeErrorEmptyBatchRequest(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.EmptyBatchRequest{} return output } func awsAwsquery_deserializeErrorInvalidAttributeName(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidAttributeName{} return output } func awsAwsquery_deserializeErrorInvalidBatchEntryId(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidBatchEntryId{} return output } func awsAwsquery_deserializeErrorInvalidIdFormat(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidIdFormat{} return output } func awsAwsquery_deserializeErrorInvalidMessageContents(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidMessageContents{} return output } func awsAwsquery_deserializeErrorMessageNotInflight(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.MessageNotInflight{} return output } func awsAwsquery_deserializeErrorOverLimit(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.OverLimit{} return output } func awsAwsquery_deserializeErrorPurgeQueueInProgress(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.PurgeQueueInProgress{} return output } func awsAwsquery_deserializeErrorQueueDeletedRecently(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.QueueDeletedRecently{} return output } func awsAwsquery_deserializeErrorQueueDoesNotExist(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.QueueDoesNotExist{} return output } func awsAwsquery_deserializeErrorQueueNameExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.QueueNameExists{} return output } func awsAwsquery_deserializeErrorReceiptHandleIsInvalid(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ReceiptHandleIsInvalid{} return output } func awsAwsquery_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceNotFoundException{} return output } func awsAwsquery_deserializeErrorTooManyEntriesInBatchRequest(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.TooManyEntriesInBatchRequest{} return output } func awsAwsquery_deserializeErrorUnsupportedOperation(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.UnsupportedOperation{} return output } func awsAwsquery_deserializeDocumentBatchEntryIdsNotDistinct(v **types.BatchEntryIdsNotDistinct, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.BatchEntryIdsNotDistinct if *v == nil { sv = &types.BatchEntryIdsNotDistinct{} } 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 awsAwsquery_deserializeDocumentBatchRequestTooLong(v **types.BatchRequestTooLong, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.BatchRequestTooLong if *v == nil { sv = &types.BatchRequestTooLong{} } 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 awsAwsquery_deserializeDocumentBatchResultErrorEntry(v **types.BatchResultErrorEntry, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.BatchResultErrorEntry if *v == nil { sv = &types.BatchResultErrorEntry{} } 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("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("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("SenderFault", 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.SenderFault = 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 awsAwsquery_deserializeDocumentBatchResultErrorEntryList(v *[]types.BatchResultErrorEntry, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv []types.BatchResultErrorEntry if *v == nil { sv = make([]types.BatchResultErrorEntry, 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.BatchResultErrorEntry nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &col if err := awsAwsquery_deserializeDocumentBatchResultErrorEntry(&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 awsAwsquery_deserializeDocumentBatchResultErrorEntryListUnwrapped(v *[]types.BatchResultErrorEntry, decoder smithyxml.NodeDecoder) error { var sv []types.BatchResultErrorEntry if *v == nil { sv = make([]types.BatchResultErrorEntry, 0) } else { sv = *v } switch { default: var mv types.BatchResultErrorEntry t := decoder.StartEl _ = t nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &mv if err := awsAwsquery_deserializeDocumentBatchResultErrorEntry(&destAddr, nodeDecoder); err != nil { return err } mv = *destAddr sv = append(sv, mv) } *v = sv return nil } func awsAwsquery_deserializeDocumentBinaryList(v *[][]byte, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv [][]byte if *v == nil { sv = make([][]byte, 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("BinaryListValue", t.Name.Local): var col []byte var data string val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) data = xtv } col, err = base64.StdEncoding.DecodeString(data) if err != nil { return err } sv = append(sv, col) default: err = decoder.Decoder.Skip() if err != nil { return err } } decoder = originalDecoder } *v = sv return nil } func awsAwsquery_deserializeDocumentBinaryListUnwrapped(v *[][]byte, decoder smithyxml.NodeDecoder) error { var sv [][]byte if *v == nil { sv = make([][]byte, 0) } else { sv = *v } switch { default: var mv []byte t := decoder.StartEl _ = t var data string val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) data = xtv } mv, err = base64.StdEncoding.DecodeString(data) if err != nil { return err } sv = append(sv, mv) } *v = sv return nil } func awsAwsquery_deserializeDocumentChangeMessageVisibilityBatchResultEntry(v **types.ChangeMessageVisibilityBatchResultEntry, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.ChangeMessageVisibilityBatchResultEntry if *v == nil { sv = &types.ChangeMessageVisibilityBatchResultEntry{} } 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("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 awsAwsquery_deserializeDocumentChangeMessageVisibilityBatchResultEntryList(v *[]types.ChangeMessageVisibilityBatchResultEntry, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv []types.ChangeMessageVisibilityBatchResultEntry if *v == nil { sv = make([]types.ChangeMessageVisibilityBatchResultEntry, 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.ChangeMessageVisibilityBatchResultEntry nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &col if err := awsAwsquery_deserializeDocumentChangeMessageVisibilityBatchResultEntry(&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 awsAwsquery_deserializeDocumentChangeMessageVisibilityBatchResultEntryListUnwrapped(v *[]types.ChangeMessageVisibilityBatchResultEntry, decoder smithyxml.NodeDecoder) error { var sv []types.ChangeMessageVisibilityBatchResultEntry if *v == nil { sv = make([]types.ChangeMessageVisibilityBatchResultEntry, 0) } else { sv = *v } switch { default: var mv types.ChangeMessageVisibilityBatchResultEntry t := decoder.StartEl _ = t nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &mv if err := awsAwsquery_deserializeDocumentChangeMessageVisibilityBatchResultEntry(&destAddr, nodeDecoder); err != nil { return err } mv = *destAddr sv = append(sv, mv) } *v = sv return nil } func awsAwsquery_deserializeDocumentDeleteMessageBatchResultEntry(v **types.DeleteMessageBatchResultEntry, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.DeleteMessageBatchResultEntry if *v == nil { sv = &types.DeleteMessageBatchResultEntry{} } 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("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 awsAwsquery_deserializeDocumentDeleteMessageBatchResultEntryList(v *[]types.DeleteMessageBatchResultEntry, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv []types.DeleteMessageBatchResultEntry if *v == nil { sv = make([]types.DeleteMessageBatchResultEntry, 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.DeleteMessageBatchResultEntry nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &col if err := awsAwsquery_deserializeDocumentDeleteMessageBatchResultEntry(&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 awsAwsquery_deserializeDocumentDeleteMessageBatchResultEntryListUnwrapped(v *[]types.DeleteMessageBatchResultEntry, decoder smithyxml.NodeDecoder) error { var sv []types.DeleteMessageBatchResultEntry if *v == nil { sv = make([]types.DeleteMessageBatchResultEntry, 0) } else { sv = *v } switch { default: var mv types.DeleteMessageBatchResultEntry t := decoder.StartEl _ = t nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &mv if err := awsAwsquery_deserializeDocumentDeleteMessageBatchResultEntry(&destAddr, nodeDecoder); err != nil { return err } mv = *destAddr sv = append(sv, mv) } *v = sv return nil } func awsAwsquery_deserializeDocumentEmptyBatchRequest(v **types.EmptyBatchRequest, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.EmptyBatchRequest if *v == nil { sv = &types.EmptyBatchRequest{} } 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 awsAwsquery_deserializeDocumentInvalidAttributeName(v **types.InvalidAttributeName, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.InvalidAttributeName if *v == nil { sv = &types.InvalidAttributeName{} } 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 awsAwsquery_deserializeDocumentInvalidBatchEntryId(v **types.InvalidBatchEntryId, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.InvalidBatchEntryId if *v == nil { sv = &types.InvalidBatchEntryId{} } 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 awsAwsquery_deserializeDocumentInvalidIdFormat(v **types.InvalidIdFormat, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.InvalidIdFormat if *v == nil { sv = &types.InvalidIdFormat{} } 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 awsAwsquery_deserializeDocumentInvalidMessageContents(v **types.InvalidMessageContents, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.InvalidMessageContents if *v == nil { sv = &types.InvalidMessageContents{} } 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 awsAwsquery_deserializeDocumentListMessageMoveTasksResultEntry(v **types.ListMessageMoveTasksResultEntry, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.ListMessageMoveTasksResultEntry if *v == nil { sv = &types.ListMessageMoveTasksResultEntry{} } 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("ApproximateNumberOfMessagesMoved", 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.ApproximateNumberOfMessagesMoved = i64 } case strings.EqualFold("ApproximateNumberOfMessagesToMove", 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.ApproximateNumberOfMessagesToMove = i64 } case strings.EqualFold("DestinationArn", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.DestinationArn = 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) } case strings.EqualFold("MaxNumberOfMessagesPerSecond", 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.MaxNumberOfMessagesPerSecond = int32(i64) } case strings.EqualFold("SourceArn", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.SourceArn = ptr.String(xtv) } case strings.EqualFold("StartedTimestamp", 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.StartedTimestamp = i64 } 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 = ptr.String(xtv) } case strings.EqualFold("TaskHandle", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.TaskHandle = 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 awsAwsquery_deserializeDocumentListMessageMoveTasksResultEntryList(v *[]types.ListMessageMoveTasksResultEntry, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv []types.ListMessageMoveTasksResultEntry if *v == nil { sv = make([]types.ListMessageMoveTasksResultEntry, 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.ListMessageMoveTasksResultEntry nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &col if err := awsAwsquery_deserializeDocumentListMessageMoveTasksResultEntry(&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 awsAwsquery_deserializeDocumentListMessageMoveTasksResultEntryListUnwrapped(v *[]types.ListMessageMoveTasksResultEntry, decoder smithyxml.NodeDecoder) error { var sv []types.ListMessageMoveTasksResultEntry if *v == nil { sv = make([]types.ListMessageMoveTasksResultEntry, 0) } else { sv = *v } switch { default: var mv types.ListMessageMoveTasksResultEntry t := decoder.StartEl _ = t nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &mv if err := awsAwsquery_deserializeDocumentListMessageMoveTasksResultEntry(&destAddr, nodeDecoder); err != nil { return err } mv = *destAddr sv = append(sv, mv) } *v = sv return nil } func awsAwsquery_deserializeDocumentMessage(v **types.Message, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.Message if *v == nil { sv = &types.Message{} } 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("Attribute", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsAwsquery_deserializeDocumentMessageSystemAttributeMapUnwrapped(&sv.Attributes, nodeDecoder); err != nil { return err } case strings.EqualFold("Body", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.Body = ptr.String(xtv) } case strings.EqualFold("MD5OfBody", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.MD5OfBody = ptr.String(xtv) } case strings.EqualFold("MD5OfMessageAttributes", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.MD5OfMessageAttributes = ptr.String(xtv) } case strings.EqualFold("MessageAttribute", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsAwsquery_deserializeDocumentMessageBodyAttributeMapUnwrapped(&sv.MessageAttributes, nodeDecoder); err != nil { return err } case strings.EqualFold("MessageId", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.MessageId = ptr.String(xtv) } case strings.EqualFold("ReceiptHandle", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.ReceiptHandle = 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 awsAwsquery_deserializeDocumentMessageAttributeValue(v **types.MessageAttributeValue, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.MessageAttributeValue if *v == nil { sv = &types.MessageAttributeValue{} } 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("BinaryListValue", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsAwsquery_deserializeDocumentBinaryListUnwrapped(&sv.BinaryListValues, nodeDecoder); err != nil { return err } case strings.EqualFold("BinaryValue", t.Name.Local): var data string val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) data = xtv } sv.BinaryValue, err = base64.StdEncoding.DecodeString(data) if err != nil { return err } case strings.EqualFold("DataType", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.DataType = ptr.String(xtv) } case strings.EqualFold("StringListValue", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsAwsquery_deserializeDocumentStringListUnwrapped(&sv.StringListValues, nodeDecoder); err != nil { return err } case strings.EqualFold("StringValue", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.StringValue = 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 awsAwsquery_deserializeDocumentMessageBodyAttributeMap(v *map[string]types.MessageAttributeValue, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv map[string]types.MessageAttributeValue if *v == nil { sv = make(map[string]types.MessageAttributeValue, 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 := awsAwsquery_deserializeDocumentMessageBodyAttributeMapUnwrapped(&sv, entryDecoder); err != nil { return err } default: err = decoder.Decoder.Skip() if err != nil { return err } } } *v = sv return nil } func awsAwsquery_deserializeDocumentMessageBodyAttributeMapUnwrapped(v *map[string]types.MessageAttributeValue, decoder smithyxml.NodeDecoder) error { var sv map[string]types.MessageAttributeValue if *v == nil { sv = make(map[string]types.MessageAttributeValue, 0) } else { sv = *v } var ek string var ev types.MessageAttributeValue 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("Name", 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): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) mapVar := ev destAddr := &mapVar if err := awsAwsquery_deserializeDocumentMessageAttributeValue(&destAddr, nodeDecoder); err != nil { return err } ev = *destAddr default: err = decoder.Decoder.Skip() if err != nil { return err } } decoder = originalDecoder } *v = sv return nil } func awsAwsquery_deserializeDocumentMessageList(v *[]types.Message, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv []types.Message if *v == nil { sv = make([]types.Message, 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.Message nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &col if err := awsAwsquery_deserializeDocumentMessage(&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 awsAwsquery_deserializeDocumentMessageListUnwrapped(v *[]types.Message, decoder smithyxml.NodeDecoder) error { var sv []types.Message if *v == nil { sv = make([]types.Message, 0) } else { sv = *v } switch { default: var mv types.Message t := decoder.StartEl _ = t nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &mv if err := awsAwsquery_deserializeDocumentMessage(&destAddr, nodeDecoder); err != nil { return err } mv = *destAddr sv = append(sv, mv) } *v = sv return nil } func awsAwsquery_deserializeDocumentMessageNotInflight(v **types.MessageNotInflight, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.MessageNotInflight if *v == nil { sv = &types.MessageNotInflight{} } 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 awsAwsquery_deserializeDocumentMessageSystemAttributeMap(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 := awsAwsquery_deserializeDocumentMessageSystemAttributeMapUnwrapped(&sv, entryDecoder); err != nil { return err } default: err = decoder.Decoder.Skip() if err != nil { return err } } } *v = sv return nil } func awsAwsquery_deserializeDocumentMessageSystemAttributeMapUnwrapped(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 types.MessageSystemAttributeName var ev string for { t, done, err := decoder.Token() if err != nil { return err } if done { sv[string(ek)] = ev 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) ek = types.MessageSystemAttributeName(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 awsAwsquery_deserializeDocumentOverLimit(v **types.OverLimit, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.OverLimit if *v == nil { sv = &types.OverLimit{} } 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 awsAwsquery_deserializeDocumentPurgeQueueInProgress(v **types.PurgeQueueInProgress, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.PurgeQueueInProgress if *v == nil { sv = &types.PurgeQueueInProgress{} } 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 awsAwsquery_deserializeDocumentQueueAttributeMap(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 := awsAwsquery_deserializeDocumentQueueAttributeMapUnwrapped(&sv, entryDecoder); err != nil { return err } default: err = decoder.Decoder.Skip() if err != nil { return err } } } *v = sv return nil } func awsAwsquery_deserializeDocumentQueueAttributeMapUnwrapped(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 types.QueueAttributeName var ev string for { t, done, err := decoder.Token() if err != nil { return err } if done { sv[string(ek)] = ev 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) ek = types.QueueAttributeName(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 awsAwsquery_deserializeDocumentQueueDeletedRecently(v **types.QueueDeletedRecently, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.QueueDeletedRecently if *v == nil { sv = &types.QueueDeletedRecently{} } 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 awsAwsquery_deserializeDocumentQueueDoesNotExist(v **types.QueueDoesNotExist, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.QueueDoesNotExist if *v == nil { sv = &types.QueueDoesNotExist{} } 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 awsAwsquery_deserializeDocumentQueueNameExists(v **types.QueueNameExists, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.QueueNameExists if *v == nil { sv = &types.QueueNameExists{} } 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 awsAwsquery_deserializeDocumentQueueUrlList(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("member", 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 awsAwsquery_deserializeDocumentQueueUrlListUnwrapped(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 awsAwsquery_deserializeDocumentReceiptHandleIsInvalid(v **types.ReceiptHandleIsInvalid, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.ReceiptHandleIsInvalid if *v == nil { sv = &types.ReceiptHandleIsInvalid{} } 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 awsAwsquery_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.ResourceNotFoundException if *v == nil { sv = &types.ResourceNotFoundException{} } 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 awsAwsquery_deserializeDocumentSendMessageBatchResultEntry(v **types.SendMessageBatchResultEntry, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.SendMessageBatchResultEntry if *v == nil { sv = &types.SendMessageBatchResultEntry{} } 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("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("MD5OfMessageAttributes", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.MD5OfMessageAttributes = ptr.String(xtv) } case strings.EqualFold("MD5OfMessageBody", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.MD5OfMessageBody = ptr.String(xtv) } case strings.EqualFold("MD5OfMessageSystemAttributes", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.MD5OfMessageSystemAttributes = ptr.String(xtv) } case strings.EqualFold("MessageId", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.MessageId = ptr.String(xtv) } case strings.EqualFold("SequenceNumber", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.SequenceNumber = 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 awsAwsquery_deserializeDocumentSendMessageBatchResultEntryList(v *[]types.SendMessageBatchResultEntry, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv []types.SendMessageBatchResultEntry if *v == nil { sv = make([]types.SendMessageBatchResultEntry, 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.SendMessageBatchResultEntry nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &col if err := awsAwsquery_deserializeDocumentSendMessageBatchResultEntry(&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 awsAwsquery_deserializeDocumentSendMessageBatchResultEntryListUnwrapped(v *[]types.SendMessageBatchResultEntry, decoder smithyxml.NodeDecoder) error { var sv []types.SendMessageBatchResultEntry if *v == nil { sv = make([]types.SendMessageBatchResultEntry, 0) } else { sv = *v } switch { default: var mv types.SendMessageBatchResultEntry t := decoder.StartEl _ = t nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &mv if err := awsAwsquery_deserializeDocumentSendMessageBatchResultEntry(&destAddr, nodeDecoder); err != nil { return err } mv = *destAddr sv = append(sv, mv) } *v = sv return nil } func awsAwsquery_deserializeDocumentStringList(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("StringListValue", 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 awsAwsquery_deserializeDocumentStringListUnwrapped(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 awsAwsquery_deserializeDocumentTagMap(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 := awsAwsquery_deserializeDocumentTagMapUnwrapped(&sv, entryDecoder); err != nil { return err } default: err = decoder.Decoder.Skip() if err != nil { return err } } } *v = sv return nil } func awsAwsquery_deserializeDocumentTagMapUnwrapped(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 awsAwsquery_deserializeDocumentTooManyEntriesInBatchRequest(v **types.TooManyEntriesInBatchRequest, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.TooManyEntriesInBatchRequest if *v == nil { sv = &types.TooManyEntriesInBatchRequest{} } 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 awsAwsquery_deserializeDocumentUnsupportedOperation(v **types.UnsupportedOperation, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *types.UnsupportedOperation if *v == nil { sv = &types.UnsupportedOperation{} } 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 awsAwsquery_deserializeOpDocumentCancelMessageMoveTaskOutput(v **CancelMessageMoveTaskOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *CancelMessageMoveTaskOutput if *v == nil { sv = &CancelMessageMoveTaskOutput{} } 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("ApproximateNumberOfMessagesMoved", 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.ApproximateNumberOfMessagesMoved = 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 awsAwsquery_deserializeOpDocumentChangeMessageVisibilityBatchOutput(v **ChangeMessageVisibilityBatchOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *ChangeMessageVisibilityBatchOutput if *v == nil { sv = &ChangeMessageVisibilityBatchOutput{} } 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("BatchResultErrorEntry", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsAwsquery_deserializeDocumentBatchResultErrorEntryListUnwrapped(&sv.Failed, nodeDecoder); err != nil { return err } case strings.EqualFold("ChangeMessageVisibilityBatchResultEntry", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsAwsquery_deserializeDocumentChangeMessageVisibilityBatchResultEntryListUnwrapped(&sv.Successful, 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 awsAwsquery_deserializeOpDocumentCreateQueueOutput(v **CreateQueueOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *CreateQueueOutput if *v == nil { sv = &CreateQueueOutput{} } 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("QueueUrl", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.QueueUrl = 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 awsAwsquery_deserializeOpDocumentDeleteMessageBatchOutput(v **DeleteMessageBatchOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *DeleteMessageBatchOutput if *v == nil { sv = &DeleteMessageBatchOutput{} } 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("BatchResultErrorEntry", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsAwsquery_deserializeDocumentBatchResultErrorEntryListUnwrapped(&sv.Failed, nodeDecoder); err != nil { return err } case strings.EqualFold("DeleteMessageBatchResultEntry", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsAwsquery_deserializeDocumentDeleteMessageBatchResultEntryListUnwrapped(&sv.Successful, 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 awsAwsquery_deserializeOpDocumentGetQueueAttributesOutput(v **GetQueueAttributesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *GetQueueAttributesOutput if *v == nil { sv = &GetQueueAttributesOutput{} } 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("Attribute", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsAwsquery_deserializeDocumentQueueAttributeMapUnwrapped(&sv.Attributes, 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 awsAwsquery_deserializeOpDocumentGetQueueUrlOutput(v **GetQueueUrlOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *GetQueueUrlOutput if *v == nil { sv = &GetQueueUrlOutput{} } 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("QueueUrl", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.QueueUrl = 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 awsAwsquery_deserializeOpDocumentListDeadLetterSourceQueuesOutput(v **ListDeadLetterSourceQueuesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *ListDeadLetterSourceQueuesOutput if *v == nil { sv = &ListDeadLetterSourceQueuesOutput{} } 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("QueueUrl", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsAwsquery_deserializeDocumentQueueUrlListUnwrapped(&sv.QueueUrls, 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 awsAwsquery_deserializeOpDocumentListMessageMoveTasksOutput(v **ListMessageMoveTasksOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *ListMessageMoveTasksOutput if *v == nil { sv = &ListMessageMoveTasksOutput{} } 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("ListMessageMoveTasksResultEntry", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsAwsquery_deserializeDocumentListMessageMoveTasksResultEntryListUnwrapped(&sv.Results, 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 awsAwsquery_deserializeOpDocumentListQueuesOutput(v **ListQueuesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *ListQueuesOutput if *v == nil { sv = &ListQueuesOutput{} } 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("QueueUrl", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsAwsquery_deserializeDocumentQueueUrlListUnwrapped(&sv.QueueUrls, 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 awsAwsquery_deserializeOpDocumentListQueueTagsOutput(v **ListQueueTagsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *ListQueueTagsOutput if *v == nil { sv = &ListQueueTagsOutput{} } 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("Tag", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsAwsquery_deserializeDocumentTagMapUnwrapped(&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 awsAwsquery_deserializeOpDocumentReceiveMessageOutput(v **ReceiveMessageOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *ReceiveMessageOutput if *v == nil { sv = &ReceiveMessageOutput{} } 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): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsAwsquery_deserializeDocumentMessageListUnwrapped(&sv.Messages, 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 awsAwsquery_deserializeOpDocumentSendMessageBatchOutput(v **SendMessageBatchOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *SendMessageBatchOutput if *v == nil { sv = &SendMessageBatchOutput{} } 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("BatchResultErrorEntry", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsAwsquery_deserializeDocumentBatchResultErrorEntryListUnwrapped(&sv.Failed, nodeDecoder); err != nil { return err } case strings.EqualFold("SendMessageBatchResultEntry", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsAwsquery_deserializeDocumentSendMessageBatchResultEntryListUnwrapped(&sv.Successful, 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 awsAwsquery_deserializeOpDocumentSendMessageOutput(v **SendMessageOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *SendMessageOutput if *v == nil { sv = &SendMessageOutput{} } 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("MD5OfMessageAttributes", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.MD5OfMessageAttributes = ptr.String(xtv) } case strings.EqualFold("MD5OfMessageBody", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.MD5OfMessageBody = ptr.String(xtv) } case strings.EqualFold("MD5OfMessageSystemAttributes", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.MD5OfMessageSystemAttributes = ptr.String(xtv) } case strings.EqualFold("MessageId", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.MessageId = ptr.String(xtv) } case strings.EqualFold("SequenceNumber", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.SequenceNumber = 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 awsAwsquery_deserializeOpDocumentStartMessageMoveTaskOutput(v **StartMessageMoveTaskOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } var sv *StartMessageMoveTaskOutput if *v == nil { sv = &StartMessageMoveTaskOutput{} } 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("TaskHandle", t.Name.Local): val, err := decoder.Value() if err != nil { return err } if val == nil { break } { xtv := string(val) sv.TaskHandle = 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 }
5,376
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package sqs provides the API client, operations, and parameter types for Amazon // Simple Queue Service. // // Welcome to the Amazon SQS API Reference. Amazon SQS is a reliable, // highly-scalable hosted queue for storing messages as they travel between // applications or microservices. Amazon SQS moves data between distributed // application components and helps you decouple these components. For information // on the permissions you need to use this API, see Identity and access management (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-authentication-and-access-control.html) // in the Amazon SQS Developer Guide. You can use Amazon Web Services SDKs (http://aws.amazon.com/tools/#sdk) // to access Amazon SQS using your favorite programming language. The SDKs perform // tasks such as the following automatically: // - Cryptographically sign your service requests // - Retry requests // - Handle error responses // // Additional information // - Amazon SQS Product Page (http://aws.amazon.com/sqs/) // - Amazon SQS Developer Guide // - Making API Requests (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-making-api-requests.html) // - Amazon SQS Message Attributes (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) // - Amazon SQS Dead-Letter Queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) // - Amazon SQS in the Command Line Interface (http://docs.aws.amazon.com/cli/latest/reference/sqs/index.html) // - Amazon Web Services General Reference // - Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#sqs_region) package sqs
28
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs 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/sqs/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 = "sqs" } 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 sqs // goModuleVersion is the tagged release for this module const goModuleVersion = "1.23.2"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/query" "github.com/aws/aws-sdk-go-v2/service/sqs/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "path" "sort" ) type awsAwsquery_serializeOpAddPermission struct { } func (*awsAwsquery_serializeOpAddPermission) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpAddPermission) 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.(*AddPermissionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("AddPermission") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentAddPermissionInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpCancelMessageMoveTask struct { } func (*awsAwsquery_serializeOpCancelMessageMoveTask) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpCancelMessageMoveTask) 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.(*CancelMessageMoveTaskInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("CancelMessageMoveTask") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentCancelMessageMoveTaskInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpChangeMessageVisibility struct { } func (*awsAwsquery_serializeOpChangeMessageVisibility) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpChangeMessageVisibility) 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.(*ChangeMessageVisibilityInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("ChangeMessageVisibility") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentChangeMessageVisibilityInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpChangeMessageVisibilityBatch struct { } func (*awsAwsquery_serializeOpChangeMessageVisibilityBatch) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpChangeMessageVisibilityBatch) 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.(*ChangeMessageVisibilityBatchInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("ChangeMessageVisibilityBatch") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentChangeMessageVisibilityBatchInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpCreateQueue struct { } func (*awsAwsquery_serializeOpCreateQueue) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpCreateQueue) 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.(*CreateQueueInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("CreateQueue") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentCreateQueueInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpDeleteMessage struct { } func (*awsAwsquery_serializeOpDeleteMessage) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpDeleteMessage) 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.(*DeleteMessageInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("DeleteMessage") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentDeleteMessageInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpDeleteMessageBatch struct { } func (*awsAwsquery_serializeOpDeleteMessageBatch) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpDeleteMessageBatch) 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.(*DeleteMessageBatchInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("DeleteMessageBatch") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentDeleteMessageBatchInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpDeleteQueue struct { } func (*awsAwsquery_serializeOpDeleteQueue) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpDeleteQueue) 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.(*DeleteQueueInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("DeleteQueue") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentDeleteQueueInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpGetQueueAttributes struct { } func (*awsAwsquery_serializeOpGetQueueAttributes) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpGetQueueAttributes) 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.(*GetQueueAttributesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("GetQueueAttributes") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentGetQueueAttributesInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpGetQueueUrl struct { } func (*awsAwsquery_serializeOpGetQueueUrl) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpGetQueueUrl) 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.(*GetQueueUrlInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("GetQueueUrl") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentGetQueueUrlInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpListDeadLetterSourceQueues struct { } func (*awsAwsquery_serializeOpListDeadLetterSourceQueues) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpListDeadLetterSourceQueues) 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.(*ListDeadLetterSourceQueuesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("ListDeadLetterSourceQueues") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentListDeadLetterSourceQueuesInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpListMessageMoveTasks struct { } func (*awsAwsquery_serializeOpListMessageMoveTasks) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpListMessageMoveTasks) 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.(*ListMessageMoveTasksInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("ListMessageMoveTasks") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentListMessageMoveTasksInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpListQueues struct { } func (*awsAwsquery_serializeOpListQueues) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpListQueues) 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.(*ListQueuesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("ListQueues") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentListQueuesInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpListQueueTags struct { } func (*awsAwsquery_serializeOpListQueueTags) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpListQueueTags) 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.(*ListQueueTagsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("ListQueueTags") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentListQueueTagsInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpPurgeQueue struct { } func (*awsAwsquery_serializeOpPurgeQueue) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpPurgeQueue) 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.(*PurgeQueueInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("PurgeQueue") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentPurgeQueueInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpReceiveMessage struct { } func (*awsAwsquery_serializeOpReceiveMessage) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpReceiveMessage) 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.(*ReceiveMessageInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("ReceiveMessage") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentReceiveMessageInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpRemovePermission struct { } func (*awsAwsquery_serializeOpRemovePermission) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpRemovePermission) 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.(*RemovePermissionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("RemovePermission") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentRemovePermissionInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpSendMessage struct { } func (*awsAwsquery_serializeOpSendMessage) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpSendMessage) 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.(*SendMessageInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("SendMessage") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentSendMessageInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpSendMessageBatch struct { } func (*awsAwsquery_serializeOpSendMessageBatch) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpSendMessageBatch) 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.(*SendMessageBatchInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("SendMessageBatch") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentSendMessageBatchInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpSetQueueAttributes struct { } func (*awsAwsquery_serializeOpSetQueueAttributes) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpSetQueueAttributes) 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.(*SetQueueAttributesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("SetQueueAttributes") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentSetQueueAttributesInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpStartMessageMoveTask struct { } func (*awsAwsquery_serializeOpStartMessageMoveTask) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpStartMessageMoveTask) 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.(*StartMessageMoveTaskInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("StartMessageMoveTask") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentStartMessageMoveTaskInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpTagQueue struct { } func (*awsAwsquery_serializeOpTagQueue) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpTagQueue) 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.(*TagQueueInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("TagQueue") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentTagQueueInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsquery_serializeOpUntagQueue struct { } func (*awsAwsquery_serializeOpUntagQueue) ID() string { return "OperationSerializer" } func (m *awsAwsquery_serializeOpUntagQueue) 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.(*UntagQueueInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() body.Key("Action").String("UntagQueue") body.Key("Version").String("2012-11-05") if err := awsAwsquery_serializeOpDocumentUntagQueueInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } err = bodyEncoder.Encode() if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsAwsquery_serializeDocumentActionNameList(v []string, value query.Value) error { array := value.Array("member") for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsAwsquery_serializeDocumentAttributeNameList(v []types.QueueAttributeName, value query.Value) error { array := value.Array("member") for i := range v { av := array.Value() av.String(string(v[i])) } return nil } func awsAwsquery_serializeDocumentAWSAccountIdList(v []string, value query.Value) error { array := value.Array("member") for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsAwsquery_serializeDocumentBinaryList(v [][]byte, value query.Value) error { array := value.Array("BinaryListValue") for i := range v { if vv := v[i]; vv == nil { continue } av := array.Value() av.Base64EncodeBytes(v[i]) } return nil } func awsAwsquery_serializeDocumentChangeMessageVisibilityBatchRequestEntry(v *types.ChangeMessageVisibilityBatchRequestEntry, value query.Value) error { object := value.Object() _ = object if v.Id != nil { objectKey := object.Key("Id") objectKey.String(*v.Id) } if v.ReceiptHandle != nil { objectKey := object.Key("ReceiptHandle") objectKey.String(*v.ReceiptHandle) } if v.VisibilityTimeout != 0 { objectKey := object.Key("VisibilityTimeout") objectKey.Integer(v.VisibilityTimeout) } return nil } func awsAwsquery_serializeDocumentChangeMessageVisibilityBatchRequestEntryList(v []types.ChangeMessageVisibilityBatchRequestEntry, value query.Value) error { array := value.Array("member") for i := range v { av := array.Value() if err := awsAwsquery_serializeDocumentChangeMessageVisibilityBatchRequestEntry(&v[i], av); err != nil { return err } } return nil } func awsAwsquery_serializeDocumentDeleteMessageBatchRequestEntry(v *types.DeleteMessageBatchRequestEntry, value query.Value) error { object := value.Object() _ = object if v.Id != nil { objectKey := object.Key("Id") objectKey.String(*v.Id) } if v.ReceiptHandle != nil { objectKey := object.Key("ReceiptHandle") objectKey.String(*v.ReceiptHandle) } return nil } func awsAwsquery_serializeDocumentDeleteMessageBatchRequestEntryList(v []types.DeleteMessageBatchRequestEntry, value query.Value) error { array := value.Array("member") for i := range v { av := array.Value() if err := awsAwsquery_serializeDocumentDeleteMessageBatchRequestEntry(&v[i], av); err != nil { return err } } return nil } func awsAwsquery_serializeDocumentMessageAttributeNameList(v []string, value query.Value) error { array := value.Array("member") for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsAwsquery_serializeDocumentMessageAttributeValue(v *types.MessageAttributeValue, value query.Value) error { object := value.Object() _ = object if v.BinaryListValues != nil { objectKey := object.FlatKey("BinaryListValue") if err := awsAwsquery_serializeDocumentBinaryList(v.BinaryListValues, objectKey); err != nil { return err } } if v.BinaryValue != nil { objectKey := object.Key("BinaryValue") objectKey.Base64EncodeBytes(v.BinaryValue) } if v.DataType != nil { objectKey := object.Key("DataType") objectKey.String(*v.DataType) } if v.StringListValues != nil { objectKey := object.FlatKey("StringListValue") if err := awsAwsquery_serializeDocumentStringList(v.StringListValues, objectKey); err != nil { return err } } if v.StringValue != nil { objectKey := object.Key("StringValue") objectKey.String(*v.StringValue) } return nil } func awsAwsquery_serializeDocumentMessageBodyAttributeMap(v map[string]types.MessageAttributeValue, value query.Value) error { if len(v) == 0 { return nil } object := value.Map("Name", "Value") keys := make([]string, 0, len(v)) for key := range v { keys = append(keys, key) } sort.Strings(keys) for _, key := range keys { om := object.Key(key) mapVar := v[key] if err := awsAwsquery_serializeDocumentMessageAttributeValue(&mapVar, om); err != nil { return err } } return nil } func awsAwsquery_serializeDocumentMessageBodySystemAttributeMap(v map[string]types.MessageSystemAttributeValue, value query.Value) error { if len(v) == 0 { return nil } object := value.Map("Name", "Value") keys := make([]string, 0, len(v)) for key := range v { keys = append(keys, key) } sort.Strings(keys) for _, key := range keys { om := object.Key(key) mapVar := v[key] if err := awsAwsquery_serializeDocumentMessageSystemAttributeValue(&mapVar, om); err != nil { return err } } return nil } func awsAwsquery_serializeDocumentMessageSystemAttributeValue(v *types.MessageSystemAttributeValue, value query.Value) error { object := value.Object() _ = object if v.BinaryListValues != nil { objectKey := object.FlatKey("BinaryListValue") if err := awsAwsquery_serializeDocumentBinaryList(v.BinaryListValues, objectKey); err != nil { return err } } if v.BinaryValue != nil { objectKey := object.Key("BinaryValue") objectKey.Base64EncodeBytes(v.BinaryValue) } if v.DataType != nil { objectKey := object.Key("DataType") objectKey.String(*v.DataType) } if v.StringListValues != nil { objectKey := object.FlatKey("StringListValue") if err := awsAwsquery_serializeDocumentStringList(v.StringListValues, objectKey); err != nil { return err } } if v.StringValue != nil { objectKey := object.Key("StringValue") objectKey.String(*v.StringValue) } return nil } func awsAwsquery_serializeDocumentQueueAttributeMap(v map[string]string, value query.Value) error { if len(v) == 0 { return nil } object := value.Map("Name", "Value") keys := make([]string, 0, len(v)) for key := range v { keys = append(keys, key) } sort.Strings(keys) for _, key := range keys { om := object.Key(key) om.String(v[key]) } return nil } func awsAwsquery_serializeDocumentSendMessageBatchRequestEntry(v *types.SendMessageBatchRequestEntry, value query.Value) error { object := value.Object() _ = object if v.DelaySeconds != 0 { objectKey := object.Key("DelaySeconds") objectKey.Integer(v.DelaySeconds) } if v.Id != nil { objectKey := object.Key("Id") objectKey.String(*v.Id) } if v.MessageAttributes != nil { objectKey := object.FlatKey("MessageAttribute") if err := awsAwsquery_serializeDocumentMessageBodyAttributeMap(v.MessageAttributes, objectKey); err != nil { return err } } if v.MessageBody != nil { objectKey := object.Key("MessageBody") objectKey.String(*v.MessageBody) } if v.MessageDeduplicationId != nil { objectKey := object.Key("MessageDeduplicationId") objectKey.String(*v.MessageDeduplicationId) } if v.MessageGroupId != nil { objectKey := object.Key("MessageGroupId") objectKey.String(*v.MessageGroupId) } if v.MessageSystemAttributes != nil { objectKey := object.FlatKey("MessageSystemAttribute") if err := awsAwsquery_serializeDocumentMessageBodySystemAttributeMap(v.MessageSystemAttributes, objectKey); err != nil { return err } } return nil } func awsAwsquery_serializeDocumentSendMessageBatchRequestEntryList(v []types.SendMessageBatchRequestEntry, value query.Value) error { array := value.Array("member") for i := range v { av := array.Value() if err := awsAwsquery_serializeDocumentSendMessageBatchRequestEntry(&v[i], av); err != nil { return err } } return nil } func awsAwsquery_serializeDocumentStringList(v []string, value query.Value) error { array := value.Array("StringListValue") for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsAwsquery_serializeDocumentTagKeyList(v []string, value query.Value) error { array := value.Array("member") for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsAwsquery_serializeDocumentTagMap(v map[string]string, value query.Value) error { if len(v) == 0 { return nil } object := value.Map("Key", "Value") keys := make([]string, 0, len(v)) for key := range v { keys = append(keys, key) } sort.Strings(keys) for _, key := range keys { om := object.Key(key) om.String(v[key]) } return nil } func awsAwsquery_serializeOpDocumentAddPermissionInput(v *AddPermissionInput, value query.Value) error { object := value.Object() _ = object if v.Actions != nil { objectKey := object.FlatKey("ActionName") if err := awsAwsquery_serializeDocumentActionNameList(v.Actions, objectKey); err != nil { return err } } if v.AWSAccountIds != nil { objectKey := object.FlatKey("AWSAccountId") if err := awsAwsquery_serializeDocumentAWSAccountIdList(v.AWSAccountIds, objectKey); err != nil { return err } } if v.Label != nil { objectKey := object.Key("Label") objectKey.String(*v.Label) } if v.QueueUrl != nil { objectKey := object.Key("QueueUrl") objectKey.String(*v.QueueUrl) } return nil } func awsAwsquery_serializeOpDocumentCancelMessageMoveTaskInput(v *CancelMessageMoveTaskInput, value query.Value) error { object := value.Object() _ = object if v.TaskHandle != nil { objectKey := object.Key("TaskHandle") objectKey.String(*v.TaskHandle) } return nil } func awsAwsquery_serializeOpDocumentChangeMessageVisibilityBatchInput(v *ChangeMessageVisibilityBatchInput, value query.Value) error { object := value.Object() _ = object if v.Entries != nil { objectKey := object.FlatKey("ChangeMessageVisibilityBatchRequestEntry") if err := awsAwsquery_serializeDocumentChangeMessageVisibilityBatchRequestEntryList(v.Entries, objectKey); err != nil { return err } } if v.QueueUrl != nil { objectKey := object.Key("QueueUrl") objectKey.String(*v.QueueUrl) } return nil } func awsAwsquery_serializeOpDocumentChangeMessageVisibilityInput(v *ChangeMessageVisibilityInput, value query.Value) error { object := value.Object() _ = object if v.QueueUrl != nil { objectKey := object.Key("QueueUrl") objectKey.String(*v.QueueUrl) } if v.ReceiptHandle != nil { objectKey := object.Key("ReceiptHandle") objectKey.String(*v.ReceiptHandle) } { objectKey := object.Key("VisibilityTimeout") objectKey.Integer(v.VisibilityTimeout) } return nil } func awsAwsquery_serializeOpDocumentCreateQueueInput(v *CreateQueueInput, value query.Value) error { object := value.Object() _ = object if v.Attributes != nil { objectKey := object.FlatKey("Attribute") if err := awsAwsquery_serializeDocumentQueueAttributeMap(v.Attributes, objectKey); err != nil { return err } } if v.QueueName != nil { objectKey := object.Key("QueueName") objectKey.String(*v.QueueName) } if v.Tags != nil { objectKey := object.FlatKey("Tag") if err := awsAwsquery_serializeDocumentTagMap(v.Tags, objectKey); err != nil { return err } } return nil } func awsAwsquery_serializeOpDocumentDeleteMessageBatchInput(v *DeleteMessageBatchInput, value query.Value) error { object := value.Object() _ = object if v.Entries != nil { objectKey := object.FlatKey("DeleteMessageBatchRequestEntry") if err := awsAwsquery_serializeDocumentDeleteMessageBatchRequestEntryList(v.Entries, objectKey); err != nil { return err } } if v.QueueUrl != nil { objectKey := object.Key("QueueUrl") objectKey.String(*v.QueueUrl) } return nil } func awsAwsquery_serializeOpDocumentDeleteMessageInput(v *DeleteMessageInput, value query.Value) error { object := value.Object() _ = object if v.QueueUrl != nil { objectKey := object.Key("QueueUrl") objectKey.String(*v.QueueUrl) } if v.ReceiptHandle != nil { objectKey := object.Key("ReceiptHandle") objectKey.String(*v.ReceiptHandle) } return nil } func awsAwsquery_serializeOpDocumentDeleteQueueInput(v *DeleteQueueInput, value query.Value) error { object := value.Object() _ = object if v.QueueUrl != nil { objectKey := object.Key("QueueUrl") objectKey.String(*v.QueueUrl) } return nil } func awsAwsquery_serializeOpDocumentGetQueueAttributesInput(v *GetQueueAttributesInput, value query.Value) error { object := value.Object() _ = object if v.AttributeNames != nil { objectKey := object.FlatKey("AttributeName") if err := awsAwsquery_serializeDocumentAttributeNameList(v.AttributeNames, objectKey); err != nil { return err } } if v.QueueUrl != nil { objectKey := object.Key("QueueUrl") objectKey.String(*v.QueueUrl) } return nil } func awsAwsquery_serializeOpDocumentGetQueueUrlInput(v *GetQueueUrlInput, value query.Value) error { object := value.Object() _ = object if v.QueueName != nil { objectKey := object.Key("QueueName") objectKey.String(*v.QueueName) } if v.QueueOwnerAWSAccountId != nil { objectKey := object.Key("QueueOwnerAWSAccountId") objectKey.String(*v.QueueOwnerAWSAccountId) } return nil } func awsAwsquery_serializeOpDocumentListDeadLetterSourceQueuesInput(v *ListDeadLetterSourceQueuesInput, value query.Value) error { object := value.Object() _ = object if v.MaxResults != nil { objectKey := object.Key("MaxResults") objectKey.Integer(*v.MaxResults) } if v.NextToken != nil { objectKey := object.Key("NextToken") objectKey.String(*v.NextToken) } if v.QueueUrl != nil { objectKey := object.Key("QueueUrl") objectKey.String(*v.QueueUrl) } return nil } func awsAwsquery_serializeOpDocumentListMessageMoveTasksInput(v *ListMessageMoveTasksInput, value query.Value) error { object := value.Object() _ = object if v.MaxResults != 0 { objectKey := object.Key("MaxResults") objectKey.Integer(v.MaxResults) } if v.SourceArn != nil { objectKey := object.Key("SourceArn") objectKey.String(*v.SourceArn) } return nil } func awsAwsquery_serializeOpDocumentListQueuesInput(v *ListQueuesInput, value query.Value) error { object := value.Object() _ = object if v.MaxResults != nil { objectKey := object.Key("MaxResults") objectKey.Integer(*v.MaxResults) } if v.NextToken != nil { objectKey := object.Key("NextToken") objectKey.String(*v.NextToken) } if v.QueueNamePrefix != nil { objectKey := object.Key("QueueNamePrefix") objectKey.String(*v.QueueNamePrefix) } return nil } func awsAwsquery_serializeOpDocumentListQueueTagsInput(v *ListQueueTagsInput, value query.Value) error { object := value.Object() _ = object if v.QueueUrl != nil { objectKey := object.Key("QueueUrl") objectKey.String(*v.QueueUrl) } return nil } func awsAwsquery_serializeOpDocumentPurgeQueueInput(v *PurgeQueueInput, value query.Value) error { object := value.Object() _ = object if v.QueueUrl != nil { objectKey := object.Key("QueueUrl") objectKey.String(*v.QueueUrl) } return nil } func awsAwsquery_serializeOpDocumentReceiveMessageInput(v *ReceiveMessageInput, value query.Value) error { object := value.Object() _ = object if v.AttributeNames != nil { objectKey := object.FlatKey("AttributeName") if err := awsAwsquery_serializeDocumentAttributeNameList(v.AttributeNames, objectKey); err != nil { return err } } if v.MaxNumberOfMessages != 0 { objectKey := object.Key("MaxNumberOfMessages") objectKey.Integer(v.MaxNumberOfMessages) } if v.MessageAttributeNames != nil { objectKey := object.FlatKey("MessageAttributeName") if err := awsAwsquery_serializeDocumentMessageAttributeNameList(v.MessageAttributeNames, objectKey); err != nil { return err } } if v.QueueUrl != nil { objectKey := object.Key("QueueUrl") objectKey.String(*v.QueueUrl) } if v.ReceiveRequestAttemptId != nil { objectKey := object.Key("ReceiveRequestAttemptId") objectKey.String(*v.ReceiveRequestAttemptId) } if v.VisibilityTimeout != 0 { objectKey := object.Key("VisibilityTimeout") objectKey.Integer(v.VisibilityTimeout) } if v.WaitTimeSeconds != 0 { objectKey := object.Key("WaitTimeSeconds") objectKey.Integer(v.WaitTimeSeconds) } return nil } func awsAwsquery_serializeOpDocumentRemovePermissionInput(v *RemovePermissionInput, value query.Value) error { object := value.Object() _ = object if v.Label != nil { objectKey := object.Key("Label") objectKey.String(*v.Label) } if v.QueueUrl != nil { objectKey := object.Key("QueueUrl") objectKey.String(*v.QueueUrl) } return nil } func awsAwsquery_serializeOpDocumentSendMessageBatchInput(v *SendMessageBatchInput, value query.Value) error { object := value.Object() _ = object if v.Entries != nil { objectKey := object.FlatKey("SendMessageBatchRequestEntry") if err := awsAwsquery_serializeDocumentSendMessageBatchRequestEntryList(v.Entries, objectKey); err != nil { return err } } if v.QueueUrl != nil { objectKey := object.Key("QueueUrl") objectKey.String(*v.QueueUrl) } return nil } func awsAwsquery_serializeOpDocumentSendMessageInput(v *SendMessageInput, value query.Value) error { object := value.Object() _ = object if v.DelaySeconds != 0 { objectKey := object.Key("DelaySeconds") objectKey.Integer(v.DelaySeconds) } if v.MessageAttributes != nil { objectKey := object.FlatKey("MessageAttribute") if err := awsAwsquery_serializeDocumentMessageBodyAttributeMap(v.MessageAttributes, objectKey); err != nil { return err } } if v.MessageBody != nil { objectKey := object.Key("MessageBody") objectKey.String(*v.MessageBody) } if v.MessageDeduplicationId != nil { objectKey := object.Key("MessageDeduplicationId") objectKey.String(*v.MessageDeduplicationId) } if v.MessageGroupId != nil { objectKey := object.Key("MessageGroupId") objectKey.String(*v.MessageGroupId) } if v.MessageSystemAttributes != nil { objectKey := object.FlatKey("MessageSystemAttribute") if err := awsAwsquery_serializeDocumentMessageBodySystemAttributeMap(v.MessageSystemAttributes, objectKey); err != nil { return err } } if v.QueueUrl != nil { objectKey := object.Key("QueueUrl") objectKey.String(*v.QueueUrl) } return nil } func awsAwsquery_serializeOpDocumentSetQueueAttributesInput(v *SetQueueAttributesInput, value query.Value) error { object := value.Object() _ = object if v.Attributes != nil { objectKey := object.FlatKey("Attribute") if err := awsAwsquery_serializeDocumentQueueAttributeMap(v.Attributes, objectKey); err != nil { return err } } if v.QueueUrl != nil { objectKey := object.Key("QueueUrl") objectKey.String(*v.QueueUrl) } return nil } func awsAwsquery_serializeOpDocumentStartMessageMoveTaskInput(v *StartMessageMoveTaskInput, value query.Value) error { object := value.Object() _ = object if v.DestinationArn != nil { objectKey := object.Key("DestinationArn") objectKey.String(*v.DestinationArn) } if v.MaxNumberOfMessagesPerSecond != 0 { objectKey := object.Key("MaxNumberOfMessagesPerSecond") objectKey.Integer(v.MaxNumberOfMessagesPerSecond) } if v.SourceArn != nil { objectKey := object.Key("SourceArn") objectKey.String(*v.SourceArn) } return nil } func awsAwsquery_serializeOpDocumentTagQueueInput(v *TagQueueInput, value query.Value) error { object := value.Object() _ = object if v.QueueUrl != nil { objectKey := object.Key("QueueUrl") objectKey.String(*v.QueueUrl) } if v.Tags != nil { objectKey := object.FlatKey("Tag") if err := awsAwsquery_serializeDocumentTagMap(v.Tags, objectKey); err != nil { return err } } return nil } func awsAwsquery_serializeOpDocumentUntagQueueInput(v *UntagQueueInput, value query.Value) error { object := value.Object() _ = object if v.QueueUrl != nil { objectKey := object.Key("QueueUrl") objectKey.String(*v.QueueUrl) } if v.TagKeys != nil { objectKey := object.FlatKey("TagKey") if err := awsAwsquery_serializeDocumentTagKeyList(v.TagKeys, objectKey); err != nil { return err } } return nil }
2,323
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sqs import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/sqs/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpAddPermission struct { } func (*validateOpAddPermission) ID() string { return "OperationInputValidation" } func (m *validateOpAddPermission) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AddPermissionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAddPermissionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCancelMessageMoveTask struct { } func (*validateOpCancelMessageMoveTask) ID() string { return "OperationInputValidation" } func (m *validateOpCancelMessageMoveTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CancelMessageMoveTaskInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCancelMessageMoveTaskInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpChangeMessageVisibilityBatch struct { } func (*validateOpChangeMessageVisibilityBatch) ID() string { return "OperationInputValidation" } func (m *validateOpChangeMessageVisibilityBatch) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ChangeMessageVisibilityBatchInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpChangeMessageVisibilityBatchInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpChangeMessageVisibility struct { } func (*validateOpChangeMessageVisibility) ID() string { return "OperationInputValidation" } func (m *validateOpChangeMessageVisibility) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ChangeMessageVisibilityInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpChangeMessageVisibilityInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateQueue struct { } func (*validateOpCreateQueue) ID() string { return "OperationInputValidation" } func (m *validateOpCreateQueue) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateQueueInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateQueueInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteMessageBatch struct { } func (*validateOpDeleteMessageBatch) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteMessageBatch) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteMessageBatchInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteMessageBatchInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteMessage struct { } func (*validateOpDeleteMessage) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteMessage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteMessageInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteMessageInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteQueue struct { } func (*validateOpDeleteQueue) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteQueue) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteQueueInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteQueueInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetQueueAttributes struct { } func (*validateOpGetQueueAttributes) ID() string { return "OperationInputValidation" } func (m *validateOpGetQueueAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetQueueAttributesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetQueueAttributesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetQueueUrl struct { } func (*validateOpGetQueueUrl) ID() string { return "OperationInputValidation" } func (m *validateOpGetQueueUrl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetQueueUrlInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetQueueUrlInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListDeadLetterSourceQueues struct { } func (*validateOpListDeadLetterSourceQueues) ID() string { return "OperationInputValidation" } func (m *validateOpListDeadLetterSourceQueues) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListDeadLetterSourceQueuesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListDeadLetterSourceQueuesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListMessageMoveTasks struct { } func (*validateOpListMessageMoveTasks) ID() string { return "OperationInputValidation" } func (m *validateOpListMessageMoveTasks) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListMessageMoveTasksInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListMessageMoveTasksInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListQueueTags struct { } func (*validateOpListQueueTags) ID() string { return "OperationInputValidation" } func (m *validateOpListQueueTags) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListQueueTagsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListQueueTagsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpPurgeQueue struct { } func (*validateOpPurgeQueue) ID() string { return "OperationInputValidation" } func (m *validateOpPurgeQueue) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PurgeQueueInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPurgeQueueInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpReceiveMessage struct { } func (*validateOpReceiveMessage) ID() string { return "OperationInputValidation" } func (m *validateOpReceiveMessage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ReceiveMessageInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpReceiveMessageInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRemovePermission struct { } func (*validateOpRemovePermission) ID() string { return "OperationInputValidation" } func (m *validateOpRemovePermission) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RemovePermissionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRemovePermissionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpSendMessageBatch struct { } func (*validateOpSendMessageBatch) ID() string { return "OperationInputValidation" } func (m *validateOpSendMessageBatch) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*SendMessageBatchInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpSendMessageBatchInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpSendMessage struct { } func (*validateOpSendMessage) ID() string { return "OperationInputValidation" } func (m *validateOpSendMessage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*SendMessageInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpSendMessageInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpSetQueueAttributes struct { } func (*validateOpSetQueueAttributes) ID() string { return "OperationInputValidation" } func (m *validateOpSetQueueAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*SetQueueAttributesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpSetQueueAttributesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartMessageMoveTask struct { } func (*validateOpStartMessageMoveTask) ID() string { return "OperationInputValidation" } func (m *validateOpStartMessageMoveTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartMessageMoveTaskInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartMessageMoveTaskInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpTagQueue struct { } func (*validateOpTagQueue) ID() string { return "OperationInputValidation" } func (m *validateOpTagQueue) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TagQueueInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTagQueueInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUntagQueue struct { } func (*validateOpUntagQueue) ID() string { return "OperationInputValidation" } func (m *validateOpUntagQueue) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UntagQueueInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUntagQueueInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpAddPermissionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAddPermission{}, middleware.After) } func addOpCancelMessageMoveTaskValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCancelMessageMoveTask{}, middleware.After) } func addOpChangeMessageVisibilityBatchValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpChangeMessageVisibilityBatch{}, middleware.After) } func addOpChangeMessageVisibilityValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpChangeMessageVisibility{}, middleware.After) } func addOpCreateQueueValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateQueue{}, middleware.After) } func addOpDeleteMessageBatchValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteMessageBatch{}, middleware.After) } func addOpDeleteMessageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteMessage{}, middleware.After) } func addOpDeleteQueueValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteQueue{}, middleware.After) } func addOpGetQueueAttributesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetQueueAttributes{}, middleware.After) } func addOpGetQueueUrlValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetQueueUrl{}, middleware.After) } func addOpListDeadLetterSourceQueuesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListDeadLetterSourceQueues{}, middleware.After) } func addOpListMessageMoveTasksValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListMessageMoveTasks{}, middleware.After) } func addOpListQueueTagsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListQueueTags{}, middleware.After) } func addOpPurgeQueueValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPurgeQueue{}, middleware.After) } func addOpReceiveMessageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpReceiveMessage{}, middleware.After) } func addOpRemovePermissionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRemovePermission{}, middleware.After) } func addOpSendMessageBatchValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSendMessageBatch{}, middleware.After) } func addOpSendMessageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSendMessage{}, middleware.After) } func addOpSetQueueAttributesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSetQueueAttributes{}, middleware.After) } func addOpStartMessageMoveTaskValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartMessageMoveTask{}, middleware.After) } func addOpTagQueueValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagQueue{}, middleware.After) } func addOpUntagQueueValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagQueue{}, middleware.After) } func validateChangeMessageVisibilityBatchRequestEntry(v *types.ChangeMessageVisibilityBatchRequestEntry) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ChangeMessageVisibilityBatchRequestEntry"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if v.ReceiptHandle == nil { invalidParams.Add(smithy.NewErrParamRequired("ReceiptHandle")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateChangeMessageVisibilityBatchRequestEntryList(v []types.ChangeMessageVisibilityBatchRequestEntry) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ChangeMessageVisibilityBatchRequestEntryList"} for i := range v { if err := validateChangeMessageVisibilityBatchRequestEntry(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDeleteMessageBatchRequestEntry(v *types.DeleteMessageBatchRequestEntry) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteMessageBatchRequestEntry"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if v.ReceiptHandle == nil { invalidParams.Add(smithy.NewErrParamRequired("ReceiptHandle")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDeleteMessageBatchRequestEntryList(v []types.DeleteMessageBatchRequestEntry) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteMessageBatchRequestEntryList"} for i := range v { if err := validateDeleteMessageBatchRequestEntry(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateMessageAttributeValue(v *types.MessageAttributeValue) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "MessageAttributeValue"} if v.DataType == nil { invalidParams.Add(smithy.NewErrParamRequired("DataType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateMessageBodyAttributeMap(v map[string]types.MessageAttributeValue) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "MessageBodyAttributeMap"} for key := range v { value := v[key] if err := validateMessageAttributeValue(&value); err != nil { invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateMessageBodySystemAttributeMap(v map[string]types.MessageSystemAttributeValue) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "MessageBodySystemAttributeMap"} for key := range v { value := v[key] if err := validateMessageSystemAttributeValue(&value); err != nil { invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateMessageSystemAttributeValue(v *types.MessageSystemAttributeValue) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "MessageSystemAttributeValue"} if v.DataType == nil { invalidParams.Add(smithy.NewErrParamRequired("DataType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateSendMessageBatchRequestEntry(v *types.SendMessageBatchRequestEntry) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SendMessageBatchRequestEntry"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if v.MessageBody == nil { invalidParams.Add(smithy.NewErrParamRequired("MessageBody")) } if v.MessageAttributes != nil { if err := validateMessageBodyAttributeMap(v.MessageAttributes); err != nil { invalidParams.AddNested("MessageAttributes", err.(smithy.InvalidParamsError)) } } if v.MessageSystemAttributes != nil { if err := validateMessageBodySystemAttributeMap(v.MessageSystemAttributes); err != nil { invalidParams.AddNested("MessageSystemAttributes", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateSendMessageBatchRequestEntryList(v []types.SendMessageBatchRequestEntry) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SendMessageBatchRequestEntryList"} for i := range v { if err := validateSendMessageBatchRequestEntry(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAddPermissionInput(v *AddPermissionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AddPermissionInput"} if v.QueueUrl == nil { invalidParams.Add(smithy.NewErrParamRequired("QueueUrl")) } if v.Label == nil { invalidParams.Add(smithy.NewErrParamRequired("Label")) } if v.AWSAccountIds == nil { invalidParams.Add(smithy.NewErrParamRequired("AWSAccountIds")) } if v.Actions == nil { invalidParams.Add(smithy.NewErrParamRequired("Actions")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCancelMessageMoveTaskInput(v *CancelMessageMoveTaskInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CancelMessageMoveTaskInput"} if v.TaskHandle == nil { invalidParams.Add(smithy.NewErrParamRequired("TaskHandle")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpChangeMessageVisibilityBatchInput(v *ChangeMessageVisibilityBatchInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ChangeMessageVisibilityBatchInput"} if v.QueueUrl == nil { invalidParams.Add(smithy.NewErrParamRequired("QueueUrl")) } if v.Entries == nil { invalidParams.Add(smithy.NewErrParamRequired("Entries")) } else if v.Entries != nil { if err := validateChangeMessageVisibilityBatchRequestEntryList(v.Entries); err != nil { invalidParams.AddNested("Entries", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpChangeMessageVisibilityInput(v *ChangeMessageVisibilityInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ChangeMessageVisibilityInput"} if v.QueueUrl == nil { invalidParams.Add(smithy.NewErrParamRequired("QueueUrl")) } if v.ReceiptHandle == nil { invalidParams.Add(smithy.NewErrParamRequired("ReceiptHandle")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateQueueInput(v *CreateQueueInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateQueueInput"} if v.QueueName == nil { invalidParams.Add(smithy.NewErrParamRequired("QueueName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteMessageBatchInput(v *DeleteMessageBatchInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteMessageBatchInput"} if v.QueueUrl == nil { invalidParams.Add(smithy.NewErrParamRequired("QueueUrl")) } if v.Entries == nil { invalidParams.Add(smithy.NewErrParamRequired("Entries")) } else if v.Entries != nil { if err := validateDeleteMessageBatchRequestEntryList(v.Entries); err != nil { invalidParams.AddNested("Entries", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteMessageInput(v *DeleteMessageInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteMessageInput"} if v.QueueUrl == nil { invalidParams.Add(smithy.NewErrParamRequired("QueueUrl")) } if v.ReceiptHandle == nil { invalidParams.Add(smithy.NewErrParamRequired("ReceiptHandle")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteQueueInput(v *DeleteQueueInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteQueueInput"} if v.QueueUrl == nil { invalidParams.Add(smithy.NewErrParamRequired("QueueUrl")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetQueueAttributesInput(v *GetQueueAttributesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetQueueAttributesInput"} if v.QueueUrl == nil { invalidParams.Add(smithy.NewErrParamRequired("QueueUrl")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetQueueUrlInput(v *GetQueueUrlInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetQueueUrlInput"} if v.QueueName == nil { invalidParams.Add(smithy.NewErrParamRequired("QueueName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListDeadLetterSourceQueuesInput(v *ListDeadLetterSourceQueuesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListDeadLetterSourceQueuesInput"} if v.QueueUrl == nil { invalidParams.Add(smithy.NewErrParamRequired("QueueUrl")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListMessageMoveTasksInput(v *ListMessageMoveTasksInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListMessageMoveTasksInput"} if v.SourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListQueueTagsInput(v *ListQueueTagsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListQueueTagsInput"} if v.QueueUrl == nil { invalidParams.Add(smithy.NewErrParamRequired("QueueUrl")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpPurgeQueueInput(v *PurgeQueueInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PurgeQueueInput"} if v.QueueUrl == nil { invalidParams.Add(smithy.NewErrParamRequired("QueueUrl")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpReceiveMessageInput(v *ReceiveMessageInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ReceiveMessageInput"} if v.QueueUrl == nil { invalidParams.Add(smithy.NewErrParamRequired("QueueUrl")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRemovePermissionInput(v *RemovePermissionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RemovePermissionInput"} if v.QueueUrl == nil { invalidParams.Add(smithy.NewErrParamRequired("QueueUrl")) } if v.Label == nil { invalidParams.Add(smithy.NewErrParamRequired("Label")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpSendMessageBatchInput(v *SendMessageBatchInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SendMessageBatchInput"} if v.QueueUrl == nil { invalidParams.Add(smithy.NewErrParamRequired("QueueUrl")) } if v.Entries == nil { invalidParams.Add(smithy.NewErrParamRequired("Entries")) } else if v.Entries != nil { if err := validateSendMessageBatchRequestEntryList(v.Entries); err != nil { invalidParams.AddNested("Entries", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpSendMessageInput(v *SendMessageInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SendMessageInput"} if v.QueueUrl == nil { invalidParams.Add(smithy.NewErrParamRequired("QueueUrl")) } if v.MessageBody == nil { invalidParams.Add(smithy.NewErrParamRequired("MessageBody")) } if v.MessageAttributes != nil { if err := validateMessageBodyAttributeMap(v.MessageAttributes); err != nil { invalidParams.AddNested("MessageAttributes", err.(smithy.InvalidParamsError)) } } if v.MessageSystemAttributes != nil { if err := validateMessageBodySystemAttributeMap(v.MessageSystemAttributes); err != nil { invalidParams.AddNested("MessageSystemAttributes", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpSetQueueAttributesInput(v *SetQueueAttributesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SetQueueAttributesInput"} if v.QueueUrl == nil { invalidParams.Add(smithy.NewErrParamRequired("QueueUrl")) } if v.Attributes == nil { invalidParams.Add(smithy.NewErrParamRequired("Attributes")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartMessageMoveTaskInput(v *StartMessageMoveTaskInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartMessageMoveTaskInput"} if v.SourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTagQueueInput(v *TagQueueInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagQueueInput"} if v.QueueUrl == nil { invalidParams.Add(smithy.NewErrParamRequired("QueueUrl")) } if v.Tags == nil { invalidParams.Add(smithy.NewErrParamRequired("Tags")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUntagQueueInput(v *UntagQueueInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UntagQueueInput"} if v.QueueUrl == nil { invalidParams.Add(smithy.NewErrParamRequired("QueueUrl")) } if v.TagKeys == nil { invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
1,112
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 SQS 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: "sqs.{region}.api.aws", Protocols: []string{"http", "https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "sqs-fips.{region}.amazonaws.com", Protocols: []string{"http", "https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "sqs-fips.{region}.api.aws", Protocols: []string{"http", "https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sqs.{region}.amazonaws.com", Protocols: []string{"http", "https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "af-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-4", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-south-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "fips-us-east-1", }: endpoints.Endpoint{ Hostname: "sqs-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: "sqs-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: "sqs-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: "sqs-fips.us-west-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-2", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "me-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "sa-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", Variant: endpoints.FIPSVariant, }: { Hostname: "sqs-fips.us-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", Variant: endpoints.FIPSVariant, }: { Hostname: "sqs-fips.us-east-2.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "sqs-fips.us-west-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", Variant: endpoints.FIPSVariant, }: { Hostname: "sqs-fips.us-west-2.amazonaws.com", }, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "sqs.{region}.api.amazonwebservices.com.cn", Protocols: []string{"http", "https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "sqs-fips.{region}.amazonaws.com.cn", Protocols: []string{"http", "https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "sqs-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"http", "https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sqs.{region}.amazonaws.com.cn", Protocols: []string{"http", "https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "cn-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "cn-northwest-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-iso", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "sqs-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sqs.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "us-iso-east-1", }: endpoints.Endpoint{ Protocols: []string{"http", "https"}, }, endpoints.EndpointKey{ Region: "us-iso-west-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-iso-b", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "sqs-fips.{region}.sc2s.sgov.gov", Protocols: []string{"http", "https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sqs.{region}.sc2s.sgov.gov", Protocols: []string{"http", "https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "us-isob-east-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-iso-e", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "sqs-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sqs.{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: "sqs-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sqs.{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: "sqs.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "sqs.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "sqs-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sqs.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "us-gov-east-1", }: endpoints.Endpoint{ Hostname: "sqs.us-gov-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-east-1", }, }, endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{ Hostname: "sqs.us-gov-west-1.amazonaws.com", Protocols: []string{"http", "https"}, CredentialScope: endpoints.CredentialScope{ Region: "us-gov-west-1", }, }, }, }, }
482
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 MessageSystemAttributeName string // Enum values for MessageSystemAttributeName const ( MessageSystemAttributeNameSenderId MessageSystemAttributeName = "SenderId" MessageSystemAttributeNameSentTimestamp MessageSystemAttributeName = "SentTimestamp" MessageSystemAttributeNameApproximateReceiveCount MessageSystemAttributeName = "ApproximateReceiveCount" MessageSystemAttributeNameApproximateFirstReceiveTimestamp MessageSystemAttributeName = "ApproximateFirstReceiveTimestamp" MessageSystemAttributeNameSequenceNumber MessageSystemAttributeName = "SequenceNumber" MessageSystemAttributeNameMessageDeduplicationId MessageSystemAttributeName = "MessageDeduplicationId" MessageSystemAttributeNameMessageGroupId MessageSystemAttributeName = "MessageGroupId" MessageSystemAttributeNameAWSTraceHeader MessageSystemAttributeName = "AWSTraceHeader" MessageSystemAttributeNameDeadLetterQueueSourceArn MessageSystemAttributeName = "DeadLetterQueueSourceArn" ) // Values returns all known values for MessageSystemAttributeName. 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 (MessageSystemAttributeName) Values() []MessageSystemAttributeName { return []MessageSystemAttributeName{ "SenderId", "SentTimestamp", "ApproximateReceiveCount", "ApproximateFirstReceiveTimestamp", "SequenceNumber", "MessageDeduplicationId", "MessageGroupId", "AWSTraceHeader", "DeadLetterQueueSourceArn", } } type MessageSystemAttributeNameForSends string // Enum values for MessageSystemAttributeNameForSends const ( MessageSystemAttributeNameForSendsAWSTraceHeader MessageSystemAttributeNameForSends = "AWSTraceHeader" ) // Values returns all known values for MessageSystemAttributeNameForSends. 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 (MessageSystemAttributeNameForSends) Values() []MessageSystemAttributeNameForSends { return []MessageSystemAttributeNameForSends{ "AWSTraceHeader", } } type QueueAttributeName string // Enum values for QueueAttributeName const ( QueueAttributeNameAll QueueAttributeName = "All" QueueAttributeNamePolicy QueueAttributeName = "Policy" QueueAttributeNameVisibilityTimeout QueueAttributeName = "VisibilityTimeout" QueueAttributeNameMaximumMessageSize QueueAttributeName = "MaximumMessageSize" QueueAttributeNameMessageRetentionPeriod QueueAttributeName = "MessageRetentionPeriod" QueueAttributeNameApproximateNumberOfMessages QueueAttributeName = "ApproximateNumberOfMessages" QueueAttributeNameApproximateNumberOfMessagesNotVisible QueueAttributeName = "ApproximateNumberOfMessagesNotVisible" QueueAttributeNameCreatedTimestamp QueueAttributeName = "CreatedTimestamp" QueueAttributeNameLastModifiedTimestamp QueueAttributeName = "LastModifiedTimestamp" QueueAttributeNameQueueArn QueueAttributeName = "QueueArn" QueueAttributeNameApproximateNumberOfMessagesDelayed QueueAttributeName = "ApproximateNumberOfMessagesDelayed" QueueAttributeNameDelaySeconds QueueAttributeName = "DelaySeconds" QueueAttributeNameReceiveMessageWaitTimeSeconds QueueAttributeName = "ReceiveMessageWaitTimeSeconds" QueueAttributeNameRedrivePolicy QueueAttributeName = "RedrivePolicy" QueueAttributeNameFifoQueue QueueAttributeName = "FifoQueue" QueueAttributeNameContentBasedDeduplication QueueAttributeName = "ContentBasedDeduplication" QueueAttributeNameKmsMasterKeyId QueueAttributeName = "KmsMasterKeyId" QueueAttributeNameKmsDataKeyReusePeriodSeconds QueueAttributeName = "KmsDataKeyReusePeriodSeconds" QueueAttributeNameDeduplicationScope QueueAttributeName = "DeduplicationScope" QueueAttributeNameFifoThroughputLimit QueueAttributeName = "FifoThroughputLimit" QueueAttributeNameRedriveAllowPolicy QueueAttributeName = "RedriveAllowPolicy" QueueAttributeNameSqsManagedSseEnabled QueueAttributeName = "SqsManagedSseEnabled" ) // Values returns all known values for QueueAttributeName. 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 (QueueAttributeName) Values() []QueueAttributeName { return []QueueAttributeName{ "All", "Policy", "VisibilityTimeout", "MaximumMessageSize", "MessageRetentionPeriod", "ApproximateNumberOfMessages", "ApproximateNumberOfMessagesNotVisible", "CreatedTimestamp", "LastModifiedTimestamp", "QueueArn", "ApproximateNumberOfMessagesDelayed", "DelaySeconds", "ReceiveMessageWaitTimeSeconds", "RedrivePolicy", "FifoQueue", "ContentBasedDeduplication", "KmsMasterKeyId", "KmsDataKeyReusePeriodSeconds", "DeduplicationScope", "FifoThroughputLimit", "RedriveAllowPolicy", "SqsManagedSseEnabled", } }
111
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" ) // Two or more batch entries in the request have the same Id . type BatchEntryIdsNotDistinct struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *BatchEntryIdsNotDistinct) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *BatchEntryIdsNotDistinct) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *BatchEntryIdsNotDistinct) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AWS.SimpleQueueService.BatchEntryIdsNotDistinct" } return *e.ErrorCodeOverride } func (e *BatchEntryIdsNotDistinct) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The length of all the messages put together is more than the limit. type BatchRequestTooLong struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *BatchRequestTooLong) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *BatchRequestTooLong) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *BatchRequestTooLong) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AWS.SimpleQueueService.BatchRequestTooLong" } return *e.ErrorCodeOverride } func (e *BatchRequestTooLong) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The batch request doesn't contain any entries. type EmptyBatchRequest struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *EmptyBatchRequest) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *EmptyBatchRequest) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *EmptyBatchRequest) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AWS.SimpleQueueService.EmptyBatchRequest" } return *e.ErrorCodeOverride } func (e *EmptyBatchRequest) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified attribute doesn't exist. type InvalidAttributeName struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidAttributeName) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidAttributeName) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidAttributeName) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidAttributeName" } return *e.ErrorCodeOverride } func (e *InvalidAttributeName) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The Id of a batch entry in a batch request doesn't abide by the specification. type InvalidBatchEntryId struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidBatchEntryId) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidBatchEntryId) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidBatchEntryId) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AWS.SimpleQueueService.InvalidBatchEntryId" } return *e.ErrorCodeOverride } func (e *InvalidBatchEntryId) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified receipt handle isn't valid for the current version. type InvalidIdFormat struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidIdFormat) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidIdFormat) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidIdFormat) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidIdFormat" } return *e.ErrorCodeOverride } func (e *InvalidIdFormat) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The message contains characters outside the allowed set. type InvalidMessageContents struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidMessageContents) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidMessageContents) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidMessageContents) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidMessageContents" } return *e.ErrorCodeOverride } func (e *InvalidMessageContents) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified message isn't in flight. type MessageNotInflight struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *MessageNotInflight) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *MessageNotInflight) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *MessageNotInflight) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AWS.SimpleQueueService.MessageNotInflight" } return *e.ErrorCodeOverride } func (e *MessageNotInflight) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified action violates a limit. For example, ReceiveMessage returns this // error if the maximum number of in flight messages is reached and AddPermission // returns this error if the maximum number of permissions for the queue is // reached. type OverLimit struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *OverLimit) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *OverLimit) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *OverLimit) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "OverLimit" } return *e.ErrorCodeOverride } func (e *OverLimit) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Indicates that the specified queue previously received a PurgeQueue request // within the last 60 seconds (the time it can take to delete the messages in the // queue). type PurgeQueueInProgress struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *PurgeQueueInProgress) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *PurgeQueueInProgress) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *PurgeQueueInProgress) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AWS.SimpleQueueService.PurgeQueueInProgress" } return *e.ErrorCodeOverride } func (e *PurgeQueueInProgress) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You must wait 60 seconds after deleting a queue before you can create another // queue with the same name. type QueueDeletedRecently struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *QueueDeletedRecently) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *QueueDeletedRecently) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *QueueDeletedRecently) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AWS.SimpleQueueService.QueueDeletedRecently" } return *e.ErrorCodeOverride } func (e *QueueDeletedRecently) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified queue doesn't exist. type QueueDoesNotExist struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *QueueDoesNotExist) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *QueueDoesNotExist) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *QueueDoesNotExist) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AWS.SimpleQueueService.NonExistentQueue" } return *e.ErrorCodeOverride } func (e *QueueDoesNotExist) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // A queue with this name already exists. Amazon SQS returns this error only if // the request includes attributes whose values differ from those of the existing // queue. type QueueNameExists struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *QueueNameExists) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *QueueNameExists) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *QueueNameExists) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "QueueAlreadyExists" } return *e.ErrorCodeOverride } func (e *QueueNameExists) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified receipt handle isn't valid. type ReceiptHandleIsInvalid struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ReceiptHandleIsInvalid) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ReceiptHandleIsInvalid) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ReceiptHandleIsInvalid) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ReceiptHandleIsInvalid" } return *e.ErrorCodeOverride } func (e *ReceiptHandleIsInvalid) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // One or more specified resources don't exist. type ResourceNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ResourceNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceNotFoundException" } return *e.ErrorCodeOverride } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The batch request contains more entries than permissible. type TooManyEntriesInBatchRequest struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *TooManyEntriesInBatchRequest) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TooManyEntriesInBatchRequest) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TooManyEntriesInBatchRequest) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AWS.SimpleQueueService.TooManyEntriesInBatchRequest" } return *e.ErrorCodeOverride } func (e *TooManyEntriesInBatchRequest) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Error code 400. Unsupported operation. type UnsupportedOperation struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *UnsupportedOperation) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *UnsupportedOperation) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *UnsupportedOperation) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AWS.SimpleQueueService.UnsupportedOperation" } return *e.ErrorCodeOverride } func (e *UnsupportedOperation) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
459
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" ) // Gives a detailed description of the result of an action on each entry in the // request. type BatchResultErrorEntry struct { // An error code representing why the action failed on this entry. // // This member is required. Code *string // The Id of an entry in a batch request. // // This member is required. Id *string // Specifies whether the error happened due to the caller of the batch API action. // // This member is required. SenderFault bool // A message explaining why the action failed on this entry. Message *string noSmithyDocumentSerde } // Encloses a receipt handle and an entry ID for each message in // ChangeMessageVisibilityBatch . type ChangeMessageVisibilityBatchRequestEntry struct { // An identifier for this particular receipt handle used to communicate the // result. The Id s of a batch request need to be unique within a request. This // identifier can have up to 80 characters. The following characters are accepted: // alphanumeric characters, hyphens(-), and underscores (_). // // This member is required. Id *string // A receipt handle. // // This member is required. ReceiptHandle *string // The new value (in seconds) for the message's visibility timeout. VisibilityTimeout int32 noSmithyDocumentSerde } // Encloses the Id of an entry in ChangeMessageVisibilityBatch . type ChangeMessageVisibilityBatchResultEntry struct { // Represents a message whose visibility timeout has been changed successfully. // // This member is required. Id *string noSmithyDocumentSerde } // Encloses a receipt handle and an identifier for it. type DeleteMessageBatchRequestEntry struct { // The identifier for this particular receipt handle. This is used to communicate // the result. The Id s of a batch request need to be unique within a request. This // identifier can have up to 80 characters. The following characters are accepted: // alphanumeric characters, hyphens(-), and underscores (_). // // This member is required. Id *string // A receipt handle. // // This member is required. ReceiptHandle *string noSmithyDocumentSerde } // Encloses the Id of an entry in DeleteMessageBatch . type DeleteMessageBatchResultEntry struct { // Represents a successfully deleted message. // // This member is required. Id *string noSmithyDocumentSerde } // Contains the details of a message movement task. type ListMessageMoveTasksResultEntry struct { // The approximate number of messages already moved to the destination queue. ApproximateNumberOfMessagesMoved int64 // The number of messages to be moved from the source queue. This number is // obtained at the time of starting the message movement task. ApproximateNumberOfMessagesToMove int64 // The ARN of the destination queue if it has been specified in the // StartMessageMoveTask request. If a DestinationArn has not been specified in the // StartMessageMoveTask request, this field value will be NULL. DestinationArn *string // The task failure reason (only included if the task status is FAILED). FailureReason *string // The number of messages to be moved per second (the message movement rate), if // it has been specified in the StartMessageMoveTask request. If a // MaxNumberOfMessagesPerSecond has not been specified in the StartMessageMoveTask // request, this field value will be NULL. MaxNumberOfMessagesPerSecond int32 // The ARN of the queue that contains the messages to be moved to another queue. SourceArn *string // The timestamp of starting the message movement task. StartedTimestamp int64 // The status of the message movement task. Possible values are: RUNNING, // COMPLETED, CANCELLING, CANCELLED, and FAILED. Status *string // An identifier associated with a message movement task. When this field is // returned in the response of the ListMessageMoveTasks action, it is only // populated for tasks that are in RUNNING status. TaskHandle *string noSmithyDocumentSerde } // An Amazon SQS message. type Message struct { // A map of the attributes requested in ReceiveMessage to their respective values. // Supported attributes: // - ApproximateReceiveCount // - ApproximateFirstReceiveTimestamp // - MessageDeduplicationId // - MessageGroupId // - SenderId // - SentTimestamp // - SequenceNumber // ApproximateFirstReceiveTimestamp and SentTimestamp are each returned as an // integer representing the epoch time (http://en.wikipedia.org/wiki/Unix_time) in // milliseconds. Attributes map[string]string // The message's contents (not URL-encoded). Body *string // An MD5 digest of the non-URL-encoded message body string. MD5OfBody *string // An MD5 digest of the non-URL-encoded message attribute string. You can use this // attribute to verify that Amazon SQS received the message correctly. Amazon SQS // URL-decodes the message before creating the MD5 digest. For information about // MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt) . MD5OfMessageAttributes *string // Each message attribute consists of a Name , Type , and Value . For more // information, see Amazon SQS message attributes (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) // in the Amazon SQS Developer Guide. MessageAttributes map[string]MessageAttributeValue // A unique identifier for the message. A MessageId is considered unique across all // Amazon Web Services accounts for an extended period of time. MessageId *string // An identifier associated with the act of receiving the message. A new receipt // handle is returned every time you receive a message. When deleting a message, // you provide the last received receipt handle to delete the message. ReceiptHandle *string noSmithyDocumentSerde } // The user-specified message attribute value. For string data types, the Value // attribute has the same restrictions on the content as the message body. For more // information, see SendMessage . Name , type , value and the message body must // not be empty or null. All parts of the message attribute, including Name , Type // , and Value , are part of the message size restriction (256 KiB or 262,144 // bytes). type MessageAttributeValue struct { // Amazon SQS supports the following logical data types: String , Number , and // Binary . For the Number data type, you must use StringValue . You can also // append custom labels. For more information, see Amazon SQS Message Attributes (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) // in the Amazon SQS Developer Guide. // // This member is required. DataType *string // Not implemented. Reserved for future use. BinaryListValues [][]byte // Binary type attributes can store any binary data, such as compressed data, // encrypted data, or images. BinaryValue []byte // Not implemented. Reserved for future use. StringListValues []string // Strings are Unicode with UTF-8 binary encoding. For a list of code values, see // ASCII Printable Characters (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters) // . StringValue *string noSmithyDocumentSerde } // The user-specified message system attribute value. For string data types, the // Value attribute has the same restrictions on the content as the message body. // For more information, see SendMessage . Name , type , value and the message // body must not be empty or null. type MessageSystemAttributeValue struct { // Amazon SQS supports the following logical data types: String , Number , and // Binary . For the Number data type, you must use StringValue . You can also // append custom labels. For more information, see Amazon SQS Message Attributes (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) // in the Amazon SQS Developer Guide. // // This member is required. DataType *string // Not implemented. Reserved for future use. BinaryListValues [][]byte // Binary type attributes can store any binary data, such as compressed data, // encrypted data, or images. BinaryValue []byte // Not implemented. Reserved for future use. StringListValues []string // Strings are Unicode with UTF-8 binary encoding. For a list of code values, see // ASCII Printable Characters (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters) // . StringValue *string noSmithyDocumentSerde } // Contains the details of a single Amazon SQS message along with an Id . type SendMessageBatchRequestEntry struct { // An identifier for a message in this batch used to communicate the result. The Id // s of a batch request need to be unique within a request. This identifier can // have up to 80 characters. The following characters are accepted: alphanumeric // characters, hyphens(-), and underscores (_). // // This member is required. Id *string // The body of the message. // // This member is required. MessageBody *string // The length of time, in seconds, for which a specific message is delayed. Valid // values: 0 to 900. Maximum: 15 minutes. Messages with a positive DelaySeconds // value become available for processing after the delay period is finished. If you // don't specify a value, the default value for the queue is applied. When you set // FifoQueue , you can't set DelaySeconds per message. You can set this parameter // only on a queue level. DelaySeconds int32 // Each message attribute consists of a Name , Type , and Value . For more // information, see Amazon SQS message attributes (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) // in the Amazon SQS Developer Guide. MessageAttributes map[string]MessageAttributeValue // This parameter applies only to FIFO (first-in-first-out) queues. The token used // for deduplication of messages within a 5-minute minimum deduplication interval. // If a message with a particular MessageDeduplicationId is sent successfully, // subsequent messages with the same MessageDeduplicationId are accepted // successfully but aren't delivered. For more information, see Exactly-once // processing (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html) // in the Amazon SQS Developer Guide. // - Every message must have a unique MessageDeduplicationId , // - You may provide a MessageDeduplicationId explicitly. // - If you aren't able to provide a MessageDeduplicationId and you enable // ContentBasedDeduplication for your queue, Amazon SQS uses a SHA-256 hash to // generate the MessageDeduplicationId using the body of the message (but not the // attributes of the message). // - If you don't provide a MessageDeduplicationId and the queue doesn't have // ContentBasedDeduplication set, the action fails with an error. // - If the queue has ContentBasedDeduplication set, your MessageDeduplicationId // overrides the generated one. // - When ContentBasedDeduplication is in effect, messages with identical content // sent within the deduplication interval are treated as duplicates and only one // copy of the message is delivered. // - If you send one message with ContentBasedDeduplication enabled and then // another message with a MessageDeduplicationId that is the same as the one // generated for the first MessageDeduplicationId , the two messages are treated // as duplicates and only one copy of the message is delivered. // The MessageDeduplicationId is available to the consumer of the message (this // can be useful for troubleshooting delivery issues). If a message is sent // successfully but the acknowledgement is lost and the message is resent with the // same MessageDeduplicationId after the deduplication interval, Amazon SQS can't // detect duplicate messages. Amazon SQS continues to keep track of the message // deduplication ID even after the message is received and deleted. The length of // MessageDeduplicationId is 128 characters. MessageDeduplicationId can contain // alphanumeric characters ( a-z , A-Z , 0-9 ) and punctuation ( // !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ ). For best practices of using // MessageDeduplicationId , see Using the MessageDeduplicationId Property (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html) // in the Amazon SQS Developer Guide. MessageDeduplicationId *string // This parameter applies only to FIFO (first-in-first-out) queues. The tag that // specifies that a message belongs to a specific message group. Messages that // belong to the same message group are processed in a FIFO manner (however, // messages in different message groups might be processed out of order). To // interleave multiple ordered streams within a single queue, use MessageGroupId // values (for example, session data for multiple users). In this scenario, // multiple consumers can process the queue, but the session data of each user is // processed in a FIFO fashion. // - You must associate a non-empty MessageGroupId with a message. If you don't // provide a MessageGroupId , the action fails. // - ReceiveMessage might return messages with multiple MessageGroupId values. // For each MessageGroupId , the messages are sorted by time sent. The caller // can't specify a MessageGroupId . // The length of MessageGroupId is 128 characters. Valid values: alphanumeric // characters and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~) . For best // practices of using MessageGroupId , see Using the MessageGroupId Property (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html) // in the Amazon SQS Developer Guide. MessageGroupId is required for FIFO queues. // You can't use it for Standard queues. MessageGroupId *string // The message system attribute to send Each message system attribute consists of // a Name , Type , and Value . // - Currently, the only supported message system attribute is AWSTraceHeader . // Its type must be String and its value must be a correctly formatted X-Ray // trace header string. // - The size of a message system attribute doesn't count towards the total size // of a message. MessageSystemAttributes map[string]MessageSystemAttributeValue noSmithyDocumentSerde } // Encloses a MessageId for a successfully-enqueued message in a SendMessageBatch . type SendMessageBatchResultEntry struct { // An identifier for the message in this batch. // // This member is required. Id *string // An MD5 digest of the non-URL-encoded message body string. You can use this // attribute to verify that Amazon SQS received the message correctly. Amazon SQS // URL-decodes the message before creating the MD5 digest. For information about // MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt) . // // This member is required. MD5OfMessageBody *string // An identifier for the message. // // This member is required. MessageId *string // An MD5 digest of the non-URL-encoded message attribute string. You can use this // attribute to verify that Amazon SQS received the message correctly. Amazon SQS // URL-decodes the message before creating the MD5 digest. For information about // MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt) . MD5OfMessageAttributes *string // An MD5 digest of the non-URL-encoded message system attribute string. You can // use this attribute to verify that Amazon SQS received the message correctly. // Amazon SQS URL-decodes the message before creating the MD5 digest. For // information about MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt) . MD5OfMessageSystemAttributes *string // This parameter applies only to FIFO (first-in-first-out) queues. The large, // non-consecutive number that Amazon SQS assigns to each message. The length of // SequenceNumber is 128 bits. As SequenceNumber continues to increase for a // particular MessageGroupId . SequenceNumber *string noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
393
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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 = "SSM" const ServiceAPIVersion = "2014-11-06" // Client provides the API client to make operations call for Amazon Simple // Systems Manager (SSM). 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, "ssm", 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 ssm 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 ssm 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/ssm/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 resource. Tags are // metadata that you can assign to your automations, documents, managed nodes, // maintenance windows, Parameter Store parameters, and patch baselines. Tags // enable you to categorize your resources in different ways, for example, by // purpose, owner, or environment. Each tag consists of a key and an optional // value, both of which you define. For example, you could define a set of tags for // your account's managed nodes that helps you track each node's owner and stack // level. For example: // - Key=Owner,Value=DbAdmin // - Key=Owner,Value=SysAdmin // - Key=Owner,Value=Dev // - Key=Stack,Value=Production // - Key=Stack,Value=Pre-Production // - Key=Stack,Value=Test // // Most resources can have a maximum of 50 tags. Automations can have a maximum of // 5 tags. We recommend that you devise a set of tag keys that meets your needs for // each resource type. Using a consistent set of tag keys makes it easier for you // to manage your resources. You can search and filter the resources based on the // tags you add. Tags don't have any semantic meaning to and are interpreted // strictly as a string of characters. For more information about using tags with // Amazon Elastic Compute Cloud (Amazon EC2) instances, see Tagging your Amazon // EC2 resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) // in the Amazon EC2 User Guide. func (c *Client) AddTagsToResource(ctx context.Context, params *AddTagsToResourceInput, optFns ...func(*Options)) (*AddTagsToResourceOutput, error) { if params == nil { params = &AddTagsToResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "AddTagsToResource", params, optFns, c.addOperationAddTagsToResourceMiddlewares) if err != nil { return nil, err } out := result.(*AddTagsToResourceOutput) out.ResultMetadata = metadata return out, nil } type AddTagsToResourceInput struct { // The resource ID you want to tag. Use the ID of the resource. Here are some // examples: MaintenanceWindow : mw-012345abcde PatchBaseline : pb-012345abcde // Automation : example-c160-4567-8519-012345abcde OpsMetadata object: ResourceID // for tagging is created from the Amazon Resource Name (ARN) for the object. // Specifically, ResourceID is created from the strings that come after the word // opsmetadata in the ARN. For example, an OpsMetadata object with an ARN of // arn:aws:ssm:us-east-2:1234567890:opsmetadata/aws/ssm/MyGroup/appmanager has a // ResourceID of either aws/ssm/MyGroup/appmanager or /aws/ssm/MyGroup/appmanager . // For the Document and Parameter values, use the name of the resource. If you're // tagging a shared document, you must use the full ARN of the document. // ManagedInstance : mi-012345abcde The ManagedInstance type for this API // operation is only for on-premises managed nodes. You must specify the name of // the managed node in the following format: mi-ID_number . For example, // mi-1a2b3c4d5e6f . // // This member is required. ResourceId *string // Specifies the type of resource you are tagging. The ManagedInstance type for // this API operation is for on-premises managed nodes. You must specify the name // of the managed node in the following format: mi-ID_number . For example, // mi-1a2b3c4d5e6f . // // This member is required. ResourceType types.ResourceTypeForTagging // One or more tags. The value parameter is required. Don't enter personally // identifiable information in this field. // // This member is required. Tags []types.Tag noSmithyDocumentSerde } type AddTagsToResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAddTagsToResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddTagsToResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddTagsToResource{}, 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 = addOpAddTagsToResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddTagsToResource(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_opAddTagsToResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "AddTagsToResource", } }
171
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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 related item to a Systems Manager OpsCenter OpsItem. For example, // you can associate an Incident Manager incident or analysis with an OpsItem. // Incident Manager and OpsCenter are capabilities of Amazon Web Services Systems // Manager. func (c *Client) AssociateOpsItemRelatedItem(ctx context.Context, params *AssociateOpsItemRelatedItemInput, optFns ...func(*Options)) (*AssociateOpsItemRelatedItemOutput, error) { if params == nil { params = &AssociateOpsItemRelatedItemInput{} } result, metadata, err := c.invokeOperation(ctx, "AssociateOpsItemRelatedItem", params, optFns, c.addOperationAssociateOpsItemRelatedItemMiddlewares) if err != nil { return nil, err } out := result.(*AssociateOpsItemRelatedItemOutput) out.ResultMetadata = metadata return out, nil } type AssociateOpsItemRelatedItemInput struct { // The type of association that you want to create between an OpsItem and a // resource. OpsCenter supports IsParentOf and RelatesTo association types. // // This member is required. AssociationType *string // The ID of the OpsItem to which you want to associate a resource as a related // item. // // This member is required. OpsItemId *string // The type of resource that you want to associate with an OpsItem. OpsCenter // supports the following types: AWS::SSMIncidents::IncidentRecord : an Incident // Manager incident. AWS::SSM::Document : a Systems Manager (SSM) document. // // This member is required. ResourceType *string // The Amazon Resource Name (ARN) of the Amazon Web Services resource that you // want to associate with the OpsItem. // // This member is required. ResourceUri *string noSmithyDocumentSerde } type AssociateOpsItemRelatedItemOutput struct { // The association ID. AssociationId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAssociateOpsItemRelatedItemMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateOpsItemRelatedItem{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateOpsItemRelatedItem{}, 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 = addOpAssociateOpsItemRelatedItemValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateOpsItemRelatedItem(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_opAssociateOpsItemRelatedItem(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "AssociateOpsItemRelatedItem", } }
147
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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" ) // Attempts to cancel the command specified by the Command ID. There is no // guarantee that the command will be terminated and the underlying process // stopped. func (c *Client) CancelCommand(ctx context.Context, params *CancelCommandInput, optFns ...func(*Options)) (*CancelCommandOutput, error) { if params == nil { params = &CancelCommandInput{} } result, metadata, err := c.invokeOperation(ctx, "CancelCommand", params, optFns, c.addOperationCancelCommandMiddlewares) if err != nil { return nil, err } out := result.(*CancelCommandOutput) out.ResultMetadata = metadata return out, nil } type CancelCommandInput struct { // The ID of the command you want to cancel. // // This member is required. CommandId *string // (Optional) A list of managed node IDs on which you want to cancel the command. // If not provided, the command is canceled on every node on which it was // requested. InstanceIds []string noSmithyDocumentSerde } // Whether or not the command was successfully canceled. There is no guarantee // that a request can be canceled. type CancelCommandOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCancelCommandMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCancelCommand{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCancelCommand{}, 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 = addOpCancelCommandValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelCommand(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_opCancelCommand(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "CancelCommand", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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" ) // Stops a maintenance window execution that is already in progress and cancels // any tasks in the window that haven't already starting running. Tasks already in // progress will continue to completion. func (c *Client) CancelMaintenanceWindowExecution(ctx context.Context, params *CancelMaintenanceWindowExecutionInput, optFns ...func(*Options)) (*CancelMaintenanceWindowExecutionOutput, error) { if params == nil { params = &CancelMaintenanceWindowExecutionInput{} } result, metadata, err := c.invokeOperation(ctx, "CancelMaintenanceWindowExecution", params, optFns, c.addOperationCancelMaintenanceWindowExecutionMiddlewares) if err != nil { return nil, err } out := result.(*CancelMaintenanceWindowExecutionOutput) out.ResultMetadata = metadata return out, nil } type CancelMaintenanceWindowExecutionInput struct { // The ID of the maintenance window execution to stop. // // This member is required. WindowExecutionId *string noSmithyDocumentSerde } type CancelMaintenanceWindowExecutionOutput struct { // The ID of the maintenance window execution that has been stopped. WindowExecutionId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCancelMaintenanceWindowExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCancelMaintenanceWindowExecution{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCancelMaintenanceWindowExecution{}, 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 = addOpCancelMaintenanceWindowExecutionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelMaintenanceWindowExecution(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_opCancelMaintenanceWindowExecution(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "CancelMaintenanceWindowExecution", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Generates an activation code and activation ID you can use to register your // on-premises servers, edge devices, or virtual machine (VM) with Amazon Web // Services Systems Manager. Registering these machines with Systems Manager makes // it possible to manage them using Systems Manager capabilities. You use the // activation code and ID when installing SSM Agent on machines in your hybrid // environment. For more information about requirements for managing on-premises // machines using Systems Manager, see Setting up Amazon Web Services Systems // Manager for hybrid environments (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-managedinstances.html) // in the Amazon Web Services Systems Manager User Guide. Amazon Elastic Compute // Cloud (Amazon EC2) instances, edge devices, and on-premises servers and VMs that // are configured for Systems Manager are all called managed nodes. func (c *Client) CreateActivation(ctx context.Context, params *CreateActivationInput, optFns ...func(*Options)) (*CreateActivationOutput, error) { if params == nil { params = &CreateActivationInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateActivation", params, optFns, c.addOperationCreateActivationMiddlewares) if err != nil { return nil, err } out := result.(*CreateActivationOutput) out.ResultMetadata = metadata return out, nil } type CreateActivationInput struct { // The name of the Identity and Access Management (IAM) role that you want to // assign to the managed node. This IAM role must provide AssumeRole permissions // for the Amazon Web Services Systems Manager service principal ssm.amazonaws.com // . For more information, see Create an IAM service role for a hybrid environment (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-service-role.html) // in the Amazon Web Services Systems Manager User Guide. You can't specify an IAM // service-linked role for this parameter. You must create a unique role. // // This member is required. IamRole *string // The name of the registered, managed node as it will appear in the Amazon Web // Services Systems Manager console or when you use the Amazon Web Services command // line tools to list Systems Manager resources. Don't enter personally // identifiable information in this field. DefaultInstanceName *string // A user-defined description of the resource that you want to register with // Systems Manager. Don't enter personally identifiable information in this field. Description *string // The date by which this activation request should expire, in timestamp format, // such as "2021-07-07T00:00:00". You can specify a date up to 30 days in advance. // If you don't provide an expiration date, the activation code expires in 24 // hours. ExpirationDate *time.Time // Specify the maximum number of managed nodes you want to register. The default // value is 1 . RegistrationLimit *int32 // Reserved for internal use. RegistrationMetadata []types.RegistrationMetadataItem // Optional metadata that you assign to a resource. Tags enable you to categorize // a resource in different ways, such as by purpose, owner, or environment. For // example, you might want to tag an activation to identify which servers or // virtual machines (VMs) in your on-premises environment you intend to activate. // In this case, you could specify the following key-value pairs: // - Key=OS,Value=Windows // - Key=Environment,Value=Production // When you install SSM Agent on your on-premises servers and VMs, you specify an // activation ID and code. When you specify the activation ID and code, tags // assigned to the activation are automatically applied to the on-premises servers // or VMs. You can't add tags to or delete tags from an existing activation. You // can tag your on-premises servers, edge devices, and VMs after they connect to // Systems Manager for the first time and are assigned a managed node ID. This // means they are listed in the Amazon Web Services Systems Manager console with an // ID that is prefixed with "mi-". For information about how to add tags to your // managed nodes, see AddTagsToResource . For information about how to remove tags // from your managed nodes, see RemoveTagsFromResource . Tags []types.Tag noSmithyDocumentSerde } type CreateActivationOutput struct { // The code the system generates when it processes the activation. The activation // code functions like a password to validate the activation ID. ActivationCode *string // The ID number generated by the system when it processed the activation. The // activation ID functions like a user name. ActivationId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateActivationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateActivation{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateActivation{}, 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 = addOpCreateActivationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateActivation(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_opCreateActivation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "CreateActivation", } }
188
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // A State Manager association defines the state that you want to maintain on your // managed nodes. For example, an association can specify that anti-virus software // must be installed and running on your managed nodes, or that certain ports must // be closed. For static targets, the association specifies a schedule for when the // configuration is reapplied. For dynamic targets, such as an Amazon Web Services // resource group or an Amazon Web Services autoscaling group, State Manager, a // capability of Amazon Web Services Systems Manager applies the configuration when // new managed nodes are added to the group. The association also specifies actions // to take when applying the configuration. For example, an association for // anti-virus software might run once a day. If the software isn't installed, then // State Manager installs it. If the software is installed, but the service isn't // running, then the association might instruct State Manager to start the service. func (c *Client) CreateAssociation(ctx context.Context, params *CreateAssociationInput, optFns ...func(*Options)) (*CreateAssociationOutput, error) { if params == nil { params = &CreateAssociationInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateAssociation", params, optFns, c.addOperationCreateAssociationMiddlewares) if err != nil { return nil, err } out := result.(*CreateAssociationOutput) out.ResultMetadata = metadata return out, nil } type CreateAssociationInput struct { // The name of the SSM Command document or Automation runbook that contains the // configuration information for the managed node. You can specify Amazon Web // Services-predefined documents, documents you created, or a document that is // shared with you from another Amazon Web Services account. For Systems Manager // documents (SSM documents) that are shared with you from other Amazon Web // Services accounts, you must specify the complete SSM document ARN, in the // following format: arn:partition:ssm:region:account-id:document/document-name // For example: arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document For // Amazon Web Services-predefined documents and SSM documents you created in your // account, you only need to specify the document name. For example, // AWS-ApplyPatchBaseline or My-Document . // // This member is required. Name *string // The details for the CloudWatch alarm you want to apply to an automation or // command. AlarmConfiguration *types.AlarmConfiguration // By default, when you create a new association, the system runs it immediately // after it is created and then according to the schedule you specified. Specify // this option if you don't want an association to run immediately after you create // it. This parameter isn't supported for rate expressions. ApplyOnlyAtCronInterval bool // Specify a descriptive name for the association. AssociationName *string // Choose the parameter that will define how your automation will branch out. This // target is required for associations that use an Automation runbook and target // resources by using rate controls. Automation is a capability of Amazon Web // Services Systems Manager. AutomationTargetParameterName *string // The names or Amazon Resource Names (ARNs) of the Change Calendar type documents // you want to gate your associations under. The associations only run when that // change calendar is open. For more information, see Amazon Web Services Systems // Manager Change Calendar (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar) // . CalendarNames []string // The severity level to assign to the association. ComplianceSeverity types.AssociationComplianceSeverity // The document version you want to associate with the target(s). Can be a // specific version or the default version. State Manager doesn't support running // associations that use a new version of a document if that document is shared // from another account. State Manager always runs the default version of a // document if shared from another account, even though the Systems Manager console // shows that a new version was processed. If you want to run an association using // a new version of a document shared form another account, you must set the // document version to default . DocumentVersion *string // The managed node ID. InstanceId has been deprecated. To specify a managed node // ID for an association, use the Targets parameter. Requests that include the // parameter InstanceID with Systems Manager documents (SSM documents) that use // schema version 2.0 or later will fail. In addition, if you use the parameter // InstanceId , you can't use the parameters AssociationName , DocumentVersion , // MaxErrors , MaxConcurrency , OutputLocation , or ScheduleExpression . To use // these parameters, you must use the Targets parameter. InstanceId *string // The maximum number of targets allowed to run the association at the same time. // You can specify a number, for example 10, or a percentage of the target set, for // example 10%. The default value is 100%, which means all targets run the // association at the same time. If a new managed node starts and attempts to run // an association while Systems Manager is running MaxConcurrency associations, // the association is allowed to run. During the next association interval, the new // managed node will process its association within the limit specified for // MaxConcurrency . MaxConcurrency *string // The number of errors that are allowed before the system stops sending requests // to run the association on additional targets. You can specify either an absolute // number of errors, for example 10, or a percentage of the target set, for example // 10%. If you specify 3, for example, the system stops sending requests when the // fourth error is received. If you specify 0, then the system stops sending // requests after the first error is returned. If you run an association on 50 // managed nodes and set MaxError to 10%, then the system stops sending the // request when the sixth error is received. Executions that are already running an // association when MaxErrors is reached are allowed to complete, but some of // these executions may fail as well. If you need to ensure that there won't be // more than max-errors failed executions, set MaxConcurrency to 1 so that // executions proceed one at a time. MaxErrors *string // An Amazon Simple Storage Service (Amazon S3) bucket where you want to store the // output details of the request. OutputLocation *types.InstanceAssociationOutputLocation // The parameters for the runtime configuration of the document. Parameters map[string][]string // A cron expression when the association will be applied to the target(s). ScheduleExpression *string // Number of days to wait after the scheduled day to run an association. For // example, if you specified a cron schedule of cron(0 0 ? * THU#2 *) , you could // specify an offset of 3 to run the association each Sunday after the second // Thursday of the month. For more information about cron schedules for // associations, see Reference: Cron and rate expressions for Systems Manager (https://docs.aws.amazon.com/systems-manager/latest/userguide/reference-cron-and-rate-expressions.html) // in the Amazon Web Services Systems Manager User Guide. To use offsets, you must // specify the ApplyOnlyAtCronInterval parameter. This option tells the system not // to run an association immediately after you create it. ScheduleOffset *int32 // The mode for generating association compliance. You can specify AUTO or MANUAL . // In AUTO mode, the system uses the status of the association execution to // determine the compliance status. If the association execution runs successfully, // then the association is COMPLIANT . If the association execution doesn't run // successfully, the association is NON-COMPLIANT . In MANUAL mode, you must // specify the AssociationId as a parameter for the PutComplianceItems API // operation. In this case, compliance data isn't managed by State Manager. It is // managed by your direct call to the PutComplianceItems API operation. By // default, all associations use AUTO mode. SyncCompliance types.AssociationSyncCompliance // Adds or overwrites one or more tags for a State Manager association. Tags are // metadata that you can assign to your Amazon Web Services resources. Tags enable // you to categorize your resources in different ways, for example, by purpose, // owner, or environment. Each tag consists of a key and an optional value, both of // which you define. Tags []types.Tag // A location is a combination of Amazon Web Services Regions and Amazon Web // Services accounts where you want to run the association. Use this action to // create an association in multiple Regions and multiple accounts. TargetLocations []types.TargetLocation // A key-value mapping of document parameters to target resources. Both Targets // and TargetMaps can't be specified together. TargetMaps []map[string][]string // The targets for the association. You can target managed nodes by using tags, // Amazon Web Services resource groups, all managed nodes in an Amazon Web Services // account, or individual managed node IDs. You can target all managed nodes in an // Amazon Web Services account by specifying the InstanceIds key with a value of * // . For more information about choosing targets for an association, see Using // targets and rate controls with State Manager associations (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-state-manager-targets-and-rate-controls.html) // in the Amazon Web Services Systems Manager User Guide. Targets []types.Target noSmithyDocumentSerde } type CreateAssociationOutput struct { // Information about the association. AssociationDescription *types.AssociationDescription // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAssociation{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAssociation{}, 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 = addOpCreateAssociationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAssociation(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_opCreateAssociation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "CreateAssociation", } }
274
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Associates the specified Amazon Web Services Systems Manager document (SSM // document) with the specified managed nodes or targets. When you associate a // document with one or more managed nodes using IDs or tags, Amazon Web Services // Systems Manager Agent (SSM Agent) running on the managed node processes the // document and configures the node as specified. If you associate a document with // a managed node that already has an associated document, the system returns the // AssociationAlreadyExists exception. func (c *Client) CreateAssociationBatch(ctx context.Context, params *CreateAssociationBatchInput, optFns ...func(*Options)) (*CreateAssociationBatchOutput, error) { if params == nil { params = &CreateAssociationBatchInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateAssociationBatch", params, optFns, c.addOperationCreateAssociationBatchMiddlewares) if err != nil { return nil, err } out := result.(*CreateAssociationBatchOutput) out.ResultMetadata = metadata return out, nil } type CreateAssociationBatchInput struct { // One or more associations. // // This member is required. Entries []types.CreateAssociationBatchRequestEntry noSmithyDocumentSerde } type CreateAssociationBatchOutput struct { // Information about the associations that failed. Failed []types.FailedCreateAssociation // Information about the associations that succeeded. Successful []types.AssociationDescription // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateAssociationBatchMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAssociationBatch{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAssociationBatch{}, 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 = addOpCreateAssociationBatchValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAssociationBatch(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_opCreateAssociationBatch(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "CreateAssociationBatch", } }
134
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a Amazon Web Services Systems Manager (SSM document). An SSM document // defines the actions that Systems Manager performs on your managed nodes. For // more information about SSM documents, including information about supported // schemas, features, and syntax, see Amazon Web Services Systems Manager Documents (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-ssm-docs.html) // in the Amazon Web Services Systems Manager User Guide. func (c *Client) CreateDocument(ctx context.Context, params *CreateDocumentInput, optFns ...func(*Options)) (*CreateDocumentOutput, error) { if params == nil { params = &CreateDocumentInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateDocument", params, optFns, c.addOperationCreateDocumentMiddlewares) if err != nil { return nil, err } out := result.(*CreateDocumentOutput) out.ResultMetadata = metadata return out, nil } type CreateDocumentInput struct { // The content for the new SSM document in JSON or YAML format. The content of the // document must not exceed 64KB. This quota also includes the content specified // for input parameters at runtime. We recommend storing the contents for your new // document in an external JSON or YAML file and referencing the file in a command. // For examples, see the following topics in the Amazon Web Services Systems // Manager User Guide. // - Create an SSM document (Amazon Web Services API) (https://docs.aws.amazon.com/systems-manager/latest/userguide/create-ssm-document-api.html) // - Create an SSM document (Amazon Web Services CLI) (https://docs.aws.amazon.com/systems-manager/latest/userguide/create-ssm-document-cli.html) // - Create an SSM document (API) (https://docs.aws.amazon.com/systems-manager/latest/userguide/create-ssm-document-api.html) // // This member is required. Content *string // A name for the SSM document. You can't use the following strings as document // name prefixes. These are reserved by Amazon Web Services for use as document // name prefixes: // - aws // - amazon // - amzn // // This member is required. Name *string // A list of key-value pairs that describe attachments to a version of a document. Attachments []types.AttachmentsSource // An optional field where you can specify a friendly name for the SSM document. // This value can differ for each version of the document. You can update this // value at a later time using the UpdateDocument operation. DisplayName *string // Specify the document format for the request. The document format can be JSON, // YAML, or TEXT. JSON is the default format. DocumentFormat types.DocumentFormat // The type of document to create. The DeploymentStrategy document type is an // internal-use-only document type reserved for AppConfig. DocumentType types.DocumentType // A list of SSM documents required by a document. This parameter is used // exclusively by AppConfig. When a user creates an AppConfig configuration in an // SSM document, the user must also specify a required document for validation // purposes. In this case, an ApplicationConfiguration document requires an // ApplicationConfigurationSchema document for validation purposes. For more // information, see What is AppConfig? (https://docs.aws.amazon.com/appconfig/latest/userguide/what-is-appconfig.html) // in the AppConfig User Guide. Requires []types.DocumentRequires // Optional metadata that you assign to a resource. Tags enable you to categorize // a resource in different ways, such as by purpose, owner, or environment. For // example, you might want to tag an SSM document to identify the types of targets // or the environment where it will run. In this case, you could specify the // following key-value pairs: // - Key=OS,Value=Windows // - Key=Environment,Value=Production // To add tags to an existing SSM document, use the AddTagsToResource operation. Tags []types.Tag // Specify a target type to define the kinds of resources the document can run on. // For example, to run a document on EC2 instances, specify the following value: // /AWS::EC2::Instance . If you specify a value of '/' the document can run on all // types of resources. If you don't specify a value, the document can't run on any // resources. For a list of valid resource types, see Amazon Web Services resource // and property types reference (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) // in the CloudFormation User Guide. TargetType *string // An optional field specifying the version of the artifact you are creating with // the document. For example, Release12.1 . This value is unique across all // versions of a document, and can't be changed. VersionName *string noSmithyDocumentSerde } type CreateDocumentOutput struct { // Information about the SSM document. DocumentDescription *types.DocumentDescription // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateDocument{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateDocument{}, 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 = addOpCreateDocumentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDocument(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_opCreateDocument(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "CreateDocument", } }
196
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new maintenance window. The value you specify for Duration determines // the specific end time for the maintenance window based on the time it begins. No // maintenance window tasks are permitted to start after the resulting endtime // minus the number of hours you specify for Cutoff . For example, if the // maintenance window starts at 3 PM, the duration is three hours, and the value // you specify for Cutoff is one hour, no maintenance window tasks can start after // 5 PM. func (c *Client) CreateMaintenanceWindow(ctx context.Context, params *CreateMaintenanceWindowInput, optFns ...func(*Options)) (*CreateMaintenanceWindowOutput, error) { if params == nil { params = &CreateMaintenanceWindowInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateMaintenanceWindow", params, optFns, c.addOperationCreateMaintenanceWindowMiddlewares) if err != nil { return nil, err } out := result.(*CreateMaintenanceWindowOutput) out.ResultMetadata = metadata return out, nil } type CreateMaintenanceWindowInput struct { // Enables a maintenance window task to run on managed nodes, even if you haven't // registered those nodes as targets. If enabled, then you must specify the // unregistered managed nodes (by node ID) when you register a task with the // maintenance window. If you don't enable this option, then you must specify // previously-registered targets when you register a task with the maintenance // window. // // This member is required. AllowUnassociatedTargets bool // The number of hours before the end of the maintenance window that Amazon Web // Services Systems Manager stops scheduling new tasks for execution. // // This member is required. Cutoff int32 // The duration of the maintenance window in hours. // // This member is required. Duration int32 // The name of the maintenance window. // // This member is required. Name *string // The schedule of the maintenance window in the form of a cron or rate expression. // // This member is required. Schedule *string // User-provided idempotency token. ClientToken *string // An optional description for the maintenance window. We recommend specifying a // description to help you organize your maintenance windows. Description *string // The date and time, in ISO-8601 Extended format, for when you want the // maintenance window to become inactive. EndDate allows you to set a date and // time in the future when the maintenance window will no longer run. EndDate *string // The number of days to wait after the date and time specified by a cron // expression before running the maintenance window. For example, the following // cron expression schedules a maintenance window to run on the third Tuesday of // every month at 11:30 PM. cron(30 23 ? * TUE#3 *) If the schedule offset is 2 , // the maintenance window won't run until two days later. ScheduleOffset *int32 // The time zone that the scheduled maintenance window executions are based on, in // Internet Assigned Numbers Authority (IANA) format. For example: // "America/Los_Angeles", "UTC", or "Asia/Seoul". For more information, see the // Time Zone Database (https://www.iana.org/time-zones) on the IANA website. ScheduleTimezone *string // The date and time, in ISO-8601 Extended format, for when you want the // maintenance window to become active. StartDate allows you to delay activation // of the maintenance window until the specified future date. StartDate *string // Optional metadata that you assign to a resource. Tags enable you to categorize // a resource in different ways, such as by purpose, owner, or environment. For // example, you might want to tag a maintenance window to identify the type of // tasks it will run, the types of targets, and the environment it will run in. In // this case, you could specify the following key-value pairs: // - Key=TaskType,Value=AgentUpdate // - Key=OS,Value=Windows // - Key=Environment,Value=Production // To add tags to an existing maintenance window, use the AddTagsToResource // operation. Tags []types.Tag noSmithyDocumentSerde } type CreateMaintenanceWindowOutput struct { // The ID of the created maintenance window. WindowId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateMaintenanceWindow{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateMaintenanceWindow{}, 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_opCreateMaintenanceWindowMiddleware(stack, options); err != nil { return err } if err = addOpCreateMaintenanceWindowValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateMaintenanceWindow(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_initializeOpCreateMaintenanceWindow struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateMaintenanceWindow) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateMaintenanceWindow) 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.(*CreateMaintenanceWindowInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateMaintenanceWindowInput ") } 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_opCreateMaintenanceWindowMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateMaintenanceWindow{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateMaintenanceWindow(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "CreateMaintenanceWindow", } }
236
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Creates a new OpsItem. You must have permission in Identity and Access // Management (IAM) to create a new OpsItem. For more information, see Set up // OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-setup.html) // in the Amazon Web Services Systems Manager User Guide. Operations engineers and // IT professionals use Amazon Web Services Systems Manager OpsCenter to view, // investigate, and remediate operational issues impacting the performance and // health of their Amazon Web Services resources. For more information, see Amazon // Web Services Systems Manager OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html) // in the Amazon Web Services Systems Manager User Guide. func (c *Client) CreateOpsItem(ctx context.Context, params *CreateOpsItemInput, optFns ...func(*Options)) (*CreateOpsItemOutput, error) { if params == nil { params = &CreateOpsItemInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateOpsItem", params, optFns, c.addOperationCreateOpsItemMiddlewares) if err != nil { return nil, err } out := result.(*CreateOpsItemOutput) out.ResultMetadata = metadata return out, nil } type CreateOpsItemInput struct { // Information about the OpsItem. // // This member is required. Description *string // The origin of the OpsItem, such as Amazon EC2 or Systems Manager. The source // name can't contain the following strings: aws , amazon , and amzn . // // This member is required. Source *string // A short heading that describes the nature of the OpsItem and the impacted // resource. // // This member is required. Title *string // The target Amazon Web Services account where you want to create an OpsItem. To // make this call, your account must be configured to work with OpsItems across // accounts. For more information, see Set up OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-setup.html) // in the Amazon Web Services Systems Manager User Guide. AccountId *string // The time a runbook workflow ended. Currently reported only for the OpsItem type // /aws/changerequest . ActualEndTime *time.Time // The time a runbook workflow started. Currently reported only for the OpsItem // type /aws/changerequest . ActualStartTime *time.Time // Specify a category to assign to an OpsItem. Category *string // The Amazon Resource Name (ARN) of an SNS topic where notifications are sent // when this OpsItem is edited or changed. Notifications []types.OpsItemNotification // Operational data is custom data that provides useful reference details about // the OpsItem. For example, you can specify log files, error strings, license // keys, troubleshooting tips, or other relevant data. You enter operational data // as key-value pairs. The key has a maximum length of 128 characters. The value // has a maximum size of 20 KB. Operational data keys can't begin with the // following: amazon , aws , amzn , ssm , /amazon , /aws , /amzn , /ssm . You can // choose to make the data searchable by other users in the account or you can // restrict search access. Searchable data means that all users with access to the // OpsItem Overview page (as provided by the DescribeOpsItems API operation) can // view and search on the specified data. Operational data that isn't searchable is // only viewable by users who have access to the OpsItem (as provided by the // GetOpsItem API operation). Use the /aws/resources key in OperationalData to // specify a related resource in the request. Use the /aws/automations key in // OperationalData to associate an Automation runbook with the OpsItem. To view // Amazon Web Services CLI example commands that use these keys, see Creating // OpsItems manually (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-manually-create-OpsItems.html) // in the Amazon Web Services Systems Manager User Guide. OperationalData map[string]types.OpsItemDataValue // The type of OpsItem to create. Systems Manager supports the following types of // OpsItems: // - /aws/issue This type of OpsItem is used for default OpsItems created by // OpsCenter. // - /aws/changerequest This type of OpsItem is used by Change Manager for // reviewing and approving or rejecting change requests. // - /aws/insights This type of OpsItem is used by OpsCenter for aggregating and // reporting on duplicate OpsItems. OpsItemType *string // The time specified in a change request for a runbook workflow to end. Currently // supported only for the OpsItem type /aws/changerequest . PlannedEndTime *time.Time // The time specified in a change request for a runbook workflow to start. // Currently supported only for the OpsItem type /aws/changerequest . PlannedStartTime *time.Time // The importance of this OpsItem in relation to other OpsItems in the system. Priority *int32 // One or more OpsItems that share something in common with the current OpsItems. // For example, related OpsItems can include OpsItems with similar error messages, // impacted resources, or statuses for the impacted resource. RelatedOpsItems []types.RelatedOpsItem // Specify a severity to assign to an OpsItem. Severity *string // Optional metadata that you assign to a resource. Tags use a key-value pair. For // example: Key=Department,Value=Finance To add tags to a new OpsItem, a user must // have IAM permissions for both the ssm:CreateOpsItems operation and the // ssm:AddTagsToResource operation. To add tags to an existing OpsItem, use the // AddTagsToResource operation. Tags []types.Tag noSmithyDocumentSerde } type CreateOpsItemOutput struct { // The OpsItem Amazon Resource Name (ARN). OpsItemArn *string // The ID of the OpsItem. OpsItemId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateOpsItemMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateOpsItem{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateOpsItem{}, 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 = addOpCreateOpsItemValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateOpsItem(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_opCreateOpsItem(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "CreateOpsItem", } }
225
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // If you create a new application in Application Manager, Amazon Web Services // Systems Manager calls this API operation to specify information about the new // application, including the application type. func (c *Client) CreateOpsMetadata(ctx context.Context, params *CreateOpsMetadataInput, optFns ...func(*Options)) (*CreateOpsMetadataOutput, error) { if params == nil { params = &CreateOpsMetadataInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateOpsMetadata", params, optFns, c.addOperationCreateOpsMetadataMiddlewares) if err != nil { return nil, err } out := result.(*CreateOpsMetadataOutput) out.ResultMetadata = metadata return out, nil } type CreateOpsMetadataInput struct { // A resource ID for a new Application Manager application. // // This member is required. ResourceId *string // Metadata for a new Application Manager application. Metadata map[string]types.MetadataValue // Optional metadata that you assign to a resource. You can specify a maximum of // five tags for an OpsMetadata object. Tags enable you to categorize a resource in // different ways, such as by purpose, owner, or environment. For example, you // might want to tag an OpsMetadata object to identify an environment or target // Amazon Web Services Region. In this case, you could specify the following // key-value pairs: // - Key=Environment,Value=Production // - Key=Region,Value=us-east-2 Tags []types.Tag noSmithyDocumentSerde } type CreateOpsMetadataOutput struct { // The Amazon Resource Name (ARN) of the OpsMetadata Object or blob created by the // call. OpsMetadataArn *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateOpsMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateOpsMetadata{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateOpsMetadata{}, 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 = addOpCreateOpsMetadataValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateOpsMetadata(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_opCreateOpsMetadata(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "CreateOpsMetadata", } }
141
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a patch baseline. For information about valid key-value pairs in // PatchFilters for each supported operating system type, see PatchFilter . func (c *Client) CreatePatchBaseline(ctx context.Context, params *CreatePatchBaselineInput, optFns ...func(*Options)) (*CreatePatchBaselineOutput, error) { if params == nil { params = &CreatePatchBaselineInput{} } result, metadata, err := c.invokeOperation(ctx, "CreatePatchBaseline", params, optFns, c.addOperationCreatePatchBaselineMiddlewares) if err != nil { return nil, err } out := result.(*CreatePatchBaselineOutput) out.ResultMetadata = metadata return out, nil } type CreatePatchBaselineInput struct { // The name of the patch baseline. // // This member is required. Name *string // A set of rules used to include patches in the baseline. ApprovalRules *types.PatchRuleGroup // A list of explicitly approved patches for the baseline. For information about // accepted formats for lists of approved patches and rejected patches, see About // package name formats for approved and rejected patch lists (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html) // in the Amazon Web Services Systems Manager User Guide. ApprovedPatches []string // Defines the compliance level for approved patches. When an approved patch is // reported as missing, this value describes the severity of the compliance // violation. The default value is UNSPECIFIED . ApprovedPatchesComplianceLevel types.PatchComplianceLevel // Indicates whether the list of approved patches includes non-security updates // that should be applied to the managed nodes. The default value is false . // Applies to Linux managed nodes only. ApprovedPatchesEnableNonSecurity *bool // User-provided idempotency token. ClientToken *string // A description of the patch baseline. Description *string // A set of global filters used to include patches in the baseline. GlobalFilters *types.PatchFilterGroup // Defines the operating system the patch baseline applies to. The default value // is WINDOWS . OperatingSystem types.OperatingSystem // A list of explicitly rejected patches for the baseline. For information about // accepted formats for lists of approved patches and rejected patches, see About // package name formats for approved and rejected patch lists (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html) // in the Amazon Web Services Systems Manager User Guide. RejectedPatches []string // The action for Patch Manager to take on patches included in the RejectedPackages // list. // - ALLOW_AS_DEPENDENCY : A package in the Rejected patches list is installed // only if it is a dependency of another package. It is considered compliant with // the patch baseline, and its status is reported as InstalledOther . This is the // default action if no option is specified. // - BLOCK : Packages in the RejectedPatches list, and packages that include them // as dependencies, aren't installed under any circumstances. If a package was // installed before it was added to the Rejected patches list, it is considered // non-compliant with the patch baseline, and its status is reported as // InstalledRejected . RejectedPatchesAction types.PatchAction // Information about the patches to use to update the managed nodes, including // target operating systems and source repositories. Applies to Linux managed nodes // only. Sources []types.PatchSource // Optional metadata that you assign to a resource. Tags enable you to categorize // a resource in different ways, such as by purpose, owner, or environment. For // example, you might want to tag a patch baseline to identify the severity level // of patches it specifies and the operating system family it applies to. In this // case, you could specify the following key-value pairs: // - Key=PatchSeverity,Value=Critical // - Key=OS,Value=Windows // To add tags to an existing patch baseline, use the AddTagsToResource operation. Tags []types.Tag noSmithyDocumentSerde } type CreatePatchBaselineOutput struct { // The ID of the created patch baseline. BaselineId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreatePatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreatePatchBaseline{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreatePatchBaseline{}, 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_opCreatePatchBaselineMiddleware(stack, options); err != nil { return err } if err = addOpCreatePatchBaselineValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePatchBaseline(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_initializeOpCreatePatchBaseline struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreatePatchBaseline) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreatePatchBaseline) 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.(*CreatePatchBaselineInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreatePatchBaselineInput ") } 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_opCreatePatchBaselineMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreatePatchBaseline{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreatePatchBaseline(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "CreatePatchBaseline", } }
229
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // A resource data sync helps you view data from multiple sources in a single // location. Amazon Web Services Systems Manager offers two types of resource data // sync: SyncToDestination and SyncFromSource . You can configure Systems Manager // Inventory to use the SyncToDestination type to synchronize Inventory data from // multiple Amazon Web Services Regions to a single Amazon Simple Storage Service // (Amazon S3) bucket. For more information, see Configuring resource data sync // for Inventory (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-inventory-datasync.html) // in the Amazon Web Services Systems Manager User Guide. You can configure Systems // Manager Explorer to use the SyncFromSource type to synchronize operational work // items (OpsItems) and operational data (OpsData) from multiple Amazon Web // Services Regions to a single Amazon S3 bucket. This type can synchronize // OpsItems and OpsData from multiple Amazon Web Services accounts and Amazon Web // Services Regions or EntireOrganization by using Organizations. For more // information, see Setting up Systems Manager Explorer to display data from // multiple accounts and Regions (https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resource-data-sync.html) // in the Amazon Web Services Systems Manager User Guide. A resource data sync is // an asynchronous operation that returns immediately. After a successful initial // sync is completed, the system continuously syncs data. To check the status of a // sync, use the ListResourceDataSync . By default, data isn't encrypted in Amazon // S3. We strongly recommend that you enable encryption in Amazon S3 to ensure // secure data storage. We also recommend that you secure access to the Amazon S3 // bucket by creating a restrictive bucket policy. func (c *Client) CreateResourceDataSync(ctx context.Context, params *CreateResourceDataSyncInput, optFns ...func(*Options)) (*CreateResourceDataSyncOutput, error) { if params == nil { params = &CreateResourceDataSyncInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateResourceDataSync", params, optFns, c.addOperationCreateResourceDataSyncMiddlewares) if err != nil { return nil, err } out := result.(*CreateResourceDataSyncOutput) out.ResultMetadata = metadata return out, nil } type CreateResourceDataSyncInput struct { // A name for the configuration. // // This member is required. SyncName *string // Amazon S3 configuration details for the sync. This parameter is required if the // SyncType value is SyncToDestination. S3Destination *types.ResourceDataSyncS3Destination // Specify information about the data sources to synchronize. This parameter is // required if the SyncType value is SyncFromSource. SyncSource *types.ResourceDataSyncSource // Specify SyncToDestination to create a resource data sync that synchronizes data // to an S3 bucket for Inventory. If you specify SyncToDestination , you must // provide a value for S3Destination . Specify SyncFromSource to synchronize data // from a single account and multiple Regions, or multiple Amazon Web Services // accounts and Amazon Web Services Regions, as listed in Organizations for // Explorer. If you specify SyncFromSource , you must provide a value for // SyncSource . The default value is SyncToDestination . SyncType *string noSmithyDocumentSerde } type CreateResourceDataSyncOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateResourceDataSyncMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateResourceDataSync{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateResourceDataSync{}, 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 = addOpCreateResourceDataSyncValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateResourceDataSync(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_opCreateResourceDataSync(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "CreateResourceDataSync", } }
159
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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 activation. You aren't required to delete an activation. If you // delete an activation, you can no longer use it to register additional managed // nodes. Deleting an activation doesn't de-register managed nodes. You must // manually de-register managed nodes. func (c *Client) DeleteActivation(ctx context.Context, params *DeleteActivationInput, optFns ...func(*Options)) (*DeleteActivationOutput, error) { if params == nil { params = &DeleteActivationInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteActivation", params, optFns, c.addOperationDeleteActivationMiddlewares) if err != nil { return nil, err } out := result.(*DeleteActivationOutput) out.ResultMetadata = metadata return out, nil } type DeleteActivationInput struct { // The ID of the activation that you want to delete. // // This member is required. ActivationId *string noSmithyDocumentSerde } type DeleteActivationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteActivationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteActivation{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteActivation{}, 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 = addOpDeleteActivationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteActivation(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_opDeleteActivation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DeleteActivation", } }
123
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Disassociates the specified Amazon Web Services Systems Manager document (SSM // document) from the specified managed node. If you created the association by // using the Targets parameter, then you must delete the association by using the // association ID. When you disassociate a document from a managed node, it doesn't // change the configuration of the node. To change the configuration state of a // managed node after you disassociate a document, you must create a new document // with the desired configuration and associate it with the node. func (c *Client) DeleteAssociation(ctx context.Context, params *DeleteAssociationInput, optFns ...func(*Options)) (*DeleteAssociationOutput, error) { if params == nil { params = &DeleteAssociationInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteAssociation", params, optFns, c.addOperationDeleteAssociationMiddlewares) if err != nil { return nil, err } out := result.(*DeleteAssociationOutput) out.ResultMetadata = metadata return out, nil } type DeleteAssociationInput struct { // The association ID that you want to delete. AssociationId *string // The managed node ID. InstanceId has been deprecated. To specify a managed node // ID for an association, use the Targets parameter. Requests that include the // parameter InstanceID with Systems Manager documents (SSM documents) that use // schema version 2.0 or later will fail. In addition, if you use the parameter // InstanceId , you can't use the parameters AssociationName , DocumentVersion , // MaxErrors , MaxConcurrency , OutputLocation , or ScheduleExpression . To use // these parameters, you must use the Targets parameter. InstanceId *string // The name of the SSM document. Name *string noSmithyDocumentSerde } type DeleteAssociationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteAssociation{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteAssociation{}, 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_opDeleteAssociation(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_opDeleteAssociation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DeleteAssociation", } }
133
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes the Amazon Web Services Systems Manager document (SSM document) and all // managed node associations to the document. Before you delete the document, we // recommend that you use DeleteAssociation to disassociate all managed nodes that // are associated with the document. func (c *Client) DeleteDocument(ctx context.Context, params *DeleteDocumentInput, optFns ...func(*Options)) (*DeleteDocumentOutput, error) { if params == nil { params = &DeleteDocumentInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteDocument", params, optFns, c.addOperationDeleteDocumentMiddlewares) if err != nil { return nil, err } out := result.(*DeleteDocumentOutput) out.ResultMetadata = metadata return out, nil } type DeleteDocumentInput struct { // The name of the document. // // This member is required. Name *string // The version of the document that you want to delete. If not provided, all // versions of the document are deleted. DocumentVersion *string // Some SSM document types require that you specify a Force flag before you can // delete the document. For example, you must specify a Force flag to delete a // document of type ApplicationConfigurationSchema . You can restrict access to the // Force flag in an Identity and Access Management (IAM) policy. Force bool // The version name of the document that you want to delete. If not provided, all // versions of the document are deleted. VersionName *string noSmithyDocumentSerde } type DeleteDocumentOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteDocument{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteDocument{}, 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 = addOpDeleteDocumentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDocument(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_opDeleteDocument(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DeleteDocument", } }
137
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Delete a custom inventory type or the data associated with a custom Inventory // type. Deleting a custom inventory type is also referred to as deleting a custom // inventory schema. func (c *Client) DeleteInventory(ctx context.Context, params *DeleteInventoryInput, optFns ...func(*Options)) (*DeleteInventoryOutput, error) { if params == nil { params = &DeleteInventoryInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteInventory", params, optFns, c.addOperationDeleteInventoryMiddlewares) if err != nil { return nil, err } out := result.(*DeleteInventoryOutput) out.ResultMetadata = metadata return out, nil } type DeleteInventoryInput struct { // The name of the custom inventory type for which you want to delete either all // previously collected data or the inventory type itself. // // This member is required. TypeName *string // User-provided idempotency token. ClientToken *string // Use this option to view a summary of the deletion request without deleting any // data or the data type. This option is useful when you only want to understand // what will be deleted. Once you validate that the data to be deleted is what you // intend to delete, you can run the same command without specifying the DryRun // option. DryRun bool // Use the SchemaDeleteOption to delete a custom inventory type (schema). If you // don't choose this option, the system only deletes existing inventory data // associated with the custom inventory type. Choose one of the following options: // DisableSchema: If you choose this option, the system ignores all inventory data // for the specified version, and any earlier versions. To enable this schema // again, you must call the PutInventory operation for a version greater than the // disabled version. DeleteSchema: This option deletes the specified custom type // from the Inventory service. You can recreate the schema later, if you want. SchemaDeleteOption types.InventorySchemaDeleteOption noSmithyDocumentSerde } type DeleteInventoryOutput struct { // Every DeleteInventory operation is assigned a unique ID. This option returns a // unique ID. You can use this ID to query the status of a delete operation. This // option is useful for ensuring that a delete operation has completed before you // begin other operations. DeletionId *string // A summary of the delete operation. For more information about this summary, see // Deleting custom inventory (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-inventory-custom.html#sysman-inventory-delete-summary) // in the Amazon Web Services Systems Manager User Guide. DeletionSummary *types.InventoryDeletionSummary // The name of the inventory data type specified in the request. TypeName *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteInventoryMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteInventory{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteInventory{}, 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_opDeleteInventoryMiddleware(stack, options); err != nil { return err } if err = addOpDeleteInventoryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteInventory(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_initializeOpDeleteInventory struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpDeleteInventory) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpDeleteInventory) 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.(*DeleteInventoryInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteInventoryInput ") } 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_opDeleteInventoryMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteInventory{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opDeleteInventory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DeleteInventory", } }
196
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a maintenance window. func (c *Client) DeleteMaintenanceWindow(ctx context.Context, params *DeleteMaintenanceWindowInput, optFns ...func(*Options)) (*DeleteMaintenanceWindowOutput, error) { if params == nil { params = &DeleteMaintenanceWindowInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteMaintenanceWindow", params, optFns, c.addOperationDeleteMaintenanceWindowMiddlewares) if err != nil { return nil, err } out := result.(*DeleteMaintenanceWindowOutput) out.ResultMetadata = metadata return out, nil } type DeleteMaintenanceWindowInput struct { // The ID of the maintenance window to delete. // // This member is required. WindowId *string noSmithyDocumentSerde } type DeleteMaintenanceWindowOutput struct { // The ID of the deleted maintenance window. WindowId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteMaintenanceWindow{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteMaintenanceWindow{}, 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 = addOpDeleteMaintenanceWindowValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteMaintenanceWindow(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_opDeleteMaintenanceWindow(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DeleteMaintenanceWindow", } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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" ) // Delete OpsMetadata related to an application. func (c *Client) DeleteOpsMetadata(ctx context.Context, params *DeleteOpsMetadataInput, optFns ...func(*Options)) (*DeleteOpsMetadataOutput, error) { if params == nil { params = &DeleteOpsMetadataInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteOpsMetadata", params, optFns, c.addOperationDeleteOpsMetadataMiddlewares) if err != nil { return nil, err } out := result.(*DeleteOpsMetadataOutput) out.ResultMetadata = metadata return out, nil } type DeleteOpsMetadataInput struct { // The Amazon Resource Name (ARN) of an OpsMetadata Object to delete. // // This member is required. OpsMetadataArn *string noSmithyDocumentSerde } type DeleteOpsMetadataOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteOpsMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteOpsMetadata{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteOpsMetadata{}, 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 = addOpDeleteOpsMetadataValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteOpsMetadata(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_opDeleteOpsMetadata(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DeleteOpsMetadata", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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" ) // Delete a parameter from the system. After deleting a parameter, wait for at // least 30 seconds to create a parameter with the same name. func (c *Client) DeleteParameter(ctx context.Context, params *DeleteParameterInput, optFns ...func(*Options)) (*DeleteParameterOutput, error) { if params == nil { params = &DeleteParameterInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteParameter", params, optFns, c.addOperationDeleteParameterMiddlewares) if err != nil { return nil, err } out := result.(*DeleteParameterOutput) out.ResultMetadata = metadata return out, nil } type DeleteParameterInput struct { // The name of the parameter to delete. // // This member is required. Name *string noSmithyDocumentSerde } type DeleteParameterOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteParameterMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteParameter{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteParameter{}, 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 = addOpDeleteParameterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteParameter(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_opDeleteParameter(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DeleteParameter", } }
121
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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" ) // Delete a list of parameters. After deleting a parameter, wait for at least 30 // seconds to create a parameter with the same name. func (c *Client) DeleteParameters(ctx context.Context, params *DeleteParametersInput, optFns ...func(*Options)) (*DeleteParametersOutput, error) { if params == nil { params = &DeleteParametersInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteParameters", params, optFns, c.addOperationDeleteParametersMiddlewares) if err != nil { return nil, err } out := result.(*DeleteParametersOutput) out.ResultMetadata = metadata return out, nil } type DeleteParametersInput struct { // The names of the parameters to delete. After deleting a parameter, wait for at // least 30 seconds to create a parameter with the same name. // // This member is required. Names []string noSmithyDocumentSerde } type DeleteParametersOutput struct { // The names of the deleted parameters. DeletedParameters []string // The names of parameters that weren't deleted because the parameters aren't // valid. InvalidParameters []string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteParametersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteParameters{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteParameters{}, 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 = addOpDeleteParametersValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteParameters(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_opDeleteParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DeleteParameters", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a patch baseline. func (c *Client) DeletePatchBaseline(ctx context.Context, params *DeletePatchBaselineInput, optFns ...func(*Options)) (*DeletePatchBaselineOutput, error) { if params == nil { params = &DeletePatchBaselineInput{} } result, metadata, err := c.invokeOperation(ctx, "DeletePatchBaseline", params, optFns, c.addOperationDeletePatchBaselineMiddlewares) if err != nil { return nil, err } out := result.(*DeletePatchBaselineOutput) out.ResultMetadata = metadata return out, nil } type DeletePatchBaselineInput struct { // The ID of the patch baseline to delete. // // This member is required. BaselineId *string noSmithyDocumentSerde } type DeletePatchBaselineOutput struct { // The ID of the deleted patch baseline. BaselineId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeletePatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeletePatchBaseline{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeletePatchBaseline{}, 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 = addOpDeletePatchBaselineValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePatchBaseline(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_opDeletePatchBaseline(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DeletePatchBaseline", } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a resource data sync configuration. After the configuration is deleted, // changes to data on managed nodes are no longer synced to or from the target. // Deleting a sync configuration doesn't delete data. func (c *Client) DeleteResourceDataSync(ctx context.Context, params *DeleteResourceDataSyncInput, optFns ...func(*Options)) (*DeleteResourceDataSyncOutput, error) { if params == nil { params = &DeleteResourceDataSyncInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteResourceDataSync", params, optFns, c.addOperationDeleteResourceDataSyncMiddlewares) if err != nil { return nil, err } out := result.(*DeleteResourceDataSyncOutput) out.ResultMetadata = metadata return out, nil } type DeleteResourceDataSyncInput struct { // The name of the configuration to delete. // // This member is required. SyncName *string // Specify the type of resource data sync to delete. SyncType *string noSmithyDocumentSerde } type DeleteResourceDataSyncOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteResourceDataSyncMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteResourceDataSync{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteResourceDataSync{}, 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 = addOpDeleteResourceDataSyncValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResourceDataSync(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_opDeleteResourceDataSync(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DeleteResourceDataSync", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a Systems Manager resource policy. A resource policy helps you to // define the IAM entity (for example, an Amazon Web Services account) that can // manage your Systems Manager resources. Currently, OpsItemGroup is the only // resource that supports Systems Manager resource policies. The resource policy // for OpsItemGroup enables Amazon Web Services accounts to view and interact with // OpsCenter operational work items (OpsItems). func (c *Client) DeleteResourcePolicy(ctx context.Context, params *DeleteResourcePolicyInput, optFns ...func(*Options)) (*DeleteResourcePolicyOutput, error) { if params == nil { params = &DeleteResourcePolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteResourcePolicy", params, optFns, c.addOperationDeleteResourcePolicyMiddlewares) if err != nil { return nil, err } out := result.(*DeleteResourcePolicyOutput) out.ResultMetadata = metadata return out, nil } type DeleteResourcePolicyInput struct { // ID of the current policy version. The hash helps to prevent multiple calls from // attempting to overwrite a policy. // // This member is required. PolicyHash *string // The policy ID. // // This member is required. PolicyId *string // Amazon Resource Name (ARN) of the resource to which the policies are attached. // // This member is required. ResourceArn *string noSmithyDocumentSerde } type DeleteResourcePolicyOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteResourcePolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteResourcePolicy{}, 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 = addOpDeleteResourcePolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResourcePolicy(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_opDeleteResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DeleteResourcePolicy", } }
136
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Removes the server or virtual machine from the list of registered servers. You // can reregister the node again at any time. If you don't plan to use Run Command // on the server, we suggest uninstalling SSM Agent first. func (c *Client) DeregisterManagedInstance(ctx context.Context, params *DeregisterManagedInstanceInput, optFns ...func(*Options)) (*DeregisterManagedInstanceOutput, error) { if params == nil { params = &DeregisterManagedInstanceInput{} } result, metadata, err := c.invokeOperation(ctx, "DeregisterManagedInstance", params, optFns, c.addOperationDeregisterManagedInstanceMiddlewares) if err != nil { return nil, err } out := result.(*DeregisterManagedInstanceOutput) out.ResultMetadata = metadata return out, nil } type DeregisterManagedInstanceInput struct { // The ID assigned to the managed node when you registered it using the activation // process. // // This member is required. InstanceId *string noSmithyDocumentSerde } type DeregisterManagedInstanceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeregisterManagedInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeregisterManagedInstance{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeregisterManagedInstance{}, 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 = addOpDeregisterManagedInstanceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterManagedInstance(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_opDeregisterManagedInstance(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DeregisterManagedInstance", } }
123
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Removes a patch group from a patch baseline. func (c *Client) DeregisterPatchBaselineForPatchGroup(ctx context.Context, params *DeregisterPatchBaselineForPatchGroupInput, optFns ...func(*Options)) (*DeregisterPatchBaselineForPatchGroupOutput, error) { if params == nil { params = &DeregisterPatchBaselineForPatchGroupInput{} } result, metadata, err := c.invokeOperation(ctx, "DeregisterPatchBaselineForPatchGroup", params, optFns, c.addOperationDeregisterPatchBaselineForPatchGroupMiddlewares) if err != nil { return nil, err } out := result.(*DeregisterPatchBaselineForPatchGroupOutput) out.ResultMetadata = metadata return out, nil } type DeregisterPatchBaselineForPatchGroupInput struct { // The ID of the patch baseline to deregister the patch group from. // // This member is required. BaselineId *string // The name of the patch group that should be deregistered from the patch baseline. // // This member is required. PatchGroup *string noSmithyDocumentSerde } type DeregisterPatchBaselineForPatchGroupOutput struct { // The ID of the patch baseline the patch group was deregistered from. BaselineId *string // The name of the patch group deregistered from the patch baseline. PatchGroup *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeregisterPatchBaselineForPatchGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeregisterPatchBaselineForPatchGroup{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeregisterPatchBaselineForPatchGroup{}, 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 = addOpDeregisterPatchBaselineForPatchGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterPatchBaselineForPatchGroup(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_opDeregisterPatchBaselineForPatchGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DeregisterPatchBaselineForPatchGroup", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Removes a target from a maintenance window. func (c *Client) DeregisterTargetFromMaintenanceWindow(ctx context.Context, params *DeregisterTargetFromMaintenanceWindowInput, optFns ...func(*Options)) (*DeregisterTargetFromMaintenanceWindowOutput, error) { if params == nil { params = &DeregisterTargetFromMaintenanceWindowInput{} } result, metadata, err := c.invokeOperation(ctx, "DeregisterTargetFromMaintenanceWindow", params, optFns, c.addOperationDeregisterTargetFromMaintenanceWindowMiddlewares) if err != nil { return nil, err } out := result.(*DeregisterTargetFromMaintenanceWindowOutput) out.ResultMetadata = metadata return out, nil } type DeregisterTargetFromMaintenanceWindowInput struct { // The ID of the maintenance window the target should be removed from. // // This member is required. WindowId *string // The ID of the target definition to remove. // // This member is required. WindowTargetId *string // The system checks if the target is being referenced by a task. If the target is // being referenced, the system returns an error and doesn't deregister the target // from the maintenance window. Safe *bool noSmithyDocumentSerde } type DeregisterTargetFromMaintenanceWindowOutput struct { // The ID of the maintenance window the target was removed from. WindowId *string // The ID of the removed target definition. WindowTargetId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeregisterTargetFromMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeregisterTargetFromMaintenanceWindow{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeregisterTargetFromMaintenanceWindow{}, 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 = addOpDeregisterTargetFromMaintenanceWindowValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterTargetFromMaintenanceWindow(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_opDeregisterTargetFromMaintenanceWindow(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DeregisterTargetFromMaintenanceWindow", } }
137
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Removes a task from a maintenance window. func (c *Client) DeregisterTaskFromMaintenanceWindow(ctx context.Context, params *DeregisterTaskFromMaintenanceWindowInput, optFns ...func(*Options)) (*DeregisterTaskFromMaintenanceWindowOutput, error) { if params == nil { params = &DeregisterTaskFromMaintenanceWindowInput{} } result, metadata, err := c.invokeOperation(ctx, "DeregisterTaskFromMaintenanceWindow", params, optFns, c.addOperationDeregisterTaskFromMaintenanceWindowMiddlewares) if err != nil { return nil, err } out := result.(*DeregisterTaskFromMaintenanceWindowOutput) out.ResultMetadata = metadata return out, nil } type DeregisterTaskFromMaintenanceWindowInput struct { // The ID of the maintenance window the task should be removed from. // // This member is required. WindowId *string // The ID of the task to remove from the maintenance window. // // This member is required. WindowTaskId *string noSmithyDocumentSerde } type DeregisterTaskFromMaintenanceWindowOutput struct { // The ID of the maintenance window the task was removed from. WindowId *string // The ID of the task removed from the maintenance window. WindowTaskId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeregisterTaskFromMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeregisterTaskFromMaintenanceWindow{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeregisterTaskFromMaintenanceWindow{}, 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 = addOpDeregisterTaskFromMaintenanceWindowValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterTaskFromMaintenanceWindow(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_opDeregisterTaskFromMaintenanceWindow(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DeregisterTaskFromMaintenanceWindow", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Describes details about the activation, such as the date and time the // activation was created, its expiration date, the Identity and Access Management // (IAM) role assigned to the managed nodes in the activation, and the number of // nodes registered by using this activation. func (c *Client) DescribeActivations(ctx context.Context, params *DescribeActivationsInput, optFns ...func(*Options)) (*DescribeActivationsOutput, error) { if params == nil { params = &DescribeActivationsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeActivations", params, optFns, c.addOperationDescribeActivationsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeActivationsOutput) out.ResultMetadata = metadata return out, nil } type DescribeActivationsInput struct { // A filter to view information about your activations. Filters []types.DescribeActivationsFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. MaxResults *int32 // A token to start the list. Use this token to get the next set of results. NextToken *string noSmithyDocumentSerde } type DescribeActivationsOutput struct { // A list of activations for your Amazon Web Services account. ActivationList []types.Activation // The token for the next set of items to return. Use this token to get the next // set of results. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeActivationsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeActivations{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeActivations{}, 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_opDescribeActivations(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 } // DescribeActivationsAPIClient is a client that implements the // DescribeActivations operation. type DescribeActivationsAPIClient interface { DescribeActivations(context.Context, *DescribeActivationsInput, ...func(*Options)) (*DescribeActivationsOutput, error) } var _ DescribeActivationsAPIClient = (*Client)(nil) // DescribeActivationsPaginatorOptions is the paginator options for // DescribeActivations type DescribeActivationsPaginatorOptions struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set 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 } // DescribeActivationsPaginator is a paginator for DescribeActivations type DescribeActivationsPaginator struct { options DescribeActivationsPaginatorOptions client DescribeActivationsAPIClient params *DescribeActivationsInput nextToken *string firstPage bool } // NewDescribeActivationsPaginator returns a new DescribeActivationsPaginator func NewDescribeActivationsPaginator(client DescribeActivationsAPIClient, params *DescribeActivationsInput, optFns ...func(*DescribeActivationsPaginatorOptions)) *DescribeActivationsPaginator { if params == nil { params = &DescribeActivationsInput{} } options := DescribeActivationsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeActivationsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeActivationsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeActivations page. func (p *DescribeActivationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeActivationsOutput, 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.DescribeActivations(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeActivations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeActivations", } }
227
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Describes the association for the specified target or managed node. If you // created the association by using the Targets parameter, then you must retrieve // the association by using the association ID. func (c *Client) DescribeAssociation(ctx context.Context, params *DescribeAssociationInput, optFns ...func(*Options)) (*DescribeAssociationOutput, error) { if params == nil { params = &DescribeAssociationInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeAssociation", params, optFns, c.addOperationDescribeAssociationMiddlewares) if err != nil { return nil, err } out := result.(*DescribeAssociationOutput) out.ResultMetadata = metadata return out, nil } type DescribeAssociationInput struct { // The association ID for which you want information. AssociationId *string // Specify the association version to retrieve. To view the latest version, either // specify $LATEST for this parameter, or omit this parameter. To view a list of // all associations for a managed node, use ListAssociations . To get a list of // versions for a specific association, use ListAssociationVersions . AssociationVersion *string // The managed node ID. InstanceId *string // The name of the SSM document. Name *string noSmithyDocumentSerde } type DescribeAssociationOutput struct { // Information about the association. AssociationDescription *types.AssociationDescription // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAssociation{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAssociation{}, 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_opDescribeAssociation(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_opDescribeAssociation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeAssociation", } }
134
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Views all executions for a specific association ID. func (c *Client) DescribeAssociationExecutions(ctx context.Context, params *DescribeAssociationExecutionsInput, optFns ...func(*Options)) (*DescribeAssociationExecutionsOutput, error) { if params == nil { params = &DescribeAssociationExecutionsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeAssociationExecutions", params, optFns, c.addOperationDescribeAssociationExecutionsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeAssociationExecutionsOutput) out.ResultMetadata = metadata return out, nil } type DescribeAssociationExecutionsInput struct { // The association ID for which you want to view execution history details. // // This member is required. AssociationId *string // Filters for the request. You can specify the following filters and values. // ExecutionId (EQUAL) Status (EQUAL) CreatedTime (EQUAL, GREATER_THAN, LESS_THAN) Filters []types.AssociationExecutionFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. MaxResults *int32 // A token to start the list. Use this token to get the next set of results. NextToken *string noSmithyDocumentSerde } type DescribeAssociationExecutionsOutput struct { // A list of the executions for the specified association ID. AssociationExecutions []types.AssociationExecution // The token for the next set of items to return. Use this token to get the next // set of results. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeAssociationExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAssociationExecutions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAssociationExecutions{}, 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 = addOpDescribeAssociationExecutionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAssociationExecutions(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 } // DescribeAssociationExecutionsAPIClient is a client that implements the // DescribeAssociationExecutions operation. type DescribeAssociationExecutionsAPIClient interface { DescribeAssociationExecutions(context.Context, *DescribeAssociationExecutionsInput, ...func(*Options)) (*DescribeAssociationExecutionsOutput, error) } var _ DescribeAssociationExecutionsAPIClient = (*Client)(nil) // DescribeAssociationExecutionsPaginatorOptions is the paginator options for // DescribeAssociationExecutions type DescribeAssociationExecutionsPaginatorOptions struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set 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 } // DescribeAssociationExecutionsPaginator is a paginator for // DescribeAssociationExecutions type DescribeAssociationExecutionsPaginator struct { options DescribeAssociationExecutionsPaginatorOptions client DescribeAssociationExecutionsAPIClient params *DescribeAssociationExecutionsInput nextToken *string firstPage bool } // NewDescribeAssociationExecutionsPaginator returns a new // DescribeAssociationExecutionsPaginator func NewDescribeAssociationExecutionsPaginator(client DescribeAssociationExecutionsAPIClient, params *DescribeAssociationExecutionsInput, optFns ...func(*DescribeAssociationExecutionsPaginatorOptions)) *DescribeAssociationExecutionsPaginator { if params == nil { params = &DescribeAssociationExecutionsInput{} } options := DescribeAssociationExecutionsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeAssociationExecutionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeAssociationExecutionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeAssociationExecutions page. func (p *DescribeAssociationExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAssociationExecutionsOutput, 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.DescribeAssociationExecutions(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeAssociationExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeAssociationExecutions", } }
235
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Views information about a specific execution of a specific association. func (c *Client) DescribeAssociationExecutionTargets(ctx context.Context, params *DescribeAssociationExecutionTargetsInput, optFns ...func(*Options)) (*DescribeAssociationExecutionTargetsOutput, error) { if params == nil { params = &DescribeAssociationExecutionTargetsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeAssociationExecutionTargets", params, optFns, c.addOperationDescribeAssociationExecutionTargetsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeAssociationExecutionTargetsOutput) out.ResultMetadata = metadata return out, nil } type DescribeAssociationExecutionTargetsInput struct { // The association ID that includes the execution for which you want to view // details. // // This member is required. AssociationId *string // The execution ID for which you want to view details. // // This member is required. ExecutionId *string // Filters for the request. You can specify the following filters and values. // Status (EQUAL) ResourceId (EQUAL) ResourceType (EQUAL) Filters []types.AssociationExecutionTargetsFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. MaxResults *int32 // A token to start the list. Use this token to get the next set of results. NextToken *string noSmithyDocumentSerde } type DescribeAssociationExecutionTargetsOutput struct { // Information about the execution. AssociationExecutionTargets []types.AssociationExecutionTarget // The token for the next set of items to return. Use this token to get the next // set of results. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeAssociationExecutionTargetsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAssociationExecutionTargets{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAssociationExecutionTargets{}, 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 = addOpDescribeAssociationExecutionTargetsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAssociationExecutionTargets(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 } // DescribeAssociationExecutionTargetsAPIClient is a client that implements the // DescribeAssociationExecutionTargets operation. type DescribeAssociationExecutionTargetsAPIClient interface { DescribeAssociationExecutionTargets(context.Context, *DescribeAssociationExecutionTargetsInput, ...func(*Options)) (*DescribeAssociationExecutionTargetsOutput, error) } var _ DescribeAssociationExecutionTargetsAPIClient = (*Client)(nil) // DescribeAssociationExecutionTargetsPaginatorOptions is the paginator options // for DescribeAssociationExecutionTargets type DescribeAssociationExecutionTargetsPaginatorOptions struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set 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 } // DescribeAssociationExecutionTargetsPaginator is a paginator for // DescribeAssociationExecutionTargets type DescribeAssociationExecutionTargetsPaginator struct { options DescribeAssociationExecutionTargetsPaginatorOptions client DescribeAssociationExecutionTargetsAPIClient params *DescribeAssociationExecutionTargetsInput nextToken *string firstPage bool } // NewDescribeAssociationExecutionTargetsPaginator returns a new // DescribeAssociationExecutionTargetsPaginator func NewDescribeAssociationExecutionTargetsPaginator(client DescribeAssociationExecutionTargetsAPIClient, params *DescribeAssociationExecutionTargetsInput, optFns ...func(*DescribeAssociationExecutionTargetsPaginatorOptions)) *DescribeAssociationExecutionTargetsPaginator { if params == nil { params = &DescribeAssociationExecutionTargetsInput{} } options := DescribeAssociationExecutionTargetsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeAssociationExecutionTargetsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeAssociationExecutionTargetsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeAssociationExecutionTargets page. func (p *DescribeAssociationExecutionTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAssociationExecutionTargetsOutput, 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.DescribeAssociationExecutionTargets(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeAssociationExecutionTargets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeAssociationExecutionTargets", } }
241
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Provides details about all active and terminated Automation executions. func (c *Client) DescribeAutomationExecutions(ctx context.Context, params *DescribeAutomationExecutionsInput, optFns ...func(*Options)) (*DescribeAutomationExecutionsOutput, error) { if params == nil { params = &DescribeAutomationExecutionsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeAutomationExecutions", params, optFns, c.addOperationDescribeAutomationExecutionsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeAutomationExecutionsOutput) out.ResultMetadata = metadata return out, nil } type DescribeAutomationExecutionsInput struct { // Filters used to limit the scope of executions that are requested. Filters []types.AutomationExecutionFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string noSmithyDocumentSerde } type DescribeAutomationExecutionsOutput struct { // The list of details about each automation execution which has occurred which // matches the filter specification, if any. AutomationExecutionMetadataList []types.AutomationExecutionMetadata // The token to use when requesting the next set of items. If there are no // additional items to return, the string is empty. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeAutomationExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAutomationExecutions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAutomationExecutions{}, 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 = addOpDescribeAutomationExecutionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAutomationExecutions(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 } // DescribeAutomationExecutionsAPIClient is a client that implements the // DescribeAutomationExecutions operation. type DescribeAutomationExecutionsAPIClient interface { DescribeAutomationExecutions(context.Context, *DescribeAutomationExecutionsInput, ...func(*Options)) (*DescribeAutomationExecutionsOutput, error) } var _ DescribeAutomationExecutionsAPIClient = (*Client)(nil) // DescribeAutomationExecutionsPaginatorOptions is the paginator options for // DescribeAutomationExecutions type DescribeAutomationExecutionsPaginatorOptions struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set 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 } // DescribeAutomationExecutionsPaginator is a paginator for // DescribeAutomationExecutions type DescribeAutomationExecutionsPaginator struct { options DescribeAutomationExecutionsPaginatorOptions client DescribeAutomationExecutionsAPIClient params *DescribeAutomationExecutionsInput nextToken *string firstPage bool } // NewDescribeAutomationExecutionsPaginator returns a new // DescribeAutomationExecutionsPaginator func NewDescribeAutomationExecutionsPaginator(client DescribeAutomationExecutionsAPIClient, params *DescribeAutomationExecutionsInput, optFns ...func(*DescribeAutomationExecutionsPaginatorOptions)) *DescribeAutomationExecutionsPaginator { if params == nil { params = &DescribeAutomationExecutionsInput{} } options := DescribeAutomationExecutionsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeAutomationExecutionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeAutomationExecutionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeAutomationExecutions page. func (p *DescribeAutomationExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAutomationExecutionsOutput, 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.DescribeAutomationExecutions(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeAutomationExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeAutomationExecutions", } }
231
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Information about all active and terminated step executions in an Automation // workflow. func (c *Client) DescribeAutomationStepExecutions(ctx context.Context, params *DescribeAutomationStepExecutionsInput, optFns ...func(*Options)) (*DescribeAutomationStepExecutionsOutput, error) { if params == nil { params = &DescribeAutomationStepExecutionsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeAutomationStepExecutions", params, optFns, c.addOperationDescribeAutomationStepExecutionsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeAutomationStepExecutionsOutput) out.ResultMetadata = metadata return out, nil } type DescribeAutomationStepExecutionsInput struct { // The Automation execution ID for which you want step execution descriptions. // // This member is required. AutomationExecutionId *string // One or more filters to limit the number of step executions returned by the // request. Filters []types.StepExecutionFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string // Indicates whether to list step executions in reverse order by start time. The // default value is 'false'. ReverseOrder *bool noSmithyDocumentSerde } type DescribeAutomationStepExecutionsOutput struct { // The token to use when requesting the next set of items. If there are no // additional items to return, the string is empty. NextToken *string // A list of details about the current state of all steps that make up an // execution. StepExecutions []types.StepExecution // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeAutomationStepExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAutomationStepExecutions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAutomationStepExecutions{}, 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 = addOpDescribeAutomationStepExecutionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAutomationStepExecutions(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 } // DescribeAutomationStepExecutionsAPIClient is a client that implements the // DescribeAutomationStepExecutions operation. type DescribeAutomationStepExecutionsAPIClient interface { DescribeAutomationStepExecutions(context.Context, *DescribeAutomationStepExecutionsInput, ...func(*Options)) (*DescribeAutomationStepExecutionsOutput, error) } var _ DescribeAutomationStepExecutionsAPIClient = (*Client)(nil) // DescribeAutomationStepExecutionsPaginatorOptions is the paginator options for // DescribeAutomationStepExecutions type DescribeAutomationStepExecutionsPaginatorOptions struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set 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 } // DescribeAutomationStepExecutionsPaginator is a paginator for // DescribeAutomationStepExecutions type DescribeAutomationStepExecutionsPaginator struct { options DescribeAutomationStepExecutionsPaginatorOptions client DescribeAutomationStepExecutionsAPIClient params *DescribeAutomationStepExecutionsInput nextToken *string firstPage bool } // NewDescribeAutomationStepExecutionsPaginator returns a new // DescribeAutomationStepExecutionsPaginator func NewDescribeAutomationStepExecutionsPaginator(client DescribeAutomationStepExecutionsAPIClient, params *DescribeAutomationStepExecutionsInput, optFns ...func(*DescribeAutomationStepExecutionsPaginatorOptions)) *DescribeAutomationStepExecutionsPaginator { if params == nil { params = &DescribeAutomationStepExecutionsInput{} } options := DescribeAutomationStepExecutionsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeAutomationStepExecutionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeAutomationStepExecutionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeAutomationStepExecutions page. func (p *DescribeAutomationStepExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAutomationStepExecutionsOutput, 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.DescribeAutomationStepExecutions(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeAutomationStepExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeAutomationStepExecutions", } }
242
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all patches eligible to be included in a patch baseline. func (c *Client) DescribeAvailablePatches(ctx context.Context, params *DescribeAvailablePatchesInput, optFns ...func(*Options)) (*DescribeAvailablePatchesOutput, error) { if params == nil { params = &DescribeAvailablePatchesInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeAvailablePatches", params, optFns, c.addOperationDescribeAvailablePatchesMiddlewares) if err != nil { return nil, err } out := result.(*DescribeAvailablePatchesOutput) out.ResultMetadata = metadata return out, nil } type DescribeAvailablePatchesInput struct { // Each element in the array is a structure containing a key-value pair. Windows // Server Supported keys for Windows Server managed node patches include the // following: // - PATCH_SET Sample values: OS | APPLICATION // - PRODUCT Sample values: WindowsServer2012 | Office 2010 | // MicrosoftDefenderAntivirus // - PRODUCT_FAMILY Sample values: Windows | Office // - MSRC_SEVERITY Sample values: ServicePacks | Important | Moderate // - CLASSIFICATION Sample values: ServicePacks | SecurityUpdates | // DefinitionUpdates // - PATCH_ID Sample values: KB123456 | KB4516046 // Linux When specifying filters for Linux patches, you must specify a key-pair // for PRODUCT . For example, using the Command Line Interface (CLI), the following // command fails: aws ssm describe-available-patches --filters // Key=CVE_ID,Values=CVE-2018-3615 However, the following command succeeds: aws // ssm describe-available-patches --filters Key=PRODUCT,Values=AmazonLinux2018.03 // Key=CVE_ID,Values=CVE-2018-3615 Supported keys for Linux managed node patches // include the following: // - PRODUCT Sample values: AmazonLinux2018.03 | AmazonLinux2.0 // - NAME Sample values: kernel-headers | samba-python | php // - SEVERITY Sample values: Critical | Important | Medium | Low // - EPOCH Sample values: 0 | 1 // - VERSION Sample values: 78.6.1 | 4.10.16 // - RELEASE Sample values: 9.56.amzn1 | 1.amzn2 // - ARCH Sample values: i686 | x86_64 // - REPOSITORY Sample values: Core | Updates // - ADVISORY_ID Sample values: ALAS-2018-1058 | ALAS2-2021-1594 // - CVE_ID Sample values: CVE-2018-3615 | CVE-2020-1472 // - BUGZILLA_ID Sample values: 1463241 Filters []types.PatchOrchestratorFilter // The maximum number of patches to return (per page). MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string noSmithyDocumentSerde } type DescribeAvailablePatchesOutput struct { // The token to use when requesting the next set of items. If there are no // additional items to return, the string is empty. NextToken *string // An array of patches. Each entry in the array is a patch structure. Patches []types.Patch // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeAvailablePatchesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAvailablePatches{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAvailablePatches{}, 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_opDescribeAvailablePatches(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 } // DescribeAvailablePatchesAPIClient is a client that implements the // DescribeAvailablePatches operation. type DescribeAvailablePatchesAPIClient interface { DescribeAvailablePatches(context.Context, *DescribeAvailablePatchesInput, ...func(*Options)) (*DescribeAvailablePatchesOutput, error) } var _ DescribeAvailablePatchesAPIClient = (*Client)(nil) // DescribeAvailablePatchesPaginatorOptions is the paginator options for // DescribeAvailablePatches type DescribeAvailablePatchesPaginatorOptions struct { // The maximum number of patches to return (per page). Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // DescribeAvailablePatchesPaginator is a paginator for DescribeAvailablePatches type DescribeAvailablePatchesPaginator struct { options DescribeAvailablePatchesPaginatorOptions client DescribeAvailablePatchesAPIClient params *DescribeAvailablePatchesInput nextToken *string firstPage bool } // NewDescribeAvailablePatchesPaginator returns a new // DescribeAvailablePatchesPaginator func NewDescribeAvailablePatchesPaginator(client DescribeAvailablePatchesAPIClient, params *DescribeAvailablePatchesInput, optFns ...func(*DescribeAvailablePatchesPaginatorOptions)) *DescribeAvailablePatchesPaginator { if params == nil { params = &DescribeAvailablePatchesInput{} } options := DescribeAvailablePatchesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeAvailablePatchesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeAvailablePatchesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeAvailablePatches page. func (p *DescribeAvailablePatchesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAvailablePatchesOutput, 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.DescribeAvailablePatches(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeAvailablePatches(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeAvailablePatches", } }
252
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Describes the specified Amazon Web Services Systems Manager document (SSM // document). func (c *Client) DescribeDocument(ctx context.Context, params *DescribeDocumentInput, optFns ...func(*Options)) (*DescribeDocumentOutput, error) { if params == nil { params = &DescribeDocumentInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeDocument", params, optFns, c.addOperationDescribeDocumentMiddlewares) if err != nil { return nil, err } out := result.(*DescribeDocumentOutput) out.ResultMetadata = metadata return out, nil } type DescribeDocumentInput struct { // The name of the SSM document. // // This member is required. Name *string // The document version for which you want information. Can be a specific version // or the default version. DocumentVersion *string // An optional field specifying the version of the artifact associated with the // document. For example, "Release 12, Update 6". This value is unique across all // versions of a document, and can't be changed. VersionName *string noSmithyDocumentSerde } type DescribeDocumentOutput struct { // Information about the SSM document. Document *types.DocumentDescription // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeDocument{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeDocument{}, 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 = addOpDescribeDocumentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDocument(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_opDescribeDocument(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeDocument", } }
135
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Describes the permissions for a Amazon Web Services Systems Manager document // (SSM document). If you created the document, you are the owner. If a document is // shared, it can either be shared privately (by specifying a user's Amazon Web // Services account ID) or publicly (All). func (c *Client) DescribeDocumentPermission(ctx context.Context, params *DescribeDocumentPermissionInput, optFns ...func(*Options)) (*DescribeDocumentPermissionOutput, error) { if params == nil { params = &DescribeDocumentPermissionInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeDocumentPermission", params, optFns, c.addOperationDescribeDocumentPermissionMiddlewares) if err != nil { return nil, err } out := result.(*DescribeDocumentPermissionOutput) out.ResultMetadata = metadata return out, nil } type DescribeDocumentPermissionInput struct { // The name of the document for which you are the owner. // // This member is required. Name *string // The permission type for the document. The permission type can be Share. // // This member is required. PermissionType types.DocumentPermissionType // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string noSmithyDocumentSerde } type DescribeDocumentPermissionOutput struct { // The account IDs that have permission to use this document. The ID can be either // an Amazon Web Services account or All. AccountIds []string // A list of Amazon Web Services accounts where the current document is shared and // the version shared with each account. AccountSharingInfoList []types.AccountSharingInfo // The token for the next set of items to return. Use this token to get the next // set of results. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeDocumentPermissionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeDocumentPermission{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeDocumentPermission{}, 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 = addOpDescribeDocumentPermissionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDocumentPermission(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_opDescribeDocumentPermission(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeDocumentPermission", } }
150
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // All associations for the managed node(s). func (c *Client) DescribeEffectiveInstanceAssociations(ctx context.Context, params *DescribeEffectiveInstanceAssociationsInput, optFns ...func(*Options)) (*DescribeEffectiveInstanceAssociationsOutput, error) { if params == nil { params = &DescribeEffectiveInstanceAssociationsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeEffectiveInstanceAssociations", params, optFns, c.addOperationDescribeEffectiveInstanceAssociationsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeEffectiveInstanceAssociationsOutput) out.ResultMetadata = metadata return out, nil } type DescribeEffectiveInstanceAssociationsInput struct { // The managed node ID for which you want to view all associations. // // This member is required. InstanceId *string // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string noSmithyDocumentSerde } type DescribeEffectiveInstanceAssociationsOutput struct { // The associations for the requested managed node. Associations []types.InstanceAssociation // The token to use when requesting the next set of items. If there are no // additional items to return, the string is empty. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeEffectiveInstanceAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeEffectiveInstanceAssociations{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeEffectiveInstanceAssociations{}, 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 = addOpDescribeEffectiveInstanceAssociationsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEffectiveInstanceAssociations(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 } // DescribeEffectiveInstanceAssociationsAPIClient is a client that implements the // DescribeEffectiveInstanceAssociations operation. type DescribeEffectiveInstanceAssociationsAPIClient interface { DescribeEffectiveInstanceAssociations(context.Context, *DescribeEffectiveInstanceAssociationsInput, ...func(*Options)) (*DescribeEffectiveInstanceAssociationsOutput, error) } var _ DescribeEffectiveInstanceAssociationsAPIClient = (*Client)(nil) // DescribeEffectiveInstanceAssociationsPaginatorOptions is the paginator options // for DescribeEffectiveInstanceAssociations type DescribeEffectiveInstanceAssociationsPaginatorOptions struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set 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 } // DescribeEffectiveInstanceAssociationsPaginator is a paginator for // DescribeEffectiveInstanceAssociations type DescribeEffectiveInstanceAssociationsPaginator struct { options DescribeEffectiveInstanceAssociationsPaginatorOptions client DescribeEffectiveInstanceAssociationsAPIClient params *DescribeEffectiveInstanceAssociationsInput nextToken *string firstPage bool } // NewDescribeEffectiveInstanceAssociationsPaginator returns a new // DescribeEffectiveInstanceAssociationsPaginator func NewDescribeEffectiveInstanceAssociationsPaginator(client DescribeEffectiveInstanceAssociationsAPIClient, params *DescribeEffectiveInstanceAssociationsInput, optFns ...func(*DescribeEffectiveInstanceAssociationsPaginatorOptions)) *DescribeEffectiveInstanceAssociationsPaginator { if params == nil { params = &DescribeEffectiveInstanceAssociationsInput{} } options := DescribeEffectiveInstanceAssociationsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeEffectiveInstanceAssociationsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeEffectiveInstanceAssociationsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeEffectiveInstanceAssociations page. func (p *DescribeEffectiveInstanceAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEffectiveInstanceAssociationsOutput, 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.DescribeEffectiveInstanceAssociations(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeEffectiveInstanceAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeEffectiveInstanceAssociations", } }
232
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves the current effective patches (the patch and the approval state) for // the specified patch baseline. Applies to patch baselines for Windows only. func (c *Client) DescribeEffectivePatchesForPatchBaseline(ctx context.Context, params *DescribeEffectivePatchesForPatchBaselineInput, optFns ...func(*Options)) (*DescribeEffectivePatchesForPatchBaselineOutput, error) { if params == nil { params = &DescribeEffectivePatchesForPatchBaselineInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeEffectivePatchesForPatchBaseline", params, optFns, c.addOperationDescribeEffectivePatchesForPatchBaselineMiddlewares) if err != nil { return nil, err } out := result.(*DescribeEffectivePatchesForPatchBaselineOutput) out.ResultMetadata = metadata return out, nil } type DescribeEffectivePatchesForPatchBaselineInput struct { // The ID of the patch baseline to retrieve the effective patches for. // // This member is required. BaselineId *string // The maximum number of patches to return (per page). MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string noSmithyDocumentSerde } type DescribeEffectivePatchesForPatchBaselineOutput struct { // An array of patches and patch status. EffectivePatches []types.EffectivePatch // The token to use when requesting the next set of items. If there are no // additional items to return, the string is empty. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeEffectivePatchesForPatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeEffectivePatchesForPatchBaseline{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeEffectivePatchesForPatchBaseline{}, 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 = addOpDescribeEffectivePatchesForPatchBaselineValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEffectivePatchesForPatchBaseline(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 } // DescribeEffectivePatchesForPatchBaselineAPIClient is a client that implements // the DescribeEffectivePatchesForPatchBaseline operation. type DescribeEffectivePatchesForPatchBaselineAPIClient interface { DescribeEffectivePatchesForPatchBaseline(context.Context, *DescribeEffectivePatchesForPatchBaselineInput, ...func(*Options)) (*DescribeEffectivePatchesForPatchBaselineOutput, error) } var _ DescribeEffectivePatchesForPatchBaselineAPIClient = (*Client)(nil) // DescribeEffectivePatchesForPatchBaselinePaginatorOptions is the paginator // options for DescribeEffectivePatchesForPatchBaseline type DescribeEffectivePatchesForPatchBaselinePaginatorOptions struct { // The maximum number of patches to return (per page). Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // DescribeEffectivePatchesForPatchBaselinePaginator is a paginator for // DescribeEffectivePatchesForPatchBaseline type DescribeEffectivePatchesForPatchBaselinePaginator struct { options DescribeEffectivePatchesForPatchBaselinePaginatorOptions client DescribeEffectivePatchesForPatchBaselineAPIClient params *DescribeEffectivePatchesForPatchBaselineInput nextToken *string firstPage bool } // NewDescribeEffectivePatchesForPatchBaselinePaginator returns a new // DescribeEffectivePatchesForPatchBaselinePaginator func NewDescribeEffectivePatchesForPatchBaselinePaginator(client DescribeEffectivePatchesForPatchBaselineAPIClient, params *DescribeEffectivePatchesForPatchBaselineInput, optFns ...func(*DescribeEffectivePatchesForPatchBaselinePaginatorOptions)) *DescribeEffectivePatchesForPatchBaselinePaginator { if params == nil { params = &DescribeEffectivePatchesForPatchBaselineInput{} } options := DescribeEffectivePatchesForPatchBaselinePaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeEffectivePatchesForPatchBaselinePaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeEffectivePatchesForPatchBaselinePaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeEffectivePatchesForPatchBaseline page. func (p *DescribeEffectivePatchesForPatchBaselinePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEffectivePatchesForPatchBaselineOutput, 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.DescribeEffectivePatchesForPatchBaseline(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeEffectivePatchesForPatchBaseline(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeEffectivePatchesForPatchBaseline", } }
231
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The status of the associations for the managed node(s). func (c *Client) DescribeInstanceAssociationsStatus(ctx context.Context, params *DescribeInstanceAssociationsStatusInput, optFns ...func(*Options)) (*DescribeInstanceAssociationsStatusOutput, error) { if params == nil { params = &DescribeInstanceAssociationsStatusInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeInstanceAssociationsStatus", params, optFns, c.addOperationDescribeInstanceAssociationsStatusMiddlewares) if err != nil { return nil, err } out := result.(*DescribeInstanceAssociationsStatusOutput) out.ResultMetadata = metadata return out, nil } type DescribeInstanceAssociationsStatusInput struct { // The managed node IDs for which you want association status information. // // This member is required. InstanceId *string // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string noSmithyDocumentSerde } type DescribeInstanceAssociationsStatusOutput struct { // Status information about the association. InstanceAssociationStatusInfos []types.InstanceAssociationStatusInfo // The token to use when requesting the next set of items. If there are no // additional items to return, the string is empty. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeInstanceAssociationsStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeInstanceAssociationsStatus{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeInstanceAssociationsStatus{}, 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 = addOpDescribeInstanceAssociationsStatusValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstanceAssociationsStatus(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 } // DescribeInstanceAssociationsStatusAPIClient is a client that implements the // DescribeInstanceAssociationsStatus operation. type DescribeInstanceAssociationsStatusAPIClient interface { DescribeInstanceAssociationsStatus(context.Context, *DescribeInstanceAssociationsStatusInput, ...func(*Options)) (*DescribeInstanceAssociationsStatusOutput, error) } var _ DescribeInstanceAssociationsStatusAPIClient = (*Client)(nil) // DescribeInstanceAssociationsStatusPaginatorOptions is the paginator options for // DescribeInstanceAssociationsStatus type DescribeInstanceAssociationsStatusPaginatorOptions struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set 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 } // DescribeInstanceAssociationsStatusPaginator is a paginator for // DescribeInstanceAssociationsStatus type DescribeInstanceAssociationsStatusPaginator struct { options DescribeInstanceAssociationsStatusPaginatorOptions client DescribeInstanceAssociationsStatusAPIClient params *DescribeInstanceAssociationsStatusInput nextToken *string firstPage bool } // NewDescribeInstanceAssociationsStatusPaginator returns a new // DescribeInstanceAssociationsStatusPaginator func NewDescribeInstanceAssociationsStatusPaginator(client DescribeInstanceAssociationsStatusAPIClient, params *DescribeInstanceAssociationsStatusInput, optFns ...func(*DescribeInstanceAssociationsStatusPaginatorOptions)) *DescribeInstanceAssociationsStatusPaginator { if params == nil { params = &DescribeInstanceAssociationsStatusInput{} } options := DescribeInstanceAssociationsStatusPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeInstanceAssociationsStatusPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeInstanceAssociationsStatusPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeInstanceAssociationsStatus page. func (p *DescribeInstanceAssociationsStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceAssociationsStatusOutput, 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.DescribeInstanceAssociationsStatus(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeInstanceAssociationsStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeInstanceAssociationsStatus", } }
232
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Provides information about one or more of your managed nodes, including the // operating system platform, SSM Agent version, association status, and IP // address. This operation does not return information for nodes that are either // Stopped or Terminated. If you specify one or more node IDs, the operation // returns information for those managed nodes. If you don't specify node IDs, it // returns information for all your managed nodes. If you specify a node ID that // isn't valid or a node that you don't own, you receive an error. The IamRole // field returned for this API operation is the Identity and Access Management // (IAM) role assigned to on-premises managed nodes. This operation does not return // the IAM role for EC2 instances. func (c *Client) DescribeInstanceInformation(ctx context.Context, params *DescribeInstanceInformationInput, optFns ...func(*Options)) (*DescribeInstanceInformationOutput, error) { if params == nil { params = &DescribeInstanceInformationInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeInstanceInformation", params, optFns, c.addOperationDescribeInstanceInformationMiddlewares) if err != nil { return nil, err } out := result.(*DescribeInstanceInformationOutput) out.ResultMetadata = metadata return out, nil } type DescribeInstanceInformationInput struct { // One or more filters. Use a filter to return a more specific list of managed // nodes. You can filter based on tags applied to your managed nodes. Tag filters // can't be combined with other filter types. Use this Filters data type instead // of InstanceInformationFilterList , which is deprecated. Filters []types.InstanceInformationStringFilter // This is a legacy method. We recommend that you don't use this method. Instead, // use the Filters data type. Filters enables you to return node information by // filtering based on tags applied to managed nodes. Attempting to use // InstanceInformationFilterList and Filters leads to an exception error. InstanceInformationFilterList []types.InstanceInformationFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. // The default value is 10 items. MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string noSmithyDocumentSerde } type DescribeInstanceInformationOutput struct { // The managed node information list. InstanceInformationList []types.InstanceInformation // The token to use when requesting the next set of items. If there are no // additional items to return, the string is empty. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeInstanceInformationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeInstanceInformation{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeInstanceInformation{}, 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 = addOpDescribeInstanceInformationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstanceInformation(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 } // DescribeInstanceInformationAPIClient is a client that implements the // DescribeInstanceInformation operation. type DescribeInstanceInformationAPIClient interface { DescribeInstanceInformation(context.Context, *DescribeInstanceInformationInput, ...func(*Options)) (*DescribeInstanceInformationOutput, error) } var _ DescribeInstanceInformationAPIClient = (*Client)(nil) // DescribeInstanceInformationPaginatorOptions is the paginator options for // DescribeInstanceInformation type DescribeInstanceInformationPaginatorOptions struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. // The default value is 10 items. 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 } // DescribeInstanceInformationPaginator is a paginator for // DescribeInstanceInformation type DescribeInstanceInformationPaginator struct { options DescribeInstanceInformationPaginatorOptions client DescribeInstanceInformationAPIClient params *DescribeInstanceInformationInput nextToken *string firstPage bool } // NewDescribeInstanceInformationPaginator returns a new // DescribeInstanceInformationPaginator func NewDescribeInstanceInformationPaginator(client DescribeInstanceInformationAPIClient, params *DescribeInstanceInformationInput, optFns ...func(*DescribeInstanceInformationPaginatorOptions)) *DescribeInstanceInformationPaginator { if params == nil { params = &DescribeInstanceInformationInput{} } options := DescribeInstanceInformationPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeInstanceInformationPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeInstanceInformationPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeInstanceInformation page. func (p *DescribeInstanceInformationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceInformationOutput, 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.DescribeInstanceInformation(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeInstanceInformation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeInstanceInformation", } }
250
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves information about the patches on the specified managed node and their // state relative to the patch baseline being used for the node. func (c *Client) DescribeInstancePatches(ctx context.Context, params *DescribeInstancePatchesInput, optFns ...func(*Options)) (*DescribeInstancePatchesOutput, error) { if params == nil { params = &DescribeInstancePatchesInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeInstancePatches", params, optFns, c.addOperationDescribeInstancePatchesMiddlewares) if err != nil { return nil, err } out := result.(*DescribeInstancePatchesOutput) out.ResultMetadata = metadata return out, nil } type DescribeInstancePatchesInput struct { // The ID of the managed node whose patch state information should be retrieved. // // This member is required. InstanceId *string // Each element in the array is a structure containing a key-value pair. Supported // keys for DescribeInstancePatches include the following: // - Classification Sample values: Security | SecurityUpdates // - KBId Sample values: KB4480056 | java-1.7.0-openjdk.x86_64 // - Severity Sample values: Important | Medium | Low // - State Sample values: Installed | InstalledOther | InstalledPendingReboot Filters []types.PatchOrchestratorFilter // The maximum number of patches to return (per page). MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string noSmithyDocumentSerde } type DescribeInstancePatchesOutput struct { // The token to use when requesting the next set of items. If there are no // additional items to return, the string is empty. NextToken *string // Each entry in the array is a structure containing: // - Title (string) // - KBId (string) // - Classification (string) // - Severity (string) // - State (string, such as "INSTALLED" or "FAILED") // - InstalledTime (DateTime) // - InstalledBy (string) Patches []types.PatchComplianceData // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeInstancePatchesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeInstancePatches{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeInstancePatches{}, 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 = addOpDescribeInstancePatchesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstancePatches(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 } // DescribeInstancePatchesAPIClient is a client that implements the // DescribeInstancePatches operation. type DescribeInstancePatchesAPIClient interface { DescribeInstancePatches(context.Context, *DescribeInstancePatchesInput, ...func(*Options)) (*DescribeInstancePatchesOutput, error) } var _ DescribeInstancePatchesAPIClient = (*Client)(nil) // DescribeInstancePatchesPaginatorOptions is the paginator options for // DescribeInstancePatches type DescribeInstancePatchesPaginatorOptions struct { // The maximum number of patches to return (per page). Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // DescribeInstancePatchesPaginator is a paginator for DescribeInstancePatches type DescribeInstancePatchesPaginator struct { options DescribeInstancePatchesPaginatorOptions client DescribeInstancePatchesAPIClient params *DescribeInstancePatchesInput nextToken *string firstPage bool } // NewDescribeInstancePatchesPaginator returns a new // DescribeInstancePatchesPaginator func NewDescribeInstancePatchesPaginator(client DescribeInstancePatchesAPIClient, params *DescribeInstancePatchesInput, optFns ...func(*DescribeInstancePatchesPaginatorOptions)) *DescribeInstancePatchesPaginator { if params == nil { params = &DescribeInstancePatchesInput{} } options := DescribeInstancePatchesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeInstancePatchesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeInstancePatchesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeInstancePatches page. func (p *DescribeInstancePatchesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstancePatchesOutput, 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.DescribeInstancePatches(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeInstancePatches(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeInstancePatches", } }
245
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves the high-level patch state of one or more managed nodes. func (c *Client) DescribeInstancePatchStates(ctx context.Context, params *DescribeInstancePatchStatesInput, optFns ...func(*Options)) (*DescribeInstancePatchStatesOutput, error) { if params == nil { params = &DescribeInstancePatchStatesInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeInstancePatchStates", params, optFns, c.addOperationDescribeInstancePatchStatesMiddlewares) if err != nil { return nil, err } out := result.(*DescribeInstancePatchStatesOutput) out.ResultMetadata = metadata return out, nil } type DescribeInstancePatchStatesInput struct { // The ID of the managed node for which patch state information should be // retrieved. // // This member is required. InstanceIds []string // The maximum number of managed nodes to return (per page). MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string noSmithyDocumentSerde } type DescribeInstancePatchStatesOutput struct { // The high-level patch state for the requested managed nodes. InstancePatchStates []types.InstancePatchState // The token to use when requesting the next set of items. If there are no // additional items to return, the string is empty. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeInstancePatchStatesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeInstancePatchStates{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeInstancePatchStates{}, 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 = addOpDescribeInstancePatchStatesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstancePatchStates(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 } // DescribeInstancePatchStatesAPIClient is a client that implements the // DescribeInstancePatchStates operation. type DescribeInstancePatchStatesAPIClient interface { DescribeInstancePatchStates(context.Context, *DescribeInstancePatchStatesInput, ...func(*Options)) (*DescribeInstancePatchStatesOutput, error) } var _ DescribeInstancePatchStatesAPIClient = (*Client)(nil) // DescribeInstancePatchStatesPaginatorOptions is the paginator options for // DescribeInstancePatchStates type DescribeInstancePatchStatesPaginatorOptions struct { // The maximum number of managed nodes to return (per page). Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // DescribeInstancePatchStatesPaginator is a paginator for // DescribeInstancePatchStates type DescribeInstancePatchStatesPaginator struct { options DescribeInstancePatchStatesPaginatorOptions client DescribeInstancePatchStatesAPIClient params *DescribeInstancePatchStatesInput nextToken *string firstPage bool } // NewDescribeInstancePatchStatesPaginator returns a new // DescribeInstancePatchStatesPaginator func NewDescribeInstancePatchStatesPaginator(client DescribeInstancePatchStatesAPIClient, params *DescribeInstancePatchStatesInput, optFns ...func(*DescribeInstancePatchStatesPaginatorOptions)) *DescribeInstancePatchStatesPaginator { if params == nil { params = &DescribeInstancePatchStatesInput{} } options := DescribeInstancePatchStatesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeInstancePatchStatesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeInstancePatchStatesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeInstancePatchStates page. func (p *DescribeInstancePatchStatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstancePatchStatesOutput, 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.DescribeInstancePatchStates(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeInstancePatchStates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeInstancePatchStates", } }
231
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves the high-level patch state for the managed nodes in the specified // patch group. func (c *Client) DescribeInstancePatchStatesForPatchGroup(ctx context.Context, params *DescribeInstancePatchStatesForPatchGroupInput, optFns ...func(*Options)) (*DescribeInstancePatchStatesForPatchGroupOutput, error) { if params == nil { params = &DescribeInstancePatchStatesForPatchGroupInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeInstancePatchStatesForPatchGroup", params, optFns, c.addOperationDescribeInstancePatchStatesForPatchGroupMiddlewares) if err != nil { return nil, err } out := result.(*DescribeInstancePatchStatesForPatchGroupOutput) out.ResultMetadata = metadata return out, nil } type DescribeInstancePatchStatesForPatchGroupInput struct { // The name of the patch group for which the patch state information should be // retrieved. // // This member is required. PatchGroup *string // Each entry in the array is a structure containing: // - Key (string between 1 and 200 characters) // - Values (array containing a single string) // - Type (string "Equal", "NotEqual", "LessThan", "GreaterThan") Filters []types.InstancePatchStateFilter // The maximum number of patches to return (per page). MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string noSmithyDocumentSerde } type DescribeInstancePatchStatesForPatchGroupOutput struct { // The high-level patch state for the requested managed nodes. InstancePatchStates []types.InstancePatchState // The token to use when requesting the next set of items. If there are no // additional items to return, the string is empty. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeInstancePatchStatesForPatchGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeInstancePatchStatesForPatchGroup{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeInstancePatchStatesForPatchGroup{}, 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 = addOpDescribeInstancePatchStatesForPatchGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstancePatchStatesForPatchGroup(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 } // DescribeInstancePatchStatesForPatchGroupAPIClient is a client that implements // the DescribeInstancePatchStatesForPatchGroup operation. type DescribeInstancePatchStatesForPatchGroupAPIClient interface { DescribeInstancePatchStatesForPatchGroup(context.Context, *DescribeInstancePatchStatesForPatchGroupInput, ...func(*Options)) (*DescribeInstancePatchStatesForPatchGroupOutput, error) } var _ DescribeInstancePatchStatesForPatchGroupAPIClient = (*Client)(nil) // DescribeInstancePatchStatesForPatchGroupPaginatorOptions is the paginator // options for DescribeInstancePatchStatesForPatchGroup type DescribeInstancePatchStatesForPatchGroupPaginatorOptions struct { // The maximum number of patches to return (per page). Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // DescribeInstancePatchStatesForPatchGroupPaginator is a paginator for // DescribeInstancePatchStatesForPatchGroup type DescribeInstancePatchStatesForPatchGroupPaginator struct { options DescribeInstancePatchStatesForPatchGroupPaginatorOptions client DescribeInstancePatchStatesForPatchGroupAPIClient params *DescribeInstancePatchStatesForPatchGroupInput nextToken *string firstPage bool } // NewDescribeInstancePatchStatesForPatchGroupPaginator returns a new // DescribeInstancePatchStatesForPatchGroupPaginator func NewDescribeInstancePatchStatesForPatchGroupPaginator(client DescribeInstancePatchStatesForPatchGroupAPIClient, params *DescribeInstancePatchStatesForPatchGroupInput, optFns ...func(*DescribeInstancePatchStatesForPatchGroupPaginatorOptions)) *DescribeInstancePatchStatesForPatchGroupPaginator { if params == nil { params = &DescribeInstancePatchStatesForPatchGroupInput{} } options := DescribeInstancePatchStatesForPatchGroupPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeInstancePatchStatesForPatchGroupPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeInstancePatchStatesForPatchGroupPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeInstancePatchStatesForPatchGroup page. func (p *DescribeInstancePatchStatesForPatchGroupPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstancePatchStatesForPatchGroupOutput, 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.DescribeInstancePatchStatesForPatchGroup(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeInstancePatchStatesForPatchGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeInstancePatchStatesForPatchGroup", } }
238
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Describes a specific delete inventory operation. func (c *Client) DescribeInventoryDeletions(ctx context.Context, params *DescribeInventoryDeletionsInput, optFns ...func(*Options)) (*DescribeInventoryDeletionsOutput, error) { if params == nil { params = &DescribeInventoryDeletionsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeInventoryDeletions", params, optFns, c.addOperationDescribeInventoryDeletionsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeInventoryDeletionsOutput) out.ResultMetadata = metadata return out, nil } type DescribeInventoryDeletionsInput struct { // Specify the delete inventory ID for which you want information. This ID was // returned by the DeleteInventory operation. DeletionId *string // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. MaxResults *int32 // A token to start the list. Use this token to get the next set of results. NextToken *string noSmithyDocumentSerde } type DescribeInventoryDeletionsOutput struct { // A list of status items for deleted inventory. InventoryDeletions []types.InventoryDeletionStatusItem // The token for the next set of items to return. Use this token to get the next // set of results. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeInventoryDeletionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeInventoryDeletions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeInventoryDeletions{}, 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_opDescribeInventoryDeletions(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 } // DescribeInventoryDeletionsAPIClient is a client that implements the // DescribeInventoryDeletions operation. type DescribeInventoryDeletionsAPIClient interface { DescribeInventoryDeletions(context.Context, *DescribeInventoryDeletionsInput, ...func(*Options)) (*DescribeInventoryDeletionsOutput, error) } var _ DescribeInventoryDeletionsAPIClient = (*Client)(nil) // DescribeInventoryDeletionsPaginatorOptions is the paginator options for // DescribeInventoryDeletions type DescribeInventoryDeletionsPaginatorOptions struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set 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 } // DescribeInventoryDeletionsPaginator is a paginator for // DescribeInventoryDeletions type DescribeInventoryDeletionsPaginator struct { options DescribeInventoryDeletionsPaginatorOptions client DescribeInventoryDeletionsAPIClient params *DescribeInventoryDeletionsInput nextToken *string firstPage bool } // NewDescribeInventoryDeletionsPaginator returns a new // DescribeInventoryDeletionsPaginator func NewDescribeInventoryDeletionsPaginator(client DescribeInventoryDeletionsAPIClient, params *DescribeInventoryDeletionsInput, optFns ...func(*DescribeInventoryDeletionsPaginatorOptions)) *DescribeInventoryDeletionsPaginator { if params == nil { params = &DescribeInventoryDeletionsInput{} } options := DescribeInventoryDeletionsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeInventoryDeletionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeInventoryDeletionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeInventoryDeletions page. func (p *DescribeInventoryDeletionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInventoryDeletionsOutput, 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.DescribeInventoryDeletions(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeInventoryDeletions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeInventoryDeletions", } }
227
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the executions of a maintenance window. This includes information about // when the maintenance window was scheduled to be active, and information about // tasks registered and run with the maintenance window. func (c *Client) DescribeMaintenanceWindowExecutions(ctx context.Context, params *DescribeMaintenanceWindowExecutionsInput, optFns ...func(*Options)) (*DescribeMaintenanceWindowExecutionsOutput, error) { if params == nil { params = &DescribeMaintenanceWindowExecutionsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindowExecutions", params, optFns, c.addOperationDescribeMaintenanceWindowExecutionsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeMaintenanceWindowExecutionsOutput) out.ResultMetadata = metadata return out, nil } type DescribeMaintenanceWindowExecutionsInput struct { // The ID of the maintenance window whose executions should be retrieved. // // This member is required. WindowId *string // Each entry in the array is a structure containing: // - Key. A string between 1 and 128 characters. Supported keys include // ExecutedBefore and ExecutedAfter . // - Values. An array of strings, each between 1 and 256 characters. Supported // values are date/time strings in a valid ISO 8601 date/time format, such as // 2021-11-04T05:00:00Z . Filters []types.MaintenanceWindowFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string noSmithyDocumentSerde } type DescribeMaintenanceWindowExecutionsOutput struct { // The token to use when requesting the next set of items. If there are no // additional items to return, the string is empty. NextToken *string // Information about the maintenance window executions. WindowExecutions []types.MaintenanceWindowExecution // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeMaintenanceWindowExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeMaintenanceWindowExecutions{}, 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 = addOpDescribeMaintenanceWindowExecutionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutions(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 } // DescribeMaintenanceWindowExecutionsAPIClient is a client that implements the // DescribeMaintenanceWindowExecutions operation. type DescribeMaintenanceWindowExecutionsAPIClient interface { DescribeMaintenanceWindowExecutions(context.Context, *DescribeMaintenanceWindowExecutionsInput, ...func(*Options)) (*DescribeMaintenanceWindowExecutionsOutput, error) } var _ DescribeMaintenanceWindowExecutionsAPIClient = (*Client)(nil) // DescribeMaintenanceWindowExecutionsPaginatorOptions is the paginator options // for DescribeMaintenanceWindowExecutions type DescribeMaintenanceWindowExecutionsPaginatorOptions struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set 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 } // DescribeMaintenanceWindowExecutionsPaginator is a paginator for // DescribeMaintenanceWindowExecutions type DescribeMaintenanceWindowExecutionsPaginator struct { options DescribeMaintenanceWindowExecutionsPaginatorOptions client DescribeMaintenanceWindowExecutionsAPIClient params *DescribeMaintenanceWindowExecutionsInput nextToken *string firstPage bool } // NewDescribeMaintenanceWindowExecutionsPaginator returns a new // DescribeMaintenanceWindowExecutionsPaginator func NewDescribeMaintenanceWindowExecutionsPaginator(client DescribeMaintenanceWindowExecutionsAPIClient, params *DescribeMaintenanceWindowExecutionsInput, optFns ...func(*DescribeMaintenanceWindowExecutionsPaginatorOptions)) *DescribeMaintenanceWindowExecutionsPaginator { if params == nil { params = &DescribeMaintenanceWindowExecutionsInput{} } options := DescribeMaintenanceWindowExecutionsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeMaintenanceWindowExecutionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeMaintenanceWindowExecutionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeMaintenanceWindowExecutions page. func (p *DescribeMaintenanceWindowExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowExecutionsOutput, 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.DescribeMaintenanceWindowExecutions(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeMaintenanceWindowExecutions", } }
242
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves the individual task executions (one per target) for a particular task // run as part of a maintenance window execution. func (c *Client) DescribeMaintenanceWindowExecutionTaskInvocations(ctx context.Context, params *DescribeMaintenanceWindowExecutionTaskInvocationsInput, optFns ...func(*Options)) (*DescribeMaintenanceWindowExecutionTaskInvocationsOutput, error) { if params == nil { params = &DescribeMaintenanceWindowExecutionTaskInvocationsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindowExecutionTaskInvocations", params, optFns, c.addOperationDescribeMaintenanceWindowExecutionTaskInvocationsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeMaintenanceWindowExecutionTaskInvocationsOutput) out.ResultMetadata = metadata return out, nil } type DescribeMaintenanceWindowExecutionTaskInvocationsInput struct { // The ID of the specific task in the maintenance window task that should be // retrieved. // // This member is required. TaskId *string // The ID of the maintenance window execution the task is part of. // // This member is required. WindowExecutionId *string // Optional filters used to scope down the returned task invocations. The // supported filter key is STATUS with the corresponding values PENDING , // IN_PROGRESS , SUCCESS , FAILED , TIMED_OUT , CANCELLING , and CANCELLED . Filters []types.MaintenanceWindowFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string noSmithyDocumentSerde } type DescribeMaintenanceWindowExecutionTaskInvocationsOutput struct { // The token to use when requesting the next set of items. If there are no // additional items to return, the string is empty. NextToken *string // Information about the task invocation results per invocation. WindowExecutionTaskInvocationIdentities []types.MaintenanceWindowExecutionTaskInvocationIdentity // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeMaintenanceWindowExecutionTaskInvocationsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutionTaskInvocations{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeMaintenanceWindowExecutionTaskInvocations{}, 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 = addOpDescribeMaintenanceWindowExecutionTaskInvocationsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutionTaskInvocations(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 } // DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient is a client that // implements the DescribeMaintenanceWindowExecutionTaskInvocations operation. type DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient interface { DescribeMaintenanceWindowExecutionTaskInvocations(context.Context, *DescribeMaintenanceWindowExecutionTaskInvocationsInput, ...func(*Options)) (*DescribeMaintenanceWindowExecutionTaskInvocationsOutput, error) } var _ DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient = (*Client)(nil) // DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions is the // paginator options for DescribeMaintenanceWindowExecutionTaskInvocations type DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set 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 } // DescribeMaintenanceWindowExecutionTaskInvocationsPaginator is a paginator for // DescribeMaintenanceWindowExecutionTaskInvocations type DescribeMaintenanceWindowExecutionTaskInvocationsPaginator struct { options DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions client DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient params *DescribeMaintenanceWindowExecutionTaskInvocationsInput nextToken *string firstPage bool } // NewDescribeMaintenanceWindowExecutionTaskInvocationsPaginator returns a new // DescribeMaintenanceWindowExecutionTaskInvocationsPaginator func NewDescribeMaintenanceWindowExecutionTaskInvocationsPaginator(client DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient, params *DescribeMaintenanceWindowExecutionTaskInvocationsInput, optFns ...func(*DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions)) *DescribeMaintenanceWindowExecutionTaskInvocationsPaginator { if params == nil { params = &DescribeMaintenanceWindowExecutionTaskInvocationsInput{} } options := DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeMaintenanceWindowExecutionTaskInvocationsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeMaintenanceWindowExecutionTaskInvocationsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeMaintenanceWindowExecutionTaskInvocations // page. func (p *DescribeMaintenanceWindowExecutionTaskInvocationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowExecutionTaskInvocationsOutput, 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.DescribeMaintenanceWindowExecutionTaskInvocations(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutionTaskInvocations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeMaintenanceWindowExecutionTaskInvocations", } }
245
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // For a given maintenance window execution, lists the tasks that were run. func (c *Client) DescribeMaintenanceWindowExecutionTasks(ctx context.Context, params *DescribeMaintenanceWindowExecutionTasksInput, optFns ...func(*Options)) (*DescribeMaintenanceWindowExecutionTasksOutput, error) { if params == nil { params = &DescribeMaintenanceWindowExecutionTasksInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindowExecutionTasks", params, optFns, c.addOperationDescribeMaintenanceWindowExecutionTasksMiddlewares) if err != nil { return nil, err } out := result.(*DescribeMaintenanceWindowExecutionTasksOutput) out.ResultMetadata = metadata return out, nil } type DescribeMaintenanceWindowExecutionTasksInput struct { // The ID of the maintenance window execution whose task executions should be // retrieved. // // This member is required. WindowExecutionId *string // Optional filters used to scope down the returned tasks. The supported filter // key is STATUS with the corresponding values PENDING , IN_PROGRESS , SUCCESS , // FAILED , TIMED_OUT , CANCELLING , and CANCELLED . Filters []types.MaintenanceWindowFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string noSmithyDocumentSerde } type DescribeMaintenanceWindowExecutionTasksOutput struct { // The token to use when requesting the next set of items. If there are no // additional items to return, the string is empty. NextToken *string // Information about the task executions. WindowExecutionTaskIdentities []types.MaintenanceWindowExecutionTaskIdentity // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeMaintenanceWindowExecutionTasksMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutionTasks{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeMaintenanceWindowExecutionTasks{}, 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 = addOpDescribeMaintenanceWindowExecutionTasksValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutionTasks(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 } // DescribeMaintenanceWindowExecutionTasksAPIClient is a client that implements // the DescribeMaintenanceWindowExecutionTasks operation. type DescribeMaintenanceWindowExecutionTasksAPIClient interface { DescribeMaintenanceWindowExecutionTasks(context.Context, *DescribeMaintenanceWindowExecutionTasksInput, ...func(*Options)) (*DescribeMaintenanceWindowExecutionTasksOutput, error) } var _ DescribeMaintenanceWindowExecutionTasksAPIClient = (*Client)(nil) // DescribeMaintenanceWindowExecutionTasksPaginatorOptions is the paginator // options for DescribeMaintenanceWindowExecutionTasks type DescribeMaintenanceWindowExecutionTasksPaginatorOptions struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set 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 } // DescribeMaintenanceWindowExecutionTasksPaginator is a paginator for // DescribeMaintenanceWindowExecutionTasks type DescribeMaintenanceWindowExecutionTasksPaginator struct { options DescribeMaintenanceWindowExecutionTasksPaginatorOptions client DescribeMaintenanceWindowExecutionTasksAPIClient params *DescribeMaintenanceWindowExecutionTasksInput nextToken *string firstPage bool } // NewDescribeMaintenanceWindowExecutionTasksPaginator returns a new // DescribeMaintenanceWindowExecutionTasksPaginator func NewDescribeMaintenanceWindowExecutionTasksPaginator(client DescribeMaintenanceWindowExecutionTasksAPIClient, params *DescribeMaintenanceWindowExecutionTasksInput, optFns ...func(*DescribeMaintenanceWindowExecutionTasksPaginatorOptions)) *DescribeMaintenanceWindowExecutionTasksPaginator { if params == nil { params = &DescribeMaintenanceWindowExecutionTasksInput{} } options := DescribeMaintenanceWindowExecutionTasksPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeMaintenanceWindowExecutionTasksPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeMaintenanceWindowExecutionTasksPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeMaintenanceWindowExecutionTasks page. func (p *DescribeMaintenanceWindowExecutionTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowExecutionTasksOutput, 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.DescribeMaintenanceWindowExecutionTasks(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutionTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeMaintenanceWindowExecutionTasks", } }
238
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves the maintenance windows in an Amazon Web Services account. func (c *Client) DescribeMaintenanceWindows(ctx context.Context, params *DescribeMaintenanceWindowsInput, optFns ...func(*Options)) (*DescribeMaintenanceWindowsOutput, error) { if params == nil { params = &DescribeMaintenanceWindowsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindows", params, optFns, c.addOperationDescribeMaintenanceWindowsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeMaintenanceWindowsOutput) out.ResultMetadata = metadata return out, nil } type DescribeMaintenanceWindowsInput struct { // Optional filters used to narrow down the scope of the returned maintenance // windows. Supported filter keys are Name and Enabled . For example, // Name=MyMaintenanceWindow and Enabled=True . Filters []types.MaintenanceWindowFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string noSmithyDocumentSerde } type DescribeMaintenanceWindowsOutput struct { // The token to use when requesting the next set of items. If there are no // additional items to return, the string is empty. NextToken *string // Information about the maintenance windows. WindowIdentities []types.MaintenanceWindowIdentity // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeMaintenanceWindowsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindows{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeMaintenanceWindows{}, 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_opDescribeMaintenanceWindows(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 } // DescribeMaintenanceWindowsAPIClient is a client that implements the // DescribeMaintenanceWindows operation. type DescribeMaintenanceWindowsAPIClient interface { DescribeMaintenanceWindows(context.Context, *DescribeMaintenanceWindowsInput, ...func(*Options)) (*DescribeMaintenanceWindowsOutput, error) } var _ DescribeMaintenanceWindowsAPIClient = (*Client)(nil) // DescribeMaintenanceWindowsPaginatorOptions is the paginator options for // DescribeMaintenanceWindows type DescribeMaintenanceWindowsPaginatorOptions struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set 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 } // DescribeMaintenanceWindowsPaginator is a paginator for // DescribeMaintenanceWindows type DescribeMaintenanceWindowsPaginator struct { options DescribeMaintenanceWindowsPaginatorOptions client DescribeMaintenanceWindowsAPIClient params *DescribeMaintenanceWindowsInput nextToken *string firstPage bool } // NewDescribeMaintenanceWindowsPaginator returns a new // DescribeMaintenanceWindowsPaginator func NewDescribeMaintenanceWindowsPaginator(client DescribeMaintenanceWindowsAPIClient, params *DescribeMaintenanceWindowsInput, optFns ...func(*DescribeMaintenanceWindowsPaginatorOptions)) *DescribeMaintenanceWindowsPaginator { if params == nil { params = &DescribeMaintenanceWindowsInput{} } options := DescribeMaintenanceWindowsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeMaintenanceWindowsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeMaintenanceWindowsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeMaintenanceWindows page. func (p *DescribeMaintenanceWindowsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowsOutput, 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.DescribeMaintenanceWindows(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeMaintenanceWindows(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeMaintenanceWindows", } }
229
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves information about upcoming executions of a maintenance window. func (c *Client) DescribeMaintenanceWindowSchedule(ctx context.Context, params *DescribeMaintenanceWindowScheduleInput, optFns ...func(*Options)) (*DescribeMaintenanceWindowScheduleOutput, error) { if params == nil { params = &DescribeMaintenanceWindowScheduleInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindowSchedule", params, optFns, c.addOperationDescribeMaintenanceWindowScheduleMiddlewares) if err != nil { return nil, err } out := result.(*DescribeMaintenanceWindowScheduleOutput) out.ResultMetadata = metadata return out, nil } type DescribeMaintenanceWindowScheduleInput struct { // Filters used to limit the range of results. For example, you can limit // maintenance window executions to only those scheduled before or after a certain // date and time. Filters []types.PatchOrchestratorFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string // The type of resource you want to retrieve information about. For example, // INSTANCE . ResourceType types.MaintenanceWindowResourceType // The managed node ID or key-value pair to retrieve information about. Targets []types.Target // The ID of the maintenance window to retrieve information about. WindowId *string noSmithyDocumentSerde } type DescribeMaintenanceWindowScheduleOutput struct { // The token for the next set of items to return. (You use this token in the next // call.) NextToken *string // Information about maintenance window executions scheduled for the specified // time range. ScheduledWindowExecutions []types.ScheduledWindowExecution // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeMaintenanceWindowScheduleMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindowSchedule{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeMaintenanceWindowSchedule{}, 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_opDescribeMaintenanceWindowSchedule(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 } // DescribeMaintenanceWindowScheduleAPIClient is a client that implements the // DescribeMaintenanceWindowSchedule operation. type DescribeMaintenanceWindowScheduleAPIClient interface { DescribeMaintenanceWindowSchedule(context.Context, *DescribeMaintenanceWindowScheduleInput, ...func(*Options)) (*DescribeMaintenanceWindowScheduleOutput, error) } var _ DescribeMaintenanceWindowScheduleAPIClient = (*Client)(nil) // DescribeMaintenanceWindowSchedulePaginatorOptions is the paginator options for // DescribeMaintenanceWindowSchedule type DescribeMaintenanceWindowSchedulePaginatorOptions struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set 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 } // DescribeMaintenanceWindowSchedulePaginator is a paginator for // DescribeMaintenanceWindowSchedule type DescribeMaintenanceWindowSchedulePaginator struct { options DescribeMaintenanceWindowSchedulePaginatorOptions client DescribeMaintenanceWindowScheduleAPIClient params *DescribeMaintenanceWindowScheduleInput nextToken *string firstPage bool } // NewDescribeMaintenanceWindowSchedulePaginator returns a new // DescribeMaintenanceWindowSchedulePaginator func NewDescribeMaintenanceWindowSchedulePaginator(client DescribeMaintenanceWindowScheduleAPIClient, params *DescribeMaintenanceWindowScheduleInput, optFns ...func(*DescribeMaintenanceWindowSchedulePaginatorOptions)) *DescribeMaintenanceWindowSchedulePaginator { if params == nil { params = &DescribeMaintenanceWindowScheduleInput{} } options := DescribeMaintenanceWindowSchedulePaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeMaintenanceWindowSchedulePaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeMaintenanceWindowSchedulePaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeMaintenanceWindowSchedule page. func (p *DescribeMaintenanceWindowSchedulePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowScheduleOutput, 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.DescribeMaintenanceWindowSchedule(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeMaintenanceWindowSchedule(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeMaintenanceWindowSchedule", } }
240
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package ssm 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/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves information about the maintenance window targets or tasks that a // managed node is associated with. func (c *Client) DescribeMaintenanceWindowsForTarget(ctx context.Context, params *DescribeMaintenanceWindowsForTargetInput, optFns ...func(*Options)) (*DescribeMaintenanceWindowsForTargetOutput, error) { if params == nil { params = &DescribeMaintenanceWindowsForTargetInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindowsForTarget", params, optFns, c.addOperationDescribeMaintenanceWindowsForTargetMiddlewares) if err != nil { return nil, err } out := result.(*DescribeMaintenanceWindowsForTargetOutput) out.ResultMetadata = metadata return out, nil } type DescribeMaintenanceWindowsForTargetInput struct { // The type of resource you want to retrieve information about. For example, // INSTANCE . // // This member is required. ResourceType types.MaintenanceWindowResourceType // The managed node ID or key-value pair to retrieve information about. // // This member is required. Targets []types.Target // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string noSmithyDocumentSerde } type DescribeMaintenanceWindowsForTargetOutput struct { // The token for the next set of items to return. (You use this token in the next // call.) NextToken *string // Information about the maintenance window targets and tasks a managed node is // associated with. WindowIdentities []types.MaintenanceWindowIdentityForTarget // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeMaintenanceWindowsForTargetMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindowsForTarget{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeMaintenanceWindowsForTarget{}, 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 = addOpDescribeMaintenanceWindowsForTargetValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceWindowsForTarget(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 } // DescribeMaintenanceWindowsForTargetAPIClient is a client that implements the // DescribeMaintenanceWindowsForTarget operation. type DescribeMaintenanceWindowsForTargetAPIClient interface { DescribeMaintenanceWindowsForTarget(context.Context, *DescribeMaintenanceWindowsForTargetInput, ...func(*Options)) (*DescribeMaintenanceWindowsForTargetOutput, error) } var _ DescribeMaintenanceWindowsForTargetAPIClient = (*Client)(nil) // DescribeMaintenanceWindowsForTargetPaginatorOptions is the paginator options // for DescribeMaintenanceWindowsForTarget type DescribeMaintenanceWindowsForTargetPaginatorOptions struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set 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 } // DescribeMaintenanceWindowsForTargetPaginator is a paginator for // DescribeMaintenanceWindowsForTarget type DescribeMaintenanceWindowsForTargetPaginator struct { options DescribeMaintenanceWindowsForTargetPaginatorOptions client DescribeMaintenanceWindowsForTargetAPIClient params *DescribeMaintenanceWindowsForTargetInput nextToken *string firstPage bool } // NewDescribeMaintenanceWindowsForTargetPaginator returns a new // DescribeMaintenanceWindowsForTargetPaginator func NewDescribeMaintenanceWindowsForTargetPaginator(client DescribeMaintenanceWindowsForTargetAPIClient, params *DescribeMaintenanceWindowsForTargetInput, optFns ...func(*DescribeMaintenanceWindowsForTargetPaginatorOptions)) *DescribeMaintenanceWindowsForTargetPaginator { if params == nil { params = &DescribeMaintenanceWindowsForTargetInput{} } options := DescribeMaintenanceWindowsForTargetPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeMaintenanceWindowsForTargetPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeMaintenanceWindowsForTargetPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeMaintenanceWindowsForTarget page. func (p *DescribeMaintenanceWindowsForTargetPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowsForTargetOutput, 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.DescribeMaintenanceWindowsForTarget(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeMaintenanceWindowsForTarget(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ssm", OperationName: "DescribeMaintenanceWindowsForTarget", } }
240