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 migrationhubstrategy 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/migrationhubstrategy/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 = "awsmigrationhubstrategyrecommendation" } 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 migrationhubstrategy // goModuleVersion is the tagged release for this module const goModuleVersion = "1.9.7"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhubstrategy
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhubstrategy import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/migrationhubstrategy/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) type awsRestjson1_serializeOpGetApplicationComponentDetails struct { } func (*awsRestjson1_serializeOpGetApplicationComponentDetails) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetApplicationComponentDetails) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetApplicationComponentDetailsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/get-applicationcomponent-details/{applicationComponentId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetApplicationComponentDetailsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetApplicationComponentDetailsInput(v *GetApplicationComponentDetailsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationComponentId == nil || len(*v.ApplicationComponentId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationComponentId must not be empty")} } if v.ApplicationComponentId != nil { if err := encoder.SetURI("applicationComponentId").String(*v.ApplicationComponentId); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetApplicationComponentStrategies struct { } func (*awsRestjson1_serializeOpGetApplicationComponentStrategies) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetApplicationComponentStrategies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetApplicationComponentStrategiesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/get-applicationcomponent-strategies/{applicationComponentId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetApplicationComponentStrategiesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetApplicationComponentStrategiesInput(v *GetApplicationComponentStrategiesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationComponentId == nil || len(*v.ApplicationComponentId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationComponentId must not be empty")} } if v.ApplicationComponentId != nil { if err := encoder.SetURI("applicationComponentId").String(*v.ApplicationComponentId); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetAssessment struct { } func (*awsRestjson1_serializeOpGetAssessment) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetAssessment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetAssessmentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/get-assessment/{id}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetAssessmentInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetAssessmentInput(v *GetAssessmentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Id == nil || len(*v.Id) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} } if v.Id != nil { if err := encoder.SetURI("id").String(*v.Id); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetImportFileTask struct { } func (*awsRestjson1_serializeOpGetImportFileTask) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetImportFileTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetImportFileTaskInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/get-import-file-task/{id}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetImportFileTaskInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetImportFileTaskInput(v *GetImportFileTaskInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Id == nil || len(*v.Id) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} } if v.Id != nil { if err := encoder.SetURI("id").String(*v.Id); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetLatestAssessmentId struct { } func (*awsRestjson1_serializeOpGetLatestAssessmentId) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetLatestAssessmentId) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetLatestAssessmentIdInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/get-latest-assessment-id") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetLatestAssessmentIdInput(v *GetLatestAssessmentIdInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpGetPortfolioPreferences struct { } func (*awsRestjson1_serializeOpGetPortfolioPreferences) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetPortfolioPreferences) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetPortfolioPreferencesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/get-portfolio-preferences") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetPortfolioPreferencesInput(v *GetPortfolioPreferencesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpGetPortfolioSummary struct { } func (*awsRestjson1_serializeOpGetPortfolioSummary) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetPortfolioSummary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetPortfolioSummaryInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/get-portfolio-summary") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetPortfolioSummaryInput(v *GetPortfolioSummaryInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpGetRecommendationReportDetails struct { } func (*awsRestjson1_serializeOpGetRecommendationReportDetails) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetRecommendationReportDetails) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetRecommendationReportDetailsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/get-recommendation-report-details/{id}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetRecommendationReportDetailsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetRecommendationReportDetailsInput(v *GetRecommendationReportDetailsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Id == nil || len(*v.Id) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} } if v.Id != nil { if err := encoder.SetURI("id").String(*v.Id); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetServerDetails struct { } func (*awsRestjson1_serializeOpGetServerDetails) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetServerDetails) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetServerDetailsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/get-server-details/{serverId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetServerDetailsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetServerDetailsInput(v *GetServerDetailsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if v.ServerId == nil || len(*v.ServerId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member serverId must not be empty")} } if v.ServerId != nil { if err := encoder.SetURI("serverId").String(*v.ServerId); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetServerStrategies struct { } func (*awsRestjson1_serializeOpGetServerStrategies) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetServerStrategies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetServerStrategiesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/get-server-strategies/{serverId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetServerStrategiesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetServerStrategiesInput(v *GetServerStrategiesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ServerId == nil || len(*v.ServerId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member serverId must not be empty")} } if v.ServerId != nil { if err := encoder.SetURI("serverId").String(*v.ServerId); err != nil { return err } } return nil } type awsRestjson1_serializeOpListApplicationComponents struct { } func (*awsRestjson1_serializeOpListApplicationComponents) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListApplicationComponents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListApplicationComponentsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/list-applicationcomponents") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentListApplicationComponentsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListApplicationComponentsInput(v *ListApplicationComponentsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListApplicationComponentsInput(v *ListApplicationComponentsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.ApplicationComponentCriteria) > 0 { ok := object.Key("applicationComponentCriteria") ok.String(string(v.ApplicationComponentCriteria)) } if v.FilterValue != nil { ok := object.Key("filterValue") ok.String(*v.FilterValue) } if v.GroupIdFilter != nil { ok := object.Key("groupIdFilter") if err := awsRestjson1_serializeDocumentGroupIds(v.GroupIdFilter, ok); err != nil { return err } } if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if len(v.Sort) > 0 { ok := object.Key("sort") ok.String(string(v.Sort)) } return nil } type awsRestjson1_serializeOpListCollectors struct { } func (*awsRestjson1_serializeOpListCollectors) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListCollectors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListCollectorsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/list-collectors") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListCollectorsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListCollectorsInput(v *ListCollectorsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListImportFileTask struct { } func (*awsRestjson1_serializeOpListImportFileTask) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListImportFileTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListImportFileTaskInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/list-import-file-task") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListImportFileTaskInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListImportFileTaskInput(v *ListImportFileTaskInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListServers struct { } func (*awsRestjson1_serializeOpListServers) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListServers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListServersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/list-servers") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentListServersInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListServersInput(v *ListServersInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListServersInput(v *ListServersInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.FilterValue != nil { ok := object.Key("filterValue") ok.String(*v.FilterValue) } if v.GroupIdFilter != nil { ok := object.Key("groupIdFilter") if err := awsRestjson1_serializeDocumentGroupIds(v.GroupIdFilter, ok); err != nil { return err } } if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if len(v.ServerCriteria) > 0 { ok := object.Key("serverCriteria") ok.String(string(v.ServerCriteria)) } if len(v.Sort) > 0 { ok := object.Key("sort") ok.String(string(v.Sort)) } return nil } type awsRestjson1_serializeOpPutPortfolioPreferences struct { } func (*awsRestjson1_serializeOpPutPortfolioPreferences) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpPutPortfolioPreferences) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*PutPortfolioPreferencesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/put-portfolio-preferences") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentPutPortfolioPreferencesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsPutPortfolioPreferencesInput(v *PutPortfolioPreferencesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentPutPortfolioPreferencesInput(v *PutPortfolioPreferencesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.ApplicationMode) > 0 { ok := object.Key("applicationMode") ok.String(string(v.ApplicationMode)) } if v.ApplicationPreferences != nil { ok := object.Key("applicationPreferences") if err := awsRestjson1_serializeDocumentApplicationPreferences(v.ApplicationPreferences, ok); err != nil { return err } } if v.DatabasePreferences != nil { ok := object.Key("databasePreferences") if err := awsRestjson1_serializeDocumentDatabasePreferences(v.DatabasePreferences, ok); err != nil { return err } } if v.PrioritizeBusinessGoals != nil { ok := object.Key("prioritizeBusinessGoals") if err := awsRestjson1_serializeDocumentPrioritizeBusinessGoals(v.PrioritizeBusinessGoals, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpStartAssessment struct { } func (*awsRestjson1_serializeOpStartAssessment) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartAssessment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartAssessmentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/start-assessment") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentStartAssessmentInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsStartAssessmentInput(v *StartAssessmentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentStartAssessmentInput(v *StartAssessmentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssessmentTargets != nil { ok := object.Key("assessmentTargets") if err := awsRestjson1_serializeDocumentAssessmentTargets(v.AssessmentTargets, ok); err != nil { return err } } if v.S3bucketForAnalysisData != nil { ok := object.Key("s3bucketForAnalysisData") ok.String(*v.S3bucketForAnalysisData) } if v.S3bucketForReportData != nil { ok := object.Key("s3bucketForReportData") ok.String(*v.S3bucketForReportData) } return nil } type awsRestjson1_serializeOpStartImportFileTask struct { } func (*awsRestjson1_serializeOpStartImportFileTask) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartImportFileTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartImportFileTaskInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/start-import-file-task") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentStartImportFileTaskInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsStartImportFileTaskInput(v *StartImportFileTaskInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentStartImportFileTaskInput(v *StartImportFileTaskInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.DataSourceType) > 0 { ok := object.Key("dataSourceType") ok.String(string(v.DataSourceType)) } if v.GroupId != nil { ok := object.Key("groupId") if err := awsRestjson1_serializeDocumentGroupIds(v.GroupId, ok); err != nil { return err } } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.S3Bucket != nil { ok := object.Key("S3Bucket") ok.String(*v.S3Bucket) } if v.S3bucketForReportData != nil { ok := object.Key("s3bucketForReportData") ok.String(*v.S3bucketForReportData) } if v.S3key != nil { ok := object.Key("s3key") ok.String(*v.S3key) } return nil } type awsRestjson1_serializeOpStartRecommendationReportGeneration struct { } func (*awsRestjson1_serializeOpStartRecommendationReportGeneration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartRecommendationReportGeneration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartRecommendationReportGenerationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/start-recommendation-report-generation") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentStartRecommendationReportGenerationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsStartRecommendationReportGenerationInput(v *StartRecommendationReportGenerationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentStartRecommendationReportGenerationInput(v *StartRecommendationReportGenerationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.GroupIdFilter != nil { ok := object.Key("groupIdFilter") if err := awsRestjson1_serializeDocumentGroupIds(v.GroupIdFilter, ok); err != nil { return err } } if len(v.OutputFormat) > 0 { ok := object.Key("outputFormat") ok.String(string(v.OutputFormat)) } return nil } type awsRestjson1_serializeOpStopAssessment struct { } func (*awsRestjson1_serializeOpStopAssessment) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStopAssessment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StopAssessmentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/stop-assessment") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentStopAssessmentInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsStopAssessmentInput(v *StopAssessmentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentStopAssessmentInput(v *StopAssessmentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssessmentId != nil { ok := object.Key("assessmentId") ok.String(*v.AssessmentId) } return nil } type awsRestjson1_serializeOpUpdateApplicationComponentConfig struct { } func (*awsRestjson1_serializeOpUpdateApplicationComponentConfig) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateApplicationComponentConfig) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateApplicationComponentConfigInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/update-applicationcomponent-config/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateApplicationComponentConfigInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUpdateApplicationComponentConfigInput(v *UpdateApplicationComponentConfigInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateApplicationComponentConfigInput(v *UpdateApplicationComponentConfigInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ApplicationComponentId != nil { ok := object.Key("applicationComponentId") ok.String(*v.ApplicationComponentId) } if len(v.AppType) > 0 { ok := object.Key("appType") ok.String(string(v.AppType)) } if v.ConfigureOnly != nil { ok := object.Key("configureOnly") ok.Boolean(*v.ConfigureOnly) } if len(v.InclusionStatus) > 0 { ok := object.Key("inclusionStatus") ok.String(string(v.InclusionStatus)) } if v.SecretsManagerKey != nil { ok := object.Key("secretsManagerKey") ok.String(*v.SecretsManagerKey) } if v.SourceCodeList != nil { ok := object.Key("sourceCodeList") if err := awsRestjson1_serializeDocumentSourceCodeList(v.SourceCodeList, ok); err != nil { return err } } if v.StrategyOption != nil { ok := object.Key("strategyOption") if err := awsRestjson1_serializeDocumentStrategyOption(v.StrategyOption, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdateServerConfig struct { } func (*awsRestjson1_serializeOpUpdateServerConfig) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateServerConfig) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateServerConfigInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/update-server-config/") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateServerConfigInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUpdateServerConfigInput(v *UpdateServerConfigInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateServerConfigInput(v *UpdateServerConfigInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ServerId != nil { ok := object.Key("serverId") ok.String(*v.ServerId) } if v.StrategyOption != nil { ok := object.Key("strategyOption") if err := awsRestjson1_serializeDocumentStrategyOption(v.StrategyOption, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentApplicationPreferences(v *types.ApplicationPreferences, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ManagementPreference != nil { ok := object.Key("managementPreference") if err := awsRestjson1_serializeDocumentManagementPreference(v.ManagementPreference, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentAssessmentTarget(v *types.AssessmentTarget, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Condition) > 0 { ok := object.Key("condition") ok.String(string(v.Condition)) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Values != nil { ok := object.Key("values") if err := awsRestjson1_serializeDocumentAssessmentTargetValues(v.Values, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentAssessmentTargets(v []types.AssessmentTarget, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentAssessmentTarget(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentAssessmentTargetValues(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentAwsManagedResources(v *types.AwsManagedResources, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.TargetDestination != nil { ok := object.Key("targetDestination") if err := awsRestjson1_serializeDocumentAwsManagedTargetDestinations(v.TargetDestination, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentAwsManagedTargetDestinations(v []types.AwsManagedTargetDestination, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(string(v[i])) } return nil } func awsRestjson1_serializeDocumentBusinessGoals(v *types.BusinessGoals, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.LicenseCostReduction != nil { ok := object.Key("licenseCostReduction") ok.Integer(*v.LicenseCostReduction) } if v.ModernizeInfrastructureWithCloudNativeTechnologies != nil { ok := object.Key("modernizeInfrastructureWithCloudNativeTechnologies") ok.Integer(*v.ModernizeInfrastructureWithCloudNativeTechnologies) } if v.ReduceOperationalOverheadWithManagedServices != nil { ok := object.Key("reduceOperationalOverheadWithManagedServices") ok.Integer(*v.ReduceOperationalOverheadWithManagedServices) } if v.SpeedOfMigration != nil { ok := object.Key("speedOfMigration") ok.Integer(*v.SpeedOfMigration) } return nil } func awsRestjson1_serializeDocumentDatabaseMigrationPreference(v types.DatabaseMigrationPreference, value smithyjson.Value) error { object := value.Object() defer object.Close() switch uv := v.(type) { case *types.DatabaseMigrationPreferenceMemberHeterogeneous: av := object.Key("heterogeneous") if err := awsRestjson1_serializeDocumentHeterogeneous(&uv.Value, av); err != nil { return err } case *types.DatabaseMigrationPreferenceMemberHomogeneous: av := object.Key("homogeneous") if err := awsRestjson1_serializeDocumentHomogeneous(&uv.Value, av); err != nil { return err } case *types.DatabaseMigrationPreferenceMemberNoPreference: av := object.Key("noPreference") if err := awsRestjson1_serializeDocumentNoDatabaseMigrationPreference(&uv.Value, av); err != nil { return err } default: return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) } return nil } func awsRestjson1_serializeDocumentDatabasePreferences(v *types.DatabasePreferences, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.DatabaseManagementPreference) > 0 { ok := object.Key("databaseManagementPreference") ok.String(string(v.DatabaseManagementPreference)) } if v.DatabaseMigrationPreference != nil { ok := object.Key("databaseMigrationPreference") if err := awsRestjson1_serializeDocumentDatabaseMigrationPreference(v.DatabaseMigrationPreference, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentGroup(v *types.Group, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Name) > 0 { ok := object.Key("name") ok.String(string(v.Name)) } if v.Value != nil { ok := object.Key("value") ok.String(*v.Value) } return nil } func awsRestjson1_serializeDocumentGroupIds(v []types.Group, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentGroup(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentHeterogeneous(v *types.Heterogeneous, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.TargetDatabaseEngine != nil { ok := object.Key("targetDatabaseEngine") if err := awsRestjson1_serializeDocumentHeterogeneousTargetDatabaseEngines(v.TargetDatabaseEngine, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentHeterogeneousTargetDatabaseEngines(v []types.HeterogeneousTargetDatabaseEngine, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(string(v[i])) } return nil } func awsRestjson1_serializeDocumentHomogeneous(v *types.Homogeneous, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.TargetDatabaseEngine != nil { ok := object.Key("targetDatabaseEngine") if err := awsRestjson1_serializeDocumentHomogeneousTargetDatabaseEngines(v.TargetDatabaseEngine, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentHomogeneousTargetDatabaseEngines(v []types.HomogeneousTargetDatabaseEngine, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(string(v[i])) } return nil } func awsRestjson1_serializeDocumentManagementPreference(v types.ManagementPreference, value smithyjson.Value) error { object := value.Object() defer object.Close() switch uv := v.(type) { case *types.ManagementPreferenceMemberAwsManagedResources: av := object.Key("awsManagedResources") if err := awsRestjson1_serializeDocumentAwsManagedResources(&uv.Value, av); err != nil { return err } case *types.ManagementPreferenceMemberNoPreference: av := object.Key("noPreference") if err := awsRestjson1_serializeDocumentNoManagementPreference(&uv.Value, av); err != nil { return err } case *types.ManagementPreferenceMemberSelfManageResources: av := object.Key("selfManageResources") if err := awsRestjson1_serializeDocumentSelfManageResources(&uv.Value, av); err != nil { return err } default: return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) } return nil } func awsRestjson1_serializeDocumentNoDatabaseMigrationPreference(v *types.NoDatabaseMigrationPreference, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.TargetDatabaseEngine != nil { ok := object.Key("targetDatabaseEngine") if err := awsRestjson1_serializeDocumentTargetDatabaseEngines(v.TargetDatabaseEngine, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentNoManagementPreference(v *types.NoManagementPreference, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.TargetDestination != nil { ok := object.Key("targetDestination") if err := awsRestjson1_serializeDocumentNoPreferenceTargetDestinations(v.TargetDestination, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentNoPreferenceTargetDestinations(v []types.NoPreferenceTargetDestination, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(string(v[i])) } return nil } func awsRestjson1_serializeDocumentPrioritizeBusinessGoals(v *types.PrioritizeBusinessGoals, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BusinessGoals != nil { ok := object.Key("businessGoals") if err := awsRestjson1_serializeDocumentBusinessGoals(v.BusinessGoals, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSelfManageResources(v *types.SelfManageResources, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.TargetDestination != nil { ok := object.Key("targetDestination") if err := awsRestjson1_serializeDocumentSelfManageTargetDestinations(v.TargetDestination, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSelfManageTargetDestinations(v []types.SelfManageTargetDestination, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(string(v[i])) } return nil } func awsRestjson1_serializeDocumentSourceCode(v *types.SourceCode, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Location != nil { ok := object.Key("location") ok.String(*v.Location) } if v.ProjectName != nil { ok := object.Key("projectName") ok.String(*v.ProjectName) } if v.SourceVersion != nil { ok := object.Key("sourceVersion") ok.String(*v.SourceVersion) } if len(v.VersionControl) > 0 { ok := object.Key("versionControl") ok.String(string(v.VersionControl)) } return nil } func awsRestjson1_serializeDocumentSourceCodeList(v []types.SourceCode, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentSourceCode(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentStrategyOption(v *types.StrategyOption, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.IsPreferred != nil { ok := object.Key("isPreferred") ok.Boolean(*v.IsPreferred) } if len(v.Strategy) > 0 { ok := object.Key("strategy") ok.String(string(v.Strategy)) } if len(v.TargetDestination) > 0 { ok := object.Key("targetDestination") ok.String(string(v.TargetDestination)) } if len(v.ToolName) > 0 { ok := object.Key("toolName") ok.String(string(v.ToolName)) } return nil } func awsRestjson1_serializeDocumentTargetDatabaseEngines(v []types.TargetDatabaseEngine, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(string(v[i])) } return nil }
1,882
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package migrationhubstrategy import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/migrationhubstrategy/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpGetApplicationComponentDetails struct { } func (*validateOpGetApplicationComponentDetails) ID() string { return "OperationInputValidation" } func (m *validateOpGetApplicationComponentDetails) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetApplicationComponentDetailsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetApplicationComponentDetailsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetApplicationComponentStrategies struct { } func (*validateOpGetApplicationComponentStrategies) ID() string { return "OperationInputValidation" } func (m *validateOpGetApplicationComponentStrategies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetApplicationComponentStrategiesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetApplicationComponentStrategiesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetAssessment struct { } func (*validateOpGetAssessment) ID() string { return "OperationInputValidation" } func (m *validateOpGetAssessment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetAssessmentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetAssessmentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetImportFileTask struct { } func (*validateOpGetImportFileTask) ID() string { return "OperationInputValidation" } func (m *validateOpGetImportFileTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetImportFileTaskInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetImportFileTaskInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetRecommendationReportDetails struct { } func (*validateOpGetRecommendationReportDetails) ID() string { return "OperationInputValidation" } func (m *validateOpGetRecommendationReportDetails) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetRecommendationReportDetailsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetRecommendationReportDetailsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetServerDetails struct { } func (*validateOpGetServerDetails) ID() string { return "OperationInputValidation" } func (m *validateOpGetServerDetails) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetServerDetailsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetServerDetailsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetServerStrategies struct { } func (*validateOpGetServerStrategies) ID() string { return "OperationInputValidation" } func (m *validateOpGetServerStrategies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetServerStrategiesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetServerStrategiesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpPutPortfolioPreferences struct { } func (*validateOpPutPortfolioPreferences) ID() string { return "OperationInputValidation" } func (m *validateOpPutPortfolioPreferences) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PutPortfolioPreferencesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPutPortfolioPreferencesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartAssessment struct { } func (*validateOpStartAssessment) ID() string { return "OperationInputValidation" } func (m *validateOpStartAssessment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartAssessmentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartAssessmentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartImportFileTask struct { } func (*validateOpStartImportFileTask) ID() string { return "OperationInputValidation" } func (m *validateOpStartImportFileTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartImportFileTaskInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartImportFileTaskInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStopAssessment struct { } func (*validateOpStopAssessment) ID() string { return "OperationInputValidation" } func (m *validateOpStopAssessment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StopAssessmentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStopAssessmentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateApplicationComponentConfig struct { } func (*validateOpUpdateApplicationComponentConfig) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateApplicationComponentConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateApplicationComponentConfigInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateApplicationComponentConfigInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateServerConfig struct { } func (*validateOpUpdateServerConfig) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateServerConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateServerConfigInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateServerConfigInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpGetApplicationComponentDetailsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetApplicationComponentDetails{}, middleware.After) } func addOpGetApplicationComponentStrategiesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetApplicationComponentStrategies{}, middleware.After) } func addOpGetAssessmentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetAssessment{}, middleware.After) } func addOpGetImportFileTaskValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetImportFileTask{}, middleware.After) } func addOpGetRecommendationReportDetailsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetRecommendationReportDetails{}, middleware.After) } func addOpGetServerDetailsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetServerDetails{}, middleware.After) } func addOpGetServerStrategiesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetServerStrategies{}, middleware.After) } func addOpPutPortfolioPreferencesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutPortfolioPreferences{}, middleware.After) } func addOpStartAssessmentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartAssessment{}, middleware.After) } func addOpStartImportFileTaskValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartImportFileTask{}, middleware.After) } func addOpStopAssessmentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStopAssessment{}, middleware.After) } func addOpUpdateApplicationComponentConfigValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateApplicationComponentConfig{}, middleware.After) } func addOpUpdateServerConfigValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateServerConfig{}, middleware.After) } func validateApplicationPreferences(v *types.ApplicationPreferences) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ApplicationPreferences"} if v.ManagementPreference != nil { if err := validateManagementPreference(v.ManagementPreference); err != nil { invalidParams.AddNested("ManagementPreference", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateAssessmentTarget(v *types.AssessmentTarget) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AssessmentTarget"} if len(v.Condition) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Condition")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Values == nil { invalidParams.Add(smithy.NewErrParamRequired("Values")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateAssessmentTargets(v []types.AssessmentTarget) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AssessmentTargets"} for i := range v { if err := validateAssessmentTarget(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateAwsManagedResources(v *types.AwsManagedResources) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AwsManagedResources"} if v.TargetDestination == nil { invalidParams.Add(smithy.NewErrParamRequired("TargetDestination")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDatabaseMigrationPreference(v types.DatabaseMigrationPreference) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DatabaseMigrationPreference"} switch uv := v.(type) { case *types.DatabaseMigrationPreferenceMemberHeterogeneous: if err := validateHeterogeneous(&uv.Value); err != nil { invalidParams.AddNested("[heterogeneous]", err.(smithy.InvalidParamsError)) } case *types.DatabaseMigrationPreferenceMemberNoPreference: if err := validateNoDatabaseMigrationPreference(&uv.Value); err != nil { invalidParams.AddNested("[noPreference]", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDatabasePreferences(v *types.DatabasePreferences) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DatabasePreferences"} if v.DatabaseMigrationPreference != nil { if err := validateDatabaseMigrationPreference(v.DatabaseMigrationPreference); err != nil { invalidParams.AddNested("DatabaseMigrationPreference", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateHeterogeneous(v *types.Heterogeneous) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Heterogeneous"} if v.TargetDatabaseEngine == nil { invalidParams.Add(smithy.NewErrParamRequired("TargetDatabaseEngine")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateManagementPreference(v types.ManagementPreference) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ManagementPreference"} switch uv := v.(type) { case *types.ManagementPreferenceMemberAwsManagedResources: if err := validateAwsManagedResources(&uv.Value); err != nil { invalidParams.AddNested("[awsManagedResources]", err.(smithy.InvalidParamsError)) } case *types.ManagementPreferenceMemberNoPreference: if err := validateNoManagementPreference(&uv.Value); err != nil { invalidParams.AddNested("[noPreference]", err.(smithy.InvalidParamsError)) } case *types.ManagementPreferenceMemberSelfManageResources: if err := validateSelfManageResources(&uv.Value); err != nil { invalidParams.AddNested("[selfManageResources]", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateNoDatabaseMigrationPreference(v *types.NoDatabaseMigrationPreference) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "NoDatabaseMigrationPreference"} if v.TargetDatabaseEngine == nil { invalidParams.Add(smithy.NewErrParamRequired("TargetDatabaseEngine")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateNoManagementPreference(v *types.NoManagementPreference) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "NoManagementPreference"} if v.TargetDestination == nil { invalidParams.Add(smithy.NewErrParamRequired("TargetDestination")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateSelfManageResources(v *types.SelfManageResources) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SelfManageResources"} if v.TargetDestination == nil { invalidParams.Add(smithy.NewErrParamRequired("TargetDestination")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetApplicationComponentDetailsInput(v *GetApplicationComponentDetailsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetApplicationComponentDetailsInput"} if v.ApplicationComponentId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationComponentId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetApplicationComponentStrategiesInput(v *GetApplicationComponentStrategiesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetApplicationComponentStrategiesInput"} if v.ApplicationComponentId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationComponentId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetAssessmentInput(v *GetAssessmentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetAssessmentInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetImportFileTaskInput(v *GetImportFileTaskInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetImportFileTaskInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetRecommendationReportDetailsInput(v *GetRecommendationReportDetailsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetRecommendationReportDetailsInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetServerDetailsInput(v *GetServerDetailsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetServerDetailsInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetServerStrategiesInput(v *GetServerStrategiesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetServerStrategiesInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpPutPortfolioPreferencesInput(v *PutPortfolioPreferencesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PutPortfolioPreferencesInput"} if v.ApplicationPreferences != nil { if err := validateApplicationPreferences(v.ApplicationPreferences); err != nil { invalidParams.AddNested("ApplicationPreferences", err.(smithy.InvalidParamsError)) } } if v.DatabasePreferences != nil { if err := validateDatabasePreferences(v.DatabasePreferences); err != nil { invalidParams.AddNested("DatabasePreferences", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartAssessmentInput(v *StartAssessmentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartAssessmentInput"} if v.AssessmentTargets != nil { if err := validateAssessmentTargets(v.AssessmentTargets); err != nil { invalidParams.AddNested("AssessmentTargets", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartImportFileTaskInput(v *StartImportFileTaskInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartImportFileTaskInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.S3Bucket == nil { invalidParams.Add(smithy.NewErrParamRequired("S3Bucket")) } if v.S3key == nil { invalidParams.Add(smithy.NewErrParamRequired("S3key")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStopAssessmentInput(v *StopAssessmentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StopAssessmentInput"} if v.AssessmentId == nil { invalidParams.Add(smithy.NewErrParamRequired("AssessmentId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateApplicationComponentConfigInput(v *UpdateApplicationComponentConfigInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateApplicationComponentConfigInput"} if v.ApplicationComponentId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationComponentId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateServerConfigInput(v *UpdateServerConfigInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateServerConfigInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
734
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 MigrationHubStrategy endpoint resolver type Resolver struct { partitions endpoints.Partitions } // ResolveEndpoint resolves the service endpoint for the given region and options func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { if len(region) == 0 { return endpoint, &aws.MissingRegionError{} } opt := transformToSharedOptions(options) return r.partitions.ResolveEndpoint(region, opt) } // New returns a new Resolver func New() *Resolver { return &Resolver{ partitions: defaultPartitions, } } var partitionRegexp = struct { Aws *regexp.Regexp AwsCn *regexp.Regexp AwsIso *regexp.Regexp AwsIsoB *regexp.Regexp AwsIsoE *regexp.Regexp AwsIsoF *regexp.Regexp AwsUsGov *regexp.Regexp }{ Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), } var defaultPartitions = endpoints.Partitions{ { ID: "aws", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "migrationhub-strategy.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "migrationhub-strategy-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "migrationhub-strategy-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "migrationhub-strategy.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "migrationhub-strategy.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "migrationhub-strategy-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "migrationhub-strategy-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "migrationhub-strategy.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, }, { ID: "aws-iso", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "migrationhub-strategy-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "migrationhub-strategy.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, }, { ID: "aws-iso-b", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "migrationhub-strategy-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "migrationhub-strategy.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, }, { ID: "aws-iso-e", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "migrationhub-strategy-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "migrationhub-strategy.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoE, IsRegionalized: true, }, { ID: "aws-iso-f", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "migrationhub-strategy-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "migrationhub-strategy.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoF, IsRegionalized: true, }, { ID: "aws-us-gov", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "migrationhub-strategy.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "migrationhub-strategy-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "migrationhub-strategy-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "migrationhub-strategy.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, }, }
320
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package endpoints import ( "testing" ) func TestRegexCompile(t *testing.T) { _ = defaultPartitions }
12
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types type AnalysisType string // Enum values for AnalysisType const ( AnalysisTypeSourceCodeAnalysis AnalysisType = "SOURCE_CODE_ANALYSIS" AnalysisTypeDatabaseAnalysis AnalysisType = "DATABASE_ANALYSIS" AnalysisTypeRuntimeAnalysis AnalysisType = "RUNTIME_ANALYSIS" AnalysisTypeBinaryAnalysis AnalysisType = "BINARY_ANALYSIS" ) // Values returns all known values for AnalysisType. 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 (AnalysisType) Values() []AnalysisType { return []AnalysisType{ "SOURCE_CODE_ANALYSIS", "DATABASE_ANALYSIS", "RUNTIME_ANALYSIS", "BINARY_ANALYSIS", } } type AntipatternReportStatus string // Enum values for AntipatternReportStatus const ( AntipatternReportStatusFailed AntipatternReportStatus = "FAILED" AntipatternReportStatusInProgress AntipatternReportStatus = "IN_PROGRESS" AntipatternReportStatusSuccess AntipatternReportStatus = "SUCCESS" ) // Values returns all known values for AntipatternReportStatus. 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 (AntipatternReportStatus) Values() []AntipatternReportStatus { return []AntipatternReportStatus{ "FAILED", "IN_PROGRESS", "SUCCESS", } } type ApplicationComponentCriteria string // Enum values for ApplicationComponentCriteria const ( ApplicationComponentCriteriaNotDefined ApplicationComponentCriteria = "NOT_DEFINED" ApplicationComponentCriteriaAppName ApplicationComponentCriteria = "APP_NAME" ApplicationComponentCriteriaServerId ApplicationComponentCriteria = "SERVER_ID" ApplicationComponentCriteriaAppType ApplicationComponentCriteria = "APP_TYPE" ApplicationComponentCriteriaStrategy ApplicationComponentCriteria = "STRATEGY" ApplicationComponentCriteriaDestination ApplicationComponentCriteria = "DESTINATION" ApplicationComponentCriteriaAnalysisStatus ApplicationComponentCriteria = "ANALYSIS_STATUS" ApplicationComponentCriteriaErrorCategory ApplicationComponentCriteria = "ERROR_CATEGORY" ) // Values returns all known values for ApplicationComponentCriteria. 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 (ApplicationComponentCriteria) Values() []ApplicationComponentCriteria { return []ApplicationComponentCriteria{ "NOT_DEFINED", "APP_NAME", "SERVER_ID", "APP_TYPE", "STRATEGY", "DESTINATION", "ANALYSIS_STATUS", "ERROR_CATEGORY", } } type ApplicationMode string // Enum values for ApplicationMode const ( ApplicationModeAll ApplicationMode = "ALL" ApplicationModeKnown ApplicationMode = "KNOWN" ApplicationModeUnknown ApplicationMode = "UNKNOWN" ) // Values returns all known values for ApplicationMode. 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 (ApplicationMode) Values() []ApplicationMode { return []ApplicationMode{ "ALL", "KNOWN", "UNKNOWN", } } type AppType string // Enum values for AppType const ( AppTypeDotNetFramework AppType = "DotNetFramework" AppTypeJava AppType = "Java" AppTypeSqlServer AppType = "SQLServer" AppTypeIis AppType = "IIS" AppTypeOracle AppType = "Oracle" AppTypeOther AppType = "Other" AppTypeTomcat AppType = "Tomcat" AppTypeJboss AppType = "JBoss" AppTypeSpring AppType = "Spring" AppTypeMongodb AppType = "Mongo DB" AppTypeDb2 AppType = "DB2" AppTypeMariadb AppType = "Maria DB" AppTypeMysql AppType = "MySQL" AppTypeSybase AppType = "Sybase" AppTypePostgresqlserver AppType = "PostgreSQLServer" AppTypeCassandra AppType = "Cassandra" AppTypeWebsphere AppType = "IBM WebSphere" AppTypeWeblogic AppType = "Oracle WebLogic" AppTypeVisualbasic AppType = "Visual Basic" AppTypeUnknown AppType = "Unknown" AppTypeDotnetcore AppType = "DotnetCore" AppTypeDotnet AppType = "Dotnet" ) // Values returns all known values for AppType. 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 (AppType) Values() []AppType { return []AppType{ "DotNetFramework", "Java", "SQLServer", "IIS", "Oracle", "Other", "Tomcat", "JBoss", "Spring", "Mongo DB", "DB2", "Maria DB", "MySQL", "Sybase", "PostgreSQLServer", "Cassandra", "IBM WebSphere", "Oracle WebLogic", "Visual Basic", "Unknown", "DotnetCore", "Dotnet", } } type AppUnitErrorCategory string // Enum values for AppUnitErrorCategory const ( AppUnitErrorCategoryCredentialError AppUnitErrorCategory = "CREDENTIAL_ERROR" AppUnitErrorCategoryConnectivityError AppUnitErrorCategory = "CONNECTIVITY_ERROR" AppUnitErrorCategoryPermissionError AppUnitErrorCategory = "PERMISSION_ERROR" AppUnitErrorCategoryUnsupportedError AppUnitErrorCategory = "UNSUPPORTED_ERROR" AppUnitErrorCategoryOtherError AppUnitErrorCategory = "OTHER_ERROR" ) // Values returns all known values for AppUnitErrorCategory. 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 (AppUnitErrorCategory) Values() []AppUnitErrorCategory { return []AppUnitErrorCategory{ "CREDENTIAL_ERROR", "CONNECTIVITY_ERROR", "PERMISSION_ERROR", "UNSUPPORTED_ERROR", "OTHER_ERROR", } } type AssessmentStatus string // Enum values for AssessmentStatus const ( AssessmentStatusInProgress AssessmentStatus = "IN_PROGRESS" AssessmentStatusComplete AssessmentStatus = "COMPLETE" AssessmentStatusFailed AssessmentStatus = "FAILED" AssessmentStatusStopped AssessmentStatus = "STOPPED" ) // Values returns all known values for AssessmentStatus. 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 (AssessmentStatus) Values() []AssessmentStatus { return []AssessmentStatus{ "IN_PROGRESS", "COMPLETE", "FAILED", "STOPPED", } } type AuthType string // Enum values for AuthType const ( AuthTypeNtlm AuthType = "NTLM" AuthTypeSsh AuthType = "SSH" AuthTypeCert AuthType = "CERT" ) // Values returns all known values for AuthType. 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 (AuthType) Values() []AuthType { return []AuthType{ "NTLM", "SSH", "CERT", } } type AwsManagedTargetDestination string // Enum values for AwsManagedTargetDestination const ( AwsManagedTargetDestinationNoneSpecified AwsManagedTargetDestination = "None specified" AwsManagedTargetDestinationAwsElasticBeanstalk AwsManagedTargetDestination = "AWS Elastic BeanStalk" AwsManagedTargetDestinationAwsFargate AwsManagedTargetDestination = "AWS Fargate" ) // Values returns all known values for AwsManagedTargetDestination. 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 (AwsManagedTargetDestination) Values() []AwsManagedTargetDestination { return []AwsManagedTargetDestination{ "None specified", "AWS Elastic BeanStalk", "AWS Fargate", } } type BinaryAnalyzerName string // Enum values for BinaryAnalyzerName const ( BinaryAnalyzerNameDllAnalyzer BinaryAnalyzerName = "DLL_ANALYZER" BinaryAnalyzerNameBytecodeAnalyzer BinaryAnalyzerName = "BYTECODE_ANALYZER" ) // Values returns all known values for BinaryAnalyzerName. 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 (BinaryAnalyzerName) Values() []BinaryAnalyzerName { return []BinaryAnalyzerName{ "DLL_ANALYZER", "BYTECODE_ANALYZER", } } type CollectorHealth string // Enum values for CollectorHealth const ( CollectorHealthCollectorHealthy CollectorHealth = "COLLECTOR_HEALTHY" CollectorHealthCollectorUnhealthy CollectorHealth = "COLLECTOR_UNHEALTHY" ) // Values returns all known values for CollectorHealth. 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 (CollectorHealth) Values() []CollectorHealth { return []CollectorHealth{ "COLLECTOR_HEALTHY", "COLLECTOR_UNHEALTHY", } } type Condition string // Enum values for Condition const ( ConditionEquals Condition = "EQUALS" ConditionNotEquals Condition = "NOT_EQUALS" ConditionContains Condition = "CONTAINS" ConditionNotContains Condition = "NOT_CONTAINS" ) // Values returns all known values for Condition. 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 (Condition) Values() []Condition { return []Condition{ "EQUALS", "NOT_EQUALS", "CONTAINS", "NOT_CONTAINS", } } type DatabaseManagementPreference string // Enum values for DatabaseManagementPreference const ( DatabaseManagementPreferenceAwsManaged DatabaseManagementPreference = "AWS-managed" DatabaseManagementPreferenceSelfManage DatabaseManagementPreference = "Self-manage" DatabaseManagementPreferenceNoPreference DatabaseManagementPreference = "No preference" ) // Values returns all known values for DatabaseManagementPreference. 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 (DatabaseManagementPreference) Values() []DatabaseManagementPreference { return []DatabaseManagementPreference{ "AWS-managed", "Self-manage", "No preference", } } type DataSourceType string // Enum values for DataSourceType const ( DataSourceTypeAds DataSourceType = "ApplicationDiscoveryService" DataSourceTypeMpa DataSourceType = "MPA" DataSourceTypeImport DataSourceType = "Import" ) // Values returns all known values for DataSourceType. 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 (DataSourceType) Values() []DataSourceType { return []DataSourceType{ "ApplicationDiscoveryService", "MPA", "Import", } } type GroupName string // Enum values for GroupName const ( GroupNameExternalId GroupName = "ExternalId" GroupNameExternalSourceType GroupName = "ExternalSourceType" ) // Values returns all known values for GroupName. 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 (GroupName) Values() []GroupName { return []GroupName{ "ExternalId", "ExternalSourceType", } } type HeterogeneousTargetDatabaseEngine string // Enum values for HeterogeneousTargetDatabaseEngine const ( HeterogeneousTargetDatabaseEngineNoneSpecified HeterogeneousTargetDatabaseEngine = "None specified" HeterogeneousTargetDatabaseEngineAmazonAurora HeterogeneousTargetDatabaseEngine = "Amazon Aurora" HeterogeneousTargetDatabaseEngineAwsPostgresql HeterogeneousTargetDatabaseEngine = "AWS PostgreSQL" HeterogeneousTargetDatabaseEngineMysql HeterogeneousTargetDatabaseEngine = "MySQL" HeterogeneousTargetDatabaseEngineMicrosoftSqlServer HeterogeneousTargetDatabaseEngine = "Microsoft SQL Server" HeterogeneousTargetDatabaseEngineOracleDatabase HeterogeneousTargetDatabaseEngine = "Oracle Database" HeterogeneousTargetDatabaseEngineMariaDb HeterogeneousTargetDatabaseEngine = "MariaDB" HeterogeneousTargetDatabaseEngineSap HeterogeneousTargetDatabaseEngine = "SAP" HeterogeneousTargetDatabaseEngineDb2Luw HeterogeneousTargetDatabaseEngine = "Db2 LUW" HeterogeneousTargetDatabaseEngineMongoDb HeterogeneousTargetDatabaseEngine = "MongoDB" ) // Values returns all known values for HeterogeneousTargetDatabaseEngine. 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 (HeterogeneousTargetDatabaseEngine) Values() []HeterogeneousTargetDatabaseEngine { return []HeterogeneousTargetDatabaseEngine{ "None specified", "Amazon Aurora", "AWS PostgreSQL", "MySQL", "Microsoft SQL Server", "Oracle Database", "MariaDB", "SAP", "Db2 LUW", "MongoDB", } } type HomogeneousTargetDatabaseEngine string // Enum values for HomogeneousTargetDatabaseEngine const ( HomogeneousTargetDatabaseEngineNoneSpecified HomogeneousTargetDatabaseEngine = "None specified" ) // Values returns all known values for HomogeneousTargetDatabaseEngine. 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 (HomogeneousTargetDatabaseEngine) Values() []HomogeneousTargetDatabaseEngine { return []HomogeneousTargetDatabaseEngine{ "None specified", } } type ImportFileTaskStatus string // Enum values for ImportFileTaskStatus const ( ImportFileTaskStatusImportInProgress ImportFileTaskStatus = "ImportInProgress" ImportFileTaskStatusImportFailed ImportFileTaskStatus = "ImportFailed" ImportFileTaskStatusImportPartialSuccess ImportFileTaskStatus = "ImportPartialSuccess" ImportFileTaskStatusImportSuccess ImportFileTaskStatus = "ImportSuccess" ImportFileTaskStatusDeleteInProgress ImportFileTaskStatus = "DeleteInProgress" ImportFileTaskStatusDeleteFailed ImportFileTaskStatus = "DeleteFailed" ImportFileTaskStatusDeletePartialSuccess ImportFileTaskStatus = "DeletePartialSuccess" ImportFileTaskStatusDeleteSuccess ImportFileTaskStatus = "DeleteSuccess" ) // Values returns all known values for ImportFileTaskStatus. 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 (ImportFileTaskStatus) Values() []ImportFileTaskStatus { return []ImportFileTaskStatus{ "ImportInProgress", "ImportFailed", "ImportPartialSuccess", "ImportSuccess", "DeleteInProgress", "DeleteFailed", "DeletePartialSuccess", "DeleteSuccess", } } type InclusionStatus string // Enum values for InclusionStatus const ( InclusionStatusExcludeFromRecommendation InclusionStatus = "excludeFromAssessment" InclusionStatusIncludeInRecommendation InclusionStatus = "includeInAssessment" ) // Values returns all known values for InclusionStatus. 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 (InclusionStatus) Values() []InclusionStatus { return []InclusionStatus{ "excludeFromAssessment", "includeInAssessment", } } type NoPreferenceTargetDestination string // Enum values for NoPreferenceTargetDestination const ( NoPreferenceTargetDestinationNoneSpecified NoPreferenceTargetDestination = "None specified" NoPreferenceTargetDestinationAwsElasticBeanstalk NoPreferenceTargetDestination = "AWS Elastic BeanStalk" NoPreferenceTargetDestinationAwsFargate NoPreferenceTargetDestination = "AWS Fargate" NoPreferenceTargetDestinationAmazonElasticCloudCompute NoPreferenceTargetDestination = "Amazon Elastic Cloud Compute (EC2)" NoPreferenceTargetDestinationAmazonElasticContainerService NoPreferenceTargetDestination = "Amazon Elastic Container Service (ECS)" NoPreferenceTargetDestinationAmazonElasticKubernetesService NoPreferenceTargetDestination = "Amazon Elastic Kubernetes Service (EKS)" ) // Values returns all known values for NoPreferenceTargetDestination. 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 (NoPreferenceTargetDestination) Values() []NoPreferenceTargetDestination { return []NoPreferenceTargetDestination{ "None specified", "AWS Elastic BeanStalk", "AWS Fargate", "Amazon Elastic Cloud Compute (EC2)", "Amazon Elastic Container Service (ECS)", "Amazon Elastic Kubernetes Service (EKS)", } } type OSType string // Enum values for OSType const ( OSTypeLinux OSType = "LINUX" OSTypeWindows OSType = "WINDOWS" ) // Values returns all known values for OSType. 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 (OSType) Values() []OSType { return []OSType{ "LINUX", "WINDOWS", } } type OutputFormat string // Enum values for OutputFormat const ( OutputFormatExcel OutputFormat = "Excel" OutputFormatJson OutputFormat = "Json" ) // Values returns all known values for OutputFormat. 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 (OutputFormat) Values() []OutputFormat { return []OutputFormat{ "Excel", "Json", } } type PipelineType string // Enum values for PipelineType const ( PipelineTypeAzureDevops PipelineType = "AZURE_DEVOPS" ) // Values returns all known values for PipelineType. 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 (PipelineType) Values() []PipelineType { return []PipelineType{ "AZURE_DEVOPS", } } type RecommendationReportStatus string // Enum values for RecommendationReportStatus const ( RecommendationReportStatusFailed RecommendationReportStatus = "FAILED" RecommendationReportStatusInProgress RecommendationReportStatus = "IN_PROGRESS" RecommendationReportStatusSuccess RecommendationReportStatus = "SUCCESS" ) // Values returns all known values for RecommendationReportStatus. 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 (RecommendationReportStatus) Values() []RecommendationReportStatus { return []RecommendationReportStatus{ "FAILED", "IN_PROGRESS", "SUCCESS", } } type ResourceSubType string // Enum values for ResourceSubType const ( ResourceSubTypeDatabase ResourceSubType = "Database" ResourceSubTypeProcess ResourceSubType = "Process" ResourceSubTypeDatabaseProcess ResourceSubType = "DatabaseProcess" ) // Values returns all known values for ResourceSubType. 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 (ResourceSubType) Values() []ResourceSubType { return []ResourceSubType{ "Database", "Process", "DatabaseProcess", } } type RuntimeAnalysisStatus string // Enum values for RuntimeAnalysisStatus const ( RuntimeAnalysisStatusAnalysisToBeScheduled RuntimeAnalysisStatus = "ANALYSIS_TO_BE_SCHEDULED" RuntimeAnalysisStatusAnalysisStarted RuntimeAnalysisStatus = "ANALYSIS_STARTED" RuntimeAnalysisStatusAnalysisSuccess RuntimeAnalysisStatus = "ANALYSIS_SUCCESS" RuntimeAnalysisStatusAnalysisFailed RuntimeAnalysisStatus = "ANALYSIS_FAILED" ) // Values returns all known values for RuntimeAnalysisStatus. 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 (RuntimeAnalysisStatus) Values() []RuntimeAnalysisStatus { return []RuntimeAnalysisStatus{ "ANALYSIS_TO_BE_SCHEDULED", "ANALYSIS_STARTED", "ANALYSIS_SUCCESS", "ANALYSIS_FAILED", } } type RunTimeAnalyzerName string // Enum values for RunTimeAnalyzerName const ( RunTimeAnalyzerNameA2cAnalyzer RunTimeAnalyzerName = "A2C_ANALYZER" RunTimeAnalyzerNameRehostAnalyzer RunTimeAnalyzerName = "REHOST_ANALYZER" RunTimeAnalyzerNameEmpPaAnalyzer RunTimeAnalyzerName = "EMP_PA_ANALYZER" RunTimeAnalyzerNameDatabaseAnalyzer RunTimeAnalyzerName = "DATABASE_ANALYZER" RunTimeAnalyzerNameSctAnalyzer RunTimeAnalyzerName = "SCT_ANALYZER" ) // Values returns all known values for RunTimeAnalyzerName. 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 (RunTimeAnalyzerName) Values() []RunTimeAnalyzerName { return []RunTimeAnalyzerName{ "A2C_ANALYZER", "REHOST_ANALYZER", "EMP_PA_ANALYZER", "DATABASE_ANALYZER", "SCT_ANALYZER", } } type RunTimeAssessmentStatus string // Enum values for RunTimeAssessmentStatus const ( RunTimeAssessmentStatusDcToBeScheduled RunTimeAssessmentStatus = "dataCollectionTaskToBeScheduled" RunTimeAssessmentStatusDcReqSent RunTimeAssessmentStatus = "dataCollectionTaskScheduled" RunTimeAssessmentStatusDcStarted RunTimeAssessmentStatus = "dataCollectionTaskStarted" RunTimeAssessmentStatusDcStopped RunTimeAssessmentStatus = "dataCollectionTaskStopped" RunTimeAssessmentStatusDcSuccess RunTimeAssessmentStatus = "dataCollectionTaskSuccess" RunTimeAssessmentStatusDcFailed RunTimeAssessmentStatus = "dataCollectionTaskFailed" RunTimeAssessmentStatusDcPartialSuccess RunTimeAssessmentStatus = "dataCollectionTaskPartialSuccess" ) // Values returns all known values for RunTimeAssessmentStatus. 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 (RunTimeAssessmentStatus) Values() []RunTimeAssessmentStatus { return []RunTimeAssessmentStatus{ "dataCollectionTaskToBeScheduled", "dataCollectionTaskScheduled", "dataCollectionTaskStarted", "dataCollectionTaskStopped", "dataCollectionTaskSuccess", "dataCollectionTaskFailed", "dataCollectionTaskPartialSuccess", } } type SelfManageTargetDestination string // Enum values for SelfManageTargetDestination const ( SelfManageTargetDestinationNoneSpecified SelfManageTargetDestination = "None specified" SelfManageTargetDestinationAmazonElasticCloudCompute SelfManageTargetDestination = "Amazon Elastic Cloud Compute (EC2)" SelfManageTargetDestinationAmazonElasticContainerService SelfManageTargetDestination = "Amazon Elastic Container Service (ECS)" SelfManageTargetDestinationAmazonElasticKubernetesService SelfManageTargetDestination = "Amazon Elastic Kubernetes Service (EKS)" ) // Values returns all known values for SelfManageTargetDestination. 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 (SelfManageTargetDestination) Values() []SelfManageTargetDestination { return []SelfManageTargetDestination{ "None specified", "Amazon Elastic Cloud Compute (EC2)", "Amazon Elastic Container Service (ECS)", "Amazon Elastic Kubernetes Service (EKS)", } } type ServerCriteria string // Enum values for ServerCriteria const ( ServerCriteriaNotDefined ServerCriteria = "NOT_DEFINED" ServerCriteriaOsName ServerCriteria = "OS_NAME" ServerCriteriaStrategy ServerCriteria = "STRATEGY" ServerCriteriaDestination ServerCriteria = "DESTINATION" ServerCriteriaServerId ServerCriteria = "SERVER_ID" ServerCriteriaAnalysisStatus ServerCriteria = "ANALYSIS_STATUS" ServerCriteriaErrorCategory ServerCriteria = "ERROR_CATEGORY" ) // Values returns all known values for ServerCriteria. 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 (ServerCriteria) Values() []ServerCriteria { return []ServerCriteria{ "NOT_DEFINED", "OS_NAME", "STRATEGY", "DESTINATION", "SERVER_ID", "ANALYSIS_STATUS", "ERROR_CATEGORY", } } type ServerErrorCategory string // Enum values for ServerErrorCategory const ( ServerErrorCategoryConnectivityError ServerErrorCategory = "CONNECTIVITY_ERROR" ServerErrorCategoryCredentialError ServerErrorCategory = "CREDENTIAL_ERROR" ServerErrorCategoryPermissionError ServerErrorCategory = "PERMISSION_ERROR" ServerErrorCategoryArchitectureError ServerErrorCategory = "ARCHITECTURE_ERROR" ServerErrorCategoryOtherError ServerErrorCategory = "OTHER_ERROR" ) // Values returns all known values for ServerErrorCategory. 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 (ServerErrorCategory) Values() []ServerErrorCategory { return []ServerErrorCategory{ "CONNECTIVITY_ERROR", "CREDENTIAL_ERROR", "PERMISSION_ERROR", "ARCHITECTURE_ERROR", "OTHER_ERROR", } } type ServerOsType string // Enum values for ServerOsType const ( ServerOsTypeWindowsServer ServerOsType = "WindowsServer" ServerOsTypeAmazonLinux ServerOsType = "AmazonLinux" ServerOsTypeEndOfSupportWindowsServer ServerOsType = "EndOfSupportWindowsServer" ServerOsTypeRedhat ServerOsType = "Redhat" ServerOsTypeOther ServerOsType = "Other" ) // Values returns all known values for ServerOsType. 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 (ServerOsType) Values() []ServerOsType { return []ServerOsType{ "WindowsServer", "AmazonLinux", "EndOfSupportWindowsServer", "Redhat", "Other", } } type Severity string // Enum values for Severity const ( SeverityHigh Severity = "HIGH" SeverityMedium Severity = "MEDIUM" SeverityLow Severity = "LOW" ) // Values returns all known values for Severity. 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 (Severity) Values() []Severity { return []Severity{ "HIGH", "MEDIUM", "LOW", } } type SortOrder string // Enum values for SortOrder const ( SortOrderAsc SortOrder = "ASC" SortOrderDesc SortOrder = "DESC" ) // Values returns all known values for SortOrder. 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 (SortOrder) Values() []SortOrder { return []SortOrder{ "ASC", "DESC", } } type SourceCodeAnalyzerName string // Enum values for SourceCodeAnalyzerName const ( SourceCodeAnalyzerNameCsharpAnalyzer SourceCodeAnalyzerName = "CSHARP_ANALYZER" SourceCodeAnalyzerNameJavaAnalyzer SourceCodeAnalyzerName = "JAVA_ANALYZER" SourceCodeAnalyzerNameBytecodeAnalyzer SourceCodeAnalyzerName = "BYTECODE_ANALYZER" SourceCodeAnalyzerNamePortingAssistant SourceCodeAnalyzerName = "PORTING_ASSISTANT" ) // Values returns all known values for SourceCodeAnalyzerName. 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 (SourceCodeAnalyzerName) Values() []SourceCodeAnalyzerName { return []SourceCodeAnalyzerName{ "CSHARP_ANALYZER", "JAVA_ANALYZER", "BYTECODE_ANALYZER", "PORTING_ASSISTANT", } } type SrcCodeOrDbAnalysisStatus string // Enum values for SrcCodeOrDbAnalysisStatus const ( SrcCodeOrDbAnalysisStatusAnalysisToBeScheduled SrcCodeOrDbAnalysisStatus = "ANALYSIS_TO_BE_SCHEDULED" SrcCodeOrDbAnalysisStatusAnalysisStarted SrcCodeOrDbAnalysisStatus = "ANALYSIS_STARTED" SrcCodeOrDbAnalysisStatusAnalysisSuccess SrcCodeOrDbAnalysisStatus = "ANALYSIS_SUCCESS" SrcCodeOrDbAnalysisStatusAnalysisFailed SrcCodeOrDbAnalysisStatus = "ANALYSIS_FAILED" SrcCodeOrDbAnalysisStatusAnalysisPartialSuccess SrcCodeOrDbAnalysisStatus = "ANALYSIS_PARTIAL_SUCCESS" SrcCodeOrDbAnalysisStatusUnconfigured SrcCodeOrDbAnalysisStatus = "UNCONFIGURED" SrcCodeOrDbAnalysisStatusConfigured SrcCodeOrDbAnalysisStatus = "CONFIGURED" ) // Values returns all known values for SrcCodeOrDbAnalysisStatus. 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 (SrcCodeOrDbAnalysisStatus) Values() []SrcCodeOrDbAnalysisStatus { return []SrcCodeOrDbAnalysisStatus{ "ANALYSIS_TO_BE_SCHEDULED", "ANALYSIS_STARTED", "ANALYSIS_SUCCESS", "ANALYSIS_FAILED", "ANALYSIS_PARTIAL_SUCCESS", "UNCONFIGURED", "CONFIGURED", } } type Strategy string // Enum values for Strategy const ( StrategyRehost Strategy = "Rehost" StrategyRetirement Strategy = "Retirement" StrategyRefactor Strategy = "Refactor" StrategyReplatform Strategy = "Replatform" StrategyRetain Strategy = "Retain" StrategyRelocate Strategy = "Relocate" StrategyRepurchase Strategy = "Repurchase" ) // Values returns all known values for Strategy. 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 (Strategy) Values() []Strategy { return []Strategy{ "Rehost", "Retirement", "Refactor", "Replatform", "Retain", "Relocate", "Repurchase", } } type StrategyRecommendation string // Enum values for StrategyRecommendation const ( StrategyRecommendationRecommended StrategyRecommendation = "recommended" StrategyRecommendationViableOption StrategyRecommendation = "viableOption" StrategyRecommendationNotRecommended StrategyRecommendation = "notRecommended" StrategyRecommendationPotential StrategyRecommendation = "potential" ) // Values returns all known values for StrategyRecommendation. 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 (StrategyRecommendation) Values() []StrategyRecommendation { return []StrategyRecommendation{ "recommended", "viableOption", "notRecommended", "potential", } } type TargetDatabaseEngine string // Enum values for TargetDatabaseEngine const ( TargetDatabaseEngineNoneSpecified TargetDatabaseEngine = "None specified" TargetDatabaseEngineAmazonAurora TargetDatabaseEngine = "Amazon Aurora" TargetDatabaseEngineAwsPostgresql TargetDatabaseEngine = "AWS PostgreSQL" TargetDatabaseEngineMysql TargetDatabaseEngine = "MySQL" TargetDatabaseEngineMicrosoftSqlServer TargetDatabaseEngine = "Microsoft SQL Server" TargetDatabaseEngineOracleDatabase TargetDatabaseEngine = "Oracle Database" TargetDatabaseEngineMariaDb TargetDatabaseEngine = "MariaDB" TargetDatabaseEngineSap TargetDatabaseEngine = "SAP" TargetDatabaseEngineDb2Luw TargetDatabaseEngine = "Db2 LUW" TargetDatabaseEngineMongoDb TargetDatabaseEngine = "MongoDB" ) // Values returns all known values for TargetDatabaseEngine. 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 (TargetDatabaseEngine) Values() []TargetDatabaseEngine { return []TargetDatabaseEngine{ "None specified", "Amazon Aurora", "AWS PostgreSQL", "MySQL", "Microsoft SQL Server", "Oracle Database", "MariaDB", "SAP", "Db2 LUW", "MongoDB", } } type TargetDestination string // Enum values for TargetDestination const ( TargetDestinationNoneSpecified TargetDestination = "None specified" TargetDestinationAwsElasticBeanstalk TargetDestination = "AWS Elastic BeanStalk" TargetDestinationAwsFargate TargetDestination = "AWS Fargate" TargetDestinationAmazonElasticCloudCompute TargetDestination = "Amazon Elastic Cloud Compute (EC2)" TargetDestinationAmazonElasticContainerService TargetDestination = "Amazon Elastic Container Service (ECS)" TargetDestinationAmazonElasticKubernetesService TargetDestination = "Amazon Elastic Kubernetes Service (EKS)" TargetDestinationAuroraMysql TargetDestination = "Aurora MySQL" TargetDestinationAuroraPostgresql TargetDestination = "Aurora PostgreSQL" TargetDestinationAmazonRdsMysql TargetDestination = "Amazon Relational Database Service on MySQL" TargetDestinationAmazonRdsPostgresql TargetDestination = "Amazon Relational Database Service on PostgreSQL" TargetDestinationAmazonDocumentdb TargetDestination = "Amazon DocumentDB" TargetDestinationAmazonDynamodb TargetDestination = "Amazon DynamoDB" TargetDestinationAmazonRds TargetDestination = "Amazon Relational Database Service" TargetDestinationBabelfishAuroraPostgresql TargetDestination = "Babelfish for Aurora PostgreSQL" ) // Values returns all known values for TargetDestination. 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 (TargetDestination) Values() []TargetDestination { return []TargetDestination{ "None specified", "AWS Elastic BeanStalk", "AWS Fargate", "Amazon Elastic Cloud Compute (EC2)", "Amazon Elastic Container Service (ECS)", "Amazon Elastic Kubernetes Service (EKS)", "Aurora MySQL", "Aurora PostgreSQL", "Amazon Relational Database Service on MySQL", "Amazon Relational Database Service on PostgreSQL", "Amazon DocumentDB", "Amazon DynamoDB", "Amazon Relational Database Service", "Babelfish for Aurora PostgreSQL", } } type TransformationToolName string // Enum values for TransformationToolName const ( TransformationToolNameApp2container TransformationToolName = "App2Container" TransformationToolNamePortingAssistant TransformationToolName = "Porting Assistant For .NET" TransformationToolNameEmp TransformationToolName = "End of Support Migration" TransformationToolNameWwama TransformationToolName = "Windows Web Application Migration Assistant" TransformationToolNameMgn TransformationToolName = "Application Migration Service" TransformationToolNameStrategyRecommendationSupport TransformationToolName = "Strategy Recommendation Support" TransformationToolNameInPlaceOsUpgrade TransformationToolName = "In Place Operating System Upgrade" TransformationToolNameSct TransformationToolName = "Schema Conversion Tool" TransformationToolNameDms TransformationToolName = "Database Migration Service" TransformationToolNameNativeSql TransformationToolName = "Native SQL Server Backup/Restore" ) // Values returns all known values for TransformationToolName. 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 (TransformationToolName) Values() []TransformationToolName { return []TransformationToolName{ "App2Container", "Porting Assistant For .NET", "End of Support Migration", "Windows Web Application Migration Assistant", "Application Migration Service", "Strategy Recommendation Support", "In Place Operating System Upgrade", "Schema Conversion Tool", "Database Migration Service", "Native SQL Server Backup/Restore", } } type VersionControl string // Enum values for VersionControl const ( VersionControlGithub VersionControl = "GITHUB" VersionControlGithubEnterprise VersionControl = "GITHUB_ENTERPRISE" VersionControlAzureDevopsGit VersionControl = "AZURE_DEVOPS_GIT" ) // Values returns all known values for VersionControl. 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 (VersionControl) Values() []VersionControl { return []VersionControl{ "GITHUB", "GITHUB_ENTERPRISE", "AZURE_DEVOPS_GIT", } } type VersionControlType string // Enum values for VersionControlType const ( VersionControlTypeGithub VersionControlType = "GITHUB" VersionControlTypeGithubEnterprise VersionControlType = "GITHUB_ENTERPRISE" VersionControlTypeAzureDevopsGit VersionControlType = "AZURE_DEVOPS_GIT" ) // Values returns all known values for VersionControlType. 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 (VersionControlType) Values() []VersionControlType { return []VersionControlType{ "GITHUB", "GITHUB_ENTERPRISE", "AZURE_DEVOPS_GIT", } }
1,037
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" ) // The user does not have permission to perform the action. Check the AWS Identity // and Access Management (IAM) policy associated with this user. type AccessDeniedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AccessDeniedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccessDeniedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccessDeniedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccessDeniedException" } return *e.ErrorCodeOverride } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Exception to indicate that there is an ongoing task when a new task is created. // Return when once the existing tasks are complete. type ConflictException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ConflictException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ConflictException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ConflictException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ConflictException" } return *e.ErrorCodeOverride } func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Dependency encountered an error. type DependencyException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *DependencyException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *DependencyException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *DependencyException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "DependencyException" } return *e.ErrorCodeOverride } func (e *DependencyException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // The server experienced an internal error. Try again. type InternalServerException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InternalServerException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalServerException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalServerException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalServerException" } return *e.ErrorCodeOverride } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // The specified ID in the request is not found. type ResourceNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ResourceNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceNotFoundException" } return *e.ErrorCodeOverride } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Exception to indicate that the service-linked role (SLR) is locked. type ServiceLinkedRoleLockClientException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ServiceLinkedRoleLockClientException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ServiceLinkedRoleLockClientException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ServiceLinkedRoleLockClientException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ServiceLinkedRoleLockClientException" } return *e.ErrorCodeOverride } func (e *ServiceLinkedRoleLockClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The AWS account has reached its quota of imports. Contact AWS Support to // increase the quota for this account. type ServiceQuotaExceededException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ServiceQuotaExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ServiceQuotaExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ServiceQuotaExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ServiceQuotaExceededException" } return *e.ErrorCodeOverride } func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request was denied due to request throttling. type ThrottlingException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ThrottlingException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ThrottlingException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ThrottlingException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ThrottlingException" } return *e.ErrorCodeOverride } func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request body isn't valid. 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 }
248
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( smithydocument "github.com/aws/smithy-go/document" "time" ) // A combination of existing analysis statuses. // // The following types satisfy this interface: // // AnalysisStatusUnionMemberRuntimeAnalysisStatus // AnalysisStatusUnionMemberSrcCodeOrDbAnalysisStatus type AnalysisStatusUnion interface { isAnalysisStatusUnion() } // The status of the analysis. type AnalysisStatusUnionMemberRuntimeAnalysisStatus struct { Value RuntimeAnalysisStatus noSmithyDocumentSerde } func (*AnalysisStatusUnionMemberRuntimeAnalysisStatus) isAnalysisStatusUnion() {} // The status of the source code or database analysis. type AnalysisStatusUnionMemberSrcCodeOrDbAnalysisStatus struct { Value SrcCodeOrDbAnalysisStatus noSmithyDocumentSerde } func (*AnalysisStatusUnionMemberSrcCodeOrDbAnalysisStatus) isAnalysisStatusUnion() {} // The combination of the existing analyzers. // // The following types satisfy this interface: // // AnalyzerNameUnionMemberBinaryAnalyzerName // AnalyzerNameUnionMemberRunTimeAnalyzerName // AnalyzerNameUnionMemberSourceCodeAnalyzerName type AnalyzerNameUnion interface { isAnalyzerNameUnion() } // The binary analyzer names. type AnalyzerNameUnionMemberBinaryAnalyzerName struct { Value BinaryAnalyzerName noSmithyDocumentSerde } func (*AnalyzerNameUnionMemberBinaryAnalyzerName) isAnalyzerNameUnion() {} // The assessment analyzer names. type AnalyzerNameUnionMemberRunTimeAnalyzerName struct { Value RunTimeAnalyzerName noSmithyDocumentSerde } func (*AnalyzerNameUnionMemberRunTimeAnalyzerName) isAnalyzerNameUnion() {} // The source code analyzer names. type AnalyzerNameUnionMemberSourceCodeAnalyzerName struct { Value SourceCodeAnalyzerName noSmithyDocumentSerde } func (*AnalyzerNameUnionMemberSourceCodeAnalyzerName) isAnalyzerNameUnion() {} // The anti-pattern report result. type AntipatternReportResult struct { // The analyzer name. AnalyzerName AnalyzerNameUnion // Contains the S3 bucket name and the Amazon S3 key name. AntiPatternReportS3Object *S3Object // The status of the anti-pattern report generation. AntipatternReportStatus AntipatternReportStatus // The status message for the anti-pattern. AntipatternReportStatusMessage *string noSmithyDocumentSerde } // Contains the summary of anti-patterns and their severity. type AntipatternSeveritySummary struct { // Contains the count of anti-patterns. Count *int32 // Contains the severity of anti-patterns. Severity Severity noSmithyDocumentSerde } // Contains detailed information about an application component. type ApplicationComponentDetail struct { // The status of analysis, if the application component has source code or an // associated database. AnalysisStatus SrcCodeOrDbAnalysisStatus // The S3 bucket name and the Amazon S3 key name for the anti-pattern report. AntipatternReportS3Object *S3Object // The status of the anti-pattern report generation. AntipatternReportStatus AntipatternReportStatus // The status message for the anti-pattern. AntipatternReportStatusMessage *string // The type of application component. AppType AppType // The error in the analysis of the source code or database. AppUnitError *AppUnitError // The ID of the server that the application component is running on. AssociatedServerId *string // Configuration details for the database associated with the application // component. DatabaseConfigDetail *DatabaseConfigDetail // The ID of the application component. Id *string // Indicates whether the application component has been included for server // recommendation or not. InclusionStatus InclusionStatus // The timestamp of when the application component was assessed. LastAnalyzedTimestamp *time.Time // A list of anti-pattern severity summaries. ListAntipatternSeveritySummary []AntipatternSeveritySummary // Set to true if the application component is running on multiple servers. MoreServerAssociationExists *bool // The name of application component. Name *string // OS driver. OsDriver *string // OS version. OsVersion *string // The top recommendation set for the application component. RecommendationSet *RecommendationSet // The application component subtype. ResourceSubType ResourceSubType // A list of the analysis results. ResultList []Result // The status of the application unit. RuntimeStatus RuntimeAnalysisStatus // The status message for the application unit. RuntimeStatusMessage *string // Details about the source code repository associated with the application // component. SourceCodeRepositories []SourceCodeRepository // A detailed description of the analysis status and any failure message. StatusMessage *string noSmithyDocumentSerde } // Summary of the analysis status of the application component. type ApplicationComponentStatusSummary struct { // The number of application components successfully analyzed, partially // successful or failed analysis. Count *int32 // The status of database analysis. SrcCodeOrDbAnalysisStatus SrcCodeOrDbAnalysisStatus noSmithyDocumentSerde } // Contains information about a strategy recommendation for an application // component. type ApplicationComponentStrategy struct { // Set to true if the recommendation is set as preferred. IsPreferred *bool // Strategy recommendation for the application component. Recommendation *RecommendationSet // The recommendation status of a strategy for an application component. Status StrategyRecommendation noSmithyDocumentSerde } // Contains the summary of application components. type ApplicationComponentSummary struct { // Contains the name of application types. AppType AppType // Contains the count of application type. Count *int32 noSmithyDocumentSerde } // Application preferences that you specify. type ApplicationPreferences struct { // Application preferences that you specify to prefer managed environment. ManagementPreference ManagementPreference noSmithyDocumentSerde } // Error in the analysis of the application unit. type AppUnitError struct { // The category of the error. AppUnitErrorCategory AppUnitErrorCategory noSmithyDocumentSerde } // Contains the summary of the assessment results. type AssessmentSummary struct { // The Amazon S3 object containing the anti-pattern report. AntipatternReportS3Object *S3Object // The status of the anti-pattern report. AntipatternReportStatus AntipatternReportStatus // The status message of the anti-pattern report. AntipatternReportStatusMessage *string // The time the assessment was performed. LastAnalyzedTimestamp *time.Time // List of AntipatternSeveritySummary. ListAntipatternSeveritySummary []AntipatternSeveritySummary // List of status summaries of the analyzed application components. ListApplicationComponentStatusSummary []ApplicationComponentStatusSummary // List of ApplicationComponentStrategySummary. ListApplicationComponentStrategySummary []StrategySummary // List of ApplicationComponentSummary. ListApplicationComponentSummary []ApplicationComponentSummary // List of status summaries of the analyzed servers. ListServerStatusSummary []ServerStatusSummary // List of ServerStrategySummary. ListServerStrategySummary []StrategySummary // List of ServerSummary. ListServerSummary []ServerSummary noSmithyDocumentSerde } // Defines the criteria of assessment. type AssessmentTarget struct { // Condition of an assessment. // // This member is required. Condition Condition // Name of an assessment. // // This member is required. Name *string // Values of an assessment. // // This member is required. Values []string noSmithyDocumentSerde } // Object containing details about applications as defined in Application // Discovery Service. type AssociatedApplication struct { // ID of the application as defined in Application Discovery Service. Id *string // Name of the application as defined in Application Discovery Service. Name *string noSmithyDocumentSerde } // Object containing the choice of application destination that you specify. type AwsManagedResources struct { // The choice of application destination that you specify. // // This member is required. TargetDestination []AwsManagedTargetDestination noSmithyDocumentSerde } // Business goals that you specify. type BusinessGoals struct { // Business goal to reduce license costs. LicenseCostReduction *int32 // Business goal to modernize infrastructure by moving to cloud native // technologies. ModernizeInfrastructureWithCloudNativeTechnologies *int32 // Business goal to reduce the operational overhead on the team by moving into // managed services. ReduceOperationalOverheadWithManagedServices *int32 // Business goal to achieve migration at a fast pace. SpeedOfMigration *int32 noSmithyDocumentSerde } // Process data collector that runs in the environment that you specify. type Collector struct { // Indicates the health of a collector. CollectorHealth CollectorHealth // The ID of the collector. CollectorId *string // Current version of the collector that is running in the environment that you // specify. CollectorVersion *string // Summary of the collector configuration. ConfigurationSummary *ConfigurationSummary // Hostname of the server that is hosting the collector. HostName *string // IP address of the server that is hosting the collector. IpAddress *string // Time when the collector last pinged the service. LastActivityTimeStamp *string // Time when the collector registered with the service. RegisteredTimeStamp *string noSmithyDocumentSerde } // Summary of the collector configuration. type ConfigurationSummary struct { // IP address based configurations. IpAddressBasedRemoteInfoList []IPAddressBasedRemoteInfo // The list of pipeline info configurations. PipelineInfoList []PipelineInfo // Info about the remote server source code configuration. RemoteSourceCodeAnalysisServerInfo *RemoteSourceCodeAnalysisServerInfo // The list of vCenter configurations. VcenterBasedRemoteInfoList []VcenterBasedRemoteInfo // The list of the version control configurations. VersionControlInfoList []VersionControlInfo noSmithyDocumentSerde } // Configuration information used for assessing databases. type DatabaseConfigDetail struct { // AWS Secrets Manager key that holds the credentials that you use to connect to a // database. SecretName *string noSmithyDocumentSerde } // Preferences for migrating a database to AWS. // // The following types satisfy this interface: // // DatabaseMigrationPreferenceMemberHeterogeneous // DatabaseMigrationPreferenceMemberHomogeneous // DatabaseMigrationPreferenceMemberNoPreference type DatabaseMigrationPreference interface { isDatabaseMigrationPreference() } // Indicates whether you are interested in moving from one type of database to // another. For example, from SQL Server to Amazon Aurora MySQL-Compatible Edition. type DatabaseMigrationPreferenceMemberHeterogeneous struct { Value Heterogeneous noSmithyDocumentSerde } func (*DatabaseMigrationPreferenceMemberHeterogeneous) isDatabaseMigrationPreference() {} // Indicates whether you are interested in moving to the same type of database // into AWS. For example, from SQL Server in your environment to SQL Server on AWS. type DatabaseMigrationPreferenceMemberHomogeneous struct { Value Homogeneous noSmithyDocumentSerde } func (*DatabaseMigrationPreferenceMemberHomogeneous) isDatabaseMigrationPreference() {} // Indicated that you do not prefer heterogeneous or homogeneous. type DatabaseMigrationPreferenceMemberNoPreference struct { Value NoDatabaseMigrationPreference noSmithyDocumentSerde } func (*DatabaseMigrationPreferenceMemberNoPreference) isDatabaseMigrationPreference() {} // Preferences on managing your databases on AWS. type DatabasePreferences struct { // Specifies whether you're interested in self-managed databases or databases // managed by AWS. DatabaseManagementPreference DatabaseManagementPreference // Specifies your preferred migration path. DatabaseMigrationPreference DatabaseMigrationPreference noSmithyDocumentSerde } // Detailed information about an assessment. type DataCollectionDetails struct { // The time the assessment completes. CompletionTime *time.Time // The number of failed servers in the assessment. Failed *int32 // The number of servers with the assessment status IN_PROGESS . InProgress *int32 // The total number of servers in the assessment. Servers *int32 // The start time of assessment. StartTime *time.Time // The status of the assessment. Status AssessmentStatus // The status message of the assessment. StatusMessage *string // The number of successful servers in the assessment. Success *int32 noSmithyDocumentSerde } // The object containing information about distinct imports or groups for Strategy // Recommendations. type Group struct { // The key of the specific import group. Name GroupName // The value of the specific import group. Value *string noSmithyDocumentSerde } // The object containing details about heterogeneous database preferences. type Heterogeneous struct { // The target database engine for heterogeneous database migration preference. // // This member is required. TargetDatabaseEngine []HeterogeneousTargetDatabaseEngine noSmithyDocumentSerde } // The object containing details about homogeneous database preferences. type Homogeneous struct { // The target database engine for homogeneous database migration preferences. TargetDatabaseEngine []HomogeneousTargetDatabaseEngine noSmithyDocumentSerde } // Information about the import file tasks you request. type ImportFileTaskInformation struct { // The time that the import task completes. CompletionTime *time.Time // The ID of the import file task. Id *string // The name of the import task given in StartImportFileTask . ImportName *string // The S3 bucket where the import file is located. InputS3Bucket *string // The Amazon S3 key name of the import file. InputS3Key *string // The number of records that failed to be imported. NumberOfRecordsFailed *int32 // The number of records successfully imported. NumberOfRecordsSuccess *int32 // Start time of the import task. StartTime *time.Time // Status of import file task. Status ImportFileTaskStatus // The S3 bucket name for status report of import task. StatusReportS3Bucket *string // The Amazon S3 key name for status report of import task. The report contains // details about whether each record imported successfully or why it did not. StatusReportS3Key *string noSmithyDocumentSerde } // IP address based configurations. type IPAddressBasedRemoteInfo struct { // The type of authorization. AuthType AuthType // The time stamp of the configuration. IpAddressConfigurationTimeStamp *string // The type of the operating system. OsType OSType noSmithyDocumentSerde } // Preferences for migrating an application to AWS. // // The following types satisfy this interface: // // ManagementPreferenceMemberAwsManagedResources // ManagementPreferenceMemberNoPreference // ManagementPreferenceMemberSelfManageResources type ManagementPreference interface { isManagementPreference() } // Indicates interest in solutions that are managed by AWS. type ManagementPreferenceMemberAwsManagedResources struct { Value AwsManagedResources noSmithyDocumentSerde } func (*ManagementPreferenceMemberAwsManagedResources) isManagementPreference() {} // No specific preference. type ManagementPreferenceMemberNoPreference struct { Value NoManagementPreference noSmithyDocumentSerde } func (*ManagementPreferenceMemberNoPreference) isManagementPreference() {} // Indicates interest in managing your own resources on AWS. type ManagementPreferenceMemberSelfManageResources struct { Value SelfManageResources noSmithyDocumentSerde } func (*ManagementPreferenceMemberSelfManageResources) isManagementPreference() {} // Information about the server's network for which the assessment was run. type NetworkInfo struct { // Information about the name of the interface of the server for which the // assessment was run. // // This member is required. InterfaceName *string // Information about the IP address of the server for which the assessment was run. // // This member is required. IpAddress *string // Information about the MAC address of the server for which the assessment was // run. // // This member is required. MacAddress *string // Information about the subnet mask of the server for which the assessment was // run. // // This member is required. NetMask *string noSmithyDocumentSerde } // The object containing details about database migration preferences, when you // have no particular preference. type NoDatabaseMigrationPreference struct { // The target database engine for database migration preference that you specify. // // This member is required. TargetDatabaseEngine []TargetDatabaseEngine noSmithyDocumentSerde } // Object containing the choice of application destination that you specify. type NoManagementPreference struct { // The choice of application destination that you specify. // // This member is required. TargetDestination []NoPreferenceTargetDestination noSmithyDocumentSerde } // Information about the operating system. type OSInfo struct { // Information about the type of operating system. Type OSType // Information about the version of operating system. Version *string noSmithyDocumentSerde } // Detailed information of the pipeline. type PipelineInfo struct { // The time when the pipeline info was configured. PipelineConfigurationTimeStamp *string // The type of pipeline. PipelineType PipelineType noSmithyDocumentSerde } // Rank of business goals based on priority. type PrioritizeBusinessGoals struct { // Rank of business goals based on priority. BusinessGoals *BusinessGoals noSmithyDocumentSerde } // Contains detailed information about a recommendation report. type RecommendationReportDetails struct { // The time that the recommendation report generation task completes. CompletionTime *time.Time // The S3 bucket where the report file is located. S3Bucket *string // The Amazon S3 key name of the report file. S3Keys []string // The time that the recommendation report generation task starts. StartTime *time.Time // The status of the recommendation report generation task. Status RecommendationReportStatus // The status message for recommendation report generation. StatusMessage *string noSmithyDocumentSerde } // Contains a recommendation set. type RecommendationSet struct { // The recommended strategy. Strategy Strategy // The recommended target destination. TargetDestination TargetDestination // The target destination for the recommendation set. TransformationTool *TransformationTool noSmithyDocumentSerde } // Information about the server configured for source code analysis. type RemoteSourceCodeAnalysisServerInfo struct { // The time when the remote source code server was configured. RemoteSourceCodeAnalysisServerConfigurationTimestamp *string noSmithyDocumentSerde } // The error in server analysis. type Result struct { // The error in server analysis. AnalysisStatus AnalysisStatusUnion // The error in server analysis. AnalysisType AnalysisType // The error in server analysis. AntipatternReportResultList []AntipatternReportResult // The error in server analysis. StatusMessage *string noSmithyDocumentSerde } // Contains the S3 bucket name and the Amazon S3 key name. type S3Object struct { // The S3 bucket name. S3Bucket *string // The Amazon S3 key name. S3key *string noSmithyDocumentSerde } // Self-managed resources. type SelfManageResources struct { // Self-managed resources target destination. // // This member is required. TargetDestination []SelfManageTargetDestination noSmithyDocumentSerde } // Detailed information about a server. type ServerDetail struct { // The S3 bucket name and Amazon S3 key name for anti-pattern report. AntipatternReportS3Object *S3Object // The status of the anti-pattern report generation. AntipatternReportStatus AntipatternReportStatus // A message about the status of the anti-pattern report generation. AntipatternReportStatusMessage *string // A list of strategy summaries. ApplicationComponentStrategySummary []StrategySummary // The status of assessment for the server. DataCollectionStatus RunTimeAssessmentStatus // The server ID. Id *string // The timestamp of when the server was assessed. LastAnalyzedTimestamp *time.Time // A list of anti-pattern severity summaries. ListAntipatternSeveritySummary []AntipatternSeveritySummary // The name of the server. Name *string // A set of recommendations. RecommendationSet *RecommendationSet // The error in server analysis. ServerError *ServerError // The type of server. ServerType *string // A message about the status of data collection, which contains detailed // descriptions of any error messages. StatusMessage *string // System information about the server. SystemInfo *SystemInfo noSmithyDocumentSerde } // The error in server analysis. type ServerError struct { // The error category of server analysis. ServerErrorCategory ServerErrorCategory noSmithyDocumentSerde } // The status summary of the server analysis. type ServerStatusSummary struct { // The number of servers successfully analyzed, partially successful or failed // analysis. Count *int32 // The status of the run time. RunTimeAssessmentStatus RunTimeAssessmentStatus noSmithyDocumentSerde } // Contains information about a strategy recommendation for a server. type ServerStrategy struct { // Set to true if the recommendation is set as preferred. IsPreferred *bool // The number of application components with this strategy recommendation running // on the server. NumberOfApplicationComponents *int32 // Strategy recommendation for the server. Recommendation *RecommendationSet // The recommendation status of the strategy for the server. Status StrategyRecommendation noSmithyDocumentSerde } // Object containing details about the servers imported by Application Discovery // Service type ServerSummary struct { // Number of servers. Count *int32 // Type of operating system for the servers. ServerOsType ServerOsType noSmithyDocumentSerde } // Object containing source code information that is linked to an application // component. type SourceCode struct { // The repository name for the source code. Location *string // The name of the project. ProjectName *string // The branch of the source code. SourceVersion *string // The type of repository to use for the source code. VersionControl VersionControl noSmithyDocumentSerde } // Object containing source code information that is linked to an application // component. type SourceCodeRepository struct { // The branch of the source code. Branch *string // The name of the project. ProjectName *string // The repository name for the source code. Repository *string // The type of repository to use for the source code. VersionControlType *string noSmithyDocumentSerde } // Information about all the available strategy options for migrating and // modernizing an application component. type StrategyOption struct { // Indicates if a specific strategy is preferred for the application component. IsPreferred *bool // Type of transformation. For example, Rehost, Replatform, and so on. Strategy Strategy // Destination information about where the application component can migrate to. // For example, EC2 , ECS , and so on. TargetDestination TargetDestination // The name of the tool that can be used to transform an application component // using this strategy. ToolName TransformationToolName noSmithyDocumentSerde } // Object containing the summary of the strategy recommendations. type StrategySummary struct { // The count of recommendations per strategy. Count *int32 // The name of recommended strategy. Strategy Strategy noSmithyDocumentSerde } // Information about the server that hosts application components. type SystemInfo struct { // CPU architecture type for the server. CpuArchitecture *string // File system type for the server. FileSystemType *string // Networking information related to a server. NetworkInfoList []NetworkInfo // Operating system corresponding to a server. OsInfo *OSInfo noSmithyDocumentSerde } // Information of the transformation tool that can be used to migrate and // modernize the application. type TransformationTool struct { // Description of the tool. Description *string // Name of the tool. Name TransformationToolName // URL for installing the tool. TranformationToolInstallationLink *string noSmithyDocumentSerde } // Details about the server in vCenter. type VcenterBasedRemoteInfo struct { // The type of the operating system. OsType OSType // The time when the remote server based on vCenter was last configured. VcenterConfigurationTimeStamp *string noSmithyDocumentSerde } // Details about the version control configuration. type VersionControlInfo struct { // The time when the version control system was last configured. VersionControlConfigurationTimeStamp *string // The type of version control. VersionControlType VersionControlType noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde // UnknownUnionMember is returned when a union member is returned over the wire, // but has an unknown tag. type UnknownUnionMember struct { Tag string Value []byte noSmithyDocumentSerde } func (*UnknownUnionMember) isAnalysisStatusUnion() {} func (*UnknownUnionMember) isAnalyzerNameUnion() {} func (*UnknownUnionMember) isDatabaseMigrationPreference() {} func (*UnknownUnionMember) isManagementPreference() {}
1,040
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types_test import ( "fmt" "github.com/aws/aws-sdk-go-v2/service/migrationhubstrategy/types" ) func ExampleAnalysisStatusUnion_outputUsage() { var union types.AnalysisStatusUnion // type switches can be used to check the union value switch v := union.(type) { case *types.AnalysisStatusUnionMemberRuntimeAnalysisStatus: _ = v.Value // Value is types.RuntimeAnalysisStatus case *types.AnalysisStatusUnionMemberSrcCodeOrDbAnalysisStatus: _ = v.Value // Value is types.SrcCodeOrDbAnalysisStatus case *types.UnknownUnionMember: fmt.Println("unknown tag:", v.Tag) default: fmt.Println("union is nil or unknown type") } } var _ types.RuntimeAnalysisStatus var _ types.SrcCodeOrDbAnalysisStatus func ExampleAnalyzerNameUnion_outputUsage() { var union types.AnalyzerNameUnion // type switches can be used to check the union value switch v := union.(type) { case *types.AnalyzerNameUnionMemberBinaryAnalyzerName: _ = v.Value // Value is types.BinaryAnalyzerName case *types.AnalyzerNameUnionMemberRunTimeAnalyzerName: _ = v.Value // Value is types.RunTimeAnalyzerName case *types.AnalyzerNameUnionMemberSourceCodeAnalyzerName: _ = v.Value // Value is types.SourceCodeAnalyzerName case *types.UnknownUnionMember: fmt.Println("unknown tag:", v.Tag) default: fmt.Println("union is nil or unknown type") } } var _ types.SourceCodeAnalyzerName var _ types.RunTimeAnalyzerName var _ types.BinaryAnalyzerName func ExampleDatabaseMigrationPreference_outputUsage() { var union types.DatabaseMigrationPreference // type switches can be used to check the union value switch v := union.(type) { case *types.DatabaseMigrationPreferenceMemberHeterogeneous: _ = v.Value // Value is types.Heterogeneous case *types.DatabaseMigrationPreferenceMemberHomogeneous: _ = v.Value // Value is types.Homogeneous case *types.DatabaseMigrationPreferenceMemberNoPreference: _ = v.Value // Value is types.NoDatabaseMigrationPreference case *types.UnknownUnionMember: fmt.Println("unknown tag:", v.Tag) default: fmt.Println("union is nil or unknown type") } } var _ *types.Heterogeneous var _ *types.NoDatabaseMigrationPreference var _ *types.Homogeneous func ExampleManagementPreference_outputUsage() { var union types.ManagementPreference // type switches can be used to check the union value switch v := union.(type) { case *types.ManagementPreferenceMemberAwsManagedResources: _ = v.Value // Value is types.AwsManagedResources case *types.ManagementPreferenceMemberNoPreference: _ = v.Value // Value is types.NoManagementPreference case *types.ManagementPreferenceMemberSelfManageResources: _ = v.Value // Value is types.SelfManageResources case *types.UnknownUnionMember: fmt.Println("unknown tag:", v.Tag) default: fmt.Println("union is nil or unknown type") } } var _ *types.NoManagementPreference var _ *types.AwsManagedResources var _ *types.SelfManageResources
109
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mobile 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 = "Mobile" const ServiceAPIVersion = "2017-07-01" // Client provides the API client to make operations call for AWS Mobile. type Client struct { options Options } // New returns an initialized Client based on the functional options. Provide // additional functional options to further configure the behavior of the client, // such as changing the client's endpoint or adding custom middleware behavior. func New(options Options, optFns ...func(*Options)) *Client { options = options.Copy() resolveDefaultLogger(&options) setResolvedDefaultsMode(&options) resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) resolveDefaultEndpointConfiguration(&options) for _, fn := range optFns { fn(&options) } client := &Client{ options: options, } return client } type Options struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // Configures the events that will be sent to the configured logger. ClientLogMode aws.ClientLogMode // The credentials object to use when signing requests. Credentials aws.CredentialsProvider // The configuration DefaultsMode that the SDK should use when constructing the // clients initial default settings. DefaultsMode aws.DefaultsMode // The endpoint options to be used when attempting to resolve an endpoint. EndpointOptions EndpointResolverOptions // The service endpoint resolver. EndpointResolver EndpointResolver // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 // The logger writer interface to write logging messages to. Logger logging.Logger // The region to send requests to. (Required) Region string // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify // per operation call's retry max attempts. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. If specified in an operation call's functional // options with a value that is different than the constructed client's Options, // the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if // Retryer option is not also specified. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. Currently does not support per operation call // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. The kind of // default retry created by the API client can be changed with the RetryMode // option. Retryer aws.Retryer // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You // should not populate this structure programmatically, or rely on the values here // within your applications. RuntimeEnvironment aws.RuntimeEnvironment // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved // value was at that point in time. Currently does not support per operation call // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient } // WithAPIOptions returns a functional option for setting the Client's APIOptions // option. func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { return func(o *Options) { o.APIOptions = append(o.APIOptions, optFns...) } } // WithEndpointResolver returns a functional option for setting the Client's // EndpointResolver option. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v } } type HTTPClient interface { Do(*http.Request) (*http.Response, error) } // Copy creates a clone where the APIOptions list is deep copied. func (o Options) Copy() Options { to := o to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) copy(to.APIOptions, o.APIOptions) return to } func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() for _, fn := range optFns { fn(&options) } finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err } } for _, fn := range options.APIOptions { if err := fn(stack); err != nil { return nil, metadata, err } } handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) result, metadata, err = handler.Handle(ctx, params) if err != nil { err = &smithy.OperationError{ ServiceID: ServiceID, OperationName: opID, Err: err, } } return result, metadata, err } type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { if o.Logger != nil { return } o.Logger = logging.Nop{} } func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } func setResolvedDefaultsMode(o *Options) { if len(o.resolvedDefaultsMode) > 0 { return } var mode aws.DefaultsMode mode.SetFromString(string(o.DefaultsMode)) if mode == aws.DefaultsModeAuto { mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) } o.resolvedDefaultsMode = mode } // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, DefaultsMode: cfg.DefaultsMode, RuntimeEnvironment: cfg.RuntimeEnvironment, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { var buildable *awshttp.BuildableClient if o.HTTPClient != nil { var ok bool buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) if !ok { return } } else { buildable = awshttp.NewBuildableClient() } modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { dialer.Timeout = dialerTimeout } }) buildable = buildable.WithTransportOptions(func(transport *http.Transport) { if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { transport.TLSHandshakeTimeout = tlsHandshakeTimeout } }) } o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } if len(o.RetryMode) == 0 { modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { o.RetryMode = modeConfig.RetryMode } } if len(o.RetryMode) == 0 { o.RetryMode = aws.RetryModeStandard } var standardOptions []func(*retry.StandardOptions) if v := o.RetryMaxAttempts; v != 0 { standardOptions = append(standardOptions, func(so *retry.StandardOptions) { so.MaxAttempts = v }) } switch o.RetryMode { case aws.RetryModeAdaptive: var adaptiveOptions []func(*retry.AdaptiveModeOptions) if len(standardOptions) != 0 { adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { ao.StandardOptions = append(ao.StandardOptions, standardOptions...) }) } o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) default: o.Retryer = retry.NewStandard(standardOptions...) } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { if cfg.Retryer == nil { return } o.Retryer = cfg.Retryer() } func resolveAWSRetryMode(cfg aws.Config, o *Options) { if len(cfg.RetryMode) == 0 { return } o.RetryMode = cfg.RetryMode } func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { if cfg.RetryMaxAttempts == 0 { return } o.RetryMaxAttempts = cfg.RetryMaxAttempts } func finalizeRetryMaxAttemptOptions(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { return } o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) } func addClientUserAgent(stack *middleware.Stack) error { return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "mobile", goModuleVersion)(stack) } func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ CredentialsProvider: o.Credentials, Signer: o.HTTPSignerV4, LogSigning: o.ClientLogMode.IsSigning(), }) return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error } func resolveHTTPSignerV4(o *Options) { if o.HTTPSignerV4 != nil { return } o.HTTPSignerV4 = newDefaultV4Signer(*o) } func newDefaultV4Signer(o Options) *v4.Signer { return v4.NewSigner(func(so *v4.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() }) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, LogRetryAttempts: o.ClientLogMode.IsRetries(), } return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseDualStackEndpoint = value } return nil } // resolves FIPS endpoint configuration func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseFIPSEndpoint = value } return nil } func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ LogRequest: o.ClientLogMode.IsRequest(), LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), LogResponse: o.ClientLogMode.IsResponse(), LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) }
434
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mobile 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 mobile 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/mobile/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates an AWS Mobile Hub project. func (c *Client) CreateProject(ctx context.Context, params *CreateProjectInput, optFns ...func(*Options)) (*CreateProjectOutput, error) { if params == nil { params = &CreateProjectInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateProject", params, optFns, c.addOperationCreateProjectMiddlewares) if err != nil { return nil, err } out := result.(*CreateProjectOutput) out.ResultMetadata = metadata return out, nil } // Request structure used to request a project be created. type CreateProjectInput struct { // ZIP or YAML file which contains configuration settings to be used when creating // the project. This may be the contents of the file downloaded from the URL // provided in an export project operation. Contents []byte // Name of the project. Name *string // Default region where project resources should be created. Region *string // Unique identifier for an exported snapshot of project configuration. This // snapshot identifier is included in the share URL when a project is exported. SnapshotId *string noSmithyDocumentSerde } // Result structure used in response to a request to create a project. type CreateProjectOutput struct { // Detailed information about the created AWS Mobile Hub project. Details *types.ProjectDetails // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateProjectMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateProject{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateProject{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opCreateProject(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_opCreateProject(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "AWSMobileHubService", OperationName: "CreateProject", } }
134
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mobile 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/mobile/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Delets a project in AWS Mobile Hub. func (c *Client) DeleteProject(ctx context.Context, params *DeleteProjectInput, optFns ...func(*Options)) (*DeleteProjectOutput, error) { if params == nil { params = &DeleteProjectInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteProject", params, optFns, c.addOperationDeleteProjectMiddlewares) if err != nil { return nil, err } out := result.(*DeleteProjectOutput) out.ResultMetadata = metadata return out, nil } // Request structure used to request a project be deleted. type DeleteProjectInput struct { // Unique project identifier. // // This member is required. ProjectId *string noSmithyDocumentSerde } // Result structure used in response to request to delete a project. type DeleteProjectOutput struct { // Resources which were deleted. DeletedResources []types.Resource // Resources which were not deleted, due to a risk of losing potentially important // data or files. OrphanedResources []types.Resource // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteProjectMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteProject{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteProject{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteProjectValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProject(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_opDeleteProject(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "AWSMobileHubService", OperationName: "DeleteProject", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mobile 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/mobile/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Get the bundle details for the requested bundle id. func (c *Client) DescribeBundle(ctx context.Context, params *DescribeBundleInput, optFns ...func(*Options)) (*DescribeBundleOutput, error) { if params == nil { params = &DescribeBundleInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeBundle", params, optFns, c.addOperationDescribeBundleMiddlewares) if err != nil { return nil, err } out := result.(*DescribeBundleOutput) out.ResultMetadata = metadata return out, nil } // Request structure to request the details of a specific bundle. type DescribeBundleInput struct { // Unique bundle identifier. // // This member is required. BundleId *string noSmithyDocumentSerde } // Result structure contains the details of the bundle. type DescribeBundleOutput struct { // The details of the bundle. Details *types.BundleDetails // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeBundleMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeBundle{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeBundle{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeBundleValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeBundle(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_opDescribeBundle(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "AWSMobileHubService", OperationName: "DescribeBundle", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mobile 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/mobile/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets details about a project in AWS Mobile Hub. func (c *Client) DescribeProject(ctx context.Context, params *DescribeProjectInput, optFns ...func(*Options)) (*DescribeProjectOutput, error) { if params == nil { params = &DescribeProjectInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeProject", params, optFns, c.addOperationDescribeProjectMiddlewares) if err != nil { return nil, err } out := result.(*DescribeProjectOutput) out.ResultMetadata = metadata return out, nil } // Request structure used to request details about a project. type DescribeProjectInput struct { // Unique project identifier. // // This member is required. ProjectId *string // If set to true, causes AWS Mobile Hub to synchronize information from other // services, e.g., update state of AWS CloudFormation stacks in the AWS Mobile Hub // project. SyncFromResources bool noSmithyDocumentSerde } // Result structure used for requests of project details. type DescribeProjectOutput struct { // Detailed information about an AWS Mobile Hub project. Details *types.ProjectDetails // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeProjectMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeProject{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeProject{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeProjectValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeProject(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_opDescribeProject(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "AWSMobileHubService", OperationName: "DescribeProject", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mobile 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/mobile/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Generates customized software development kit (SDK) and or tool packages used // to integrate mobile web or mobile app clients with backend AWS resources. func (c *Client) ExportBundle(ctx context.Context, params *ExportBundleInput, optFns ...func(*Options)) (*ExportBundleOutput, error) { if params == nil { params = &ExportBundleInput{} } result, metadata, err := c.invokeOperation(ctx, "ExportBundle", params, optFns, c.addOperationExportBundleMiddlewares) if err != nil { return nil, err } out := result.(*ExportBundleOutput) out.ResultMetadata = metadata return out, nil } // Request structure used to request generation of custom SDK and tool packages // required to integrate mobile web or app clients with backed AWS resources. type ExportBundleInput struct { // Unique bundle identifier. // // This member is required. BundleId *string // Developer desktop or target application platform. Platform types.Platform // Unique project identifier. ProjectId *string noSmithyDocumentSerde } // Result structure which contains link to download custom-generated SDK and tool // packages used to integrate mobile web or app clients with backed AWS resources. type ExportBundleOutput struct { // URL which contains the custom-generated SDK and tool packages used to integrate // the client mobile app or web app with the AWS resources created by the AWS // Mobile Hub project. DownloadUrl *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationExportBundleMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpExportBundle{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpExportBundle{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpExportBundleValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opExportBundle(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_opExportBundle(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "AWSMobileHubService", OperationName: "ExportBundle", } }
138
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mobile 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" ) // Exports project configuration to a snapshot which can be downloaded and shared. // Note that mobile app push credentials are encrypted in exported projects, so // they can only be shared successfully within the same AWS account. func (c *Client) ExportProject(ctx context.Context, params *ExportProjectInput, optFns ...func(*Options)) (*ExportProjectOutput, error) { if params == nil { params = &ExportProjectInput{} } result, metadata, err := c.invokeOperation(ctx, "ExportProject", params, optFns, c.addOperationExportProjectMiddlewares) if err != nil { return nil, err } out := result.(*ExportProjectOutput) out.ResultMetadata = metadata return out, nil } // Request structure used in requests to export project configuration details. type ExportProjectInput struct { // Unique project identifier. // // This member is required. ProjectId *string noSmithyDocumentSerde } // Result structure used for requests to export project configuration details. type ExportProjectOutput struct { // URL which can be used to download the exported project configuation file(s). DownloadUrl *string // URL which can be shared to allow other AWS users to create their own project in // AWS Mobile Hub with the same configuration as the specified project. This URL // pertains to a snapshot in time of the project configuration that is created when // this API is called. If you want to share additional changes to your project // configuration, then you will need to create and share a new snapshot by calling // this method again. ShareUrl *string // Unique identifier for the exported snapshot of the project configuration. This // snapshot identifier is included in the share URL. SnapshotId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationExportProjectMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpExportProject{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpExportProject{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpExportProjectValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opExportProject(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_opExportProject(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "AWSMobileHubService", OperationName: "ExportProject", } }
140
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mobile 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/mobile/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // List all available bundles. func (c *Client) ListBundles(ctx context.Context, params *ListBundlesInput, optFns ...func(*Options)) (*ListBundlesOutput, error) { if params == nil { params = &ListBundlesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListBundles", params, optFns, c.addOperationListBundlesMiddlewares) if err != nil { return nil, err } out := result.(*ListBundlesOutput) out.ResultMetadata = metadata return out, nil } // Request structure to request all available bundles. type ListBundlesInput struct { // Maximum number of records to list in a single response. MaxResults int32 // Pagination token. Set to null to start listing bundles from start. If non-null // pagination token is returned in a result, then pass its value in here in another // request to list more bundles. NextToken *string noSmithyDocumentSerde } // Result structure contains a list of all available bundles with details. type ListBundlesOutput struct { // A list of bundles. BundleList []types.BundleDetails // Pagination token. If non-null pagination token is returned in a result, then // pass its value in another request to fetch more entries. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListBundlesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListBundles{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListBundles{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListBundles(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 } // ListBundlesAPIClient is a client that implements the ListBundles operation. type ListBundlesAPIClient interface { ListBundles(context.Context, *ListBundlesInput, ...func(*Options)) (*ListBundlesOutput, error) } var _ ListBundlesAPIClient = (*Client)(nil) // ListBundlesPaginatorOptions is the paginator options for ListBundles type ListBundlesPaginatorOptions struct { // Maximum number of records to list in a single 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 } // ListBundlesPaginator is a paginator for ListBundles type ListBundlesPaginator struct { options ListBundlesPaginatorOptions client ListBundlesAPIClient params *ListBundlesInput nextToken *string firstPage bool } // NewListBundlesPaginator returns a new ListBundlesPaginator func NewListBundlesPaginator(client ListBundlesAPIClient, params *ListBundlesInput, optFns ...func(*ListBundlesPaginatorOptions)) *ListBundlesPaginator { if params == nil { params = &ListBundlesInput{} } options := ListBundlesPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListBundlesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListBundlesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListBundles page. func (p *ListBundlesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBundlesOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListBundles(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_opListBundles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "AWSMobileHubService", OperationName: "ListBundles", } }
217
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mobile 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/mobile/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists projects in AWS Mobile Hub. func (c *Client) ListProjects(ctx context.Context, params *ListProjectsInput, optFns ...func(*Options)) (*ListProjectsOutput, error) { if params == nil { params = &ListProjectsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListProjects", params, optFns, c.addOperationListProjectsMiddlewares) if err != nil { return nil, err } out := result.(*ListProjectsOutput) out.ResultMetadata = metadata return out, nil } // Request structure used to request projects list in AWS Mobile Hub. type ListProjectsInput struct { // Maximum number of records to list in a single response. MaxResults int32 // Pagination token. Set to null to start listing projects from start. If non-null // pagination token is returned in a result, then pass its value in here in another // request to list more projects. NextToken *string noSmithyDocumentSerde } // Result structure used for requests to list projects in AWS Mobile Hub. type ListProjectsOutput struct { // Pagination token. Set to null to start listing records from start. If non-null // pagination token is returned in a result, then pass its value in here in another // request to list more entries. NextToken *string // List of projects. Projects []types.ProjectSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListProjectsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListProjects{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListProjects{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListProjects(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 } // ListProjectsAPIClient is a client that implements the ListProjects operation. type ListProjectsAPIClient interface { ListProjects(context.Context, *ListProjectsInput, ...func(*Options)) (*ListProjectsOutput, error) } var _ ListProjectsAPIClient = (*Client)(nil) // ListProjectsPaginatorOptions is the paginator options for ListProjects type ListProjectsPaginatorOptions struct { // Maximum number of records to list in a single 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 } // ListProjectsPaginator is a paginator for ListProjects type ListProjectsPaginator struct { options ListProjectsPaginatorOptions client ListProjectsAPIClient params *ListProjectsInput nextToken *string firstPage bool } // NewListProjectsPaginator returns a new ListProjectsPaginator func NewListProjectsPaginator(client ListProjectsAPIClient, params *ListProjectsInput, optFns ...func(*ListProjectsPaginatorOptions)) *ListProjectsPaginator { if params == nil { params = &ListProjectsInput{} } options := ListProjectsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListProjectsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListProjectsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListProjects page. func (p *ListProjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProjectsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListProjects(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_opListProjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "AWSMobileHubService", OperationName: "ListProjects", } }
218
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mobile 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/mobile/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Update an existing project. func (c *Client) UpdateProject(ctx context.Context, params *UpdateProjectInput, optFns ...func(*Options)) (*UpdateProjectOutput, error) { if params == nil { params = &UpdateProjectInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateProject", params, optFns, c.addOperationUpdateProjectMiddlewares) if err != nil { return nil, err } out := result.(*UpdateProjectOutput) out.ResultMetadata = metadata return out, nil } // Request structure used for requests to update project configuration. type UpdateProjectInput struct { // Unique project identifier. // // This member is required. ProjectId *string // ZIP or YAML file which contains project configuration to be updated. This // should be the contents of the file downloaded from the URL provided in an export // project operation. Contents []byte noSmithyDocumentSerde } // Result structure used for requests to updated project configuration. type UpdateProjectOutput struct { // Detailed information about the updated AWS Mobile Hub project. Details *types.ProjectDetails // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateProjectMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateProject{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateProject{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateProjectValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateProject(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_opUpdateProject(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "AWSMobileHubService", OperationName: "UpdateProject", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mobile import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/mobile/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "strings" ) type awsRestjson1_deserializeOpCreateProject struct { } func (*awsRestjson1_deserializeOpCreateProject) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateProject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorCreateProject(response, &metadata) } output := &CreateProjectOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentCreateProjectOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateProject(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateProjectOutput(v **CreateProjectOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateProjectOutput if *v == nil { sv = &CreateProjectOutput{} } else { sv = *v } for key, value := range shape { switch key { case "details": if err := awsRestjson1_deserializeDocumentProjectDetails(&sv.Details, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteProject struct { } func (*awsRestjson1_deserializeOpDeleteProject) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteProject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDeleteProject(response, &metadata) } output := &DeleteProjectOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentDeleteProjectOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteProject(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteProjectOutput(v **DeleteProjectOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteProjectOutput if *v == nil { sv = &DeleteProjectOutput{} } else { sv = *v } for key, value := range shape { switch key { case "deletedResources": if err := awsRestjson1_deserializeDocumentResources(&sv.DeletedResources, value); err != nil { return err } case "orphanedResources": if err := awsRestjson1_deserializeDocumentResources(&sv.OrphanedResources, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeBundle struct { } func (*awsRestjson1_deserializeOpDescribeBundle) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeBundle) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDescribeBundle(response, &metadata) } output := &DescribeBundleOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentDescribeBundleOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDescribeBundle(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeBundleOutput(v **DescribeBundleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeBundleOutput if *v == nil { sv = &DescribeBundleOutput{} } else { sv = *v } for key, value := range shape { switch key { case "details": if err := awsRestjson1_deserializeDocumentBundleDetails(&sv.Details, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeProject struct { } func (*awsRestjson1_deserializeOpDescribeProject) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeProject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDescribeProject(response, &metadata) } output := &DescribeProjectOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentDescribeProjectOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDescribeProject(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeProjectOutput(v **DescribeProjectOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeProjectOutput if *v == nil { sv = &DescribeProjectOutput{} } else { sv = *v } for key, value := range shape { switch key { case "details": if err := awsRestjson1_deserializeDocumentProjectDetails(&sv.Details, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpExportBundle struct { } func (*awsRestjson1_deserializeOpExportBundle) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpExportBundle) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorExportBundle(response, &metadata) } output := &ExportBundleOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentExportBundleOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorExportBundle(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentExportBundleOutput(v **ExportBundleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ExportBundleOutput if *v == nil { sv = &ExportBundleOutput{} } else { sv = *v } for key, value := range shape { switch key { case "downloadUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DownloadUrl to be of type string, got %T instead", value) } sv.DownloadUrl = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpExportProject struct { } func (*awsRestjson1_deserializeOpExportProject) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpExportProject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorExportProject(response, &metadata) } output := &ExportProjectOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentExportProjectOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorExportProject(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentExportProjectOutput(v **ExportProjectOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ExportProjectOutput if *v == nil { sv = &ExportProjectOutput{} } else { sv = *v } for key, value := range shape { switch key { case "downloadUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DownloadUrl to be of type string, got %T instead", value) } sv.DownloadUrl = ptr.String(jtv) } case "shareUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShareUrl to be of type string, got %T instead", value) } sv.ShareUrl = ptr.String(jtv) } case "snapshotId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SnapshotId to be of type string, got %T instead", value) } sv.SnapshotId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListBundles struct { } func (*awsRestjson1_deserializeOpListBundles) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListBundles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListBundles(response, &metadata) } output := &ListBundlesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListBundlesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListBundles(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListBundlesOutput(v **ListBundlesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListBundlesOutput if *v == nil { sv = &ListBundlesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "bundleList": if err := awsRestjson1_deserializeDocumentBundleList(&sv.BundleList, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListProjects struct { } func (*awsRestjson1_deserializeOpListProjects) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListProjects) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListProjects(response, &metadata) } output := &ListProjectsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListProjectsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListProjects(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListProjectsOutput(v **ListProjectsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListProjectsOutput if *v == nil { sv = &ListProjectsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "projects": if err := awsRestjson1_deserializeDocumentProjectSummaries(&sv.Projects, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateProject struct { } func (*awsRestjson1_deserializeOpUpdateProject) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateProject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUpdateProject(response, &metadata) } output := &UpdateProjectOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentUpdateProjectOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateProject(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccountActionRequiredException", errorCode): return awsRestjson1_deserializeErrorAccountActionRequiredException(response, errorBody) case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateProjectOutput(v **UpdateProjectOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateProjectOutput if *v == nil { sv = &UpdateProjectOutput{} } else { sv = *v } for key, value := range shape { switch key { case "details": if err := awsRestjson1_deserializeDocumentProjectDetails(&sv.Details, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeOpHttpBindingsLimitExceededException(v *types.LimitExceededException, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { headerValues[0] = strings.TrimSpace(headerValues[0]) v.RetryAfterSeconds = ptr.String(headerValues[0]) } return nil } func awsRestjson1_deserializeOpHttpBindingsServiceUnavailableException(v *types.ServiceUnavailableException, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { headerValues[0] = strings.TrimSpace(headerValues[0]) v.RetryAfterSeconds = ptr.String(headerValues[0]) } return nil } func awsRestjson1_deserializeOpHttpBindingsTooManyRequestsException(v *types.TooManyRequestsException, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { headerValues[0] = strings.TrimSpace(headerValues[0]) v.RetryAfterSeconds = ptr.String(headerValues[0]) } return nil } func awsRestjson1_deserializeErrorAccountActionRequiredException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.AccountActionRequiredException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentAccountActionRequiredException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.BadRequestException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentBadRequestException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorInternalFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalFailureException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentInternalFailureException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.LimitExceededException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentLimitExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if err := awsRestjson1_deserializeOpHttpBindingsLimitExceededException(output, response); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} } return output } func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.NotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorServiceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ServiceUnavailableException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentServiceUnavailableException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if err := awsRestjson1_deserializeOpHttpBindingsServiceUnavailableException(output, response); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} } return output } func awsRestjson1_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.TooManyRequestsException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentTooManyRequestsException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if err := awsRestjson1_deserializeOpHttpBindingsTooManyRequestsException(output, response); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} } return output } func awsRestjson1_deserializeErrorUnauthorizedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.UnauthorizedException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentUnauthorizedException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeDocumentAccountActionRequiredException(v **types.AccountActionRequiredException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AccountActionRequiredException if *v == nil { sv = &types.AccountActionRequiredException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAttributes(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var mv map[string]string if *v == nil { mv = map[string]string{} } else { mv = *v } for key, value := range shape { var parsedVal string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AttributeValue to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.BadRequestException if *v == nil { sv = &types.BadRequestException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBundleDetails(v **types.BundleDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.BundleDetails if *v == nil { sv = &types.BundleDetails{} } else { sv = *v } for key, value := range shape { switch key { case "availablePlatforms": if err := awsRestjson1_deserializeDocumentPlatforms(&sv.AvailablePlatforms, value); err != nil { return err } case "bundleId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BundleId to be of type string, got %T instead", value) } sv.BundleId = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BundleDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "iconUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IconUrl to be of type string, got %T instead", value) } sv.IconUrl = ptr.String(jtv) } case "title": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BundleTitle to be of type string, got %T instead", value) } sv.Title = ptr.String(jtv) } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BundleVersion to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBundleList(v *[]types.BundleDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.BundleDetails if *v == nil { cv = []types.BundleDetails{} } else { cv = *v } for _, value := range shape { var col types.BundleDetails destAddr := &col if err := awsRestjson1_deserializeDocumentBundleDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInternalFailureException(v **types.InternalFailureException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InternalFailureException if *v == nil { sv = &types.InternalFailureException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LimitExceededException if *v == nil { sv = &types.LimitExceededException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "retryAfterSeconds": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.RetryAfterSeconds = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNotFoundException(v **types.NotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NotFoundException if *v == nil { sv = &types.NotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPlatforms(v *[]types.Platform, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.Platform if *v == nil { cv = []types.Platform{} } else { cv = *v } for _, value := range shape { var col types.Platform if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Platform to be of type string, got %T instead", value) } col = types.Platform(jtv) } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentProjectDetails(v **types.ProjectDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ProjectDetails if *v == nil { sv = &types.ProjectDetails{} } else { sv = *v } for key, value := range shape { switch key { case "consoleUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConsoleUrl to be of type string, got %T instead", value) } sv.ConsoleUrl = ptr.String(jtv) } case "createdDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value) } } case "lastUpdatedDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value) } } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProjectName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "projectId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProjectId to be of type string, got %T instead", value) } sv.ProjectId = ptr.String(jtv) } case "region": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProjectRegion to be of type string, got %T instead", value) } sv.Region = ptr.String(jtv) } case "resources": if err := awsRestjson1_deserializeDocumentResources(&sv.Resources, value); err != nil { return err } case "state": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProjectState to be of type string, got %T instead", value) } sv.State = types.ProjectState(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentProjectSummaries(v *[]types.ProjectSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.ProjectSummary if *v == nil { cv = []types.ProjectSummary{} } else { cv = *v } for _, value := range shape { var col types.ProjectSummary destAddr := &col if err := awsRestjson1_deserializeDocumentProjectSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentProjectSummary(v **types.ProjectSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ProjectSummary if *v == nil { sv = &types.ProjectSummary{} } else { sv = *v } for key, value := range shape { switch key { case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProjectName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "projectId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProjectId to be of type string, got %T instead", value) } sv.ProjectId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResource(v **types.Resource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Resource if *v == nil { sv = &types.Resource{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "attributes": if err := awsRestjson1_deserializeDocumentAttributes(&sv.Attributes, value); err != nil { return err } case "feature": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Feature to be of type string, got %T instead", value) } sv.Feature = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResources(v *[]types.Resource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.Resource if *v == nil { cv = []types.Resource{} } else { cv = *v } for _, value := range shape { var col types.Resource destAddr := &col if err := awsRestjson1_deserializeDocumentResource(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ServiceUnavailableException if *v == nil { sv = &types.ServiceUnavailableException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "retryAfterSeconds": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.RetryAfterSeconds = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTooManyRequestsException(v **types.TooManyRequestsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.TooManyRequestsException if *v == nil { sv = &types.TooManyRequestsException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "retryAfterSeconds": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.RetryAfterSeconds = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUnauthorizedException(v **types.UnauthorizedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.UnauthorizedException if *v == nil { sv = &types.UnauthorizedException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil }
2,700
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package mobile provides the API client, operations, and parameter types for AWS // Mobile. // // AWS Mobile Service provides mobile app and website developers with capabilities // required to configure AWS resources and bootstrap their developer desktop // projects with the necessary SDKs, constants, tools and samples to make use of // those resources. package mobile
11
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mobile 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/mobile/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 = "awsmobilehubservice" } 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 mobile // goModuleVersion is the tagged release for this module const goModuleVersion = "1.12.12"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mobile
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mobile import ( "bytes" "context" "fmt" 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" ) type awsRestjson1_serializeOpCreateProject struct { } func (*awsRestjson1_serializeOpCreateProject) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateProjectInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsCreateProjectInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if !restEncoder.HasHeader("Content-Type") { ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true) restEncoder.SetHeader("Content-Type").String("application/octet-stream") } if input.Contents != nil { payload := bytes.NewReader(input.Contents) if request, err = request.SetStream(payload); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsCreateProjectInput(v *CreateProjectInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Name != nil { encoder.SetQuery("name").String(*v.Name) } if v.Region != nil { encoder.SetQuery("region").String(*v.Region) } if v.SnapshotId != nil { encoder.SetQuery("snapshotId").String(*v.SnapshotId) } return nil } type awsRestjson1_serializeOpDeleteProject struct { } func (*awsRestjson1_serializeOpDeleteProject) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteProjectInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{projectId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDeleteProjectInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDeleteProjectInput(v *DeleteProjectInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ProjectId == nil || len(*v.ProjectId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member projectId must not be empty")} } if v.ProjectId != nil { if err := encoder.SetURI("projectId").String(*v.ProjectId); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeBundle struct { } func (*awsRestjson1_serializeOpDescribeBundle) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeBundle) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeBundleInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/bundles/{bundleId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDescribeBundleInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDescribeBundleInput(v *DescribeBundleInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.BundleId == nil || len(*v.BundleId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member bundleId must not be empty")} } if v.BundleId != nil { if err := encoder.SetURI("bundleId").String(*v.BundleId); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeProject struct { } func (*awsRestjson1_serializeOpDescribeProject) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeProjectInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/project") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDescribeProjectInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDescribeProjectInput(v *DescribeProjectInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ProjectId != nil { encoder.SetQuery("projectId").String(*v.ProjectId) } if v.SyncFromResources { encoder.SetQuery("syncFromResources").Boolean(v.SyncFromResources) } return nil } type awsRestjson1_serializeOpExportBundle struct { } func (*awsRestjson1_serializeOpExportBundle) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpExportBundle) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ExportBundleInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/bundles/{bundleId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsExportBundleInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsExportBundleInput(v *ExportBundleInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.BundleId == nil || len(*v.BundleId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member bundleId must not be empty")} } if v.BundleId != nil { if err := encoder.SetURI("bundleId").String(*v.BundleId); err != nil { return err } } if len(v.Platform) > 0 { encoder.SetQuery("platform").String(string(v.Platform)) } if v.ProjectId != nil { encoder.SetQuery("projectId").String(*v.ProjectId) } return nil } type awsRestjson1_serializeOpExportProject struct { } func (*awsRestjson1_serializeOpExportProject) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpExportProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ExportProjectInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/exports/{projectId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsExportProjectInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsExportProjectInput(v *ExportProjectInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ProjectId == nil || len(*v.ProjectId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member projectId must not be empty")} } if v.ProjectId != nil { if err := encoder.SetURI("projectId").String(*v.ProjectId); err != nil { return err } } return nil } type awsRestjson1_serializeOpListBundles struct { } func (*awsRestjson1_serializeOpListBundles) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListBundles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListBundlesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/bundles") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListBundlesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListBundlesInput(v *ListBundlesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListProjects struct { } func (*awsRestjson1_serializeOpListProjects) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListProjects) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListProjectsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListProjectsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListProjectsInput(v *ListProjectsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpUpdateProject struct { } func (*awsRestjson1_serializeOpUpdateProject) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateProjectInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/update") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateProjectInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if !restEncoder.HasHeader("Content-Type") { ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true) restEncoder.SetHeader("Content-Type").String("application/octet-stream") } if input.Contents != nil { payload := bytes.NewReader(input.Contents) if request, err = request.SetStream(payload); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUpdateProjectInput(v *UpdateProjectInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ProjectId != nil { encoder.SetQuery("projectId").String(*v.ProjectId) } return nil }
563
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mobile import ( "context" "fmt" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpDeleteProject struct { } func (*validateOpDeleteProject) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteProject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteProjectInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteProjectInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeBundle struct { } func (*validateOpDescribeBundle) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeBundle) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeBundleInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeBundleInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeProject struct { } func (*validateOpDescribeProject) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeProject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeProjectInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeProjectInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpExportBundle struct { } func (*validateOpExportBundle) ID() string { return "OperationInputValidation" } func (m *validateOpExportBundle) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ExportBundleInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpExportBundleInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpExportProject struct { } func (*validateOpExportProject) ID() string { return "OperationInputValidation" } func (m *validateOpExportProject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ExportProjectInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpExportProjectInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateProject struct { } func (*validateOpUpdateProject) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateProject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateProjectInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateProjectInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpDeleteProjectValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteProject{}, middleware.After) } func addOpDescribeBundleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeBundle{}, middleware.After) } func addOpDescribeProjectValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeProject{}, middleware.After) } func addOpExportBundleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpExportBundle{}, middleware.After) } func addOpExportProjectValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpExportProject{}, middleware.After) } func addOpUpdateProjectValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateProject{}, middleware.After) } func validateOpDeleteProjectInput(v *DeleteProjectInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteProjectInput"} if v.ProjectId == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeBundleInput(v *DescribeBundleInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeBundleInput"} if v.BundleId == nil { invalidParams.Add(smithy.NewErrParamRequired("BundleId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeProjectInput(v *DescribeProjectInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeProjectInput"} if v.ProjectId == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpExportBundleInput(v *ExportBundleInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ExportBundleInput"} if v.BundleId == nil { invalidParams.Add(smithy.NewErrParamRequired("BundleId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpExportProjectInput(v *ExportProjectInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ExportProjectInput"} if v.ProjectId == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateProjectInput(v *UpdateProjectInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateProjectInput"} if v.ProjectId == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
245
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 Mobile 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: "mobile.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "mobile-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "mobile-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mobile.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "mobile.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "mobile-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "mobile-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mobile.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, }, { ID: "aws-iso", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "mobile-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mobile.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, }, { ID: "aws-iso-b", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "mobile-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mobile.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, }, { ID: "aws-iso-e", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "mobile-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mobile.{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: "mobile-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mobile.{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: "mobile.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "mobile-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "mobile-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mobile.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, }, }
297
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package endpoints import ( "testing" ) func TestRegexCompile(t *testing.T) { _ = defaultPartitions }
12
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types type Platform string // Enum values for Platform const ( PlatformOsx Platform = "OSX" PlatformWindows Platform = "WINDOWS" PlatformLinux Platform = "LINUX" PlatformObjc Platform = "OBJC" PlatformSwift Platform = "SWIFT" PlatformAndroid Platform = "ANDROID" PlatformJavascript Platform = "JAVASCRIPT" ) // Values returns all known values for Platform. 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 (Platform) Values() []Platform { return []Platform{ "OSX", "WINDOWS", "LINUX", "OBJC", "SWIFT", "ANDROID", "JAVASCRIPT", } } type ProjectState string // Enum values for ProjectState const ( ProjectStateNormal ProjectState = "NORMAL" ProjectStateSyncing ProjectState = "SYNCING" ProjectStateImporting ProjectState = "IMPORTING" ) // Values returns all known values for ProjectState. 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 (ProjectState) Values() []ProjectState { return []ProjectState{ "NORMAL", "SYNCING", "IMPORTING", } }
52
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" ) // Account Action is required in order to continue the request. type AccountActionRequiredException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AccountActionRequiredException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccountActionRequiredException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccountActionRequiredException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccountActionRequiredException" } return *e.ErrorCodeOverride } func (e *AccountActionRequiredException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request cannot be processed because some parameter is not valid or the // project state prevents the operation from being performed. type BadRequestException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *BadRequestException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *BadRequestException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *BadRequestException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "BadRequestException" } return *e.ErrorCodeOverride } func (e *BadRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The service has encountered an unexpected error condition which prevents it // from servicing the request. type InternalFailureException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InternalFailureException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalFailureException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalFailureException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalFailureException" } return *e.ErrorCodeOverride } func (e *InternalFailureException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // There are too many AWS Mobile Hub projects in the account or the account has // exceeded the maximum number of resources in some AWS service. You should create // another sub-account using AWS Organizations or remove some resources and retry // your request. type LimitExceededException struct { Message *string ErrorCodeOverride *string RetryAfterSeconds *string noSmithyDocumentSerde } func (e *LimitExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *LimitExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *LimitExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "LimitExceededException" } return *e.ErrorCodeOverride } func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // No entity can be found with the specified identifier. type NotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *NotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *NotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *NotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "NotFoundException" } return *e.ErrorCodeOverride } func (e *NotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The service is temporarily unavailable. The request should be retried after // some time delay. type ServiceUnavailableException struct { Message *string ErrorCodeOverride *string RetryAfterSeconds *string noSmithyDocumentSerde } func (e *ServiceUnavailableException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ServiceUnavailableException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ServiceUnavailableException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ServiceUnavailableException" } return *e.ErrorCodeOverride } func (e *ServiceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // Too many requests have been received for this AWS account in too short a time. // The request should be retried after some time delay. type TooManyRequestsException struct { Message *string ErrorCodeOverride *string RetryAfterSeconds *string noSmithyDocumentSerde } func (e *TooManyRequestsException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TooManyRequestsException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TooManyRequestsException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "TooManyRequestsException" } return *e.ErrorCodeOverride } func (e *TooManyRequestsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Credentials of the caller are insufficient to authorize the request. type UnauthorizedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *UnauthorizedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *UnauthorizedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *UnauthorizedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "UnauthorizedException" } return *e.ErrorCodeOverride } func (e *UnauthorizedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
230
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( smithydocument "github.com/aws/smithy-go/document" "time" ) // The details of the bundle. type BundleDetails struct { // Developer desktop or mobile app or website platforms. AvailablePlatforms []Platform // Unique bundle identifier. BundleId *string // Description of the download bundle. Description *string // Icon for the download bundle. IconUrl *string // Title of the download bundle. Title *string // Version of the download bundle. Version *string noSmithyDocumentSerde } // Detailed information about an AWS Mobile Hub project. type ProjectDetails struct { // Website URL for this project in the AWS Mobile Hub console. ConsoleUrl *string // Date the project was created. CreatedDate *time.Time // Date of the last modification of the project. LastUpdatedDate *time.Time // Name of the project. Name *string // Unique project identifier. ProjectId *string // Default region to use for AWS resource creation in the AWS Mobile Hub project. Region *string // List of AWS resources associated with a project. Resources []Resource // Synchronization state for a project. State ProjectState noSmithyDocumentSerde } // Summary information about an AWS Mobile Hub project. type ProjectSummary struct { // Name of the project. Name *string // Unique project identifier. ProjectId *string noSmithyDocumentSerde } // Information about an instance of an AWS resource associated with a project. type Resource struct { // AWS resource name which uniquely identifies the resource in AWS systems. Arn *string // Key-value attribute pairs. Attributes map[string]string // Identifies which feature in AWS Mobile Hub is associated with this AWS resource. Feature *string // Name of the AWS resource (e.g., for an Amazon S3 bucket this is the name of the // bucket). Name *string // Simplified name for type of AWS resource (e.g., bucket is an Amazon S3 bucket). Type *string noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
99
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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 = "mq" const ServiceAPIVersion = "2017-11-27" // Client provides the API client to make operations call for AmazonMQ. 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, "mq", 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) }
454
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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 mq 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/mq/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a broker. Note: This API is asynchronous. To create a broker, you must // either use the AmazonMQFullAccess IAM policy or include the following EC2 // permissions in your IAM policy. // - ec2:CreateNetworkInterface This permission is required to allow Amazon MQ // to create an elastic network interface (ENI) on behalf of your account. // - ec2:CreateNetworkInterfacePermission This permission is required to attach // the ENI to the broker instance. // - ec2:DeleteNetworkInterface // - ec2:DeleteNetworkInterfacePermission // - ec2:DetachNetworkInterface // - ec2:DescribeInternetGateways // - ec2:DescribeNetworkInterfaces // - ec2:DescribeNetworkInterfacePermissions // - ec2:DescribeRouteTables // - ec2:DescribeSecurityGroups // - ec2:DescribeSubnets // - ec2:DescribeVpcs // // For more information, see Create an IAM User and Get Your Amazon Web Services // Credentials (https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/amazon-mq-setting-up.html#create-iam-user) // and Never Modify or Delete the Amazon MQ Elastic Network Interface (https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/connecting-to-amazon-mq.html#never-modify-delete-elastic-network-interface) // in the Amazon MQ Developer Guide. func (c *Client) CreateBroker(ctx context.Context, params *CreateBrokerInput, optFns ...func(*Options)) (*CreateBrokerOutput, error) { if params == nil { params = &CreateBrokerInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateBroker", params, optFns, c.addOperationCreateBrokerMiddlewares) if err != nil { return nil, err } out := result.(*CreateBrokerOutput) out.ResultMetadata = metadata return out, nil } // Creates a broker using the specified properties. type CreateBrokerInput struct { // Enables automatic upgrades to new minor versions for brokers, as new versions // are released and supported by Amazon MQ. Automatic upgrades occur during the // scheduled maintenance window of the broker or after a manual broker reboot. Set // to true by default, if no value is specified. // // This member is required. AutoMinorVersionUpgrade bool // Required. The broker's name. This value must be unique in your Amazon Web // Services account, 1-50 characters long, must contain only letters, numbers, // dashes, and underscores, and must not contain white spaces, brackets, wildcard // characters, or special characters. Do not add personally identifiable // information (PII) or other confidential or sensitive information in broker // names. Broker names are accessible to other Amazon Web Services services, // including CloudWatch Logs. Broker names are not intended to be used for private // or sensitive data. // // This member is required. BrokerName *string // Required. The broker's deployment mode. // // This member is required. DeploymentMode types.DeploymentMode // Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and // RABBITMQ. // // This member is required. EngineType types.EngineType // Required. The broker engine's version. For a list of supported engine versions, // see Supported engines (https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/broker-engine.html) // . // // This member is required. EngineVersion *string // Required. The broker's instance type. // // This member is required. HostInstanceType *string // Enables connections from applications outside of the VPC that hosts the // broker's subnets. Set to false by default, if no value is provided. // // This member is required. PubliclyAccessible bool // The list of broker users (persons or applications) who can access queues and // topics. For Amazon MQ for RabbitMQ brokers, one and only one administrative user // is accepted and created when a broker is first provisioned. All subsequent // broker users are created by making RabbitMQ API calls directly to brokers or via // the RabbitMQ web console. // // This member is required. Users []types.User // Optional. The authentication strategy used to secure the broker. The default is // SIMPLE. AuthenticationStrategy types.AuthenticationStrategy // A list of information about the configuration. Configuration *types.ConfigurationId // The unique ID that the requester receives for the created broker. Amazon MQ // passes your ID with the API action. We recommend using a Universally Unique // Identifier (UUID) for the creatorRequestId. You may omit the creatorRequestId if // your application doesn't require idempotency. CreatorRequestId *string // Defines whether this broker is a part of a data replication pair. DataReplicationMode types.DataReplicationMode // The Amazon Resource Name (ARN) of the primary broker that is used to replicate // data from in a data replication pair, and is applied to the replica broker. Must // be set when dataReplicationMode is set to CRDR. DataReplicationPrimaryBrokerArn *string // Encryption options for the broker. EncryptionOptions *types.EncryptionOptions // Optional. The metadata of the LDAP server used to authenticate and authorize // connections to the broker. Does not apply to RabbitMQ brokers. LdapServerMetadata *types.LdapServerMetadataInput // Enables Amazon CloudWatch logging for brokers. Logs *types.Logs // The parameters that determine the WeeklyStartTime. MaintenanceWindowStartTime *types.WeeklyStartTime // The list of rules (1 minimum, 125 maximum) that authorize connections to // brokers. SecurityGroups []string // The broker's storage type. StorageType types.BrokerStorageType // The list of groups that define which subnets and IP ranges the broker can use // from different Availability Zones. If you specify more than one subnet, the // subnets must be in different Availability Zones. Amazon MQ will not be able to // create VPC endpoints for your broker with multiple subnets in the same // Availability Zone. A SINGLE_INSTANCE deployment requires one subnet (for // example, the default subnet). An ACTIVE_STANDBY_MULTI_AZ Amazon MQ for ActiveMQ // deployment requires two subnets. A CLUSTER_MULTI_AZ Amazon MQ for RabbitMQ // deployment has no subnet requirements when deployed with public accessibility. // Deployment without public accessibility requires at least one subnet. If you // specify subnets in a shared VPC (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-sharing.html) // for a RabbitMQ broker, the associated VPC to which the specified subnets belong // must be owned by your Amazon Web Services account. Amazon MQ will not be able to // create VPC endpoints in VPCs that are not owned by your Amazon Web Services // account. SubnetIds []string // Create tags when creating the broker. Tags map[string]string noSmithyDocumentSerde } type CreateBrokerOutput struct { // The broker's Amazon Resource Name (ARN). BrokerArn *string // The unique ID that Amazon MQ generates for the broker. BrokerId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateBrokerMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateBroker{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateBroker{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opCreateBrokerMiddleware(stack, options); err != nil { return err } if err = addOpCreateBrokerValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateBroker(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_initializeOpCreateBroker struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateBroker) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateBroker) 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.(*CreateBrokerInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateBrokerInput ") } if input.CreatorRequestId == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.CreatorRequestId = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateBrokerMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateBroker{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateBroker(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "CreateBroker", } }
300
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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/mq/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Creates a new configuration for the specified configuration name. Amazon MQ // uses the default configuration (the engine type and version). func (c *Client) CreateConfiguration(ctx context.Context, params *CreateConfigurationInput, optFns ...func(*Options)) (*CreateConfigurationOutput, error) { if params == nil { params = &CreateConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateConfiguration", params, optFns, c.addOperationCreateConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*CreateConfigurationOutput) out.ResultMetadata = metadata return out, nil } // Creates a new configuration for the specified configuration name. Amazon MQ // uses the default configuration (the engine type and version). type CreateConfigurationInput struct { // Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and // RABBITMQ. // // This member is required. EngineType types.EngineType // Required. The broker engine's version. For a list of supported engine versions, // see Supported engines (https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/broker-engine.html) // . // // This member is required. EngineVersion *string // Required. The name of the configuration. This value can contain only // alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). // This value must be 1-150 characters long. // // This member is required. Name *string // Optional. The authentication strategy associated with the configuration. The // default is SIMPLE. AuthenticationStrategy types.AuthenticationStrategy // Create tags when creating the configuration. Tags map[string]string noSmithyDocumentSerde } type CreateConfigurationOutput struct { // Required. The Amazon Resource Name (ARN) of the configuration. Arn *string // Optional. The authentication strategy associated with the configuration. The // default is SIMPLE. AuthenticationStrategy types.AuthenticationStrategy // Required. The date and time of the configuration. Created *time.Time // Required. The unique ID that Amazon MQ generates for the configuration. Id *string // The latest revision of the configuration. LatestRevision *types.ConfigurationRevision // Required. The name of the configuration. This value can contain only // alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). // This value must be 1-150 characters long. Name *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateConfiguration(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_opCreateConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "CreateConfiguration", } }
169
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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 a tag to a resource. func (c *Client) CreateTags(ctx context.Context, params *CreateTagsInput, optFns ...func(*Options)) (*CreateTagsOutput, error) { if params == nil { params = &CreateTagsInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateTags", params, optFns, c.addOperationCreateTagsMiddlewares) if err != nil { return nil, err } out := result.(*CreateTagsOutput) out.ResultMetadata = metadata return out, nil } // A map of the key-value pairs for the resource tag. type CreateTagsInput struct { // The Amazon Resource Name (ARN) of the resource tag. // // This member is required. ResourceArn *string // The key-value pair for the resource tag. Tags map[string]string noSmithyDocumentSerde } type CreateTagsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateTagsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateTags{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateTags{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateTagsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTags(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_opCreateTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "CreateTags", } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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 an ActiveMQ user. Do not add personally identifiable information (PII) // or other confidential or sensitive information in broker usernames. Broker // usernames are accessible to other Amazon Web Services services, including // CloudWatch Logs. Broker usernames are not intended to be used for private or // sensitive data. func (c *Client) CreateUser(ctx context.Context, params *CreateUserInput, optFns ...func(*Options)) (*CreateUserOutput, error) { if params == nil { params = &CreateUserInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateUser", params, optFns, c.addOperationCreateUserMiddlewares) if err != nil { return nil, err } out := result.(*CreateUserOutput) out.ResultMetadata = metadata return out, nil } // Creates a new ActiveMQ user. type CreateUserInput struct { // The unique ID that Amazon MQ generates for the broker. // // This member is required. BrokerId *string // Required. The password of the user. This value must be at least 12 characters // long, must contain at least 4 unique characters, and must not contain commas, // colons, or equal signs (,:=). // // This member is required. Password *string // The username of the ActiveMQ user. This value can contain only alphanumeric // characters, dashes, periods, underscores, and tildes (- . _ ~). This value must // be 2-100 characters long. // // This member is required. Username *string // Enables access to the ActiveMQ Web Console for the ActiveMQ user. ConsoleAccess bool // The list of groups (20 maximum) to which the ActiveMQ user belongs. This value // can contain only alphanumeric characters, dashes, periods, underscores, and // tildes (- . _ ~). This value must be 2-100 characters long. Groups []string // Defines if this user is intended for CRDR replication purposes. ReplicationUser bool noSmithyDocumentSerde } type CreateUserOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateUserMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateUser{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateUser{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateUserValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateUser(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_opCreateUser(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "CreateUser", } }
150
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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 broker. Note: This API is asynchronous. func (c *Client) DeleteBroker(ctx context.Context, params *DeleteBrokerInput, optFns ...func(*Options)) (*DeleteBrokerOutput, error) { if params == nil { params = &DeleteBrokerInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteBroker", params, optFns, c.addOperationDeleteBrokerMiddlewares) if err != nil { return nil, err } out := result.(*DeleteBrokerOutput) out.ResultMetadata = metadata return out, nil } type DeleteBrokerInput struct { // The unique ID that Amazon MQ generates for the broker. // // This member is required. BrokerId *string noSmithyDocumentSerde } type DeleteBrokerOutput struct { // The unique ID that Amazon MQ generates for the broker. BrokerId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteBrokerMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteBroker{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteBroker{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteBrokerValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteBroker(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_opDeleteBroker(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "DeleteBroker", } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Removes a tag from a resource. func (c *Client) DeleteTags(ctx context.Context, params *DeleteTagsInput, optFns ...func(*Options)) (*DeleteTagsOutput, error) { if params == nil { params = &DeleteTagsInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteTags", params, optFns, c.addOperationDeleteTagsMiddlewares) if err != nil { return nil, err } out := result.(*DeleteTagsOutput) out.ResultMetadata = metadata return out, nil } type DeleteTagsInput struct { // The Amazon Resource Name (ARN) of the resource tag. // // This member is required. ResourceArn *string // An array of tag keys to delete // // This member is required. TagKeys []string noSmithyDocumentSerde } type DeleteTagsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteTagsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteTags{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteTags{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteTagsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTags(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_opDeleteTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "DeleteTags", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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 ActiveMQ user. func (c *Client) DeleteUser(ctx context.Context, params *DeleteUserInput, optFns ...func(*Options)) (*DeleteUserOutput, error) { if params == nil { params = &DeleteUserInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteUser", params, optFns, c.addOperationDeleteUserMiddlewares) if err != nil { return nil, err } out := result.(*DeleteUserOutput) out.ResultMetadata = metadata return out, nil } type DeleteUserInput struct { // The unique ID that Amazon MQ generates for the broker. // // This member is required. BrokerId *string // The username of the ActiveMQ user. This value can contain only alphanumeric // characters, dashes, periods, underscores, and tildes (- . _ ~). This value must // be 2-100 characters long. // // This member is required. Username *string noSmithyDocumentSerde } type DeleteUserOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteUserMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteUser{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteUser{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteUserValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteUser(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_opDeleteUser(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "DeleteUser", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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/mq/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Returns information about the specified broker. func (c *Client) DescribeBroker(ctx context.Context, params *DescribeBrokerInput, optFns ...func(*Options)) (*DescribeBrokerOutput, error) { if params == nil { params = &DescribeBrokerInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeBroker", params, optFns, c.addOperationDescribeBrokerMiddlewares) if err != nil { return nil, err } out := result.(*DescribeBrokerOutput) out.ResultMetadata = metadata return out, nil } type DescribeBrokerInput struct { // The unique ID that Amazon MQ generates for the broker. // // This member is required. BrokerId *string noSmithyDocumentSerde } type DescribeBrokerOutput struct { // Actions required for a broker. ActionsRequired []types.ActionRequired // The authentication strategy used to secure the broker. The default is SIMPLE. AuthenticationStrategy types.AuthenticationStrategy // Enables automatic upgrades to new minor versions for brokers, as new versions // are released and supported by Amazon MQ. Automatic upgrades occur during the // scheduled maintenance window of the broker or after a manual broker reboot. AutoMinorVersionUpgrade bool // The broker's Amazon Resource Name (ARN). BrokerArn *string // The unique ID that Amazon MQ generates for the broker. BrokerId *string // A list of information about allocated brokers. BrokerInstances []types.BrokerInstance // The broker's name. This value must be unique in your Amazon Web Services // account account, 1-50 characters long, must contain only letters, numbers, // dashes, and underscores, and must not contain white spaces, brackets, wildcard // characters, or special characters. BrokerName *string // The broker's status. BrokerState types.BrokerState // The list of all revisions for the specified configuration. Configurations *types.Configurations // The time when the broker was created. Created *time.Time // The replication details of the data replication-enabled broker. Only returned // if dataReplicationMode is set to CRDR. DataReplicationMetadata *types.DataReplicationMetadataOutput // Describes whether this broker is a part of a data replication pair. DataReplicationMode types.DataReplicationMode // The broker's deployment mode. DeploymentMode types.DeploymentMode // Encryption options for the broker. EncryptionOptions *types.EncryptionOptions // The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and RABBITMQ. EngineType types.EngineType // The broker engine's version. For a list of supported engine versions, see // Supported engines (https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/broker-engine.html) // . EngineVersion *string // The broker's instance type. HostInstanceType *string // The metadata of the LDAP server used to authenticate and authorize connections // to the broker. LdapServerMetadata *types.LdapServerMetadataOutput // The list of information about logs currently enabled and pending to be deployed // for the specified broker. Logs *types.LogsSummary // The parameters that determine the WeeklyStartTime. MaintenanceWindowStartTime *types.WeeklyStartTime // The authentication strategy that will be applied when the broker is rebooted. // The default is SIMPLE. PendingAuthenticationStrategy types.AuthenticationStrategy // The pending replication details of the data replication-enabled broker. Only // returned if pendingDataReplicationMode is set to CRDR. PendingDataReplicationMetadata *types.DataReplicationMetadataOutput // Describes whether this broker will be a part of a data replication pair after // reboot. PendingDataReplicationMode types.DataReplicationMode // The broker engine version to upgrade to. For a list of supported engine // versions, see Supported engines (https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/broker-engine.html) // . PendingEngineVersion *string // The broker's host instance type to upgrade to. For a list of supported instance // types, see Broker instance types (https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/broker.html#broker-instance-types) // . PendingHostInstanceType *string // The metadata of the LDAP server that will be used to authenticate and authorize // connections to the broker after it is rebooted. PendingLdapServerMetadata *types.LdapServerMetadataOutput // The list of pending security groups to authorize connections to brokers. PendingSecurityGroups []string // Enables connections from applications outside of the VPC that hosts the // broker's subnets. PubliclyAccessible bool // The list of rules (1 minimum, 125 maximum) that authorize connections to // brokers. SecurityGroups []string // The broker's storage type. StorageType types.BrokerStorageType // The list of groups that define which subnets and IP ranges the broker can use // from different Availability Zones. SubnetIds []string // The list of all tags associated with this broker. Tags map[string]string // The list of all broker usernames for the specified broker. Users []types.UserSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeBrokerMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeBroker{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeBroker{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeBrokerValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeBroker(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_opDescribeBroker(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "DescribeBroker", } }
243
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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/mq/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Describe available engine types and versions. func (c *Client) DescribeBrokerEngineTypes(ctx context.Context, params *DescribeBrokerEngineTypesInput, optFns ...func(*Options)) (*DescribeBrokerEngineTypesOutput, error) { if params == nil { params = &DescribeBrokerEngineTypesInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeBrokerEngineTypes", params, optFns, c.addOperationDescribeBrokerEngineTypesMiddlewares) if err != nil { return nil, err } out := result.(*DescribeBrokerEngineTypesOutput) out.ResultMetadata = metadata return out, nil } type DescribeBrokerEngineTypesInput struct { // Filter response by engine type. EngineType *string // The maximum number of brokers that Amazon MQ can return per page (20 by // default). This value must be an integer from 5 to 100. MaxResults int32 // The token that specifies the next page of results Amazon MQ should return. To // request the first page, leave nextToken empty. NextToken *string noSmithyDocumentSerde } type DescribeBrokerEngineTypesOutput struct { // List of available engine types and versions. BrokerEngineTypes []types.BrokerEngineType // Required. The maximum number of engine types that can be returned per page (20 // by default). This value must be an integer from 5 to 100. MaxResults int32 // The token that specifies the next page of results Amazon MQ should return. To // request the first page, leave nextToken empty. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeBrokerEngineTypesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeBrokerEngineTypes{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeBrokerEngineTypes{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opDescribeBrokerEngineTypes(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_opDescribeBrokerEngineTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "DescribeBrokerEngineTypes", } }
136
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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/mq/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Describe available broker instance options. func (c *Client) DescribeBrokerInstanceOptions(ctx context.Context, params *DescribeBrokerInstanceOptionsInput, optFns ...func(*Options)) (*DescribeBrokerInstanceOptionsOutput, error) { if params == nil { params = &DescribeBrokerInstanceOptionsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeBrokerInstanceOptions", params, optFns, c.addOperationDescribeBrokerInstanceOptionsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeBrokerInstanceOptionsOutput) out.ResultMetadata = metadata return out, nil } type DescribeBrokerInstanceOptionsInput struct { // Filter response by engine type. EngineType *string // Filter response by host instance type. HostInstanceType *string // The maximum number of brokers that Amazon MQ can return per page (20 by // default). This value must be an integer from 5 to 100. MaxResults int32 // The token that specifies the next page of results Amazon MQ should return. To // request the first page, leave nextToken empty. NextToken *string // Filter response by storage type. StorageType *string noSmithyDocumentSerde } type DescribeBrokerInstanceOptionsOutput struct { // List of available broker instance options. BrokerInstanceOptions []types.BrokerInstanceOption // Required. The maximum number of instance options that can be returned per page // (20 by default). This value must be an integer from 5 to 100. MaxResults int32 // The token that specifies the next page of results Amazon MQ should return. To // request the first page, leave nextToken empty. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeBrokerInstanceOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeBrokerInstanceOptions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeBrokerInstanceOptions{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opDescribeBrokerInstanceOptions(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_opDescribeBrokerInstanceOptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "DescribeBrokerInstanceOptions", } }
142
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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/mq/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Returns information about the specified configuration. func (c *Client) DescribeConfiguration(ctx context.Context, params *DescribeConfigurationInput, optFns ...func(*Options)) (*DescribeConfigurationOutput, error) { if params == nil { params = &DescribeConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeConfiguration", params, optFns, c.addOperationDescribeConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*DescribeConfigurationOutput) out.ResultMetadata = metadata return out, nil } type DescribeConfigurationInput struct { // The unique ID that Amazon MQ generates for the configuration. // // This member is required. ConfigurationId *string noSmithyDocumentSerde } type DescribeConfigurationOutput struct { // Required. The ARN of the configuration. Arn *string // Optional. The authentication strategy associated with the configuration. The // default is SIMPLE. AuthenticationStrategy types.AuthenticationStrategy // Required. The date and time of the configuration revision. Created *time.Time // Required. The description of the configuration. Description *string // Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and // RABBITMQ. EngineType types.EngineType // Required. The broker engine's version. For a list of supported engine versions, // see, Supported engines (https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/broker-engine.html) // . EngineVersion *string // Required. The unique ID that Amazon MQ generates for the configuration. Id *string // Required. The latest revision of the configuration. LatestRevision *types.ConfigurationRevision // Required. The name of the configuration. This value can contain only // alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). // This value must be 1-150 characters long. Name *string // The list of all tags associated with this configuration. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeConfiguration(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_opDescribeConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "DescribeConfiguration", } }
159
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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" "time" ) // Returns the specified configuration revision for the specified configuration. func (c *Client) DescribeConfigurationRevision(ctx context.Context, params *DescribeConfigurationRevisionInput, optFns ...func(*Options)) (*DescribeConfigurationRevisionOutput, error) { if params == nil { params = &DescribeConfigurationRevisionInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeConfigurationRevision", params, optFns, c.addOperationDescribeConfigurationRevisionMiddlewares) if err != nil { return nil, err } out := result.(*DescribeConfigurationRevisionOutput) out.ResultMetadata = metadata return out, nil } type DescribeConfigurationRevisionInput struct { // The unique ID that Amazon MQ generates for the configuration. // // This member is required. ConfigurationId *string // The revision of the configuration. // // This member is required. ConfigurationRevision *string noSmithyDocumentSerde } type DescribeConfigurationRevisionOutput struct { // Required. The unique ID that Amazon MQ generates for the configuration. ConfigurationId *string // Required. The date and time of the configuration. Created *time.Time // Amazon MQ for ActiveMQ: the base64-encoded XML configuration. Amazon MQ for // RabbitMQ: base64-encoded Cuttlefish. Data *string // The description of the configuration. Description *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeConfigurationRevisionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeConfigurationRevision{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeConfigurationRevision{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeConfigurationRevisionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeConfigurationRevision(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_opDescribeConfigurationRevision(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "DescribeConfigurationRevision", } }
140
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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/mq/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns information about an ActiveMQ user. func (c *Client) DescribeUser(ctx context.Context, params *DescribeUserInput, optFns ...func(*Options)) (*DescribeUserOutput, error) { if params == nil { params = &DescribeUserInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeUser", params, optFns, c.addOperationDescribeUserMiddlewares) if err != nil { return nil, err } out := result.(*DescribeUserOutput) out.ResultMetadata = metadata return out, nil } type DescribeUserInput struct { // The unique ID that Amazon MQ generates for the broker. // // This member is required. BrokerId *string // The username of the ActiveMQ user. This value can contain only alphanumeric // characters, dashes, periods, underscores, and tildes (- . _ ~). This value must // be 2-100 characters long. // // This member is required. Username *string noSmithyDocumentSerde } type DescribeUserOutput struct { // Required. The unique ID that Amazon MQ generates for the broker. BrokerId *string // Enables access to the the ActiveMQ Web Console for the ActiveMQ user. ConsoleAccess bool // The list of groups (20 maximum) to which the ActiveMQ user belongs. This value // can contain only alphanumeric characters, dashes, periods, underscores, and // tildes (- . _ ~). This value must be 2-100 characters long. Groups []string // The status of the changes pending for the ActiveMQ user. Pending *types.UserPendingChanges // Describes whether the user is intended for data replication ReplicationUser bool // Required. The username of the ActiveMQ user. This value can contain only // alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). // This value must be 2-100 characters long. Username *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeUserMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeUser{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeUser{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeUserValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeUser(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_opDescribeUser(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "DescribeUser", } }
151
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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/mq/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of all brokers. func (c *Client) ListBrokers(ctx context.Context, params *ListBrokersInput, optFns ...func(*Options)) (*ListBrokersOutput, error) { if params == nil { params = &ListBrokersInput{} } result, metadata, err := c.invokeOperation(ctx, "ListBrokers", params, optFns, c.addOperationListBrokersMiddlewares) if err != nil { return nil, err } out := result.(*ListBrokersOutput) out.ResultMetadata = metadata return out, nil } type ListBrokersInput struct { // The maximum number of brokers that Amazon MQ can return per page (20 by // default). This value must be an integer from 5 to 100. MaxResults int32 // The token that specifies the next page of results Amazon MQ should return. To // request the first page, leave nextToken empty. NextToken *string noSmithyDocumentSerde } type ListBrokersOutput struct { // A list of information about all brokers. BrokerSummaries []types.BrokerSummary // The token that specifies the next page of results Amazon MQ should return. To // request the first page, leave nextToken empty. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListBrokersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListBrokers{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListBrokers{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListBrokers(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 } // ListBrokersAPIClient is a client that implements the ListBrokers operation. type ListBrokersAPIClient interface { ListBrokers(context.Context, *ListBrokersInput, ...func(*Options)) (*ListBrokersOutput, error) } var _ ListBrokersAPIClient = (*Client)(nil) // ListBrokersPaginatorOptions is the paginator options for ListBrokers type ListBrokersPaginatorOptions struct { // The maximum number of brokers that Amazon MQ can return per page (20 by // default). This value must be an integer from 5 to 100. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListBrokersPaginator is a paginator for ListBrokers type ListBrokersPaginator struct { options ListBrokersPaginatorOptions client ListBrokersAPIClient params *ListBrokersInput nextToken *string firstPage bool } // NewListBrokersPaginator returns a new ListBrokersPaginator func NewListBrokersPaginator(client ListBrokersAPIClient, params *ListBrokersInput, optFns ...func(*ListBrokersPaginatorOptions)) *ListBrokersPaginator { if params == nil { params = &ListBrokersInput{} } options := ListBrokersPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListBrokersPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListBrokersPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListBrokers page. func (p *ListBrokersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBrokersOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListBrokers(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_opListBrokers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "ListBrokers", } }
216
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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/mq/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of all revisions for the specified configuration. func (c *Client) ListConfigurationRevisions(ctx context.Context, params *ListConfigurationRevisionsInput, optFns ...func(*Options)) (*ListConfigurationRevisionsOutput, error) { if params == nil { params = &ListConfigurationRevisionsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListConfigurationRevisions", params, optFns, c.addOperationListConfigurationRevisionsMiddlewares) if err != nil { return nil, err } out := result.(*ListConfigurationRevisionsOutput) out.ResultMetadata = metadata return out, nil } type ListConfigurationRevisionsInput struct { // The unique ID that Amazon MQ generates for the configuration. // // This member is required. ConfigurationId *string // The maximum number of brokers that Amazon MQ can return per page (20 by // default). This value must be an integer from 5 to 100. MaxResults int32 // The token that specifies the next page of results Amazon MQ should return. To // request the first page, leave nextToken empty. NextToken *string noSmithyDocumentSerde } type ListConfigurationRevisionsOutput struct { // The unique ID that Amazon MQ generates for the configuration. ConfigurationId *string // The maximum number of configuration revisions that can be returned per page (20 // by default). This value must be an integer from 5 to 100. MaxResults int32 // The token that specifies the next page of results Amazon MQ should return. To // request the first page, leave nextToken empty. NextToken *string // The list of all revisions for the specified configuration. Revisions []types.ConfigurationRevision // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListConfigurationRevisionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListConfigurationRevisions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListConfigurationRevisions{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListConfigurationRevisionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListConfigurationRevisions(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_opListConfigurationRevisions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "ListConfigurationRevisions", } }
144
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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/mq/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of all configurations. func (c *Client) ListConfigurations(ctx context.Context, params *ListConfigurationsInput, optFns ...func(*Options)) (*ListConfigurationsOutput, error) { if params == nil { params = &ListConfigurationsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListConfigurations", params, optFns, c.addOperationListConfigurationsMiddlewares) if err != nil { return nil, err } out := result.(*ListConfigurationsOutput) out.ResultMetadata = metadata return out, nil } type ListConfigurationsInput struct { // The maximum number of brokers that Amazon MQ can return per page (20 by // default). This value must be an integer from 5 to 100. MaxResults int32 // The token that specifies the next page of results Amazon MQ should return. To // request the first page, leave nextToken empty. NextToken *string noSmithyDocumentSerde } type ListConfigurationsOutput struct { // The list of all revisions for the specified configuration. Configurations []types.Configuration // The maximum number of configurations that Amazon MQ can return per page (20 by // default). This value must be an integer from 5 to 100. MaxResults int32 // The token that specifies the next page of results Amazon MQ should return. To // request the first page, leave nextToken empty. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListConfigurations{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListConfigurations{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListConfigurations(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_opListConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "ListConfigurations", } }
133
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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" ) // Lists tags for a resource. func (c *Client) ListTags(ctx context.Context, params *ListTagsInput, optFns ...func(*Options)) (*ListTagsOutput, error) { if params == nil { params = &ListTagsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListTags", params, optFns, c.addOperationListTagsMiddlewares) if err != nil { return nil, err } out := result.(*ListTagsOutput) out.ResultMetadata = metadata return out, nil } type ListTagsInput struct { // The Amazon Resource Name (ARN) of the resource tag. // // This member is required. ResourceArn *string noSmithyDocumentSerde } type ListTagsOutput struct { // The key-value pair for the resource tag. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListTagsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListTags{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTags{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListTagsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTags(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opListTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "ListTags", } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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/mq/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of all ActiveMQ users. func (c *Client) ListUsers(ctx context.Context, params *ListUsersInput, optFns ...func(*Options)) (*ListUsersOutput, error) { if params == nil { params = &ListUsersInput{} } result, metadata, err := c.invokeOperation(ctx, "ListUsers", params, optFns, c.addOperationListUsersMiddlewares) if err != nil { return nil, err } out := result.(*ListUsersOutput) out.ResultMetadata = metadata return out, nil } type ListUsersInput struct { // The unique ID that Amazon MQ generates for the broker. // // This member is required. BrokerId *string // The maximum number of brokers that Amazon MQ can return per page (20 by // default). This value must be an integer from 5 to 100. MaxResults int32 // The token that specifies the next page of results Amazon MQ should return. To // request the first page, leave nextToken empty. NextToken *string noSmithyDocumentSerde } type ListUsersOutput struct { // Required. The unique ID that Amazon MQ generates for the broker. BrokerId *string // Required. The maximum number of ActiveMQ users that can be returned per page // (20 by default). This value must be an integer from 5 to 100. MaxResults int32 // The token that specifies the next page of results Amazon MQ should return. To // request the first page, leave nextToken empty. NextToken *string // Required. The list of all ActiveMQ usernames for the specified broker. Does not // apply to RabbitMQ brokers. Users []types.UserSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListUsersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListUsers{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListUsers{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListUsersValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListUsers(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_opListUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "ListUsers", } }
145
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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/mq/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Promotes a data replication replica broker to the primary broker role. func (c *Client) Promote(ctx context.Context, params *PromoteInput, optFns ...func(*Options)) (*PromoteOutput, error) { if params == nil { params = &PromoteInput{} } result, metadata, err := c.invokeOperation(ctx, "Promote", params, optFns, c.addOperationPromoteMiddlewares) if err != nil { return nil, err } out := result.(*PromoteOutput) out.ResultMetadata = metadata return out, nil } // Promotes a data replication replica broker to the primary broker role. type PromoteInput struct { // The unique ID that Amazon MQ generates for the broker. // // This member is required. BrokerId *string // The Promote mode requested. Note: Valid values for the parameter are // SWITCHOVER, FAILOVER. // // This member is required. Mode types.PromoteMode noSmithyDocumentSerde } type PromoteOutput struct { // The unique ID that Amazon MQ generates for the broker. BrokerId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationPromoteMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpPromote{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPromote{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpPromoteValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPromote(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_opPromote(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "Promote", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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" ) // Reboots a broker. Note: This API is asynchronous. func (c *Client) RebootBroker(ctx context.Context, params *RebootBrokerInput, optFns ...func(*Options)) (*RebootBrokerOutput, error) { if params == nil { params = &RebootBrokerInput{} } result, metadata, err := c.invokeOperation(ctx, "RebootBroker", params, optFns, c.addOperationRebootBrokerMiddlewares) if err != nil { return nil, err } out := result.(*RebootBrokerOutput) out.ResultMetadata = metadata return out, nil } type RebootBrokerInput struct { // The unique ID that Amazon MQ generates for the broker. // // This member is required. BrokerId *string noSmithyDocumentSerde } type RebootBrokerOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRebootBrokerMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpRebootBroker{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRebootBroker{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpRebootBrokerValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRebootBroker(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_opRebootBroker(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "RebootBroker", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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/mq/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Adds a pending configuration change to a broker. func (c *Client) UpdateBroker(ctx context.Context, params *UpdateBrokerInput, optFns ...func(*Options)) (*UpdateBrokerOutput, error) { if params == nil { params = &UpdateBrokerInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateBroker", params, optFns, c.addOperationUpdateBrokerMiddlewares) if err != nil { return nil, err } out := result.(*UpdateBrokerOutput) out.ResultMetadata = metadata return out, nil } // Updates the broker using the specified properties. type UpdateBrokerInput struct { // The unique ID that Amazon MQ generates for the broker. // // This member is required. BrokerId *string // Optional. The authentication strategy used to secure the broker. The default is // SIMPLE. AuthenticationStrategy types.AuthenticationStrategy // Enables automatic upgrades to new minor versions for brokers, as new versions // are released and supported by Amazon MQ. Automatic upgrades occur during the // scheduled maintenance window of the broker or after a manual broker reboot. AutoMinorVersionUpgrade bool // A list of information about the configuration. Configuration *types.ConfigurationId // Defines whether this broker is a part of a data replication pair. DataReplicationMode types.DataReplicationMode // The broker engine version. For a list of supported engine versions, see // Supported engines (https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/broker-engine.html) // . EngineVersion *string // The broker's host instance type to upgrade to. For a list of supported instance // types, see Broker instance types (https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/broker.html#broker-instance-types) // . HostInstanceType *string // Optional. The metadata of the LDAP server used to authenticate and authorize // connections to the broker. Does not apply to RabbitMQ brokers. LdapServerMetadata *types.LdapServerMetadataInput // Enables Amazon CloudWatch logging for brokers. Logs *types.Logs // The parameters that determine the WeeklyStartTime. MaintenanceWindowStartTime *types.WeeklyStartTime // The list of security groups (1 minimum, 5 maximum) that authorizes connections // to brokers. SecurityGroups []string noSmithyDocumentSerde } type UpdateBrokerOutput struct { // Optional. The authentication strategy used to secure the broker. The default is // SIMPLE. AuthenticationStrategy types.AuthenticationStrategy // The new boolean value that specifies whether broker engines automatically // upgrade to new minor versions as new versions are released and supported by // Amazon MQ. AutoMinorVersionUpgrade bool // Required. The unique ID that Amazon MQ generates for the broker. BrokerId *string // The ID of the updated configuration. Configuration *types.ConfigurationId // The replication details of the data replication-enabled broker. Only returned // if dataReplicationMode is set to CRDR. DataReplicationMetadata *types.DataReplicationMetadataOutput // Describes whether this broker is a part of a data replication pair. DataReplicationMode types.DataReplicationMode // The broker engine version to upgrade to. For a list of supported engine // versions, see Supported engines (https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/broker-engine.html) // . EngineVersion *string // The broker's host instance type to upgrade to. For a list of supported instance // types, see Broker instance types (https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/broker.html#broker-instance-types) // . HostInstanceType *string // Optional. The metadata of the LDAP server used to authenticate and authorize // connections to the broker. Does not apply to RabbitMQ brokers. LdapServerMetadata *types.LdapServerMetadataOutput // The list of information about logs to be enabled for the specified broker. Logs *types.Logs // The parameters that determine the WeeklyStartTime. MaintenanceWindowStartTime *types.WeeklyStartTime // The pending replication details of the data replication-enabled broker. Only // returned if pendingDataReplicationMode is set to CRDR. PendingDataReplicationMetadata *types.DataReplicationMetadataOutput // Describes whether this broker will be a part of a data replication pair after // reboot. PendingDataReplicationMode types.DataReplicationMode // The list of security groups (1 minimum, 5 maximum) that authorizes connections // to brokers. SecurityGroups []string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateBrokerMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateBroker{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateBroker{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateBrokerValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateBroker(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_opUpdateBroker(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "UpdateBroker", } }
216
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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/mq/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Updates the specified configuration. func (c *Client) UpdateConfiguration(ctx context.Context, params *UpdateConfigurationInput, optFns ...func(*Options)) (*UpdateConfigurationOutput, error) { if params == nil { params = &UpdateConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateConfiguration", params, optFns, c.addOperationUpdateConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*UpdateConfigurationOutput) out.ResultMetadata = metadata return out, nil } // Updates the specified configuration. type UpdateConfigurationInput struct { // The unique ID that Amazon MQ generates for the configuration. // // This member is required. ConfigurationId *string // Amazon MQ for Active MQ: The base64-encoded XML configuration. Amazon MQ for // RabbitMQ: the base64-encoded Cuttlefish configuration. // // This member is required. Data *string // The description of the configuration. Description *string noSmithyDocumentSerde } type UpdateConfigurationOutput struct { // The Amazon Resource Name (ARN) of the configuration. Arn *string // Required. The date and time of the configuration. Created *time.Time // The unique ID that Amazon MQ generates for the configuration. Id *string // The latest revision of the configuration. LatestRevision *types.ConfigurationRevision // The name of the configuration. This value can contain only alphanumeric // characters, dashes, periods, underscores, and tildes (- . _ ~). This value must // be 1-150 characters long. Name *string // The list of the first 20 warnings about the configuration elements or // attributes that were sanitized. Warnings []types.SanitizationWarning // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateConfiguration(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_opUpdateConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "UpdateConfiguration", } }
154
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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" ) // Updates the information for an ActiveMQ user. func (c *Client) UpdateUser(ctx context.Context, params *UpdateUserInput, optFns ...func(*Options)) (*UpdateUserOutput, error) { if params == nil { params = &UpdateUserInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateUser", params, optFns, c.addOperationUpdateUserMiddlewares) if err != nil { return nil, err } out := result.(*UpdateUserOutput) out.ResultMetadata = metadata return out, nil } // Updates the information for an ActiveMQ user. type UpdateUserInput struct { // The unique ID that Amazon MQ generates for the broker. // // This member is required. BrokerId *string // The username of the ActiveMQ user. This value can contain only alphanumeric // characters, dashes, periods, underscores, and tildes (- . _ ~). This value must // be 2-100 characters long. // // This member is required. Username *string // Enables access to the the ActiveMQ Web Console for the ActiveMQ user. ConsoleAccess bool // The list of groups (20 maximum) to which the ActiveMQ user belongs. This value // can contain only alphanumeric characters, dashes, periods, underscores, and // tildes (- . _ ~). This value must be 2-100 characters long. Groups []string // The password of the user. This value must be at least 12 characters long, must // contain at least 4 unique characters, and must not contain commas, colons, or // equal signs (,:=). Password *string // Defines whether the user is intended for data replication. ReplicationUser bool noSmithyDocumentSerde } type UpdateUserOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateUserMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateUser{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateUser{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateUserValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateUser(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_opUpdateUser(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mq", OperationName: "UpdateUser", } }
144
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/mq/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "io/ioutil" "strings" ) type awsRestjson1_deserializeOpCreateBroker struct { } func (*awsRestjson1_deserializeOpCreateBroker) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateBroker) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorCreateBroker(response, &metadata) } output := &CreateBrokerOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentCreateBrokerOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateBroker(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateBrokerOutput(v **CreateBrokerOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateBrokerOutput if *v == nil { sv = &CreateBrokerOutput{} } else { sv = *v } for key, value := range shape { switch key { case "brokerArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BrokerArn = ptr.String(jtv) } case "brokerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BrokerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateConfiguration struct { } func (*awsRestjson1_deserializeOpCreateConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorCreateConfiguration(response, &metadata) } output := &CreateConfigurationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentCreateConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateConfigurationOutput(v **CreateConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateConfigurationOutput if *v == nil { sv = &CreateConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "authenticationStrategy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AuthenticationStrategy to be of type string, got %T instead", value) } sv.AuthenticationStrategy = types.AuthenticationStrategy(jtv) } case "created": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.Created = ptr.Time(t) } case "id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "latestRevision": if err := awsRestjson1_deserializeDocumentConfigurationRevision(&sv.LatestRevision, value); err != nil { return err } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateTags struct { } func (*awsRestjson1_deserializeOpCreateTags) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorCreateTags(response, &metadata) } output := &CreateTagsOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpCreateUser struct { } func (*awsRestjson1_deserializeOpCreateUser) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorCreateUser(response, &metadata) } output := &CreateUserOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateUser(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteBroker struct { } func (*awsRestjson1_deserializeOpDeleteBroker) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteBroker) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDeleteBroker(response, &metadata) } output := &DeleteBrokerOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentDeleteBrokerOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteBroker(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteBrokerOutput(v **DeleteBrokerOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteBrokerOutput if *v == nil { sv = &DeleteBrokerOutput{} } else { sv = *v } for key, value := range shape { switch key { case "brokerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BrokerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteTags struct { } func (*awsRestjson1_deserializeOpDeleteTags) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDeleteTags(response, &metadata) } output := &DeleteTagsOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteUser struct { } func (*awsRestjson1_deserializeOpDeleteUser) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDeleteUser(response, &metadata) } output := &DeleteUserOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteUser(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDescribeBroker struct { } func (*awsRestjson1_deserializeOpDescribeBroker) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeBroker) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDescribeBroker(response, &metadata) } output := &DescribeBrokerOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentDescribeBrokerOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDescribeBroker(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeBrokerOutput(v **DescribeBrokerOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeBrokerOutput if *v == nil { sv = &DescribeBrokerOutput{} } else { sv = *v } for key, value := range shape { switch key { case "actionsRequired": if err := awsRestjson1_deserializeDocument__listOfActionRequired(&sv.ActionsRequired, value); err != nil { return err } case "authenticationStrategy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AuthenticationStrategy to be of type string, got %T instead", value) } sv.AuthenticationStrategy = types.AuthenticationStrategy(jtv) } case "autoMinorVersionUpgrade": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.AutoMinorVersionUpgrade = jtv } case "brokerArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BrokerArn = ptr.String(jtv) } case "brokerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BrokerId = ptr.String(jtv) } case "brokerInstances": if err := awsRestjson1_deserializeDocument__listOfBrokerInstance(&sv.BrokerInstances, value); err != nil { return err } case "brokerName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BrokerName = ptr.String(jtv) } case "brokerState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BrokerState to be of type string, got %T instead", value) } sv.BrokerState = types.BrokerState(jtv) } case "configurations": if err := awsRestjson1_deserializeDocumentConfigurations(&sv.Configurations, value); err != nil { return err } case "created": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.Created = ptr.Time(t) } case "dataReplicationMetadata": if err := awsRestjson1_deserializeDocumentDataReplicationMetadataOutput(&sv.DataReplicationMetadata, value); err != nil { return err } case "dataReplicationMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataReplicationMode to be of type string, got %T instead", value) } sv.DataReplicationMode = types.DataReplicationMode(jtv) } case "deploymentMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeploymentMode to be of type string, got %T instead", value) } sv.DeploymentMode = types.DeploymentMode(jtv) } case "encryptionOptions": if err := awsRestjson1_deserializeDocumentEncryptionOptions(&sv.EncryptionOptions, value); err != nil { return err } case "engineType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EngineType to be of type string, got %T instead", value) } sv.EngineType = types.EngineType(jtv) } case "engineVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.EngineVersion = ptr.String(jtv) } case "hostInstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.HostInstanceType = ptr.String(jtv) } case "ldapServerMetadata": if err := awsRestjson1_deserializeDocumentLdapServerMetadataOutput(&sv.LdapServerMetadata, value); err != nil { return err } case "logs": if err := awsRestjson1_deserializeDocumentLogsSummary(&sv.Logs, value); err != nil { return err } case "maintenanceWindowStartTime": if err := awsRestjson1_deserializeDocumentWeeklyStartTime(&sv.MaintenanceWindowStartTime, value); err != nil { return err } case "pendingAuthenticationStrategy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AuthenticationStrategy to be of type string, got %T instead", value) } sv.PendingAuthenticationStrategy = types.AuthenticationStrategy(jtv) } case "pendingDataReplicationMetadata": if err := awsRestjson1_deserializeDocumentDataReplicationMetadataOutput(&sv.PendingDataReplicationMetadata, value); err != nil { return err } case "pendingDataReplicationMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataReplicationMode to be of type string, got %T instead", value) } sv.PendingDataReplicationMode = types.DataReplicationMode(jtv) } case "pendingEngineVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.PendingEngineVersion = ptr.String(jtv) } case "pendingHostInstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.PendingHostInstanceType = ptr.String(jtv) } case "pendingLdapServerMetadata": if err := awsRestjson1_deserializeDocumentLdapServerMetadataOutput(&sv.PendingLdapServerMetadata, value); err != nil { return err } case "pendingSecurityGroups": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.PendingSecurityGroups, value); err != nil { return err } case "publiclyAccessible": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.PubliclyAccessible = jtv } case "securityGroups": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.SecurityGroups, value); err != nil { return err } case "storageType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BrokerStorageType to be of type string, got %T instead", value) } sv.StorageType = types.BrokerStorageType(jtv) } case "subnetIds": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.SubnetIds, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocument__mapOf__string(&sv.Tags, value); err != nil { return err } case "users": if err := awsRestjson1_deserializeDocument__listOfUserSummary(&sv.Users, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeBrokerEngineTypes struct { } func (*awsRestjson1_deserializeOpDescribeBrokerEngineTypes) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeBrokerEngineTypes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDescribeBrokerEngineTypes(response, &metadata) } output := &DescribeBrokerEngineTypesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentDescribeBrokerEngineTypesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDescribeBrokerEngineTypes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeBrokerEngineTypesOutput(v **DescribeBrokerEngineTypesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeBrokerEngineTypesOutput if *v == nil { sv = &DescribeBrokerEngineTypesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "brokerEngineTypes": if err := awsRestjson1_deserializeDocument__listOfBrokerEngineType(&sv.BrokerEngineTypes, value); err != nil { return err } case "maxResults": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected __integerMin5Max100 to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaxResults = int32(i64) } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeBrokerInstanceOptions struct { } func (*awsRestjson1_deserializeOpDescribeBrokerInstanceOptions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeBrokerInstanceOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDescribeBrokerInstanceOptions(response, &metadata) } output := &DescribeBrokerInstanceOptionsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentDescribeBrokerInstanceOptionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDescribeBrokerInstanceOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeBrokerInstanceOptionsOutput(v **DescribeBrokerInstanceOptionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeBrokerInstanceOptionsOutput if *v == nil { sv = &DescribeBrokerInstanceOptionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "brokerInstanceOptions": if err := awsRestjson1_deserializeDocument__listOfBrokerInstanceOption(&sv.BrokerInstanceOptions, value); err != nil { return err } case "maxResults": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected __integerMin5Max100 to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaxResults = int32(i64) } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeConfiguration struct { } func (*awsRestjson1_deserializeOpDescribeConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDescribeConfiguration(response, &metadata) } output := &DescribeConfigurationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentDescribeConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDescribeConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeConfigurationOutput(v **DescribeConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeConfigurationOutput if *v == nil { sv = &DescribeConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "authenticationStrategy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AuthenticationStrategy to be of type string, got %T instead", value) } sv.AuthenticationStrategy = types.AuthenticationStrategy(jtv) } case "created": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.Created = ptr.Time(t) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "engineType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EngineType to be of type string, got %T instead", value) } sv.EngineType = types.EngineType(jtv) } case "engineVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.EngineVersion = ptr.String(jtv) } case "id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "latestRevision": if err := awsRestjson1_deserializeDocumentConfigurationRevision(&sv.LatestRevision, value); err != nil { return err } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocument__mapOf__string(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeConfigurationRevision struct { } func (*awsRestjson1_deserializeOpDescribeConfigurationRevision) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeConfigurationRevision) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDescribeConfigurationRevision(response, &metadata) } output := &DescribeConfigurationRevisionOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentDescribeConfigurationRevisionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDescribeConfigurationRevision(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeConfigurationRevisionOutput(v **DescribeConfigurationRevisionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeConfigurationRevisionOutput if *v == nil { sv = &DescribeConfigurationRevisionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "configurationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ConfigurationId = ptr.String(jtv) } case "created": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.Created = ptr.Time(t) } case "data": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Data = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeUser struct { } func (*awsRestjson1_deserializeOpDescribeUser) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDescribeUser(response, &metadata) } output := &DescribeUserOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentDescribeUserOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDescribeUser(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeUserOutput(v **DescribeUserOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeUserOutput if *v == nil { sv = &DescribeUserOutput{} } else { sv = *v } for key, value := range shape { switch key { case "brokerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BrokerId = ptr.String(jtv) } case "consoleAccess": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.ConsoleAccess = jtv } case "groups": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.Groups, value); err != nil { return err } case "pending": if err := awsRestjson1_deserializeDocumentUserPendingChanges(&sv.Pending, value); err != nil { return err } case "replicationUser": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.ReplicationUser = jtv } case "username": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Username = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListBrokers struct { } func (*awsRestjson1_deserializeOpListBrokers) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListBrokers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListBrokers(response, &metadata) } output := &ListBrokersOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListBrokersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListBrokers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListBrokersOutput(v **ListBrokersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListBrokersOutput if *v == nil { sv = &ListBrokersOutput{} } else { sv = *v } for key, value := range shape { switch key { case "brokerSummaries": if err := awsRestjson1_deserializeDocument__listOfBrokerSummary(&sv.BrokerSummaries, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListConfigurationRevisions struct { } func (*awsRestjson1_deserializeOpListConfigurationRevisions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListConfigurationRevisions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListConfigurationRevisions(response, &metadata) } output := &ListConfigurationRevisionsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListConfigurationRevisionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListConfigurationRevisions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListConfigurationRevisionsOutput(v **ListConfigurationRevisionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListConfigurationRevisionsOutput if *v == nil { sv = &ListConfigurationRevisionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "configurationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ConfigurationId = ptr.String(jtv) } case "maxResults": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaxResults = int32(i64) } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "revisions": if err := awsRestjson1_deserializeDocument__listOfConfigurationRevision(&sv.Revisions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListConfigurations struct { } func (*awsRestjson1_deserializeOpListConfigurations) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListConfigurations(response, &metadata) } output := &ListConfigurationsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListConfigurationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListConfigurationsOutput(v **ListConfigurationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListConfigurationsOutput if *v == nil { sv = &ListConfigurationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "configurations": if err := awsRestjson1_deserializeDocument__listOfConfiguration(&sv.Configurations, value); err != nil { return err } case "maxResults": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaxResults = int32(i64) } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTags struct { } func (*awsRestjson1_deserializeOpListTags) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListTags(response, &metadata) } output := &ListTagsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListTagsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListTagsOutput(v **ListTagsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTagsOutput if *v == nil { sv = &ListTagsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "tags": if err := awsRestjson1_deserializeDocument__mapOf__string(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListUsers struct { } func (*awsRestjson1_deserializeOpListUsers) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListUsers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListUsers(response, &metadata) } output := &ListUsersOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListUsersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListUsers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListUsersOutput(v **ListUsersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListUsersOutput if *v == nil { sv = &ListUsersOutput{} } else { sv = *v } for key, value := range shape { switch key { case "brokerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BrokerId = ptr.String(jtv) } case "maxResults": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected __integerMin5Max100 to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaxResults = int32(i64) } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "users": if err := awsRestjson1_deserializeDocument__listOfUserSummary(&sv.Users, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpPromote struct { } func (*awsRestjson1_deserializeOpPromote) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpPromote) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorPromote(response, &metadata) } output := &PromoteOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentPromoteOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorPromote(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentPromoteOutput(v **PromoteOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *PromoteOutput if *v == nil { sv = &PromoteOutput{} } else { sv = *v } for key, value := range shape { switch key { case "brokerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BrokerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpRebootBroker struct { } func (*awsRestjson1_deserializeOpRebootBroker) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpRebootBroker) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorRebootBroker(response, &metadata) } output := &RebootBrokerOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorRebootBroker(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUpdateBroker struct { } func (*awsRestjson1_deserializeOpUpdateBroker) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateBroker) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUpdateBroker(response, &metadata) } output := &UpdateBrokerOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentUpdateBrokerOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateBroker(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateBrokerOutput(v **UpdateBrokerOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateBrokerOutput if *v == nil { sv = &UpdateBrokerOutput{} } else { sv = *v } for key, value := range shape { switch key { case "authenticationStrategy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AuthenticationStrategy to be of type string, got %T instead", value) } sv.AuthenticationStrategy = types.AuthenticationStrategy(jtv) } case "autoMinorVersionUpgrade": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.AutoMinorVersionUpgrade = jtv } case "brokerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BrokerId = ptr.String(jtv) } case "configuration": if err := awsRestjson1_deserializeDocumentConfigurationId(&sv.Configuration, value); err != nil { return err } case "dataReplicationMetadata": if err := awsRestjson1_deserializeDocumentDataReplicationMetadataOutput(&sv.DataReplicationMetadata, value); err != nil { return err } case "dataReplicationMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataReplicationMode to be of type string, got %T instead", value) } sv.DataReplicationMode = types.DataReplicationMode(jtv) } case "engineVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.EngineVersion = ptr.String(jtv) } case "hostInstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.HostInstanceType = ptr.String(jtv) } case "ldapServerMetadata": if err := awsRestjson1_deserializeDocumentLdapServerMetadataOutput(&sv.LdapServerMetadata, value); err != nil { return err } case "logs": if err := awsRestjson1_deserializeDocumentLogs(&sv.Logs, value); err != nil { return err } case "maintenanceWindowStartTime": if err := awsRestjson1_deserializeDocumentWeeklyStartTime(&sv.MaintenanceWindowStartTime, value); err != nil { return err } case "pendingDataReplicationMetadata": if err := awsRestjson1_deserializeDocumentDataReplicationMetadataOutput(&sv.PendingDataReplicationMetadata, value); err != nil { return err } case "pendingDataReplicationMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataReplicationMode to be of type string, got %T instead", value) } sv.PendingDataReplicationMode = types.DataReplicationMode(jtv) } case "securityGroups": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.SecurityGroups, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateConfiguration struct { } func (*awsRestjson1_deserializeOpUpdateConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUpdateConfiguration(response, &metadata) } output := &UpdateConfigurationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentUpdateConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateConfigurationOutput(v **UpdateConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateConfigurationOutput if *v == nil { sv = &UpdateConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "created": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.Created = ptr.Time(t) } case "id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "latestRevision": if err := awsRestjson1_deserializeDocumentConfigurationRevision(&sv.LatestRevision, value); err != nil { return err } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "warnings": if err := awsRestjson1_deserializeDocument__listOfSanitizationWarning(&sv.Warnings, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateUser struct { } func (*awsRestjson1_deserializeOpUpdateUser) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUpdateUser(response, &metadata) } output := &UpdateUserOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateUser(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.BadRequestException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentBadRequestException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ConflictException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentConflictException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorForbiddenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ForbiddenException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentForbiddenException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorInternalServerErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalServerErrorException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentInternalServerErrorException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.NotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorUnauthorizedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.UnauthorizedException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentUnauthorizedException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeDocument__listOf__string(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfActionRequired(v *[]types.ActionRequired, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.ActionRequired if *v == nil { cv = []types.ActionRequired{} } else { cv = *v } for _, value := range shape { var col types.ActionRequired destAddr := &col if err := awsRestjson1_deserializeDocumentActionRequired(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfAvailabilityZone(v *[]types.AvailabilityZone, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.AvailabilityZone if *v == nil { cv = []types.AvailabilityZone{} } else { cv = *v } for _, value := range shape { var col types.AvailabilityZone destAddr := &col if err := awsRestjson1_deserializeDocumentAvailabilityZone(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfBrokerEngineType(v *[]types.BrokerEngineType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.BrokerEngineType if *v == nil { cv = []types.BrokerEngineType{} } else { cv = *v } for _, value := range shape { var col types.BrokerEngineType destAddr := &col if err := awsRestjson1_deserializeDocumentBrokerEngineType(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfBrokerInstance(v *[]types.BrokerInstance, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.BrokerInstance if *v == nil { cv = []types.BrokerInstance{} } else { cv = *v } for _, value := range shape { var col types.BrokerInstance destAddr := &col if err := awsRestjson1_deserializeDocumentBrokerInstance(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfBrokerInstanceOption(v *[]types.BrokerInstanceOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.BrokerInstanceOption if *v == nil { cv = []types.BrokerInstanceOption{} } else { cv = *v } for _, value := range shape { var col types.BrokerInstanceOption destAddr := &col if err := awsRestjson1_deserializeDocumentBrokerInstanceOption(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfBrokerSummary(v *[]types.BrokerSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.BrokerSummary if *v == nil { cv = []types.BrokerSummary{} } else { cv = *v } for _, value := range shape { var col types.BrokerSummary destAddr := &col if err := awsRestjson1_deserializeDocumentBrokerSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfConfiguration(v *[]types.Configuration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.Configuration if *v == nil { cv = []types.Configuration{} } else { cv = *v } for _, value := range shape { var col types.Configuration destAddr := &col if err := awsRestjson1_deserializeDocumentConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfConfigurationId(v *[]types.ConfigurationId, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.ConfigurationId if *v == nil { cv = []types.ConfigurationId{} } else { cv = *v } for _, value := range shape { var col types.ConfigurationId destAddr := &col if err := awsRestjson1_deserializeDocumentConfigurationId(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfConfigurationRevision(v *[]types.ConfigurationRevision, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.ConfigurationRevision if *v == nil { cv = []types.ConfigurationRevision{} } else { cv = *v } for _, value := range shape { var col types.ConfigurationRevision destAddr := &col if err := awsRestjson1_deserializeDocumentConfigurationRevision(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfDeploymentMode(v *[]types.DeploymentMode, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.DeploymentMode if *v == nil { cv = []types.DeploymentMode{} } else { cv = *v } for _, value := range shape { var col types.DeploymentMode if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeploymentMode to be of type string, got %T instead", value) } col = types.DeploymentMode(jtv) } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfEngineVersion(v *[]types.EngineVersion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.EngineVersion if *v == nil { cv = []types.EngineVersion{} } else { cv = *v } for _, value := range shape { var col types.EngineVersion destAddr := &col if err := awsRestjson1_deserializeDocumentEngineVersion(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfSanitizationWarning(v *[]types.SanitizationWarning, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.SanitizationWarning if *v == nil { cv = []types.SanitizationWarning{} } else { cv = *v } for _, value := range shape { var col types.SanitizationWarning destAddr := &col if err := awsRestjson1_deserializeDocumentSanitizationWarning(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfUserSummary(v *[]types.UserSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.UserSummary if *v == nil { cv = []types.UserSummary{} } else { cv = *v } for _, value := range shape { var col types.UserSummary destAddr := &col if err := awsRestjson1_deserializeDocumentUserSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__mapOf__string(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var mv map[string]string if *v == nil { mv = map[string]string{} } else { mv = *v } for key, value := range shape { var parsedVal string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentActionRequired(v **types.ActionRequired, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ActionRequired if *v == nil { sv = &types.ActionRequired{} } else { sv = *v } for key, value := range shape { switch key { case "actionRequiredCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ActionRequiredCode = ptr.String(jtv) } case "actionRequiredInfo": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ActionRequiredInfo = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAvailabilityZone(v **types.AvailabilityZone, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AvailabilityZone if *v == nil { sv = &types.AvailabilityZone{} } else { sv = *v } for key, value := range shape { switch key { case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.BadRequestException if *v == nil { sv = &types.BadRequestException{} } else { sv = *v } for key, value := range shape { switch key { case "errorAttribute": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ErrorAttribute = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBrokerEngineType(v **types.BrokerEngineType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.BrokerEngineType if *v == nil { sv = &types.BrokerEngineType{} } else { sv = *v } for key, value := range shape { switch key { case "engineType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EngineType to be of type string, got %T instead", value) } sv.EngineType = types.EngineType(jtv) } case "engineVersions": if err := awsRestjson1_deserializeDocument__listOfEngineVersion(&sv.EngineVersions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBrokerInstance(v **types.BrokerInstance, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.BrokerInstance if *v == nil { sv = &types.BrokerInstance{} } else { sv = *v } for key, value := range shape { switch key { case "consoleURL": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ConsoleURL = ptr.String(jtv) } case "endpoints": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.Endpoints, value); err != nil { return err } case "ipAddress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.IpAddress = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBrokerInstanceOption(v **types.BrokerInstanceOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.BrokerInstanceOption if *v == nil { sv = &types.BrokerInstanceOption{} } else { sv = *v } for key, value := range shape { switch key { case "availabilityZones": if err := awsRestjson1_deserializeDocument__listOfAvailabilityZone(&sv.AvailabilityZones, value); err != nil { return err } case "engineType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EngineType to be of type string, got %T instead", value) } sv.EngineType = types.EngineType(jtv) } case "hostInstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.HostInstanceType = ptr.String(jtv) } case "storageType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BrokerStorageType to be of type string, got %T instead", value) } sv.StorageType = types.BrokerStorageType(jtv) } case "supportedDeploymentModes": if err := awsRestjson1_deserializeDocument__listOfDeploymentMode(&sv.SupportedDeploymentModes, value); err != nil { return err } case "supportedEngineVersions": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.SupportedEngineVersions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBrokerSummary(v **types.BrokerSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.BrokerSummary if *v == nil { sv = &types.BrokerSummary{} } else { sv = *v } for key, value := range shape { switch key { case "brokerArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BrokerArn = ptr.String(jtv) } case "brokerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BrokerId = ptr.String(jtv) } case "brokerName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BrokerName = ptr.String(jtv) } case "brokerState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BrokerState to be of type string, got %T instead", value) } sv.BrokerState = types.BrokerState(jtv) } case "created": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.Created = ptr.Time(t) } case "deploymentMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeploymentMode to be of type string, got %T instead", value) } sv.DeploymentMode = types.DeploymentMode(jtv) } case "engineType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EngineType to be of type string, got %T instead", value) } sv.EngineType = types.EngineType(jtv) } case "hostInstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.HostInstanceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConfiguration(v **types.Configuration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Configuration if *v == nil { sv = &types.Configuration{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "authenticationStrategy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AuthenticationStrategy to be of type string, got %T instead", value) } sv.AuthenticationStrategy = types.AuthenticationStrategy(jtv) } case "created": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.Created = ptr.Time(t) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "engineType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EngineType to be of type string, got %T instead", value) } sv.EngineType = types.EngineType(jtv) } case "engineVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.EngineVersion = ptr.String(jtv) } case "id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "latestRevision": if err := awsRestjson1_deserializeDocumentConfigurationRevision(&sv.LatestRevision, value); err != nil { return err } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocument__mapOf__string(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConfigurationId(v **types.ConfigurationId, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ConfigurationId if *v == nil { sv = &types.ConfigurationId{} } else { sv = *v } for key, value := range shape { switch key { case "id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "revision": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Revision = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConfigurationRevision(v **types.ConfigurationRevision, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ConfigurationRevision if *v == nil { sv = &types.ConfigurationRevision{} } else { sv = *v } for key, value := range shape { switch key { case "created": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.Created = ptr.Time(t) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "revision": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Revision = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConfigurations(v **types.Configurations, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Configurations if *v == nil { sv = &types.Configurations{} } else { sv = *v } for key, value := range shape { switch key { case "current": if err := awsRestjson1_deserializeDocumentConfigurationId(&sv.Current, value); err != nil { return err } case "history": if err := awsRestjson1_deserializeDocument__listOfConfigurationId(&sv.History, value); err != nil { return err } case "pending": if err := awsRestjson1_deserializeDocumentConfigurationId(&sv.Pending, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ConflictException if *v == nil { sv = &types.ConflictException{} } else { sv = *v } for key, value := range shape { switch key { case "errorAttribute": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ErrorAttribute = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataReplicationCounterpart(v **types.DataReplicationCounterpart, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DataReplicationCounterpart if *v == nil { sv = &types.DataReplicationCounterpart{} } else { sv = *v } for key, value := range shape { switch key { case "brokerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BrokerId = ptr.String(jtv) } case "region": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Region = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataReplicationMetadataOutput(v **types.DataReplicationMetadataOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DataReplicationMetadataOutput if *v == nil { sv = &types.DataReplicationMetadataOutput{} } else { sv = *v } for key, value := range shape { switch key { case "dataReplicationCounterpart": if err := awsRestjson1_deserializeDocumentDataReplicationCounterpart(&sv.DataReplicationCounterpart, value); err != nil { return err } case "dataReplicationRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.DataReplicationRole = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEncryptionOptions(v **types.EncryptionOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.EncryptionOptions if *v == nil { sv = &types.EncryptionOptions{} } else { sv = *v } for key, value := range shape { switch key { case "kmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "useAwsOwnedKey": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.UseAwsOwnedKey = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEngineVersion(v **types.EngineVersion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.EngineVersion if *v == nil { sv = &types.EngineVersion{} } else { sv = *v } for key, value := range shape { switch key { case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentForbiddenException(v **types.ForbiddenException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ForbiddenException if *v == nil { sv = &types.ForbiddenException{} } else { sv = *v } for key, value := range shape { switch key { case "errorAttribute": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ErrorAttribute = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInternalServerErrorException(v **types.InternalServerErrorException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InternalServerErrorException if *v == nil { sv = &types.InternalServerErrorException{} } else { sv = *v } for key, value := range shape { switch key { case "errorAttribute": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ErrorAttribute = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLdapServerMetadataOutput(v **types.LdapServerMetadataOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LdapServerMetadataOutput if *v == nil { sv = &types.LdapServerMetadataOutput{} } else { sv = *v } for key, value := range shape { switch key { case "hosts": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.Hosts, value); err != nil { return err } case "roleBase": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.RoleBase = ptr.String(jtv) } case "roleName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.RoleName = ptr.String(jtv) } case "roleSearchMatching": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.RoleSearchMatching = ptr.String(jtv) } case "roleSearchSubtree": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.RoleSearchSubtree = jtv } case "serviceAccountUsername": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ServiceAccountUsername = ptr.String(jtv) } case "userBase": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.UserBase = ptr.String(jtv) } case "userRoleName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.UserRoleName = ptr.String(jtv) } case "userSearchMatching": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.UserSearchMatching = ptr.String(jtv) } case "userSearchSubtree": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.UserSearchSubtree = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLogs(v **types.Logs, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Logs if *v == nil { sv = &types.Logs{} } else { sv = *v } for key, value := range shape { switch key { case "audit": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.Audit = jtv } case "general": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.General = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLogsSummary(v **types.LogsSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LogsSummary if *v == nil { sv = &types.LogsSummary{} } else { sv = *v } for key, value := range shape { switch key { case "audit": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.Audit = jtv } case "auditLogGroup": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.AuditLogGroup = ptr.String(jtv) } case "general": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.General = jtv } case "generalLogGroup": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.GeneralLogGroup = ptr.String(jtv) } case "pending": if err := awsRestjson1_deserializeDocumentPendingLogs(&sv.Pending, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNotFoundException(v **types.NotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NotFoundException if *v == nil { sv = &types.NotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "errorAttribute": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ErrorAttribute = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPendingLogs(v **types.PendingLogs, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PendingLogs if *v == nil { sv = &types.PendingLogs{} } else { sv = *v } for key, value := range shape { switch key { case "audit": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.Audit = jtv } case "general": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.General = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSanitizationWarning(v **types.SanitizationWarning, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SanitizationWarning if *v == nil { sv = &types.SanitizationWarning{} } else { sv = *v } for key, value := range shape { switch key { case "attributeName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.AttributeName = ptr.String(jtv) } case "elementName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ElementName = ptr.String(jtv) } case "reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SanitizationWarningReason to be of type string, got %T instead", value) } sv.Reason = types.SanitizationWarningReason(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUnauthorizedException(v **types.UnauthorizedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.UnauthorizedException if *v == nil { sv = &types.UnauthorizedException{} } else { sv = *v } for key, value := range shape { switch key { case "errorAttribute": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ErrorAttribute = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUserPendingChanges(v **types.UserPendingChanges, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.UserPendingChanges if *v == nil { sv = &types.UserPendingChanges{} } else { sv = *v } for key, value := range shape { switch key { case "consoleAccess": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.ConsoleAccess = jtv } case "groups": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.Groups, value); err != nil { return err } case "pendingChange": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChangeType to be of type string, got %T instead", value) } sv.PendingChange = types.ChangeType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUserSummary(v **types.UserSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.UserSummary if *v == nil { sv = &types.UserSummary{} } else { sv = *v } for key, value := range shape { switch key { case "pendingChange": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChangeType to be of type string, got %T instead", value) } sv.PendingChange = types.ChangeType(jtv) } case "username": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Username = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWeeklyStartTime(v **types.WeeklyStartTime, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WeeklyStartTime if *v == nil { sv = &types.WeeklyStartTime{} } else { sv = *v } for key, value := range shape { switch key { case "dayOfWeek": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DayOfWeek to be of type string, got %T instead", value) } sv.DayOfWeek = types.DayOfWeek(jtv) } case "timeOfDay": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.TimeOfDay = ptr.String(jtv) } case "timeZone": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.TimeZone = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil }
6,344
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package mq provides the API client, operations, and parameter types for // AmazonMQ. // // Amazon MQ is a managed message broker service for Apache ActiveMQ and RabbitMQ // that makes it easy to set up and operate message brokers in the cloud. A message // broker allows software applications and components to communicate using various // programming languages, operating systems, and formal messaging protocols. package mq
11
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq 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/mq/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 = "mq" } 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 mq // goModuleVersion is the tagged release for this module const goModuleVersion = "1.15.0"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/mq/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) type awsRestjson1_serializeOpCreateBroker struct { } func (*awsRestjson1_serializeOpCreateBroker) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateBroker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateBrokerInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/brokers") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateBrokerInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsCreateBrokerInput(v *CreateBrokerInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateBrokerInput(v *CreateBrokerInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.AuthenticationStrategy) > 0 { ok := object.Key("authenticationStrategy") ok.String(string(v.AuthenticationStrategy)) } { ok := object.Key("autoMinorVersionUpgrade") ok.Boolean(v.AutoMinorVersionUpgrade) } if v.BrokerName != nil { ok := object.Key("brokerName") ok.String(*v.BrokerName) } if v.Configuration != nil { ok := object.Key("configuration") if err := awsRestjson1_serializeDocumentConfigurationId(v.Configuration, ok); err != nil { return err } } if v.CreatorRequestId != nil { ok := object.Key("creatorRequestId") ok.String(*v.CreatorRequestId) } if len(v.DataReplicationMode) > 0 { ok := object.Key("dataReplicationMode") ok.String(string(v.DataReplicationMode)) } if v.DataReplicationPrimaryBrokerArn != nil { ok := object.Key("dataReplicationPrimaryBrokerArn") ok.String(*v.DataReplicationPrimaryBrokerArn) } if len(v.DeploymentMode) > 0 { ok := object.Key("deploymentMode") ok.String(string(v.DeploymentMode)) } if v.EncryptionOptions != nil { ok := object.Key("encryptionOptions") if err := awsRestjson1_serializeDocumentEncryptionOptions(v.EncryptionOptions, ok); err != nil { return err } } if len(v.EngineType) > 0 { ok := object.Key("engineType") ok.String(string(v.EngineType)) } if v.EngineVersion != nil { ok := object.Key("engineVersion") ok.String(*v.EngineVersion) } if v.HostInstanceType != nil { ok := object.Key("hostInstanceType") ok.String(*v.HostInstanceType) } if v.LdapServerMetadata != nil { ok := object.Key("ldapServerMetadata") if err := awsRestjson1_serializeDocumentLdapServerMetadataInput(v.LdapServerMetadata, ok); err != nil { return err } } if v.Logs != nil { ok := object.Key("logs") if err := awsRestjson1_serializeDocumentLogs(v.Logs, ok); err != nil { return err } } if v.MaintenanceWindowStartTime != nil { ok := object.Key("maintenanceWindowStartTime") if err := awsRestjson1_serializeDocumentWeeklyStartTime(v.MaintenanceWindowStartTime, ok); err != nil { return err } } { ok := object.Key("publiclyAccessible") ok.Boolean(v.PubliclyAccessible) } if v.SecurityGroups != nil { ok := object.Key("securityGroups") if err := awsRestjson1_serializeDocument__listOf__string(v.SecurityGroups, ok); err != nil { return err } } if len(v.StorageType) > 0 { ok := object.Key("storageType") ok.String(string(v.StorageType)) } if v.SubnetIds != nil { ok := object.Key("subnetIds") if err := awsRestjson1_serializeDocument__listOf__string(v.SubnetIds, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocument__mapOf__string(v.Tags, ok); err != nil { return err } } if v.Users != nil { ok := object.Key("users") if err := awsRestjson1_serializeDocument__listOfUser(v.Users, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateConfiguration struct { } func (*awsRestjson1_serializeOpCreateConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/configurations") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateConfigurationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsCreateConfigurationInput(v *CreateConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateConfigurationInput(v *CreateConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.AuthenticationStrategy) > 0 { ok := object.Key("authenticationStrategy") ok.String(string(v.AuthenticationStrategy)) } if len(v.EngineType) > 0 { ok := object.Key("engineType") ok.String(string(v.EngineType)) } if v.EngineVersion != nil { ok := object.Key("engineVersion") ok.String(*v.EngineVersion) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocument__mapOf__string(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateTags struct { } func (*awsRestjson1_serializeOpCreateTags) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateTags) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateTagsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/tags/{ResourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsCreateTagsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateTagsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsCreateTagsInput(v *CreateTagsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentCreateTagsInput(v *CreateTagsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocument__mapOf__string(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateUser struct { } func (*awsRestjson1_serializeOpCreateUser) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateUserInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/brokers/{BrokerId}/users/{Username}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsCreateUserInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateUserInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsCreateUserInput(v *CreateUserInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.BrokerId == nil || len(*v.BrokerId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member BrokerId must not be empty")} } if v.BrokerId != nil { if err := encoder.SetURI("BrokerId").String(*v.BrokerId); err != nil { return err } } if v.Username == nil || len(*v.Username) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Username must not be empty")} } if v.Username != nil { if err := encoder.SetURI("Username").String(*v.Username); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentCreateUserInput(v *CreateUserInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ConsoleAccess { ok := object.Key("consoleAccess") ok.Boolean(v.ConsoleAccess) } if v.Groups != nil { ok := object.Key("groups") if err := awsRestjson1_serializeDocument__listOf__string(v.Groups, ok); err != nil { return err } } if v.Password != nil { ok := object.Key("password") ok.String(*v.Password) } if v.ReplicationUser { ok := object.Key("replicationUser") ok.Boolean(v.ReplicationUser) } return nil } type awsRestjson1_serializeOpDeleteBroker struct { } func (*awsRestjson1_serializeOpDeleteBroker) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteBroker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteBrokerInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/brokers/{BrokerId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDeleteBrokerInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDeleteBrokerInput(v *DeleteBrokerInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.BrokerId == nil || len(*v.BrokerId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member BrokerId must not be empty")} } if v.BrokerId != nil { if err := encoder.SetURI("BrokerId").String(*v.BrokerId); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteTags struct { } func (*awsRestjson1_serializeOpDeleteTags) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteTags) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteTagsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/tags/{ResourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDeleteTagsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDeleteTagsInput(v *DeleteTagsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { return err } } if v.TagKeys != nil { for i := range v.TagKeys { encoder.AddQuery("tagKeys").String(v.TagKeys[i]) } } return nil } type awsRestjson1_serializeOpDeleteUser struct { } func (*awsRestjson1_serializeOpDeleteUser) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteUserInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/brokers/{BrokerId}/users/{Username}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDeleteUserInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDeleteUserInput(v *DeleteUserInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.BrokerId == nil || len(*v.BrokerId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member BrokerId must not be empty")} } if v.BrokerId != nil { if err := encoder.SetURI("BrokerId").String(*v.BrokerId); err != nil { return err } } if v.Username == nil || len(*v.Username) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Username must not be empty")} } if v.Username != nil { if err := encoder.SetURI("Username").String(*v.Username); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeBroker struct { } func (*awsRestjson1_serializeOpDescribeBroker) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeBroker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeBrokerInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/brokers/{BrokerId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDescribeBrokerInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDescribeBrokerInput(v *DescribeBrokerInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.BrokerId == nil || len(*v.BrokerId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member BrokerId must not be empty")} } if v.BrokerId != nil { if err := encoder.SetURI("BrokerId").String(*v.BrokerId); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeBrokerEngineTypes struct { } func (*awsRestjson1_serializeOpDescribeBrokerEngineTypes) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeBrokerEngineTypes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeBrokerEngineTypesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/broker-engine-types") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDescribeBrokerEngineTypesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDescribeBrokerEngineTypesInput(v *DescribeBrokerEngineTypesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.EngineType != nil { encoder.SetQuery("engineType").String(*v.EngineType) } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpDescribeBrokerInstanceOptions struct { } func (*awsRestjson1_serializeOpDescribeBrokerInstanceOptions) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeBrokerInstanceOptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeBrokerInstanceOptionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/broker-instance-options") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDescribeBrokerInstanceOptionsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDescribeBrokerInstanceOptionsInput(v *DescribeBrokerInstanceOptionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.EngineType != nil { encoder.SetQuery("engineType").String(*v.EngineType) } if v.HostInstanceType != nil { encoder.SetQuery("hostInstanceType").String(*v.HostInstanceType) } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if v.StorageType != nil { encoder.SetQuery("storageType").String(*v.StorageType) } return nil } type awsRestjson1_serializeOpDescribeConfiguration struct { } func (*awsRestjson1_serializeOpDescribeConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/configurations/{ConfigurationId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDescribeConfigurationInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDescribeConfigurationInput(v *DescribeConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ConfigurationId == nil || len(*v.ConfigurationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigurationId must not be empty")} } if v.ConfigurationId != nil { if err := encoder.SetURI("ConfigurationId").String(*v.ConfigurationId); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeConfigurationRevision struct { } func (*awsRestjson1_serializeOpDescribeConfigurationRevision) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeConfigurationRevision) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeConfigurationRevisionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/configurations/{ConfigurationId}/revisions/{ConfigurationRevision}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDescribeConfigurationRevisionInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDescribeConfigurationRevisionInput(v *DescribeConfigurationRevisionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ConfigurationId == nil || len(*v.ConfigurationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigurationId must not be empty")} } if v.ConfigurationId != nil { if err := encoder.SetURI("ConfigurationId").String(*v.ConfigurationId); err != nil { return err } } if v.ConfigurationRevision == nil || len(*v.ConfigurationRevision) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigurationRevision must not be empty")} } if v.ConfigurationRevision != nil { if err := encoder.SetURI("ConfigurationRevision").String(*v.ConfigurationRevision); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeUser struct { } func (*awsRestjson1_serializeOpDescribeUser) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeUserInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/brokers/{BrokerId}/users/{Username}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDescribeUserInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDescribeUserInput(v *DescribeUserInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.BrokerId == nil || len(*v.BrokerId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member BrokerId must not be empty")} } if v.BrokerId != nil { if err := encoder.SetURI("BrokerId").String(*v.BrokerId); err != nil { return err } } if v.Username == nil || len(*v.Username) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Username must not be empty")} } if v.Username != nil { if err := encoder.SetURI("Username").String(*v.Username); err != nil { return err } } return nil } type awsRestjson1_serializeOpListBrokers struct { } func (*awsRestjson1_serializeOpListBrokers) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListBrokers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListBrokersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/brokers") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListBrokersInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListBrokersInput(v *ListBrokersInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListConfigurationRevisions struct { } func (*awsRestjson1_serializeOpListConfigurationRevisions) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListConfigurationRevisions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListConfigurationRevisionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/configurations/{ConfigurationId}/revisions") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListConfigurationRevisionsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListConfigurationRevisionsInput(v *ListConfigurationRevisionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ConfigurationId == nil || len(*v.ConfigurationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigurationId must not be empty")} } if v.ConfigurationId != nil { if err := encoder.SetURI("ConfigurationId").String(*v.ConfigurationId); err != nil { return err } } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListConfigurations struct { } func (*awsRestjson1_serializeOpListConfigurations) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListConfigurationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/configurations") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListConfigurationsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListConfigurationsInput(v *ListConfigurationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListTags struct { } func (*awsRestjson1_serializeOpListTags) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListTags) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListTagsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/tags/{ResourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListTagsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListTagsInput(v *ListTagsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpListUsers struct { } func (*awsRestjson1_serializeOpListUsers) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListUsers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListUsersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/brokers/{BrokerId}/users") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListUsersInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListUsersInput(v *ListUsersInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.BrokerId == nil || len(*v.BrokerId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member BrokerId must not be empty")} } if v.BrokerId != nil { if err := encoder.SetURI("BrokerId").String(*v.BrokerId); err != nil { return err } } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpPromote struct { } func (*awsRestjson1_serializeOpPromote) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpPromote) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*PromoteInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/brokers/{BrokerId}/promote") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsPromoteInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentPromoteInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsPromoteInput(v *PromoteInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.BrokerId == nil || len(*v.BrokerId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member BrokerId must not be empty")} } if v.BrokerId != nil { if err := encoder.SetURI("BrokerId").String(*v.BrokerId); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentPromoteInput(v *PromoteInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Mode) > 0 { ok := object.Key("mode") ok.String(string(v.Mode)) } return nil } type awsRestjson1_serializeOpRebootBroker struct { } func (*awsRestjson1_serializeOpRebootBroker) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpRebootBroker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RebootBrokerInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/brokers/{BrokerId}/reboot") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsRebootBrokerInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsRebootBrokerInput(v *RebootBrokerInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.BrokerId == nil || len(*v.BrokerId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member BrokerId must not be empty")} } if v.BrokerId != nil { if err := encoder.SetURI("BrokerId").String(*v.BrokerId); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdateBroker struct { } func (*awsRestjson1_serializeOpUpdateBroker) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateBroker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateBrokerInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/brokers/{BrokerId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateBrokerInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateBrokerInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUpdateBrokerInput(v *UpdateBrokerInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.BrokerId == nil || len(*v.BrokerId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member BrokerId must not be empty")} } if v.BrokerId != nil { if err := encoder.SetURI("BrokerId").String(*v.BrokerId); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateBrokerInput(v *UpdateBrokerInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.AuthenticationStrategy) > 0 { ok := object.Key("authenticationStrategy") ok.String(string(v.AuthenticationStrategy)) } if v.AutoMinorVersionUpgrade { ok := object.Key("autoMinorVersionUpgrade") ok.Boolean(v.AutoMinorVersionUpgrade) } if v.Configuration != nil { ok := object.Key("configuration") if err := awsRestjson1_serializeDocumentConfigurationId(v.Configuration, ok); err != nil { return err } } if len(v.DataReplicationMode) > 0 { ok := object.Key("dataReplicationMode") ok.String(string(v.DataReplicationMode)) } if v.EngineVersion != nil { ok := object.Key("engineVersion") ok.String(*v.EngineVersion) } if v.HostInstanceType != nil { ok := object.Key("hostInstanceType") ok.String(*v.HostInstanceType) } if v.LdapServerMetadata != nil { ok := object.Key("ldapServerMetadata") if err := awsRestjson1_serializeDocumentLdapServerMetadataInput(v.LdapServerMetadata, ok); err != nil { return err } } if v.Logs != nil { ok := object.Key("logs") if err := awsRestjson1_serializeDocumentLogs(v.Logs, ok); err != nil { return err } } if v.MaintenanceWindowStartTime != nil { ok := object.Key("maintenanceWindowStartTime") if err := awsRestjson1_serializeDocumentWeeklyStartTime(v.MaintenanceWindowStartTime, ok); err != nil { return err } } if v.SecurityGroups != nil { ok := object.Key("securityGroups") if err := awsRestjson1_serializeDocument__listOf__string(v.SecurityGroups, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdateConfiguration struct { } func (*awsRestjson1_serializeOpUpdateConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/configurations/{ConfigurationId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateConfigurationInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateConfigurationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUpdateConfigurationInput(v *UpdateConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ConfigurationId == nil || len(*v.ConfigurationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigurationId must not be empty")} } if v.ConfigurationId != nil { if err := encoder.SetURI("ConfigurationId").String(*v.ConfigurationId); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateConfigurationInput(v *UpdateConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Data != nil { ok := object.Key("data") ok.String(*v.Data) } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } return nil } type awsRestjson1_serializeOpUpdateUser struct { } func (*awsRestjson1_serializeOpUpdateUser) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateUserInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/brokers/{BrokerId}/users/{Username}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateUserInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateUserInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUpdateUserInput(v *UpdateUserInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.BrokerId == nil || len(*v.BrokerId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member BrokerId must not be empty")} } if v.BrokerId != nil { if err := encoder.SetURI("BrokerId").String(*v.BrokerId); err != nil { return err } } if v.Username == nil || len(*v.Username) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Username must not be empty")} } if v.Username != nil { if err := encoder.SetURI("Username").String(*v.Username); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateUserInput(v *UpdateUserInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ConsoleAccess { ok := object.Key("consoleAccess") ok.Boolean(v.ConsoleAccess) } if v.Groups != nil { ok := object.Key("groups") if err := awsRestjson1_serializeDocument__listOf__string(v.Groups, ok); err != nil { return err } } if v.Password != nil { ok := object.Key("password") ok.String(*v.Password) } if v.ReplicationUser { ok := object.Key("replicationUser") ok.Boolean(v.ReplicationUser) } return nil } func awsRestjson1_serializeDocument__listOf__string(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocument__listOfUser(v []types.User, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentUser(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocument__mapOf__string(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) om.String(v[key]) } return nil } func awsRestjson1_serializeDocumentConfigurationId(v *types.ConfigurationId, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Id != nil { ok := object.Key("id") ok.String(*v.Id) } if v.Revision != 0 { ok := object.Key("revision") ok.Integer(v.Revision) } return nil } func awsRestjson1_serializeDocumentEncryptionOptions(v *types.EncryptionOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.KmsKeyId != nil { ok := object.Key("kmsKeyId") ok.String(*v.KmsKeyId) } { ok := object.Key("useAwsOwnedKey") ok.Boolean(v.UseAwsOwnedKey) } return nil } func awsRestjson1_serializeDocumentLdapServerMetadataInput(v *types.LdapServerMetadataInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Hosts != nil { ok := object.Key("hosts") if err := awsRestjson1_serializeDocument__listOf__string(v.Hosts, ok); err != nil { return err } } if v.RoleBase != nil { ok := object.Key("roleBase") ok.String(*v.RoleBase) } if v.RoleName != nil { ok := object.Key("roleName") ok.String(*v.RoleName) } if v.RoleSearchMatching != nil { ok := object.Key("roleSearchMatching") ok.String(*v.RoleSearchMatching) } if v.RoleSearchSubtree { ok := object.Key("roleSearchSubtree") ok.Boolean(v.RoleSearchSubtree) } if v.ServiceAccountPassword != nil { ok := object.Key("serviceAccountPassword") ok.String(*v.ServiceAccountPassword) } if v.ServiceAccountUsername != nil { ok := object.Key("serviceAccountUsername") ok.String(*v.ServiceAccountUsername) } if v.UserBase != nil { ok := object.Key("userBase") ok.String(*v.UserBase) } if v.UserRoleName != nil { ok := object.Key("userRoleName") ok.String(*v.UserRoleName) } if v.UserSearchMatching != nil { ok := object.Key("userSearchMatching") ok.String(*v.UserSearchMatching) } if v.UserSearchSubtree { ok := object.Key("userSearchSubtree") ok.Boolean(v.UserSearchSubtree) } return nil } func awsRestjson1_serializeDocumentLogs(v *types.Logs, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Audit { ok := object.Key("audit") ok.Boolean(v.Audit) } if v.General { ok := object.Key("general") ok.Boolean(v.General) } return nil } func awsRestjson1_serializeDocumentUser(v *types.User, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ConsoleAccess { ok := object.Key("consoleAccess") ok.Boolean(v.ConsoleAccess) } if v.Groups != nil { ok := object.Key("groups") if err := awsRestjson1_serializeDocument__listOf__string(v.Groups, ok); err != nil { return err } } if v.Password != nil { ok := object.Key("password") ok.String(*v.Password) } if v.ReplicationUser { ok := object.Key("replicationUser") ok.Boolean(v.ReplicationUser) } if v.Username != nil { ok := object.Key("username") ok.String(*v.Username) } return nil } func awsRestjson1_serializeDocumentWeeklyStartTime(v *types.WeeklyStartTime, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.DayOfWeek) > 0 { ok := object.Key("dayOfWeek") ok.String(string(v.DayOfWeek)) } if v.TimeOfDay != nil { ok := object.Key("timeOfDay") ok.String(*v.TimeOfDay) } if v.TimeZone != nil { ok := object.Key("timeZone") ok.String(*v.TimeZone) } return nil }
2,029
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mq import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/mq/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpCreateBroker struct { } func (*validateOpCreateBroker) ID() string { return "OperationInputValidation" } func (m *validateOpCreateBroker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateBrokerInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateBrokerInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateConfiguration struct { } func (*validateOpCreateConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpCreateConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateTags struct { } func (*validateOpCreateTags) ID() string { return "OperationInputValidation" } func (m *validateOpCreateTags) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateTagsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateTagsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateUser struct { } func (*validateOpCreateUser) ID() string { return "OperationInputValidation" } func (m *validateOpCreateUser) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateUserInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateUserInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteBroker struct { } func (*validateOpDeleteBroker) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteBroker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteBrokerInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteBrokerInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteTags struct { } func (*validateOpDeleteTags) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteTags) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteTagsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteTagsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteUser struct { } func (*validateOpDeleteUser) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteUser) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteUserInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteUserInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeBroker struct { } func (*validateOpDescribeBroker) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeBroker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeBrokerInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeBrokerInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeConfiguration struct { } func (*validateOpDescribeConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeConfigurationRevision struct { } func (*validateOpDescribeConfigurationRevision) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeConfigurationRevision) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeConfigurationRevisionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeConfigurationRevisionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeUser struct { } func (*validateOpDescribeUser) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeUser) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeUserInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeUserInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListConfigurationRevisions struct { } func (*validateOpListConfigurationRevisions) ID() string { return "OperationInputValidation" } func (m *validateOpListConfigurationRevisions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListConfigurationRevisionsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListConfigurationRevisionsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListTags struct { } func (*validateOpListTags) ID() string { return "OperationInputValidation" } func (m *validateOpListTags) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListTagsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListTagsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListUsers struct { } func (*validateOpListUsers) ID() string { return "OperationInputValidation" } func (m *validateOpListUsers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListUsersInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListUsersInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpPromote struct { } func (*validateOpPromote) ID() string { return "OperationInputValidation" } func (m *validateOpPromote) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PromoteInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPromoteInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRebootBroker struct { } func (*validateOpRebootBroker) ID() string { return "OperationInputValidation" } func (m *validateOpRebootBroker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RebootBrokerInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRebootBrokerInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateBroker struct { } func (*validateOpUpdateBroker) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateBroker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateBrokerInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateBrokerInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateConfiguration struct { } func (*validateOpUpdateConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateUser struct { } func (*validateOpUpdateUser) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateUser) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateUserInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateUserInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpCreateBrokerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateBroker{}, middleware.After) } func addOpCreateConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateConfiguration{}, middleware.After) } func addOpCreateTagsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateTags{}, middleware.After) } func addOpCreateUserValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateUser{}, middleware.After) } func addOpDeleteBrokerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteBroker{}, middleware.After) } func addOpDeleteTagsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteTags{}, middleware.After) } func addOpDeleteUserValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteUser{}, middleware.After) } func addOpDescribeBrokerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeBroker{}, middleware.After) } func addOpDescribeConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeConfiguration{}, middleware.After) } func addOpDescribeConfigurationRevisionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeConfigurationRevision{}, middleware.After) } func addOpDescribeUserValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeUser{}, middleware.After) } func addOpListConfigurationRevisionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListConfigurationRevisions{}, middleware.After) } func addOpListTagsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTags{}, middleware.After) } func addOpListUsersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListUsers{}, middleware.After) } func addOpPromoteValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPromote{}, middleware.After) } func addOpRebootBrokerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRebootBroker{}, middleware.After) } func addOpUpdateBrokerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateBroker{}, middleware.After) } func addOpUpdateConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateConfiguration{}, middleware.After) } func addOpUpdateUserValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateUser{}, middleware.After) } func validate__listOfUser(v []types.User) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListOfUser"} for i := range v { if err := validateUser(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateConfigurationId(v *types.ConfigurationId) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ConfigurationId"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateEncryptionOptions(v *types.EncryptionOptions) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "EncryptionOptions"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateLdapServerMetadataInput(v *types.LdapServerMetadataInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "LdapServerMetadataInput"} if v.Hosts == nil { invalidParams.Add(smithy.NewErrParamRequired("Hosts")) } if v.RoleBase == nil { invalidParams.Add(smithy.NewErrParamRequired("RoleBase")) } if v.RoleSearchMatching == nil { invalidParams.Add(smithy.NewErrParamRequired("RoleSearchMatching")) } if v.ServiceAccountPassword == nil { invalidParams.Add(smithy.NewErrParamRequired("ServiceAccountPassword")) } if v.ServiceAccountUsername == nil { invalidParams.Add(smithy.NewErrParamRequired("ServiceAccountUsername")) } if v.UserBase == nil { invalidParams.Add(smithy.NewErrParamRequired("UserBase")) } if v.UserSearchMatching == nil { invalidParams.Add(smithy.NewErrParamRequired("UserSearchMatching")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateUser(v *types.User) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "User"} if v.Password == nil { invalidParams.Add(smithy.NewErrParamRequired("Password")) } if v.Username == nil { invalidParams.Add(smithy.NewErrParamRequired("Username")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateWeeklyStartTime(v *types.WeeklyStartTime) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "WeeklyStartTime"} if len(v.DayOfWeek) == 0 { invalidParams.Add(smithy.NewErrParamRequired("DayOfWeek")) } if v.TimeOfDay == nil { invalidParams.Add(smithy.NewErrParamRequired("TimeOfDay")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateBrokerInput(v *CreateBrokerInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateBrokerInput"} if v.BrokerName == nil { invalidParams.Add(smithy.NewErrParamRequired("BrokerName")) } if v.Configuration != nil { if err := validateConfigurationId(v.Configuration); err != nil { invalidParams.AddNested("Configuration", err.(smithy.InvalidParamsError)) } } if len(v.DeploymentMode) == 0 { invalidParams.Add(smithy.NewErrParamRequired("DeploymentMode")) } if v.EncryptionOptions != nil { if err := validateEncryptionOptions(v.EncryptionOptions); err != nil { invalidParams.AddNested("EncryptionOptions", err.(smithy.InvalidParamsError)) } } if len(v.EngineType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("EngineType")) } if v.EngineVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("EngineVersion")) } if v.HostInstanceType == nil { invalidParams.Add(smithy.NewErrParamRequired("HostInstanceType")) } if v.LdapServerMetadata != nil { if err := validateLdapServerMetadataInput(v.LdapServerMetadata); err != nil { invalidParams.AddNested("LdapServerMetadata", err.(smithy.InvalidParamsError)) } } if v.MaintenanceWindowStartTime != nil { if err := validateWeeklyStartTime(v.MaintenanceWindowStartTime); err != nil { invalidParams.AddNested("MaintenanceWindowStartTime", err.(smithy.InvalidParamsError)) } } if v.Users == nil { invalidParams.Add(smithy.NewErrParamRequired("Users")) } else if v.Users != nil { if err := validate__listOfUser(v.Users); err != nil { invalidParams.AddNested("Users", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateConfigurationInput(v *CreateConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateConfigurationInput"} if len(v.EngineType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("EngineType")) } if v.EngineVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("EngineVersion")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateTagsInput(v *CreateTagsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateTagsInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateUserInput(v *CreateUserInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateUserInput"} if v.BrokerId == nil { invalidParams.Add(smithy.NewErrParamRequired("BrokerId")) } if v.Password == nil { invalidParams.Add(smithy.NewErrParamRequired("Password")) } if v.Username == nil { invalidParams.Add(smithy.NewErrParamRequired("Username")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteBrokerInput(v *DeleteBrokerInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteBrokerInput"} if v.BrokerId == nil { invalidParams.Add(smithy.NewErrParamRequired("BrokerId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteTagsInput(v *DeleteTagsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteTagsInput"} 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 validateOpDeleteUserInput(v *DeleteUserInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteUserInput"} if v.BrokerId == nil { invalidParams.Add(smithy.NewErrParamRequired("BrokerId")) } if v.Username == nil { invalidParams.Add(smithy.NewErrParamRequired("Username")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeBrokerInput(v *DescribeBrokerInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeBrokerInput"} if v.BrokerId == nil { invalidParams.Add(smithy.NewErrParamRequired("BrokerId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeConfigurationInput(v *DescribeConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeConfigurationInput"} if v.ConfigurationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ConfigurationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeConfigurationRevisionInput(v *DescribeConfigurationRevisionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeConfigurationRevisionInput"} if v.ConfigurationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ConfigurationId")) } if v.ConfigurationRevision == nil { invalidParams.Add(smithy.NewErrParamRequired("ConfigurationRevision")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeUserInput(v *DescribeUserInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeUserInput"} if v.BrokerId == nil { invalidParams.Add(smithy.NewErrParamRequired("BrokerId")) } if v.Username == nil { invalidParams.Add(smithy.NewErrParamRequired("Username")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListConfigurationRevisionsInput(v *ListConfigurationRevisionsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListConfigurationRevisionsInput"} if v.ConfigurationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ConfigurationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListTagsInput(v *ListTagsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListTagsInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListUsersInput(v *ListUsersInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListUsersInput"} if v.BrokerId == nil { invalidParams.Add(smithy.NewErrParamRequired("BrokerId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpPromoteInput(v *PromoteInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PromoteInput"} if v.BrokerId == nil { invalidParams.Add(smithy.NewErrParamRequired("BrokerId")) } if len(v.Mode) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Mode")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRebootBrokerInput(v *RebootBrokerInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RebootBrokerInput"} if v.BrokerId == nil { invalidParams.Add(smithy.NewErrParamRequired("BrokerId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateBrokerInput(v *UpdateBrokerInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateBrokerInput"} if v.BrokerId == nil { invalidParams.Add(smithy.NewErrParamRequired("BrokerId")) } if v.Configuration != nil { if err := validateConfigurationId(v.Configuration); err != nil { invalidParams.AddNested("Configuration", err.(smithy.InvalidParamsError)) } } if v.LdapServerMetadata != nil { if err := validateLdapServerMetadataInput(v.LdapServerMetadata); err != nil { invalidParams.AddNested("LdapServerMetadata", err.(smithy.InvalidParamsError)) } } if v.MaintenanceWindowStartTime != nil { if err := validateWeeklyStartTime(v.MaintenanceWindowStartTime); err != nil { invalidParams.AddNested("MaintenanceWindowStartTime", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateConfigurationInput(v *UpdateConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateConfigurationInput"} if v.ConfigurationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ConfigurationId")) } if v.Data == nil { invalidParams.Add(smithy.NewErrParamRequired("Data")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateUserInput(v *UpdateUserInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateUserInput"} if v.BrokerId == nil { invalidParams.Add(smithy.NewErrParamRequired("BrokerId")) } if v.Username == nil { invalidParams.Add(smithy.NewErrParamRequired("Username")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
953
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 mq 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: "mq.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "mq-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "mq-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mq.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "af-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-4", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-south-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "fips-us-east-1", }: endpoints.Endpoint{ Hostname: "mq-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: "mq-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: "mq-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: "mq-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: "mq-fips.us-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", Variant: endpoints.FIPSVariant, }: { Hostname: "mq-fips.us-east-2.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "mq-fips.us-west-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", Variant: endpoints.FIPSVariant, }: { Hostname: "mq-fips.us-west-2.amazonaws.com", }, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "mq.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "mq-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "mq-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mq.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "cn-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "cn-northwest-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-iso", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "mq-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mq.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, }, { ID: "aws-iso-b", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "mq-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mq.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, }, { ID: "aws-iso-e", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "mq-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mq.{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: "mq-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mq.{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: "mq.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "mq-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "mq-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mq.{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: "mq-fips.us-gov-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-east-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-gov-west-1", }: endpoints.Endpoint{ Hostname: "mq-fips.us-gov-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-west-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "us-gov-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-gov-east-1", Variant: endpoints.FIPSVariant, }: { Hostname: "mq-fips.us-gov-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-gov-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "mq-fips.us-gov-west-1.amazonaws.com", }, }, }, }
486
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 AuthenticationStrategy string // Enum values for AuthenticationStrategy const ( AuthenticationStrategySimple AuthenticationStrategy = "SIMPLE" AuthenticationStrategyLdap AuthenticationStrategy = "LDAP" ) // Values returns all known values for AuthenticationStrategy. 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 (AuthenticationStrategy) Values() []AuthenticationStrategy { return []AuthenticationStrategy{ "SIMPLE", "LDAP", } } type BrokerState string // Enum values for BrokerState const ( BrokerStateCreationInProgress BrokerState = "CREATION_IN_PROGRESS" BrokerStateCreationFailed BrokerState = "CREATION_FAILED" BrokerStateDeletionInProgress BrokerState = "DELETION_IN_PROGRESS" BrokerStateRunning BrokerState = "RUNNING" BrokerStateRebootInProgress BrokerState = "REBOOT_IN_PROGRESS" BrokerStateCriticalActionRequired BrokerState = "CRITICAL_ACTION_REQUIRED" BrokerStateReplica BrokerState = "REPLICA" ) // Values returns all known values for BrokerState. 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 (BrokerState) Values() []BrokerState { return []BrokerState{ "CREATION_IN_PROGRESS", "CREATION_FAILED", "DELETION_IN_PROGRESS", "RUNNING", "REBOOT_IN_PROGRESS", "CRITICAL_ACTION_REQUIRED", "REPLICA", } } type BrokerStorageType string // Enum values for BrokerStorageType const ( BrokerStorageTypeEbs BrokerStorageType = "EBS" BrokerStorageTypeEfs BrokerStorageType = "EFS" ) // Values returns all known values for BrokerStorageType. 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 (BrokerStorageType) Values() []BrokerStorageType { return []BrokerStorageType{ "EBS", "EFS", } } type ChangeType string // Enum values for ChangeType const ( ChangeTypeCreate ChangeType = "CREATE" ChangeTypeUpdate ChangeType = "UPDATE" ChangeTypeDelete ChangeType = "DELETE" ) // Values returns all known values for ChangeType. 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 (ChangeType) Values() []ChangeType { return []ChangeType{ "CREATE", "UPDATE", "DELETE", } } type DataReplicationMode string // Enum values for DataReplicationMode const ( DataReplicationModeNone DataReplicationMode = "NONE" DataReplicationModeCrdr DataReplicationMode = "CRDR" ) // Values returns all known values for DataReplicationMode. 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 (DataReplicationMode) Values() []DataReplicationMode { return []DataReplicationMode{ "NONE", "CRDR", } } type DayOfWeek string // Enum values for DayOfWeek const ( DayOfWeekMonday DayOfWeek = "MONDAY" DayOfWeekTuesday DayOfWeek = "TUESDAY" DayOfWeekWednesday DayOfWeek = "WEDNESDAY" DayOfWeekThursday DayOfWeek = "THURSDAY" DayOfWeekFriday DayOfWeek = "FRIDAY" DayOfWeekSaturday DayOfWeek = "SATURDAY" DayOfWeekSunday DayOfWeek = "SUNDAY" ) // Values returns all known values for DayOfWeek. 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 (DayOfWeek) Values() []DayOfWeek { return []DayOfWeek{ "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY", } } type DeploymentMode string // Enum values for DeploymentMode const ( DeploymentModeSingleInstance DeploymentMode = "SINGLE_INSTANCE" DeploymentModeActiveStandbyMultiAz DeploymentMode = "ACTIVE_STANDBY_MULTI_AZ" DeploymentModeClusterMultiAz DeploymentMode = "CLUSTER_MULTI_AZ" ) // Values returns all known values for DeploymentMode. 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 (DeploymentMode) Values() []DeploymentMode { return []DeploymentMode{ "SINGLE_INSTANCE", "ACTIVE_STANDBY_MULTI_AZ", "CLUSTER_MULTI_AZ", } } type EngineType string // Enum values for EngineType const ( EngineTypeActivemq EngineType = "ACTIVEMQ" EngineTypeRabbitmq EngineType = "RABBITMQ" ) // Values returns all known values for EngineType. Note that this can be expanded // in the future, and so it is only as up to date as the client. The ordering of // this slice is not guaranteed to be stable across updates. func (EngineType) Values() []EngineType { return []EngineType{ "ACTIVEMQ", "RABBITMQ", } } type PromoteMode string // Enum values for PromoteMode const ( PromoteModeSwitchover PromoteMode = "SWITCHOVER" PromoteModeFailover PromoteMode = "FAILOVER" ) // Values returns all known values for PromoteMode. 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 (PromoteMode) Values() []PromoteMode { return []PromoteMode{ "SWITCHOVER", "FAILOVER", } } type SanitizationWarningReason string // Enum values for SanitizationWarningReason const ( SanitizationWarningReasonDisallowedElementRemoved SanitizationWarningReason = "DISALLOWED_ELEMENT_REMOVED" SanitizationWarningReasonDisallowedAttributeRemoved SanitizationWarningReason = "DISALLOWED_ATTRIBUTE_REMOVED" SanitizationWarningReasonInvalidAttributeValueRemoved SanitizationWarningReason = "INVALID_ATTRIBUTE_VALUE_REMOVED" ) // Values returns all known values for SanitizationWarningReason. 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 (SanitizationWarningReason) Values() []SanitizationWarningReason { return []SanitizationWarningReason{ "DISALLOWED_ELEMENT_REMOVED", "DISALLOWED_ATTRIBUTE_REMOVED", "INVALID_ATTRIBUTE_VALUE_REMOVED", } }
210
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" ) // Returns information about an error. type BadRequestException struct { Message *string ErrorCodeOverride *string ErrorAttribute *string noSmithyDocumentSerde } func (e *BadRequestException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *BadRequestException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *BadRequestException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "BadRequestException" } return *e.ErrorCodeOverride } func (e *BadRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Returns information about an error. type ConflictException struct { Message *string ErrorCodeOverride *string ErrorAttribute *string noSmithyDocumentSerde } func (e *ConflictException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ConflictException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ConflictException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ConflictException" } return *e.ErrorCodeOverride } func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Returns information about an error. type ForbiddenException struct { Message *string ErrorCodeOverride *string ErrorAttribute *string noSmithyDocumentSerde } func (e *ForbiddenException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ForbiddenException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ForbiddenException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ForbiddenException" } return *e.ErrorCodeOverride } func (e *ForbiddenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Returns information about an error. type InternalServerErrorException struct { Message *string ErrorCodeOverride *string ErrorAttribute *string noSmithyDocumentSerde } func (e *InternalServerErrorException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalServerErrorException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalServerErrorException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalServerErrorException" } return *e.ErrorCodeOverride } func (e *InternalServerErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // Returns information about an error. type NotFoundException struct { Message *string ErrorCodeOverride *string ErrorAttribute *string noSmithyDocumentSerde } func (e *NotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *NotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *NotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "NotFoundException" } return *e.ErrorCodeOverride } func (e *NotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Returns information about an error. type UnauthorizedException struct { Message *string ErrorCodeOverride *string ErrorAttribute *string noSmithyDocumentSerde } func (e *UnauthorizedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *UnauthorizedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *UnauthorizedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "UnauthorizedException" } return *e.ErrorCodeOverride } func (e *UnauthorizedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
177
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" ) // Action required for a broker. type ActionRequired struct { // The code you can use to find instructions on the action required to resolve // your broker issue. ActionRequiredCode *string // Information about the action required to resolve your broker issue. ActionRequiredInfo *string noSmithyDocumentSerde } // Name of the availability zone. type AvailabilityZone struct { // Id for the availability zone. Name *string noSmithyDocumentSerde } // Types of broker engines. type BrokerEngineType struct { // The broker's engine type. EngineType EngineType // The list of engine versions. EngineVersions []EngineVersion noSmithyDocumentSerde } // Returns information about all brokers. type BrokerInstance struct { // The brokers web console URL. ConsoleURL *string // The broker's wire-level protocol endpoints. Endpoints []string // The IP address of the Elastic Network Interface (ENI) attached to the broker. // Does not apply to RabbitMQ brokers. IpAddress *string noSmithyDocumentSerde } // Option for host instance type. type BrokerInstanceOption struct { // The list of available az. AvailabilityZones []AvailabilityZone // The broker's engine type. EngineType EngineType // The broker's instance type. HostInstanceType *string // The broker's storage type. StorageType BrokerStorageType // The list of supported deployment modes. SupportedDeploymentModes []DeploymentMode // The list of supported engine versions. SupportedEngineVersions []string noSmithyDocumentSerde } // Returns information about all brokers. type BrokerSummary struct { // The broker's deployment mode. // // This member is required. DeploymentMode DeploymentMode // The type of broker engine. // // This member is required. EngineType EngineType // The broker's Amazon Resource Name (ARN). BrokerArn *string // The unique ID that Amazon MQ generates for the broker. BrokerId *string // The broker's name. This value is unique in your Amazon Web Services account, // 1-50 characters long, and containing only letters, numbers, dashes, and // underscores, and must not contain white spaces, brackets, wildcard characters, // or special characters. BrokerName *string // The broker's status. BrokerState BrokerState // The time when the broker was created. Created *time.Time // The broker's instance type. HostInstanceType *string noSmithyDocumentSerde } // Returns information about all configurations. type Configuration struct { // Required. The ARN of the configuration. // // This member is required. Arn *string // Optional. The authentication strategy associated with the configuration. The // default is SIMPLE. // // This member is required. AuthenticationStrategy AuthenticationStrategy // Required. The date and time of the configuration revision. // // This member is required. Created *time.Time // Required. The description of the configuration. // // This member is required. Description *string // Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and // RABBITMQ. // // This member is required. EngineType EngineType // Required. The broker engine's version. For a list of supported engine versions, // see, Supported engines (https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/broker-engine.html) // . // // This member is required. EngineVersion *string // Required. The unique ID that Amazon MQ generates for the configuration. // // This member is required. Id *string // Required. The latest revision of the configuration. // // This member is required. LatestRevision *ConfigurationRevision // Required. The name of the configuration. This value can contain only // alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). // This value must be 1-150 characters long. // // This member is required. Name *string // The list of all tags associated with this configuration. Tags map[string]string noSmithyDocumentSerde } // A list of information about the configuration. type ConfigurationId struct { // Required. The unique ID that Amazon MQ generates for the configuration. // // This member is required. Id *string // The revision number of the configuration. Revision int32 noSmithyDocumentSerde } // Returns information about the specified configuration revision. type ConfigurationRevision struct { // Required. The date and time of the configuration revision. // // This member is required. Created *time.Time // Required. The revision number of the configuration. // // This member is required. Revision int32 // The description of the configuration revision. Description *string noSmithyDocumentSerde } // Broker configuration information type Configurations struct { // The broker's current configuration. Current *ConfigurationId // The history of configurations applied to the broker. History []ConfigurationId // The broker's pending configuration. Pending *ConfigurationId noSmithyDocumentSerde } // Specifies a broker in a data replication pair. type DataReplicationCounterpart struct { // Required. The unique broker id generated by Amazon MQ. // // This member is required. BrokerId *string // Required. The region of the broker. // // This member is required. Region *string noSmithyDocumentSerde } // The replication details of the data replication-enabled broker. Only returned // if dataReplicationMode or pendingDataReplicationMode is set to CRDR. type DataReplicationMetadataOutput struct { // Defines the role of this broker in a data replication pair. When a replica // broker is promoted to primary, this role is interchanged. // // This member is required. DataReplicationRole *string // Describes the replica/primary broker. Only returned if this broker is currently // set as a primary or replica in the broker's dataReplicationRole property. DataReplicationCounterpart *DataReplicationCounterpart noSmithyDocumentSerde } // Encryption options for the broker. type EncryptionOptions struct { // Enables the use of an Amazon Web Services owned CMK using KMS (KMS). Set to // true by default, if no value is provided, for example, for RabbitMQ brokers. // // This member is required. UseAwsOwnedKey bool // The customer master key (CMK) to use for the A KMS (KMS). This key is used to // encrypt your data at rest. If not provided, Amazon MQ will use a default CMK to // encrypt your data. KmsKeyId *string noSmithyDocumentSerde } // Id of the engine version. type EngineVersion struct { // Id for the version. Name *string noSmithyDocumentSerde } // Optional. The metadata of the LDAP server used to authenticate and authorize // connections to the broker. Does not apply to RabbitMQ brokers. type LdapServerMetadataInput struct { // Specifies the location of the LDAP server such as Directory Service for // Microsoft Active Directory. Optional failover server. // // This member is required. Hosts []string // The distinguished name of the node in the directory information tree (DIT) to // search for roles or groups. For example, ou=group, ou=corp, dc=corp, dc=example, // dc=com. // // This member is required. RoleBase *string // The LDAP search filter used to find roles within the roleBase. The // distinguished name of the user matched by userSearchMatching is substituted into // the {0} placeholder in the search filter. The client's username is substituted // into the {1} placeholder. For example, if you set this option to // (member=uid={1})for the user janedoe, the search filter becomes // (member=uid=janedoe) after string substitution. It matches all role entries that // have a member attribute equal to uid=janedoe under the subtree selected by the // roleBase. // // This member is required. RoleSearchMatching *string // Service account password. A service account is an account in your LDAP server // that has access to initiate a connection. For example, cn=admin,dc=corp, // dc=example, dc=com. // // This member is required. ServiceAccountPassword *string // Service account username. A service account is an account in your LDAP server // that has access to initiate a connection. For example, cn=admin,dc=corp, // dc=example, dc=com. // // This member is required. ServiceAccountUsername *string // Select a particular subtree of the directory information tree (DIT) to search // for user entries. The subtree is specified by a DN, which specifies the base // node of the subtree. For example, by setting this option to ou=Users,ou=corp, // dc=corp, dc=example, dc=com, the search for user entries is restricted to the // subtree beneath ou=Users, ou=corp, dc=corp, dc=example, dc=com. // // This member is required. UserBase *string // The LDAP search filter used to find users within the userBase. The client's // username is substituted into the {0} placeholder in the search filter. For // example, if this option is set to (uid={0}) and the received username is // janedoe, the search filter becomes (uid=janedoe) after string substitution. It // will result in matching an entry like uid=janedoe, ou=Users,ou=corp, dc=corp, // dc=example, dc=com. // // This member is required. UserSearchMatching *string // Specifies the LDAP attribute that identifies the group name attribute in the // object returned from the group membership query. RoleName *string // The directory search scope for the role. If set to true, scope is to search the // entire subtree. RoleSearchSubtree bool // Specifies the name of the LDAP attribute for the user group membership. UserRoleName *string // The directory search scope for the user. If set to true, scope is to search the // entire subtree. UserSearchSubtree bool noSmithyDocumentSerde } // Optional. The metadata of the LDAP server used to authenticate and authorize // connections to the broker. type LdapServerMetadataOutput struct { // Specifies the location of the LDAP server such as Directory Service for // Microsoft Active Directory. Optional failover server. // // This member is required. Hosts []string // The distinguished name of the node in the directory information tree (DIT) to // search for roles or groups. For example, ou=group, ou=corp, dc=corp, dc=example, // dc=com. // // This member is required. RoleBase *string // The LDAP search filter used to find roles within the roleBase. The // distinguished name of the user matched by userSearchMatching is substituted into // the {0} placeholder in the search filter. The client's username is substituted // into the {1} placeholder. For example, if you set this option to // (member=uid={1})for the user janedoe, the search filter becomes // (member=uid=janedoe) after string substitution. It matches all role entries that // have a member attribute equal to uid=janedoe under the subtree selected by the // roleBase. // // This member is required. RoleSearchMatching *string // Service account username. A service account is an account in your LDAP server // that has access to initiate a connection. For example, cn=admin,dc=corp, // dc=example, dc=com. // // This member is required. ServiceAccountUsername *string // Select a particular subtree of the directory information tree (DIT) to search // for user entries. The subtree is specified by a DN, which specifies the base // node of the subtree. For example, by setting this option to ou=Users,ou=corp, // dc=corp, dc=example, dc=com, the search for user entries is restricted to the // subtree beneath ou=Users, ou=corp, dc=corp, dc=example, dc=com. // // This member is required. UserBase *string // The LDAP search filter used to find users within the userBase. The client's // username is substituted into the {0} placeholder in the search filter. For // example, if this option is set to (uid={0}) and the received username is // janedoe, the search filter becomes (uid=janedoe) after string substitution. It // will result in matching an entry like uid=janedoe, ou=Users,ou=corp, dc=corp, // dc=example, dc=com. // // This member is required. UserSearchMatching *string // Specifies the LDAP attribute that identifies the group name attribute in the // object returned from the group membership query. RoleName *string // The directory search scope for the role. If set to true, scope is to search the // entire subtree. RoleSearchSubtree bool // Specifies the name of the LDAP attribute for the user group membership. UserRoleName *string // The directory search scope for the user. If set to true, scope is to search the // entire subtree. UserSearchSubtree bool noSmithyDocumentSerde } // The list of information about logs to be enabled for the specified broker. type Logs struct { // Enables audit logging. Every user management action made using JMX or the // ActiveMQ Web Console is logged. Does not apply to RabbitMQ brokers. Audit bool // Enables general logging. General bool noSmithyDocumentSerde } // The list of information about logs currently enabled and pending to be deployed // for the specified broker. type LogsSummary struct { // Enables general logging. // // This member is required. General bool // The location of the CloudWatch Logs log group where general logs are sent. // // This member is required. GeneralLogGroup *string // Enables audit logging. Every user management action made using JMX or the // ActiveMQ Web Console is logged. Audit bool // The location of the CloudWatch Logs log group where audit logs are sent. AuditLogGroup *string // The list of information about logs pending to be deployed for the specified // broker. Pending *PendingLogs noSmithyDocumentSerde } // The list of information about logs to be enabled for the specified broker. type PendingLogs struct { // Enables audit logging. Every user management action made using JMX or the // ActiveMQ Web Console is logged. Audit bool // Enables general logging. General bool noSmithyDocumentSerde } // Returns information about the configuration element or attribute that was // sanitized in the configuration. type SanitizationWarning struct { // The reason for which the configuration elements or attributes were sanitized. // // This member is required. Reason SanitizationWarningReason // The name of the configuration attribute that has been sanitized. AttributeName *string // The name of the configuration element that has been sanitized. ElementName *string noSmithyDocumentSerde } // A user associated with the broker. For Amazon MQ for RabbitMQ brokers, one and // only one administrative user is accepted and created when a broker is first // provisioned. All subsequent broker users are created by making RabbitMQ API // calls directly to brokers or via the RabbitMQ web console. type User struct { // Required. The password of the user. This value must be at least 12 characters // long, must contain at least 4 unique characters, and must not contain commas, // colons, or equal signs (,:=). // // This member is required. Password *string // The username of the broker user. The following restrictions apply to broker // usernames: // - For Amazon MQ for ActiveMQ brokers, this value can contain only // alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). // This value must be 2-100 characters long. // - para>For Amazon MQ for RabbitMQ brokers, this value can contain only // alphanumeric characters, dashes, periods, underscores (- . _). This value must // not contain a tilde (~) character. Amazon MQ prohibts using guest as a valid // usename. This value must be 2-100 characters long. // Do not add personally identifiable information (PII) or other confidential or // sensitive information in broker usernames. Broker usernames are accessible to // other Amazon Web Services services, including CloudWatch Logs. Broker usernames // are not intended to be used for private or sensitive data. // // This member is required. Username *string // Enables access to the ActiveMQ Web Console for the ActiveMQ user. Does not // apply to RabbitMQ brokers. ConsoleAccess bool // The list of groups (20 maximum) to which the ActiveMQ user belongs. This value // can contain only alphanumeric characters, dashes, periods, underscores, and // tildes (- . _ ~). This value must be 2-100 characters long. Does not apply to // RabbitMQ brokers. Groups []string // Defines if this user is intended for CRDR replication purposes. ReplicationUser bool noSmithyDocumentSerde } // Returns information about the status of the changes pending for the ActiveMQ // user. type UserPendingChanges struct { // Required. The type of change pending for the ActiveMQ user. // // This member is required. PendingChange ChangeType // Enables access to the the ActiveMQ Web Console for the ActiveMQ user. ConsoleAccess bool // The list of groups (20 maximum) to which the ActiveMQ user belongs. This value // can contain only alphanumeric characters, dashes, periods, underscores, and // tildes (- . _ ~). This value must be 2-100 characters long. Groups []string noSmithyDocumentSerde } // Returns a list of all broker users. Does not apply to RabbitMQ brokers. type UserSummary struct { // Required. The username of the broker user. This value can contain only // alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). // This value must be 2-100 characters long. // // This member is required. Username *string // The type of change pending for the broker user. PendingChange ChangeType noSmithyDocumentSerde } // The scheduled time period relative to UTC during which Amazon MQ begins to // apply pending updates or patches to the broker. type WeeklyStartTime struct { // Required. The day of the week. // // This member is required. DayOfWeek DayOfWeek // Required. The time, in 24-hour format. // // This member is required. TimeOfDay *string // The time zone, UTC by default, in either the Country/City format, or the UTC // offset format. TimeZone *string noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
617
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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 = "MTurk" const ServiceAPIVersion = "2017-01-17" // Client provides the API client to make operations call for Amazon Mechanical // Turk. type Client struct { options Options } // New returns an initialized Client based on the functional options. Provide // additional functional options to further configure the behavior of the client, // such as changing the client's endpoint or adding custom middleware behavior. func New(options Options, optFns ...func(*Options)) *Client { options = options.Copy() resolveDefaultLogger(&options) setResolvedDefaultsMode(&options) resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) resolveDefaultEndpointConfiguration(&options) for _, fn := range optFns { fn(&options) } client := &Client{ options: options, } return client } type Options struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // Configures the events that will be sent to the configured logger. ClientLogMode aws.ClientLogMode // The credentials object to use when signing requests. Credentials aws.CredentialsProvider // The configuration DefaultsMode that the SDK should use when constructing the // clients initial default settings. DefaultsMode aws.DefaultsMode // The endpoint options to be used when attempting to resolve an endpoint. EndpointOptions EndpointResolverOptions // The service endpoint resolver. EndpointResolver EndpointResolver // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 // The logger writer interface to write logging messages to. Logger logging.Logger // The region to send requests to. (Required) Region string // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify // per operation call's retry max attempts. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. If specified in an operation call's functional // options with a value that is different than the constructed client's Options, // the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if // Retryer option is not also specified. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. Currently does not support per operation call // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. The kind of // default retry created by the API client can be changed with the RetryMode // option. Retryer aws.Retryer // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You // should not populate this structure programmatically, or rely on the values here // within your applications. RuntimeEnvironment aws.RuntimeEnvironment // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved // value was at that point in time. Currently does not support per operation call // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient } // WithAPIOptions returns a functional option for setting the Client's APIOptions // option. func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { return func(o *Options) { o.APIOptions = append(o.APIOptions, optFns...) } } // WithEndpointResolver returns a functional option for setting the Client's // EndpointResolver option. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v } } type HTTPClient interface { Do(*http.Request) (*http.Response, error) } // Copy creates a clone where the APIOptions list is deep copied. func (o Options) Copy() Options { to := o to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) copy(to.APIOptions, o.APIOptions) return to } func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() for _, fn := range optFns { fn(&options) } finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err } } for _, fn := range options.APIOptions { if err := fn(stack); err != nil { return nil, metadata, err } } handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) result, metadata, err = handler.Handle(ctx, params) if err != nil { err = &smithy.OperationError{ ServiceID: ServiceID, OperationName: opID, Err: err, } } return result, metadata, err } type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { if o.Logger != nil { return } o.Logger = logging.Nop{} } func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } func setResolvedDefaultsMode(o *Options) { if len(o.resolvedDefaultsMode) > 0 { return } var mode aws.DefaultsMode mode.SetFromString(string(o.DefaultsMode)) if mode == aws.DefaultsModeAuto { mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) } o.resolvedDefaultsMode = mode } // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, DefaultsMode: cfg.DefaultsMode, RuntimeEnvironment: cfg.RuntimeEnvironment, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { var buildable *awshttp.BuildableClient if o.HTTPClient != nil { var ok bool buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) if !ok { return } } else { buildable = awshttp.NewBuildableClient() } modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { dialer.Timeout = dialerTimeout } }) buildable = buildable.WithTransportOptions(func(transport *http.Transport) { if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { transport.TLSHandshakeTimeout = tlsHandshakeTimeout } }) } o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } if len(o.RetryMode) == 0 { modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { o.RetryMode = modeConfig.RetryMode } } if len(o.RetryMode) == 0 { o.RetryMode = aws.RetryModeStandard } var standardOptions []func(*retry.StandardOptions) if v := o.RetryMaxAttempts; v != 0 { standardOptions = append(standardOptions, func(so *retry.StandardOptions) { so.MaxAttempts = v }) } switch o.RetryMode { case aws.RetryModeAdaptive: var adaptiveOptions []func(*retry.AdaptiveModeOptions) if len(standardOptions) != 0 { adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { ao.StandardOptions = append(ao.StandardOptions, standardOptions...) }) } o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) default: o.Retryer = retry.NewStandard(standardOptions...) } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { if cfg.Retryer == nil { return } o.Retryer = cfg.Retryer() } func resolveAWSRetryMode(cfg aws.Config, o *Options) { if len(cfg.RetryMode) == 0 { return } o.RetryMode = cfg.RetryMode } func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { if cfg.RetryMaxAttempts == 0 { return } o.RetryMaxAttempts = cfg.RetryMaxAttempts } func finalizeRetryMaxAttemptOptions(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { return } o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) } func addClientUserAgent(stack *middleware.Stack) error { return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "mturk", goModuleVersion)(stack) } func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ CredentialsProvider: o.Credentials, Signer: o.HTTPSignerV4, LogSigning: o.ClientLogMode.IsSigning(), }) return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error } func resolveHTTPSignerV4(o *Options) { if o.HTTPSignerV4 != nil { return } o.HTTPSignerV4 = newDefaultV4Signer(*o) } func newDefaultV4Signer(o Options) *v4.Signer { return v4.NewSigner(func(so *v4.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() }) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, LogRetryAttempts: o.ClientLogMode.IsRetries(), } return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseDualStackEndpoint = value } return nil } // resolves FIPS endpoint configuration func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseFIPSEndpoint = value } return nil } func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ LogRequest: o.ClientLogMode.IsRequest(), LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), LogResponse: o.ClientLogMode.IsResponse(), LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) }
435
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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 mturk 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" ) // The AcceptQualificationRequest operation approves a Worker's request for a // Qualification. Only the owner of the Qualification type can grant a // Qualification request for that type. A successful request for the // AcceptQualificationRequest operation returns with no errors and an empty body. func (c *Client) AcceptQualificationRequest(ctx context.Context, params *AcceptQualificationRequestInput, optFns ...func(*Options)) (*AcceptQualificationRequestOutput, error) { if params == nil { params = &AcceptQualificationRequestInput{} } result, metadata, err := c.invokeOperation(ctx, "AcceptQualificationRequest", params, optFns, c.addOperationAcceptQualificationRequestMiddlewares) if err != nil { return nil, err } out := result.(*AcceptQualificationRequestOutput) out.ResultMetadata = metadata return out, nil } type AcceptQualificationRequestInput struct { // The ID of the Qualification request, as returned by the GetQualificationRequests // operation. // // This member is required. QualificationRequestId *string // The value of the Qualification. You can omit this value if you are using the // presence or absence of the Qualification as the basis for a HIT requirement. IntegerValue *int32 noSmithyDocumentSerde } type AcceptQualificationRequestOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAcceptQualificationRequestMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpAcceptQualificationRequest{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAcceptQualificationRequest{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpAcceptQualificationRequestValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAcceptQualificationRequest(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_opAcceptQualificationRequest(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "AcceptQualificationRequest", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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" ) // The ApproveAssignment operation approves the results of a completed assignment. // Approving an assignment initiates two payments from the Requester's Amazon.com // account // - The Worker who submitted the results is paid the reward specified in the // HIT. // - Amazon Mechanical Turk fees are debited. // // If the Requester's account does not have adequate funds for these payments, the // call to ApproveAssignment returns an exception, and the approval is not // processed. You can include an optional feedback message with the approval, which // the Worker can see in the Status section of the web site. You can also call this // operation for assignments that were previous rejected and approve them by // explicitly overriding the previous rejection. This only works on rejected // assignments that were submitted within the previous 30 days and only if the // assignment's related HIT has not been deleted. func (c *Client) ApproveAssignment(ctx context.Context, params *ApproveAssignmentInput, optFns ...func(*Options)) (*ApproveAssignmentOutput, error) { if params == nil { params = &ApproveAssignmentInput{} } result, metadata, err := c.invokeOperation(ctx, "ApproveAssignment", params, optFns, c.addOperationApproveAssignmentMiddlewares) if err != nil { return nil, err } out := result.(*ApproveAssignmentOutput) out.ResultMetadata = metadata return out, nil } type ApproveAssignmentInput struct { // The ID of the assignment. The assignment must correspond to a HIT created by // the Requester. // // This member is required. AssignmentId *string // A flag indicating that an assignment should be approved even if it was // previously rejected. Defaults to False . OverrideRejection *bool // A message for the Worker, which the Worker can see in the Status section of the // web site. RequesterFeedback *string noSmithyDocumentSerde } type ApproveAssignmentOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationApproveAssignmentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpApproveAssignment{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpApproveAssignment{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpApproveAssignmentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opApproveAssignment(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_opApproveAssignment(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "ApproveAssignment", } }
143
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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" ) // The AssociateQualificationWithWorker operation gives a Worker a Qualification. // AssociateQualificationWithWorker does not require that the Worker submit a // Qualification request. It gives the Qualification directly to the Worker. You // can only assign a Qualification of a Qualification type that you created (using // the CreateQualificationType operation). Note: AssociateQualificationWithWorker // does not affect any pending Qualification requests for the Qualification by the // Worker. If you assign a Qualification to a Worker, then later grant a // Qualification request made by the Worker, the granting of the request may modify // the Qualification score. To resolve a pending Qualification request without // affecting the Qualification the Worker already has, reject the request with the // RejectQualificationRequest operation. func (c *Client) AssociateQualificationWithWorker(ctx context.Context, params *AssociateQualificationWithWorkerInput, optFns ...func(*Options)) (*AssociateQualificationWithWorkerOutput, error) { if params == nil { params = &AssociateQualificationWithWorkerInput{} } result, metadata, err := c.invokeOperation(ctx, "AssociateQualificationWithWorker", params, optFns, c.addOperationAssociateQualificationWithWorkerMiddlewares) if err != nil { return nil, err } out := result.(*AssociateQualificationWithWorkerOutput) out.ResultMetadata = metadata return out, nil } type AssociateQualificationWithWorkerInput struct { // The ID of the Qualification type to use for the assigned Qualification. // // This member is required. QualificationTypeId *string // The ID of the Worker to whom the Qualification is being assigned. Worker IDs // are included with submitted HIT assignments and Qualification requests. // // This member is required. WorkerId *string // The value of the Qualification to assign. IntegerValue *int32 // Specifies whether to send a notification email message to the Worker saying // that the qualification was assigned to the Worker. Note: this is true by // default. SendNotification *bool noSmithyDocumentSerde } type AssociateQualificationWithWorkerOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAssociateQualificationWithWorkerMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateQualificationWithWorker{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateQualificationWithWorker{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpAssociateQualificationWithWorkerValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateQualificationWithWorker(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_opAssociateQualificationWithWorker(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "AssociateQualificationWithWorker", } }
144
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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" ) // The CreateAdditionalAssignmentsForHIT operation increases the maximum number of // assignments of an existing HIT. To extend the maximum number of assignments, // specify the number of additional assignments. // - HITs created with fewer than 10 assignments cannot be extended to have 10 // or more assignments. Attempting to add assignments in a way that brings the // total number of assignments for a HIT from fewer than 10 assignments to 10 or // more assignments will result in an // AWS.MechanicalTurk.InvalidMaximumAssignmentsIncrease exception. // - HITs that were created before July 22, 2015 cannot be extended. Attempting // to extend HITs that were created before July 22, 2015 will result in an // AWS.MechanicalTurk.HITTooOldForExtension exception. func (c *Client) CreateAdditionalAssignmentsForHIT(ctx context.Context, params *CreateAdditionalAssignmentsForHITInput, optFns ...func(*Options)) (*CreateAdditionalAssignmentsForHITOutput, error) { if params == nil { params = &CreateAdditionalAssignmentsForHITInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateAdditionalAssignmentsForHIT", params, optFns, c.addOperationCreateAdditionalAssignmentsForHITMiddlewares) if err != nil { return nil, err } out := result.(*CreateAdditionalAssignmentsForHITOutput) out.ResultMetadata = metadata return out, nil } type CreateAdditionalAssignmentsForHITInput struct { // The ID of the HIT to extend. // // This member is required. HITId *string // The number of additional assignments to request for this HIT. // // This member is required. NumberOfAdditionalAssignments *int32 // A unique identifier for this request, which allows you to retry the call on // error without extending the HIT multiple times. This is useful in cases such as // network timeouts where it is unclear whether or not the call succeeded on the // server. If the extend HIT already exists in the system from a previous call // using the same UniqueRequestToken , subsequent calls will return an error with a // message containing the request ID. UniqueRequestToken *string noSmithyDocumentSerde } type CreateAdditionalAssignmentsForHITOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateAdditionalAssignmentsForHITMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAdditionalAssignmentsForHIT{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAdditionalAssignmentsForHIT{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateAdditionalAssignmentsForHITValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAdditionalAssignmentsForHIT(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_opCreateAdditionalAssignmentsForHIT(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "CreateAdditionalAssignmentsForHIT", } }
143
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The CreateHIT operation creates a new Human Intelligence Task (HIT). The new // HIT is made available for Workers to find and accept on the Amazon Mechanical // Turk website. This operation allows you to specify a new HIT by passing in // values for the properties of the HIT, such as its title, reward amount and // number of assignments. When you pass these values to CreateHIT , a new HIT is // created for you, with a new HITTypeID . The HITTypeID can be used to create // additional HITs in the future without needing to specify common parameters such // as the title, description and reward amount each time. An alternative way to // create HITs is to first generate a HITTypeID using the CreateHITType operation // and then call the CreateHITWithHITType operation. This is the recommended best // practice for Requesters who are creating large numbers of HITs. CreateHIT also // supports several ways to provide question data: by providing a value for the // Question parameter that fully specifies the contents of the HIT, or by providing // a HitLayoutId and associated HitLayoutParameters . If a HIT is created with 10 // or more maximum assignments, there is an additional fee. For more information, // see Amazon Mechanical Turk Pricing (https://requester.mturk.com/pricing) . func (c *Client) CreateHIT(ctx context.Context, params *CreateHITInput, optFns ...func(*Options)) (*CreateHITOutput, error) { if params == nil { params = &CreateHITInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateHIT", params, optFns, c.addOperationCreateHITMiddlewares) if err != nil { return nil, err } out := result.(*CreateHITOutput) out.ResultMetadata = metadata return out, nil } type CreateHITInput struct { // The amount of time, in seconds, that a Worker has to complete the HIT after // accepting it. If a Worker does not complete the assignment within the specified // duration, the assignment is considered abandoned. If the HIT is still active // (that is, its lifetime has not elapsed), the assignment becomes available for // other users to find and accept. // // This member is required. AssignmentDurationInSeconds *int64 // A general description of the HIT. A description includes detailed information // about the kind of task the HIT contains. On the Amazon Mechanical Turk web site, // the HIT description appears in the expanded view of search results, and in the // HIT and assignment screens. A good description gives the user enough information // to evaluate the HIT before accepting it. // // This member is required. Description *string // An amount of time, in seconds, after which the HIT is no longer available for // users to accept. After the lifetime of the HIT elapses, the HIT no longer // appears in HIT searches, even if not all of the assignments for the HIT have // been accepted. // // This member is required. LifetimeInSeconds *int64 // The amount of money the Requester will pay a Worker for successfully completing // the HIT. // // This member is required. Reward *string // The title of the HIT. A title should be short and descriptive about the kind of // task the HIT contains. On the Amazon Mechanical Turk web site, the HIT title // appears in search results, and everywhere the HIT is mentioned. // // This member is required. Title *string // The Assignment-level Review Policy applies to the assignments under the HIT. // You can specify for Mechanical Turk to take various actions based on the policy. AssignmentReviewPolicy *types.ReviewPolicy // The number of seconds after an assignment for the HIT has been submitted, after // which the assignment is considered Approved automatically unless the Requester // explicitly rejects it. AutoApprovalDelayInSeconds *int64 // The HITLayoutId allows you to use a pre-existing HIT design with placeholder // values and create an additional HIT by providing those values as // HITLayoutParameters. Constraints: Either a Question parameter or a HITLayoutId // parameter must be provided. HITLayoutId *string // If the HITLayoutId is provided, any placeholder values must be filled in with // values using the HITLayoutParameter structure. For more information, see // HITLayout. HITLayoutParameters []types.HITLayoutParameter // The HIT-level Review Policy applies to the HIT. You can specify for Mechanical // Turk to take various actions based on the policy. HITReviewPolicy *types.ReviewPolicy // One or more words or phrases that describe the HIT, separated by commas. These // words are used in searches to find HITs. Keywords *string // The number of times the HIT can be accepted and completed before the HIT // becomes unavailable. MaxAssignments *int32 // Conditions that a Worker's Qualifications must meet in order to accept the HIT. // A HIT can have between zero and ten Qualification requirements. All requirements // must be met in order for a Worker to accept the HIT. Additionally, other actions // can be restricted using the ActionsGuarded field on each // QualificationRequirement structure. QualificationRequirements []types.QualificationRequirement // The data the person completing the HIT uses to produce the results. // Constraints: Must be a QuestionForm data structure, an ExternalQuestion data // structure, or an HTMLQuestion data structure. The XML question data must not be // larger than 64 kilobytes (65,535 bytes) in size, including whitespace. Either a // Question parameter or a HITLayoutId parameter must be provided. Question *string // An arbitrary data field. The RequesterAnnotation parameter lets your // application attach arbitrary data to the HIT for tracking purposes. For example, // this parameter could be an identifier internal to the Requester's application // that corresponds with the HIT. The RequesterAnnotation parameter for a HIT is // only visible to the Requester who created the HIT. It is not shown to the // Worker, or any other Requester. The RequesterAnnotation parameter may be // different for each HIT you submit. It does not affect how your HITs are grouped. RequesterAnnotation *string // A unique identifier for this request which allows you to retry the call on // error without creating duplicate HITs. This is useful in cases such as network // timeouts where it is unclear whether or not the call succeeded on the server. If // the HIT already exists in the system from a previous call using the same // UniqueRequestToken, subsequent calls will return a // AWS.MechanicalTurk.HitAlreadyExists error with a message containing the HITId. // Note: It is your responsibility to ensure uniqueness of the token. The unique // token expires after 24 hours. Subsequent calls using the same UniqueRequestToken // made after the 24 hour limit could create duplicate HITs. UniqueRequestToken *string noSmithyDocumentSerde } type CreateHITOutput struct { // Contains the newly created HIT data. For a description of the HIT data // structure as it appears in responses, see the HIT Data Structure documentation. HIT *types.HIT // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateHITMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateHIT{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateHIT{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateHITValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateHIT(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_opCreateHIT(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "CreateHIT", } }
241
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The CreateHITType operation creates a new HIT type. This operation allows you // to define a standard set of HIT properties to use when creating HITs. If you // register a HIT type with values that match an existing HIT type, the HIT type ID // of the existing type will be returned. func (c *Client) CreateHITType(ctx context.Context, params *CreateHITTypeInput, optFns ...func(*Options)) (*CreateHITTypeOutput, error) { if params == nil { params = &CreateHITTypeInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateHITType", params, optFns, c.addOperationCreateHITTypeMiddlewares) if err != nil { return nil, err } out := result.(*CreateHITTypeOutput) out.ResultMetadata = metadata return out, nil } type CreateHITTypeInput struct { // The amount of time, in seconds, that a Worker has to complete the HIT after // accepting it. If a Worker does not complete the assignment within the specified // duration, the assignment is considered abandoned. If the HIT is still active // (that is, its lifetime has not elapsed), the assignment becomes available for // other users to find and accept. // // This member is required. AssignmentDurationInSeconds *int64 // A general description of the HIT. A description includes detailed information // about the kind of task the HIT contains. On the Amazon Mechanical Turk web site, // the HIT description appears in the expanded view of search results, and in the // HIT and assignment screens. A good description gives the user enough information // to evaluate the HIT before accepting it. // // This member is required. Description *string // The amount of money the Requester will pay a Worker for successfully completing // the HIT. // // This member is required. Reward *string // The title of the HIT. A title should be short and descriptive about the kind of // task the HIT contains. On the Amazon Mechanical Turk web site, the HIT title // appears in search results, and everywhere the HIT is mentioned. // // This member is required. Title *string // The number of seconds after an assignment for the HIT has been submitted, after // which the assignment is considered Approved automatically unless the Requester // explicitly rejects it. AutoApprovalDelayInSeconds *int64 // One or more words or phrases that describe the HIT, separated by commas. These // words are used in searches to find HITs. Keywords *string // Conditions that a Worker's Qualifications must meet in order to accept the HIT. // A HIT can have between zero and ten Qualification requirements. All requirements // must be met in order for a Worker to accept the HIT. Additionally, other actions // can be restricted using the ActionsGuarded field on each // QualificationRequirement structure. QualificationRequirements []types.QualificationRequirement noSmithyDocumentSerde } type CreateHITTypeOutput struct { // The ID of the newly registered HIT type. HITTypeId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateHITTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateHITType{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateHITType{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateHITTypeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateHITType(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_opCreateHITType(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "CreateHITType", } }
170
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The CreateHITWithHITType operation creates a new Human Intelligence Task (HIT) // using an existing HITTypeID generated by the CreateHITType operation. This is // an alternative way to create HITs from the CreateHIT operation. This is the // recommended best practice for Requesters who are creating large numbers of HITs. // CreateHITWithHITType also supports several ways to provide question data: by // providing a value for the Question parameter that fully specifies the contents // of the HIT, or by providing a HitLayoutId and associated HitLayoutParameters . // If a HIT is created with 10 or more maximum assignments, there is an additional // fee. For more information, see Amazon Mechanical Turk Pricing (https://requester.mturk.com/pricing) // . func (c *Client) CreateHITWithHITType(ctx context.Context, params *CreateHITWithHITTypeInput, optFns ...func(*Options)) (*CreateHITWithHITTypeOutput, error) { if params == nil { params = &CreateHITWithHITTypeInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateHITWithHITType", params, optFns, c.addOperationCreateHITWithHITTypeMiddlewares) if err != nil { return nil, err } out := result.(*CreateHITWithHITTypeOutput) out.ResultMetadata = metadata return out, nil } type CreateHITWithHITTypeInput struct { // The HIT type ID you want to create this HIT with. // // This member is required. HITTypeId *string // An amount of time, in seconds, after which the HIT is no longer available for // users to accept. After the lifetime of the HIT elapses, the HIT no longer // appears in HIT searches, even if not all of the assignments for the HIT have // been accepted. // // This member is required. LifetimeInSeconds *int64 // The Assignment-level Review Policy applies to the assignments under the HIT. // You can specify for Mechanical Turk to take various actions based on the policy. AssignmentReviewPolicy *types.ReviewPolicy // The HITLayoutId allows you to use a pre-existing HIT design with placeholder // values and create an additional HIT by providing those values as // HITLayoutParameters. Constraints: Either a Question parameter or a HITLayoutId // parameter must be provided. HITLayoutId *string // If the HITLayoutId is provided, any placeholder values must be filled in with // values using the HITLayoutParameter structure. For more information, see // HITLayout. HITLayoutParameters []types.HITLayoutParameter // The HIT-level Review Policy applies to the HIT. You can specify for Mechanical // Turk to take various actions based on the policy. HITReviewPolicy *types.ReviewPolicy // The number of times the HIT can be accepted and completed before the HIT // becomes unavailable. MaxAssignments *int32 // The data the person completing the HIT uses to produce the results. // Constraints: Must be a QuestionForm data structure, an ExternalQuestion data // structure, or an HTMLQuestion data structure. The XML question data must not be // larger than 64 kilobytes (65,535 bytes) in size, including whitespace. Either a // Question parameter or a HITLayoutId parameter must be provided. Question *string // An arbitrary data field. The RequesterAnnotation parameter lets your // application attach arbitrary data to the HIT for tracking purposes. For example, // this parameter could be an identifier internal to the Requester's application // that corresponds with the HIT. The RequesterAnnotation parameter for a HIT is // only visible to the Requester who created the HIT. It is not shown to the // Worker, or any other Requester. The RequesterAnnotation parameter may be // different for each HIT you submit. It does not affect how your HITs are grouped. RequesterAnnotation *string // A unique identifier for this request which allows you to retry the call on // error without creating duplicate HITs. This is useful in cases such as network // timeouts where it is unclear whether or not the call succeeded on the server. If // the HIT already exists in the system from a previous call using the same // UniqueRequestToken, subsequent calls will return a // AWS.MechanicalTurk.HitAlreadyExists error with a message containing the HITId. // Note: It is your responsibility to ensure uniqueness of the token. The unique // token expires after 24 hours. Subsequent calls using the same UniqueRequestToken // made after the 24 hour limit could create duplicate HITs. UniqueRequestToken *string noSmithyDocumentSerde } type CreateHITWithHITTypeOutput struct { // Contains the newly created HIT data. For a description of the HIT data // structure as it appears in responses, see the HIT Data Structure documentation. HIT *types.HIT // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateHITWithHITTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateHITWithHITType{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateHITWithHITType{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateHITWithHITTypeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateHITWithHITType(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_opCreateHITWithHITType(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "CreateHITWithHITType", } }
193
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The CreateQualificationType operation creates a new Qualification type, which // is represented by a QualificationType data structure. func (c *Client) CreateQualificationType(ctx context.Context, params *CreateQualificationTypeInput, optFns ...func(*Options)) (*CreateQualificationTypeOutput, error) { if params == nil { params = &CreateQualificationTypeInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateQualificationType", params, optFns, c.addOperationCreateQualificationTypeMiddlewares) if err != nil { return nil, err } out := result.(*CreateQualificationTypeOutput) out.ResultMetadata = metadata return out, nil } type CreateQualificationTypeInput struct { // A long description for the Qualification type. On the Amazon Mechanical Turk // website, the long description is displayed when a Worker examines a // Qualification type. // // This member is required. Description *string // The name you give to the Qualification type. The type name is used to represent // the Qualification to Workers, and to find the type using a Qualification type // search. It must be unique across all of your Qualification types. // // This member is required. Name *string // The initial status of the Qualification type. Constraints: Valid values are: // Active | Inactive // // This member is required. QualificationTypeStatus types.QualificationTypeStatus // The answers to the Qualification test specified in the Test parameter, in the // form of an AnswerKey data structure. Constraints: Must not be longer than 65535 // bytes. Constraints: None. If not specified, you must process Qualification // requests manually. AnswerKey *string // Specifies whether requests for the Qualification type are granted immediately, // without prompting the Worker with a Qualification test. Constraints: If the Test // parameter is specified, this parameter cannot be true. AutoGranted *bool // The Qualification value to use for automatically granted Qualifications. This // parameter is used only if the AutoGranted parameter is true. AutoGrantedValue *int32 // One or more words or phrases that describe the Qualification type, separated by // commas. The keywords of a type make the type easier to find during a search. Keywords *string // The number of seconds that a Worker must wait after requesting a Qualification // of the Qualification type before the worker can retry the Qualification request. // Constraints: None. If not specified, retries are disabled and Workers can // request a Qualification of this type only once, even if the Worker has not been // granted the Qualification. It is not possible to disable retries for a // Qualification type after it has been created with retries enabled. If you want // to disable retries, you must delete existing retry-enabled Qualification type // and then create a new Qualification type with retries disabled. RetryDelayInSeconds *int64 // The questions for the Qualification test a Worker must answer correctly to // obtain a Qualification of this type. If this parameter is specified, // TestDurationInSeconds must also be specified. Constraints: Must not be longer // than 65535 bytes. Must be a QuestionForm data structure. This parameter cannot // be specified if AutoGranted is true. Constraints: None. If not specified, the // Worker may request the Qualification without answering any questions. Test *string // The number of seconds the Worker has to complete the Qualification test, // starting from the time the Worker requests the Qualification. TestDurationInSeconds *int64 noSmithyDocumentSerde } type CreateQualificationTypeOutput struct { // The created Qualification type, returned as a QualificationType data structure. QualificationType *types.QualificationType // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateQualificationTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateQualificationType{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateQualificationType{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateQualificationTypeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateQualificationType(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_opCreateQualificationType(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "CreateQualificationType", } }
182
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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" ) // The CreateWorkerBlock operation allows you to prevent a Worker from working on // your HITs. For example, you can block a Worker who is producing poor quality // work. You can block up to 100,000 Workers. func (c *Client) CreateWorkerBlock(ctx context.Context, params *CreateWorkerBlockInput, optFns ...func(*Options)) (*CreateWorkerBlockOutput, error) { if params == nil { params = &CreateWorkerBlockInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateWorkerBlock", params, optFns, c.addOperationCreateWorkerBlockMiddlewares) if err != nil { return nil, err } out := result.(*CreateWorkerBlockOutput) out.ResultMetadata = metadata return out, nil } type CreateWorkerBlockInput struct { // A message explaining the reason for blocking the Worker. This parameter enables // you to keep track of your Workers. The Worker does not see this message. // // This member is required. Reason *string // The ID of the Worker to block. // // This member is required. WorkerId *string noSmithyDocumentSerde } type CreateWorkerBlockOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateWorkerBlockMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateWorkerBlock{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateWorkerBlock{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateWorkerBlockValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWorkerBlock(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_opCreateWorkerBlock(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "CreateWorkerBlock", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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" ) // The DeleteHIT operation is used to delete HIT that is no longer needed. Only // the Requester who created the HIT can delete it. You can only dispose of HITs // that are in the Reviewable state, with all of their submitted assignments // already either approved or rejected. If you call the DeleteHIT operation on a // HIT that is not in the Reviewable state (for example, that has not expired, or // still has active assignments), or on a HIT that is Reviewable but without all of // its submitted assignments already approved or rejected, the service will return // an error. // - HITs are automatically disposed of after 120 days. // - After you dispose of a HIT, you can no longer approve the HIT's rejected // assignments. // - Disposed HITs are not returned in results for the ListHITs operation. // - Disposing HITs can improve the performance of operations such as // ListReviewableHITs and ListHITs. func (c *Client) DeleteHIT(ctx context.Context, params *DeleteHITInput, optFns ...func(*Options)) (*DeleteHITOutput, error) { if params == nil { params = &DeleteHITInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteHIT", params, optFns, c.addOperationDeleteHITMiddlewares) if err != nil { return nil, err } out := result.(*DeleteHITOutput) out.ResultMetadata = metadata return out, nil } type DeleteHITInput struct { // The ID of the HIT to be deleted. // // This member is required. HITId *string noSmithyDocumentSerde } type DeleteHITOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteHITMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteHIT{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteHIT{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteHITValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteHIT(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_opDeleteHIT(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "DeleteHIT", } }
133
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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" ) // The DeleteQualificationType deletes a Qualification type and deletes any HIT // types that are associated with the Qualification type. This operation does not // revoke Qualifications already assigned to Workers because the Qualifications // might be needed for active HITs. If there are any pending requests for the // Qualification type, Amazon Mechanical Turk rejects those requests. After you // delete a Qualification type, you can no longer use it to create HITs or HIT // types. DeleteQualificationType must wait for all the HITs that use the deleted // Qualification type to be deleted before completing. It may take up to 48 hours // before DeleteQualificationType completes and the unique name of the // Qualification type is available for reuse with CreateQualificationType. func (c *Client) DeleteQualificationType(ctx context.Context, params *DeleteQualificationTypeInput, optFns ...func(*Options)) (*DeleteQualificationTypeOutput, error) { if params == nil { params = &DeleteQualificationTypeInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteQualificationType", params, optFns, c.addOperationDeleteQualificationTypeMiddlewares) if err != nil { return nil, err } out := result.(*DeleteQualificationTypeOutput) out.ResultMetadata = metadata return out, nil } type DeleteQualificationTypeInput struct { // The ID of the QualificationType to dispose. // // This member is required. QualificationTypeId *string noSmithyDocumentSerde } type DeleteQualificationTypeOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteQualificationTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteQualificationType{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteQualificationType{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteQualificationTypeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteQualificationType(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_opDeleteQualificationType(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "DeleteQualificationType", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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" ) // The DisassociateQualificationFromWorker revokes a previously granted // Qualification from a user. You can provide a text message explaining why the // Qualification was revoked. The user who had the Qualification can see this // message. func (c *Client) DisassociateQualificationFromWorker(ctx context.Context, params *DisassociateQualificationFromWorkerInput, optFns ...func(*Options)) (*DisassociateQualificationFromWorkerOutput, error) { if params == nil { params = &DisassociateQualificationFromWorkerInput{} } result, metadata, err := c.invokeOperation(ctx, "DisassociateQualificationFromWorker", params, optFns, c.addOperationDisassociateQualificationFromWorkerMiddlewares) if err != nil { return nil, err } out := result.(*DisassociateQualificationFromWorkerOutput) out.ResultMetadata = metadata return out, nil } type DisassociateQualificationFromWorkerInput struct { // The ID of the Qualification type of the Qualification to be revoked. // // This member is required. QualificationTypeId *string // The ID of the Worker who possesses the Qualification to be revoked. // // This member is required. WorkerId *string // A text message that explains why the Qualification was revoked. The user who // had the Qualification sees this message. Reason *string noSmithyDocumentSerde } type DisassociateQualificationFromWorkerOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDisassociateQualificationFromWorkerMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisassociateQualificationFromWorker{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisassociateQualificationFromWorker{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDisassociateQualificationFromWorkerValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateQualificationFromWorker(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_opDisassociateQualificationFromWorker(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "DisassociateQualificationFromWorker", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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" ) // The GetAccountBalance operation retrieves the Prepaid HITs balance in your // Amazon Mechanical Turk account if you are a Prepaid Requester. Alternatively, // this operation will retrieve the remaining available AWS Billing usage if you // have enabled AWS Billing. Note: If you have enabled AWS Billing and still have a // remaining Prepaid HITs balance, this balance can be viewed on the My Account // page in the Requester console. func (c *Client) GetAccountBalance(ctx context.Context, params *GetAccountBalanceInput, optFns ...func(*Options)) (*GetAccountBalanceOutput, error) { if params == nil { params = &GetAccountBalanceInput{} } result, metadata, err := c.invokeOperation(ctx, "GetAccountBalance", params, optFns, c.addOperationGetAccountBalanceMiddlewares) if err != nil { return nil, err } out := result.(*GetAccountBalanceOutput) out.ResultMetadata = metadata return out, nil } type GetAccountBalanceInput struct { noSmithyDocumentSerde } type GetAccountBalanceOutput struct { // A string representing a currency amount. AvailableBalance *string // A string representing a currency amount. OnHoldBalance *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetAccountBalanceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAccountBalance{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetAccountBalance{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opGetAccountBalance(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_opGetAccountBalance(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "GetAccountBalance", } }
123
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The GetAssignment operation retrieves the details of the specified Assignment. func (c *Client) GetAssignment(ctx context.Context, params *GetAssignmentInput, optFns ...func(*Options)) (*GetAssignmentOutput, error) { if params == nil { params = &GetAssignmentInput{} } result, metadata, err := c.invokeOperation(ctx, "GetAssignment", params, optFns, c.addOperationGetAssignmentMiddlewares) if err != nil { return nil, err } out := result.(*GetAssignmentOutput) out.ResultMetadata = metadata return out, nil } type GetAssignmentInput struct { // The ID of the Assignment to be retrieved. // // This member is required. AssignmentId *string noSmithyDocumentSerde } type GetAssignmentOutput struct { // The assignment. The response includes one Assignment element. Assignment *types.Assignment // The HIT associated with this assignment. The response includes one HIT element. HIT *types.HIT // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetAssignmentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAssignment{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetAssignment{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetAssignmentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAssignment(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_opGetAssignment(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "GetAssignment", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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" ) // The GetFileUploadURL operation generates and returns a temporary URL. You use // the temporary URL to retrieve a file uploaded by a Worker as an answer to a // FileUploadAnswer question for a HIT. The temporary URL is generated the instant // the GetFileUploadURL operation is called, and is valid for 60 seconds. You can // get a temporary file upload URL any time until the HIT is disposed. After the // HIT is disposed, any uploaded files are deleted, and cannot be retrieved. // Pending Deprecation on December 12, 2017. The Answer Specification // // structure will no longer support the FileUploadAnswer element to be used for // the QuestionForm data structure. Instead, we recommend that Requesters who want // to create HITs asking Workers to upload files to use Amazon S3. func (c *Client) GetFileUploadURL(ctx context.Context, params *GetFileUploadURLInput, optFns ...func(*Options)) (*GetFileUploadURLOutput, error) { if params == nil { params = &GetFileUploadURLInput{} } result, metadata, err := c.invokeOperation(ctx, "GetFileUploadURL", params, optFns, c.addOperationGetFileUploadURLMiddlewares) if err != nil { return nil, err } out := result.(*GetFileUploadURLOutput) out.ResultMetadata = metadata return out, nil } type GetFileUploadURLInput struct { // The ID of the assignment that contains the question with a FileUploadAnswer. // // This member is required. AssignmentId *string // The identifier of the question with a FileUploadAnswer, as specified in the // QuestionForm of the HIT. // // This member is required. QuestionIdentifier *string noSmithyDocumentSerde } type GetFileUploadURLOutput struct { // A temporary URL for the file that the Worker uploaded for the answer. FileUploadURL *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetFileUploadURLMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetFileUploadURL{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetFileUploadURL{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetFileUploadURLValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFileUploadURL(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_opGetFileUploadURL(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "GetFileUploadURL", } }
140
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The GetHIT operation retrieves the details of the specified HIT. func (c *Client) GetHIT(ctx context.Context, params *GetHITInput, optFns ...func(*Options)) (*GetHITOutput, error) { if params == nil { params = &GetHITInput{} } result, metadata, err := c.invokeOperation(ctx, "GetHIT", params, optFns, c.addOperationGetHITMiddlewares) if err != nil { return nil, err } out := result.(*GetHITOutput) out.ResultMetadata = metadata return out, nil } type GetHITInput struct { // The ID of the HIT to be retrieved. // // This member is required. HITId *string noSmithyDocumentSerde } type GetHITOutput struct { // Contains the requested HIT data. HIT *types.HIT // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetHITMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetHIT{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetHIT{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetHITValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetHIT(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_opGetHIT(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "GetHIT", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The GetQualificationScore operation returns the value of a Worker's // Qualification for a given Qualification type. To get a Worker's Qualification, // you must know the Worker's ID. The Worker's ID is included in the assignment // data returned by the ListAssignmentsForHIT operation. Only the owner of a // Qualification type can query the value of a Worker's Qualification of that type. func (c *Client) GetQualificationScore(ctx context.Context, params *GetQualificationScoreInput, optFns ...func(*Options)) (*GetQualificationScoreOutput, error) { if params == nil { params = &GetQualificationScoreInput{} } result, metadata, err := c.invokeOperation(ctx, "GetQualificationScore", params, optFns, c.addOperationGetQualificationScoreMiddlewares) if err != nil { return nil, err } out := result.(*GetQualificationScoreOutput) out.ResultMetadata = metadata return out, nil } type GetQualificationScoreInput struct { // The ID of the QualificationType. // // This member is required. QualificationTypeId *string // The ID of the Worker whose Qualification is being updated. // // This member is required. WorkerId *string noSmithyDocumentSerde } type GetQualificationScoreOutput struct { // The Qualification data structure of the Qualification assigned to a user, // including the Qualification type and the value (score). Qualification *types.Qualification // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetQualificationScoreMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetQualificationScore{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetQualificationScore{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetQualificationScoreValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetQualificationScore(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_opGetQualificationScore(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "GetQualificationScore", } }
135
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The GetQualificationType operation retrieves information about a Qualification // type using its ID. func (c *Client) GetQualificationType(ctx context.Context, params *GetQualificationTypeInput, optFns ...func(*Options)) (*GetQualificationTypeOutput, error) { if params == nil { params = &GetQualificationTypeInput{} } result, metadata, err := c.invokeOperation(ctx, "GetQualificationType", params, optFns, c.addOperationGetQualificationTypeMiddlewares) if err != nil { return nil, err } out := result.(*GetQualificationTypeOutput) out.ResultMetadata = metadata return out, nil } type GetQualificationTypeInput struct { // The ID of the QualificationType. // // This member is required. QualificationTypeId *string noSmithyDocumentSerde } type GetQualificationTypeOutput struct { // The returned Qualification Type QualificationType *types.QualificationType // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetQualificationTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetQualificationType{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetQualificationType{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetQualificationTypeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetQualificationType(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_opGetQualificationType(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "GetQualificationType", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The ListAssignmentsForHIT operation retrieves completed assignments for a HIT. // You can use this operation to retrieve the results for a HIT. You can get // assignments for a HIT at any time, even if the HIT is not yet Reviewable. If a // HIT requested multiple assignments, and has received some results but has not // yet become Reviewable, you can still retrieve the partial results with this // operation. Use the AssignmentStatus parameter to control which set of // assignments for a HIT are returned. The ListAssignmentsForHIT operation can // return submitted assignments awaiting approval, or it can return assignments // that have already been approved or rejected. You can set // AssignmentStatus=Approved,Rejected to get assignments that have already been // approved and rejected together in one result set. Only the Requester who created // the HIT can retrieve the assignments for that HIT. Results are sorted and // divided into numbered pages and the operation returns a single page of results. // You can use the parameters of the operation to control sorting and pagination. func (c *Client) ListAssignmentsForHIT(ctx context.Context, params *ListAssignmentsForHITInput, optFns ...func(*Options)) (*ListAssignmentsForHITOutput, error) { if params == nil { params = &ListAssignmentsForHITInput{} } result, metadata, err := c.invokeOperation(ctx, "ListAssignmentsForHIT", params, optFns, c.addOperationListAssignmentsForHITMiddlewares) if err != nil { return nil, err } out := result.(*ListAssignmentsForHITOutput) out.ResultMetadata = metadata return out, nil } type ListAssignmentsForHITInput struct { // The ID of the HIT. // // This member is required. HITId *string // The status of the assignments to return: Submitted | Approved | Rejected AssignmentStatuses []types.AssignmentStatus MaxResults *int32 // Pagination token NextToken *string noSmithyDocumentSerde } type ListAssignmentsForHITOutput struct { // The collection of Assignment data structures returned by this call. Assignments []types.Assignment // If the previous response was incomplete (because there is more data to // retrieve), Amazon Mechanical Turk returns a pagination token in the response. // You can use this pagination token to retrieve the next set of results. NextToken *string // The number of assignments on the page in the filtered results list, equivalent // to the number of assignments returned by this call. NumResults *int32 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListAssignmentsForHITMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAssignmentsForHIT{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAssignmentsForHIT{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListAssignmentsForHITValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssignmentsForHIT(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 } // ListAssignmentsForHITAPIClient is a client that implements the // ListAssignmentsForHIT operation. type ListAssignmentsForHITAPIClient interface { ListAssignmentsForHIT(context.Context, *ListAssignmentsForHITInput, ...func(*Options)) (*ListAssignmentsForHITOutput, error) } var _ ListAssignmentsForHITAPIClient = (*Client)(nil) // ListAssignmentsForHITPaginatorOptions is the paginator options for // ListAssignmentsForHIT type ListAssignmentsForHITPaginatorOptions struct { Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListAssignmentsForHITPaginator is a paginator for ListAssignmentsForHIT type ListAssignmentsForHITPaginator struct { options ListAssignmentsForHITPaginatorOptions client ListAssignmentsForHITAPIClient params *ListAssignmentsForHITInput nextToken *string firstPage bool } // NewListAssignmentsForHITPaginator returns a new ListAssignmentsForHITPaginator func NewListAssignmentsForHITPaginator(client ListAssignmentsForHITAPIClient, params *ListAssignmentsForHITInput, optFns ...func(*ListAssignmentsForHITPaginatorOptions)) *ListAssignmentsForHITPaginator { if params == nil { params = &ListAssignmentsForHITInput{} } options := ListAssignmentsForHITPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListAssignmentsForHITPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListAssignmentsForHITPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListAssignmentsForHIT page. func (p *ListAssignmentsForHITPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssignmentsForHITOutput, 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.ListAssignmentsForHIT(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_opListAssignmentsForHIT(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "ListAssignmentsForHIT", } }
246
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The ListBonusPayments operation retrieves the amounts of bonuses you have paid // to Workers for a given HIT or assignment. func (c *Client) ListBonusPayments(ctx context.Context, params *ListBonusPaymentsInput, optFns ...func(*Options)) (*ListBonusPaymentsOutput, error) { if params == nil { params = &ListBonusPaymentsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListBonusPayments", params, optFns, c.addOperationListBonusPaymentsMiddlewares) if err != nil { return nil, err } out := result.(*ListBonusPaymentsOutput) out.ResultMetadata = metadata return out, nil } type ListBonusPaymentsInput struct { // The ID of the assignment associated with the bonus payments to retrieve. If // specified, only bonus payments for the given assignment are returned. Either the // HITId parameter or the AssignmentId parameter must be specified AssignmentId *string // The ID of the HIT associated with the bonus payments to retrieve. If not // specified, all bonus payments for all assignments for the given HIT are // returned. Either the HITId parameter or the AssignmentId parameter must be // specified HITId *string MaxResults *int32 // Pagination token NextToken *string noSmithyDocumentSerde } type ListBonusPaymentsOutput struct { // A successful request to the ListBonusPayments operation returns a list of // BonusPayment objects. BonusPayments []types.BonusPayment // If the previous response was incomplete (because there is more data to // retrieve), Amazon Mechanical Turk returns a pagination token in the response. // You can use this pagination token to retrieve the next set of results. NextToken *string // The number of bonus payments on this page in the filtered results list, // equivalent to the number of bonus payments being returned by this call. NumResults *int32 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListBonusPaymentsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListBonusPayments{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListBonusPayments{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListBonusPayments(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 } // ListBonusPaymentsAPIClient is a client that implements the ListBonusPayments // operation. type ListBonusPaymentsAPIClient interface { ListBonusPayments(context.Context, *ListBonusPaymentsInput, ...func(*Options)) (*ListBonusPaymentsOutput, error) } var _ ListBonusPaymentsAPIClient = (*Client)(nil) // ListBonusPaymentsPaginatorOptions is the paginator options for ListBonusPayments type ListBonusPaymentsPaginatorOptions struct { Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListBonusPaymentsPaginator is a paginator for ListBonusPayments type ListBonusPaymentsPaginator struct { options ListBonusPaymentsPaginatorOptions client ListBonusPaymentsAPIClient params *ListBonusPaymentsInput nextToken *string firstPage bool } // NewListBonusPaymentsPaginator returns a new ListBonusPaymentsPaginator func NewListBonusPaymentsPaginator(client ListBonusPaymentsAPIClient, params *ListBonusPaymentsInput, optFns ...func(*ListBonusPaymentsPaginatorOptions)) *ListBonusPaymentsPaginator { if params == nil { params = &ListBonusPaymentsInput{} } options := ListBonusPaymentsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListBonusPaymentsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListBonusPaymentsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListBonusPayments page. func (p *ListBonusPaymentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBonusPaymentsOutput, 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.ListBonusPayments(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_opListBonusPayments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "ListBonusPayments", } }
234
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The ListHITs operation returns all of a Requester's HITs. The operation returns // HITs of any status, except for HITs that have been deleted of with the DeleteHIT // operation or that have been auto-deleted. func (c *Client) ListHITs(ctx context.Context, params *ListHITsInput, optFns ...func(*Options)) (*ListHITsOutput, error) { if params == nil { params = &ListHITsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListHITs", params, optFns, c.addOperationListHITsMiddlewares) if err != nil { return nil, err } out := result.(*ListHITsOutput) out.ResultMetadata = metadata return out, nil } type ListHITsInput struct { MaxResults *int32 // Pagination token NextToken *string noSmithyDocumentSerde } type ListHITsOutput struct { // The list of HIT elements returned by the query. HITs []types.HIT // If the previous response was incomplete (because there is more data to // retrieve), Amazon Mechanical Turk returns a pagination token in the response. // You can use this pagination token to retrieve the next set of results. NextToken *string // The number of HITs on this page in the filtered results list, equivalent to the // number of HITs being returned by this call. NumResults *int32 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListHITsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListHITs{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListHITs{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListHITs(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 } // ListHITsAPIClient is a client that implements the ListHITs operation. type ListHITsAPIClient interface { ListHITs(context.Context, *ListHITsInput, ...func(*Options)) (*ListHITsOutput, error) } var _ ListHITsAPIClient = (*Client)(nil) // ListHITsPaginatorOptions is the paginator options for ListHITs type ListHITsPaginatorOptions struct { Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListHITsPaginator is a paginator for ListHITs type ListHITsPaginator struct { options ListHITsPaginatorOptions client ListHITsAPIClient params *ListHITsInput nextToken *string firstPage bool } // NewListHITsPaginator returns a new ListHITsPaginator func NewListHITsPaginator(client ListHITsAPIClient, params *ListHITsInput, optFns ...func(*ListHITsPaginatorOptions)) *ListHITsPaginator { if params == nil { params = &ListHITsInput{} } options := ListHITsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListHITsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListHITsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListHITs page. func (p *ListHITsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHITsOutput, 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.ListHITs(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_opListHITs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "ListHITs", } }
221
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The ListHITsForQualificationType operation returns the HITs that use the given // Qualification type for a Qualification requirement. The operation returns HITs // of any status, except for HITs that have been deleted with the DeleteHIT // operation or that have been auto-deleted. func (c *Client) ListHITsForQualificationType(ctx context.Context, params *ListHITsForQualificationTypeInput, optFns ...func(*Options)) (*ListHITsForQualificationTypeOutput, error) { if params == nil { params = &ListHITsForQualificationTypeInput{} } result, metadata, err := c.invokeOperation(ctx, "ListHITsForQualificationType", params, optFns, c.addOperationListHITsForQualificationTypeMiddlewares) if err != nil { return nil, err } out := result.(*ListHITsForQualificationTypeOutput) out.ResultMetadata = metadata return out, nil } type ListHITsForQualificationTypeInput struct { // The ID of the Qualification type to use when querying HITs. // // This member is required. QualificationTypeId *string // Limit the number of results returned. MaxResults *int32 // Pagination Token NextToken *string noSmithyDocumentSerde } type ListHITsForQualificationTypeOutput struct { // The list of HIT elements returned by the query. HITs []types.HIT // If the previous response was incomplete (because there is more data to // retrieve), Amazon Mechanical Turk returns a pagination token in the response. // You can use this pagination token to retrieve the next set of results. NextToken *string // The number of HITs on this page in the filtered results list, equivalent to the // number of HITs being returned by this call. NumResults *int32 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListHITsForQualificationTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListHITsForQualificationType{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListHITsForQualificationType{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListHITsForQualificationTypeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListHITsForQualificationType(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 } // ListHITsForQualificationTypeAPIClient is a client that implements the // ListHITsForQualificationType operation. type ListHITsForQualificationTypeAPIClient interface { ListHITsForQualificationType(context.Context, *ListHITsForQualificationTypeInput, ...func(*Options)) (*ListHITsForQualificationTypeOutput, error) } var _ ListHITsForQualificationTypeAPIClient = (*Client)(nil) // ListHITsForQualificationTypePaginatorOptions is the paginator options for // ListHITsForQualificationType type ListHITsForQualificationTypePaginatorOptions struct { // Limit the number of results returned. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListHITsForQualificationTypePaginator is a paginator for // ListHITsForQualificationType type ListHITsForQualificationTypePaginator struct { options ListHITsForQualificationTypePaginatorOptions client ListHITsForQualificationTypeAPIClient params *ListHITsForQualificationTypeInput nextToken *string firstPage bool } // NewListHITsForQualificationTypePaginator returns a new // ListHITsForQualificationTypePaginator func NewListHITsForQualificationTypePaginator(client ListHITsForQualificationTypeAPIClient, params *ListHITsForQualificationTypeInput, optFns ...func(*ListHITsForQualificationTypePaginatorOptions)) *ListHITsForQualificationTypePaginator { if params == nil { params = &ListHITsForQualificationTypeInput{} } options := ListHITsForQualificationTypePaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListHITsForQualificationTypePaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListHITsForQualificationTypePaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListHITsForQualificationType page. func (p *ListHITsForQualificationTypePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHITsForQualificationTypeOutput, 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.ListHITsForQualificationType(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_opListHITsForQualificationType(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "ListHITsForQualificationType", } }
237
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The ListQualificationRequests operation retrieves requests for Qualifications // of a particular Qualification type. The owner of the Qualification type calls // this operation to poll for pending requests, and accepts them using the // AcceptQualification operation. func (c *Client) ListQualificationRequests(ctx context.Context, params *ListQualificationRequestsInput, optFns ...func(*Options)) (*ListQualificationRequestsOutput, error) { if params == nil { params = &ListQualificationRequestsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListQualificationRequests", params, optFns, c.addOperationListQualificationRequestsMiddlewares) if err != nil { return nil, err } out := result.(*ListQualificationRequestsOutput) out.ResultMetadata = metadata return out, nil } type ListQualificationRequestsInput struct { // The maximum number of results to return in a single call. MaxResults *int32 // If the previous response was incomplete (because there is more data to // retrieve), Amazon Mechanical Turk returns a pagination token in the response. // You can use this pagination token to retrieve the next set of results. NextToken *string // The ID of the QualificationType. QualificationTypeId *string noSmithyDocumentSerde } type ListQualificationRequestsOutput struct { // If the previous response was incomplete (because there is more data to // retrieve), Amazon Mechanical Turk returns a pagination token in the response. // You can use this pagination token to retrieve the next set of results. NextToken *string // The number of Qualification requests on this page in the filtered results list, // equivalent to the number of Qualification requests being returned by this call. NumResults *int32 // The Qualification request. The response includes one QualificationRequest // element for each Qualification request returned by the query. QualificationRequests []types.QualificationRequest // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListQualificationRequestsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListQualificationRequests{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListQualificationRequests{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListQualificationRequests(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 } // ListQualificationRequestsAPIClient is a client that implements the // ListQualificationRequests operation. type ListQualificationRequestsAPIClient interface { ListQualificationRequests(context.Context, *ListQualificationRequestsInput, ...func(*Options)) (*ListQualificationRequestsOutput, error) } var _ ListQualificationRequestsAPIClient = (*Client)(nil) // ListQualificationRequestsPaginatorOptions is the paginator options for // ListQualificationRequests type ListQualificationRequestsPaginatorOptions struct { // The maximum number of results to return in a single call. 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 } // ListQualificationRequestsPaginator is a paginator for ListQualificationRequests type ListQualificationRequestsPaginator struct { options ListQualificationRequestsPaginatorOptions client ListQualificationRequestsAPIClient params *ListQualificationRequestsInput nextToken *string firstPage bool } // NewListQualificationRequestsPaginator returns a new // ListQualificationRequestsPaginator func NewListQualificationRequestsPaginator(client ListQualificationRequestsAPIClient, params *ListQualificationRequestsInput, optFns ...func(*ListQualificationRequestsPaginatorOptions)) *ListQualificationRequestsPaginator { if params == nil { params = &ListQualificationRequestsInput{} } options := ListQualificationRequestsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListQualificationRequestsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListQualificationRequestsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListQualificationRequests page. func (p *ListQualificationRequestsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListQualificationRequestsOutput, 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.ListQualificationRequests(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_opListQualificationRequests(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "ListQualificationRequests", } }
234
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The ListQualificationTypes operation returns a list of Qualification types, // filtered by an optional search term. func (c *Client) ListQualificationTypes(ctx context.Context, params *ListQualificationTypesInput, optFns ...func(*Options)) (*ListQualificationTypesOutput, error) { if params == nil { params = &ListQualificationTypesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListQualificationTypes", params, optFns, c.addOperationListQualificationTypesMiddlewares) if err != nil { return nil, err } out := result.(*ListQualificationTypesOutput) out.ResultMetadata = metadata return out, nil } type ListQualificationTypesInput struct { // Specifies that only Qualification types that a user can request through the // Amazon Mechanical Turk web site, such as by taking a Qualification test, are // returned as results of the search. Some Qualification types, such as those // assigned automatically by the system, cannot be requested directly by users. If // false, all Qualification types, including those managed by the system, are // considered. Valid values are True | False. // // This member is required. MustBeRequestable *bool // The maximum number of results to return in a single call. MaxResults *int32 // Specifies that only Qualification types that the Requester created are // returned. If false, the operation returns all Qualification types. MustBeOwnedByCaller *bool // If the previous response was incomplete (because there is more data to // retrieve), Amazon Mechanical Turk returns a pagination token in the response. // You can use this pagination token to retrieve the next set of results. NextToken *string // A text query against all of the searchable attributes of Qualification types. Query *string noSmithyDocumentSerde } type ListQualificationTypesOutput struct { // If the previous response was incomplete (because there is more data to // retrieve), Amazon Mechanical Turk returns a pagination token in the response. // You can use this pagination token to retrieve the next set of results. NextToken *string // The number of Qualification types on this page in the filtered results list, // equivalent to the number of types this operation returns. NumResults *int32 // The list of QualificationType elements returned by the query. QualificationTypes []types.QualificationType // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListQualificationTypesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListQualificationTypes{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListQualificationTypes{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListQualificationTypesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListQualificationTypes(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 } // ListQualificationTypesAPIClient is a client that implements the // ListQualificationTypes operation. type ListQualificationTypesAPIClient interface { ListQualificationTypes(context.Context, *ListQualificationTypesInput, ...func(*Options)) (*ListQualificationTypesOutput, error) } var _ ListQualificationTypesAPIClient = (*Client)(nil) // ListQualificationTypesPaginatorOptions is the paginator options for // ListQualificationTypes type ListQualificationTypesPaginatorOptions struct { // The maximum number of results to return in a single call. 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 } // ListQualificationTypesPaginator is a paginator for ListQualificationTypes type ListQualificationTypesPaginator struct { options ListQualificationTypesPaginatorOptions client ListQualificationTypesAPIClient params *ListQualificationTypesInput nextToken *string firstPage bool } // NewListQualificationTypesPaginator returns a new ListQualificationTypesPaginator func NewListQualificationTypesPaginator(client ListQualificationTypesAPIClient, params *ListQualificationTypesInput, optFns ...func(*ListQualificationTypesPaginatorOptions)) *ListQualificationTypesPaginator { if params == nil { params = &ListQualificationTypesInput{} } options := ListQualificationTypesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListQualificationTypesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListQualificationTypesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListQualificationTypes page. func (p *ListQualificationTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListQualificationTypesOutput, 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.ListQualificationTypes(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_opListQualificationTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "ListQualificationTypes", } }
247
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The ListReviewableHITs operation retrieves the HITs with Status equal to // Reviewable or Status equal to Reviewing that belong to the Requester calling the // operation. func (c *Client) ListReviewableHITs(ctx context.Context, params *ListReviewableHITsInput, optFns ...func(*Options)) (*ListReviewableHITsOutput, error) { if params == nil { params = &ListReviewableHITsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListReviewableHITs", params, optFns, c.addOperationListReviewableHITsMiddlewares) if err != nil { return nil, err } out := result.(*ListReviewableHITsOutput) out.ResultMetadata = metadata return out, nil } type ListReviewableHITsInput struct { // The ID of the HIT type of the HITs to consider for the query. If not specified, // all HITs for the Reviewer are considered HITTypeId *string // Limit the number of results returned. MaxResults *int32 // Pagination Token NextToken *string // Can be either Reviewable or Reviewing . Reviewable is the default value. Status types.ReviewableHITStatus noSmithyDocumentSerde } type ListReviewableHITsOutput struct { // The list of HIT elements returned by the query. HITs []types.HIT // If the previous response was incomplete (because there is more data to // retrieve), Amazon Mechanical Turk returns a pagination token in the response. // You can use this pagination token to retrieve the next set of results. NextToken *string // The number of HITs on this page in the filtered results list, equivalent to the // number of HITs being returned by this call. NumResults *int32 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListReviewableHITsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListReviewableHITs{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListReviewableHITs{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListReviewableHITs(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 } // ListReviewableHITsAPIClient is a client that implements the ListReviewableHITs // operation. type ListReviewableHITsAPIClient interface { ListReviewableHITs(context.Context, *ListReviewableHITsInput, ...func(*Options)) (*ListReviewableHITsOutput, error) } var _ ListReviewableHITsAPIClient = (*Client)(nil) // ListReviewableHITsPaginatorOptions is the paginator options for // ListReviewableHITs type ListReviewableHITsPaginatorOptions struct { // Limit the number of results returned. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListReviewableHITsPaginator is a paginator for ListReviewableHITs type ListReviewableHITsPaginator struct { options ListReviewableHITsPaginatorOptions client ListReviewableHITsAPIClient params *ListReviewableHITsInput nextToken *string firstPage bool } // NewListReviewableHITsPaginator returns a new ListReviewableHITsPaginator func NewListReviewableHITsPaginator(client ListReviewableHITsAPIClient, params *ListReviewableHITsInput, optFns ...func(*ListReviewableHITsPaginatorOptions)) *ListReviewableHITsPaginator { if params == nil { params = &ListReviewableHITsInput{} } options := ListReviewableHITsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListReviewableHITsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListReviewableHITsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListReviewableHITs page. func (p *ListReviewableHITsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListReviewableHITsOutput, 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.ListReviewableHITs(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_opListReviewableHITs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "ListReviewableHITs", } }
233
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The ListReviewPolicyResultsForHIT operation retrieves the computed results and // the actions taken in the course of executing your Review Policies for a given // HIT. For information about how to specify Review Policies when you call // CreateHIT, see Review Policies. The ListReviewPolicyResultsForHIT operation can // return results for both Assignment-level and HIT-level review results. func (c *Client) ListReviewPolicyResultsForHIT(ctx context.Context, params *ListReviewPolicyResultsForHITInput, optFns ...func(*Options)) (*ListReviewPolicyResultsForHITOutput, error) { if params == nil { params = &ListReviewPolicyResultsForHITInput{} } result, metadata, err := c.invokeOperation(ctx, "ListReviewPolicyResultsForHIT", params, optFns, c.addOperationListReviewPolicyResultsForHITMiddlewares) if err != nil { return nil, err } out := result.(*ListReviewPolicyResultsForHITOutput) out.ResultMetadata = metadata return out, nil } type ListReviewPolicyResultsForHITInput struct { // The unique identifier of the HIT to retrieve review results for. // // This member is required. HITId *string // Limit the number of results returned. MaxResults *int32 // Pagination token NextToken *string // The Policy Level(s) to retrieve review results for - HIT or Assignment. If // omitted, the default behavior is to retrieve all data for both policy levels. // For a list of all the described policies, see Review Policies. PolicyLevels []types.ReviewPolicyLevel // Specify if the operation should retrieve a list of the actions taken executing // the Review Policies and their outcomes. RetrieveActions *bool // Specify if the operation should retrieve a list of the results computed by the // Review Policies. RetrieveResults *bool noSmithyDocumentSerde } type ListReviewPolicyResultsForHITOutput struct { // The name of the Assignment-level Review Policy. This contains only the // PolicyName element. AssignmentReviewPolicy *types.ReviewPolicy // Contains both ReviewResult and ReviewAction elements for an Assignment. AssignmentReviewReport *types.ReviewReport // The HITId of the HIT for which results have been returned. HITId *string // The name of the HIT-level Review Policy. This contains only the PolicyName // element. HITReviewPolicy *types.ReviewPolicy // Contains both ReviewResult and ReviewAction elements for a particular HIT. HITReviewReport *types.ReviewReport // If the previous response was incomplete (because there is more data to // retrieve), Amazon Mechanical Turk returns a pagination token in the response. // You can use this pagination token to retrieve the next set of results. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListReviewPolicyResultsForHITMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListReviewPolicyResultsForHIT{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListReviewPolicyResultsForHIT{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListReviewPolicyResultsForHITValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListReviewPolicyResultsForHIT(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 } // ListReviewPolicyResultsForHITAPIClient is a client that implements the // ListReviewPolicyResultsForHIT operation. type ListReviewPolicyResultsForHITAPIClient interface { ListReviewPolicyResultsForHIT(context.Context, *ListReviewPolicyResultsForHITInput, ...func(*Options)) (*ListReviewPolicyResultsForHITOutput, error) } var _ ListReviewPolicyResultsForHITAPIClient = (*Client)(nil) // ListReviewPolicyResultsForHITPaginatorOptions is the paginator options for // ListReviewPolicyResultsForHIT type ListReviewPolicyResultsForHITPaginatorOptions struct { // Limit the number of results returned. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListReviewPolicyResultsForHITPaginator is a paginator for // ListReviewPolicyResultsForHIT type ListReviewPolicyResultsForHITPaginator struct { options ListReviewPolicyResultsForHITPaginatorOptions client ListReviewPolicyResultsForHITAPIClient params *ListReviewPolicyResultsForHITInput nextToken *string firstPage bool } // NewListReviewPolicyResultsForHITPaginator returns a new // ListReviewPolicyResultsForHITPaginator func NewListReviewPolicyResultsForHITPaginator(client ListReviewPolicyResultsForHITAPIClient, params *ListReviewPolicyResultsForHITInput, optFns ...func(*ListReviewPolicyResultsForHITPaginatorOptions)) *ListReviewPolicyResultsForHITPaginator { if params == nil { params = &ListReviewPolicyResultsForHITInput{} } options := ListReviewPolicyResultsForHITPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListReviewPolicyResultsForHITPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListReviewPolicyResultsForHITPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListReviewPolicyResultsForHIT page. func (p *ListReviewPolicyResultsForHITPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListReviewPolicyResultsForHITOutput, 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.ListReviewPolicyResultsForHIT(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_opListReviewPolicyResultsForHIT(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "ListReviewPolicyResultsForHIT", } }
261
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The ListWorkersBlocks operation retrieves a list of Workers who are blocked // from working on your HITs. func (c *Client) ListWorkerBlocks(ctx context.Context, params *ListWorkerBlocksInput, optFns ...func(*Options)) (*ListWorkerBlocksOutput, error) { if params == nil { params = &ListWorkerBlocksInput{} } result, metadata, err := c.invokeOperation(ctx, "ListWorkerBlocks", params, optFns, c.addOperationListWorkerBlocksMiddlewares) if err != nil { return nil, err } out := result.(*ListWorkerBlocksOutput) out.ResultMetadata = metadata return out, nil } type ListWorkerBlocksInput struct { MaxResults *int32 // Pagination token NextToken *string noSmithyDocumentSerde } type ListWorkerBlocksOutput struct { // If the previous response was incomplete (because there is more data to // retrieve), Amazon Mechanical Turk returns a pagination token in the response. // You can use this pagination token to retrieve the next set of results. NextToken *string // The number of assignments on the page in the filtered results list, equivalent // to the number of assignments returned by this call. NumResults *int32 // The list of WorkerBlocks, containing the collection of Worker IDs and reasons // for blocking. WorkerBlocks []types.WorkerBlock // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListWorkerBlocksMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListWorkerBlocks{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListWorkerBlocks{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListWorkerBlocks(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 } // ListWorkerBlocksAPIClient is a client that implements the ListWorkerBlocks // operation. type ListWorkerBlocksAPIClient interface { ListWorkerBlocks(context.Context, *ListWorkerBlocksInput, ...func(*Options)) (*ListWorkerBlocksOutput, error) } var _ ListWorkerBlocksAPIClient = (*Client)(nil) // ListWorkerBlocksPaginatorOptions is the paginator options for ListWorkerBlocks type ListWorkerBlocksPaginatorOptions struct { Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListWorkerBlocksPaginator is a paginator for ListWorkerBlocks type ListWorkerBlocksPaginator struct { options ListWorkerBlocksPaginatorOptions client ListWorkerBlocksAPIClient params *ListWorkerBlocksInput nextToken *string firstPage bool } // NewListWorkerBlocksPaginator returns a new ListWorkerBlocksPaginator func NewListWorkerBlocksPaginator(client ListWorkerBlocksAPIClient, params *ListWorkerBlocksInput, optFns ...func(*ListWorkerBlocksPaginatorOptions)) *ListWorkerBlocksPaginator { if params == nil { params = &ListWorkerBlocksInput{} } options := ListWorkerBlocksPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListWorkerBlocksPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListWorkerBlocksPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListWorkerBlocks page. func (p *ListWorkerBlocksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkerBlocksOutput, 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.ListWorkerBlocks(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_opListWorkerBlocks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "ListWorkerBlocks", } }
222