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 macie2 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/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the sensitivity scoring settings for an S3 bucket. func (c *Client) UpdateResourceProfileDetections(ctx context.Context, params *UpdateResourceProfileDetectionsInput, optFns ...func(*Options)) (*UpdateResourceProfileDetectionsOutput, error) { if params == nil { params = &UpdateResourceProfileDetectionsInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateResourceProfileDetections", params, optFns, c.addOperationUpdateResourceProfileDetectionsMiddlewares) if err != nil { return nil, err } out := result.(*UpdateResourceProfileDetectionsOutput) out.ResultMetadata = metadata return out, nil } type UpdateResourceProfileDetectionsInput struct { // The Amazon Resource Name (ARN) of the S3 bucket that the request applies to. // // This member is required. ResourceArn *string // An array of objects, one for each custom data identifier or managed data // identifier that detected the type of sensitive data to start excluding or // including in the bucket's score. To start including all sensitive data types in // the score, don't specify any values for this array. SuppressDataIdentifiers []types.SuppressDataIdentifier noSmithyDocumentSerde } type UpdateResourceProfileDetectionsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateResourceProfileDetectionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateResourceProfileDetections{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateResourceProfileDetections{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateResourceProfileDetectionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateResourceProfileDetections(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateResourceProfileDetections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "UpdateResourceProfileDetections", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 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/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the status and configuration settings for retrieving occurrences of // sensitive data reported by findings. func (c *Client) UpdateRevealConfiguration(ctx context.Context, params *UpdateRevealConfigurationInput, optFns ...func(*Options)) (*UpdateRevealConfigurationOutput, error) { if params == nil { params = &UpdateRevealConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateRevealConfiguration", params, optFns, c.addOperationUpdateRevealConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*UpdateRevealConfigurationOutput) out.ResultMetadata = metadata return out, nil } type UpdateRevealConfigurationInput struct { // The new configuration settings and the status of the configuration for the // account. // // This member is required. Configuration *types.RevealConfiguration noSmithyDocumentSerde } type UpdateRevealConfigurationOutput struct { // The new configuration settings and the status of the configuration for the // account. Configuration *types.RevealConfiguration // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateRevealConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateRevealConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateRevealConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateRevealConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRevealConfiguration(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateRevealConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "UpdateRevealConfiguration", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 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/macie2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the settings for the sensitivity inspection template for an account. func (c *Client) UpdateSensitivityInspectionTemplate(ctx context.Context, params *UpdateSensitivityInspectionTemplateInput, optFns ...func(*Options)) (*UpdateSensitivityInspectionTemplateOutput, error) { if params == nil { params = &UpdateSensitivityInspectionTemplateInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateSensitivityInspectionTemplate", params, optFns, c.addOperationUpdateSensitivityInspectionTemplateMiddlewares) if err != nil { return nil, err } out := result.(*UpdateSensitivityInspectionTemplateOutput) out.ResultMetadata = metadata return out, nil } type UpdateSensitivityInspectionTemplateInput struct { // The unique identifier for the Amazon Macie resource that the request applies to. // // This member is required. Id *string // A custom description of the template. The description can contain as many as // 200 characters. Description *string // The managed data identifiers to explicitly exclude (not use) when analyzing // data. To exclude an allow list or custom data identifier that's currently // included by the template, update the values for the // SensitivityInspectionTemplateIncludes.allowListIds and // SensitivityInspectionTemplateIncludes.customDataIdentifierIds properties, // respectively. Excludes *types.SensitivityInspectionTemplateExcludes // The allow lists, custom data identifiers, and managed data identifiers to // include (use) when analyzing data. Includes *types.SensitivityInspectionTemplateIncludes noSmithyDocumentSerde } type UpdateSensitivityInspectionTemplateOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateSensitivityInspectionTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSensitivityInspectionTemplate{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSensitivityInspectionTemplate{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateSensitivityInspectionTemplateValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSensitivityInspectionTemplate(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateSensitivityInspectionTemplate(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "macie2", OperationName: "UpdateSensitivityInspectionTemplate", } }
137
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package macie2 provides the API client, operations, and parameter types for // Amazon Macie 2. // // Amazon Macie package macie2
8
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 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/macie2/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 = "macie2" } 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 macie2 // goModuleVersion is the tagged release for this module const goModuleVersion = "1.28.0"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/macie2/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_serializeOpAcceptInvitation struct { } func (*awsRestjson1_serializeOpAcceptInvitation) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpAcceptInvitation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*AcceptInvitationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/invitations/accept") 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_serializeOpDocumentAcceptInvitationInput(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_serializeOpHttpBindingsAcceptInvitationInput(v *AcceptInvitationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentAcceptInvitationInput(v *AcceptInvitationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AdministratorAccountId != nil { ok := object.Key("administratorAccountId") ok.String(*v.AdministratorAccountId) } if v.InvitationId != nil { ok := object.Key("invitationId") ok.String(*v.InvitationId) } if v.MasterAccount != nil { ok := object.Key("masterAccount") ok.String(*v.MasterAccount) } return nil } type awsRestjson1_serializeOpBatchGetCustomDataIdentifiers struct { } func (*awsRestjson1_serializeOpBatchGetCustomDataIdentifiers) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpBatchGetCustomDataIdentifiers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*BatchGetCustomDataIdentifiersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/custom-data-identifiers/get") 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_serializeOpDocumentBatchGetCustomDataIdentifiersInput(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_serializeOpHttpBindingsBatchGetCustomDataIdentifiersInput(v *BatchGetCustomDataIdentifiersInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentBatchGetCustomDataIdentifiersInput(v *BatchGetCustomDataIdentifiersInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Ids != nil { ok := object.Key("ids") if err := awsRestjson1_serializeDocument__listOf__string(v.Ids, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateAllowList struct { } func (*awsRestjson1_serializeOpCreateAllowList) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateAllowList) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateAllowListInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/allow-lists") 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_serializeOpDocumentCreateAllowListInput(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_serializeOpHttpBindingsCreateAllowListInput(v *CreateAllowListInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateAllowListInput(v *CreateAllowListInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.Criteria != nil { ok := object.Key("criteria") if err := awsRestjson1_serializeDocumentAllowListCriteria(v.Criteria, ok); err != nil { return err } } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateClassificationJob struct { } func (*awsRestjson1_serializeOpCreateClassificationJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateClassificationJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateClassificationJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/jobs") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateClassificationJobInput(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_serializeOpHttpBindingsCreateClassificationJobInput(v *CreateClassificationJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateClassificationJobInput(v *CreateClassificationJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AllowListIds != nil { ok := object.Key("allowListIds") if err := awsRestjson1_serializeDocument__listOf__string(v.AllowListIds, ok); err != nil { return err } } if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.CustomDataIdentifierIds != nil { ok := object.Key("customDataIdentifierIds") if err := awsRestjson1_serializeDocument__listOf__string(v.CustomDataIdentifierIds, ok); err != nil { return err } } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.InitialRun { ok := object.Key("initialRun") ok.Boolean(v.InitialRun) } if len(v.JobType) > 0 { ok := object.Key("jobType") ok.String(string(v.JobType)) } if v.ManagedDataIdentifierIds != nil { ok := object.Key("managedDataIdentifierIds") if err := awsRestjson1_serializeDocument__listOf__string(v.ManagedDataIdentifierIds, ok); err != nil { return err } } if len(v.ManagedDataIdentifierSelector) > 0 { ok := object.Key("managedDataIdentifierSelector") ok.String(string(v.ManagedDataIdentifierSelector)) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.S3JobDefinition != nil { ok := object.Key("s3JobDefinition") if err := awsRestjson1_serializeDocumentS3JobDefinition(v.S3JobDefinition, ok); err != nil { return err } } if v.SamplingPercentage != 0 { ok := object.Key("samplingPercentage") ok.Integer(v.SamplingPercentage) } if v.ScheduleFrequency != nil { ok := object.Key("scheduleFrequency") if err := awsRestjson1_serializeDocumentJobScheduleFrequency(v.ScheduleFrequency, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateCustomDataIdentifier struct { } func (*awsRestjson1_serializeOpCreateCustomDataIdentifier) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateCustomDataIdentifier) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateCustomDataIdentifierInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/custom-data-identifiers") 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_serializeOpDocumentCreateCustomDataIdentifierInput(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_serializeOpHttpBindingsCreateCustomDataIdentifierInput(v *CreateCustomDataIdentifierInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateCustomDataIdentifierInput(v *CreateCustomDataIdentifierInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.IgnoreWords != nil { ok := object.Key("ignoreWords") if err := awsRestjson1_serializeDocument__listOf__string(v.IgnoreWords, ok); err != nil { return err } } if v.Keywords != nil { ok := object.Key("keywords") if err := awsRestjson1_serializeDocument__listOf__string(v.Keywords, ok); err != nil { return err } } if v.MaximumMatchDistance != 0 { ok := object.Key("maximumMatchDistance") ok.Integer(v.MaximumMatchDistance) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Regex != nil { ok := object.Key("regex") ok.String(*v.Regex) } if v.SeverityLevels != nil { ok := object.Key("severityLevels") if err := awsRestjson1_serializeDocumentSeverityLevelList(v.SeverityLevels, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateFindingsFilter struct { } func (*awsRestjson1_serializeOpCreateFindingsFilter) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateFindingsFilter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateFindingsFilterInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/findingsfilters") 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_serializeOpDocumentCreateFindingsFilterInput(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_serializeOpHttpBindingsCreateFindingsFilterInput(v *CreateFindingsFilterInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateFindingsFilterInput(v *CreateFindingsFilterInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Action) > 0 { ok := object.Key("action") ok.String(string(v.Action)) } if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.FindingCriteria != nil { ok := object.Key("findingCriteria") if err := awsRestjson1_serializeDocumentFindingCriteria(v.FindingCriteria, ok); err != nil { return err } } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Position != 0 { ok := object.Key("position") ok.Integer(v.Position) } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateInvitations struct { } func (*awsRestjson1_serializeOpCreateInvitations) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateInvitations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateInvitationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/invitations") 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_serializeOpDocumentCreateInvitationsInput(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_serializeOpHttpBindingsCreateInvitationsInput(v *CreateInvitationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateInvitationsInput(v *CreateInvitationsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccountIds != nil { ok := object.Key("accountIds") if err := awsRestjson1_serializeDocument__listOf__string(v.AccountIds, ok); err != nil { return err } } if v.DisableEmailNotification { ok := object.Key("disableEmailNotification") ok.Boolean(v.DisableEmailNotification) } if v.Message != nil { ok := object.Key("message") ok.String(*v.Message) } return nil } type awsRestjson1_serializeOpCreateMember struct { } func (*awsRestjson1_serializeOpCreateMember) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateMember) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateMemberInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/members") 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_serializeOpDocumentCreateMemberInput(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_serializeOpHttpBindingsCreateMemberInput(v *CreateMemberInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateMemberInput(v *CreateMemberInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Account != nil { ok := object.Key("account") if err := awsRestjson1_serializeDocumentAccountDetail(v.Account, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateSampleFindings struct { } func (*awsRestjson1_serializeOpCreateSampleFindings) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateSampleFindings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateSampleFindingsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/findings/sample") 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_serializeOpDocumentCreateSampleFindingsInput(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_serializeOpHttpBindingsCreateSampleFindingsInput(v *CreateSampleFindingsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateSampleFindingsInput(v *CreateSampleFindingsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.FindingTypes != nil { ok := object.Key("findingTypes") if err := awsRestjson1_serializeDocument__listOfFindingType(v.FindingTypes, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeclineInvitations struct { } func (*awsRestjson1_serializeOpDeclineInvitations) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeclineInvitations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeclineInvitationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/invitations/decline") 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_serializeOpDocumentDeclineInvitationsInput(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_serializeOpHttpBindingsDeclineInvitationsInput(v *DeclineInvitationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDeclineInvitationsInput(v *DeclineInvitationsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccountIds != nil { ok := object.Key("accountIds") if err := awsRestjson1_serializeDocument__listOf__string(v.AccountIds, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteAllowList struct { } func (*awsRestjson1_serializeOpDeleteAllowList) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteAllowList) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteAllowListInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/allow-lists/{id}") 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_serializeOpHttpBindingsDeleteAllowListInput(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_serializeOpHttpBindingsDeleteAllowListInput(v *DeleteAllowListInput, 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 } } if v.IgnoreJobChecks != nil { encoder.SetQuery("ignoreJobChecks").String(*v.IgnoreJobChecks) } return nil } type awsRestjson1_serializeOpDeleteCustomDataIdentifier struct { } func (*awsRestjson1_serializeOpDeleteCustomDataIdentifier) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteCustomDataIdentifier) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteCustomDataIdentifierInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/custom-data-identifiers/{id}") 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_serializeOpHttpBindingsDeleteCustomDataIdentifierInput(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_serializeOpHttpBindingsDeleteCustomDataIdentifierInput(v *DeleteCustomDataIdentifierInput, 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_serializeOpDeleteFindingsFilter struct { } func (*awsRestjson1_serializeOpDeleteFindingsFilter) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteFindingsFilter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteFindingsFilterInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/findingsfilters/{id}") 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_serializeOpHttpBindingsDeleteFindingsFilterInput(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_serializeOpHttpBindingsDeleteFindingsFilterInput(v *DeleteFindingsFilterInput, 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_serializeOpDeleteInvitations struct { } func (*awsRestjson1_serializeOpDeleteInvitations) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteInvitations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteInvitationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/invitations/delete") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDeleteInvitationsInput(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_serializeOpHttpBindingsDeleteInvitationsInput(v *DeleteInvitationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDeleteInvitationsInput(v *DeleteInvitationsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccountIds != nil { ok := object.Key("accountIds") if err := awsRestjson1_serializeDocument__listOf__string(v.AccountIds, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteMember struct { } func (*awsRestjson1_serializeOpDeleteMember) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteMember) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteMemberInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/members/{id}") 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_serializeOpHttpBindingsDeleteMemberInput(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_serializeOpHttpBindingsDeleteMemberInput(v *DeleteMemberInput, 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_serializeOpDescribeBuckets struct { } func (*awsRestjson1_serializeOpDescribeBuckets) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeBuckets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeBucketsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/datasources/s3") 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_serializeOpDocumentDescribeBucketsInput(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_serializeOpHttpBindingsDescribeBucketsInput(v *DescribeBucketsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDescribeBucketsInput(v *DescribeBucketsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Criteria != nil { ok := object.Key("criteria") if err := awsRestjson1_serializeDocumentBucketCriteria(v.Criteria, ok); err != nil { return err } } if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if v.SortCriteria != nil { ok := object.Key("sortCriteria") if err := awsRestjson1_serializeDocumentBucketSortCriteria(v.SortCriteria, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeClassificationJob struct { } func (*awsRestjson1_serializeOpDescribeClassificationJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeClassificationJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeClassificationJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/jobs/{jobId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDescribeClassificationJobInput(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_serializeOpHttpBindingsDescribeClassificationJobInput(v *DescribeClassificationJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.JobId == nil || len(*v.JobId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member jobId must not be empty")} } if v.JobId != nil { if err := encoder.SetURI("jobId").String(*v.JobId); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeOrganizationConfiguration struct { } func (*awsRestjson1_serializeOpDescribeOrganizationConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeOrganizationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeOrganizationConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/admin/configuration") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if 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_serializeOpHttpBindingsDescribeOrganizationConfigurationInput(v *DescribeOrganizationConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpDisableMacie struct { } func (*awsRestjson1_serializeOpDisableMacie) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDisableMacie) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisableMacieInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/macie") 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 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_serializeOpHttpBindingsDisableMacieInput(v *DisableMacieInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpDisableOrganizationAdminAccount struct { } func (*awsRestjson1_serializeOpDisableOrganizationAdminAccount) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDisableOrganizationAdminAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisableOrganizationAdminAccountInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/admin") 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_serializeOpHttpBindingsDisableOrganizationAdminAccountInput(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_serializeOpHttpBindingsDisableOrganizationAdminAccountInput(v *DisableOrganizationAdminAccountInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.AdminAccountId != nil { encoder.SetQuery("adminAccountId").String(*v.AdminAccountId) } return nil } type awsRestjson1_serializeOpDisassociateFromAdministratorAccount struct { } func (*awsRestjson1_serializeOpDisassociateFromAdministratorAccount) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDisassociateFromAdministratorAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisassociateFromAdministratorAccountInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/administrator/disassociate") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDisassociateFromAdministratorAccountInput(v *DisassociateFromAdministratorAccountInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpDisassociateFromMasterAccount struct { } func (*awsRestjson1_serializeOpDisassociateFromMasterAccount) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDisassociateFromMasterAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisassociateFromMasterAccountInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/master/disassociate") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDisassociateFromMasterAccountInput(v *DisassociateFromMasterAccountInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpDisassociateMember struct { } func (*awsRestjson1_serializeOpDisassociateMember) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDisassociateMember) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisassociateMemberInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/members/disassociate/{id}") 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_serializeOpHttpBindingsDisassociateMemberInput(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_serializeOpHttpBindingsDisassociateMemberInput(v *DisassociateMemberInput, 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_serializeOpEnableMacie struct { } func (*awsRestjson1_serializeOpEnableMacie) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpEnableMacie) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*EnableMacieInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/macie") 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_serializeOpDocumentEnableMacieInput(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_serializeOpHttpBindingsEnableMacieInput(v *EnableMacieInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentEnableMacieInput(v *EnableMacieInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if len(v.FindingPublishingFrequency) > 0 { ok := object.Key("findingPublishingFrequency") ok.String(string(v.FindingPublishingFrequency)) } if len(v.Status) > 0 { ok := object.Key("status") ok.String(string(v.Status)) } return nil } type awsRestjson1_serializeOpEnableOrganizationAdminAccount struct { } func (*awsRestjson1_serializeOpEnableOrganizationAdminAccount) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpEnableOrganizationAdminAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*EnableOrganizationAdminAccountInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/admin") 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_serializeOpDocumentEnableOrganizationAdminAccountInput(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_serializeOpHttpBindingsEnableOrganizationAdminAccountInput(v *EnableOrganizationAdminAccountInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentEnableOrganizationAdminAccountInput(v *EnableOrganizationAdminAccountInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AdminAccountId != nil { ok := object.Key("adminAccountId") ok.String(*v.AdminAccountId) } if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } return nil } type awsRestjson1_serializeOpGetAdministratorAccount struct { } func (*awsRestjson1_serializeOpGetAdministratorAccount) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetAdministratorAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetAdministratorAccountInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/administrator") 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_serializeOpHttpBindingsGetAdministratorAccountInput(v *GetAdministratorAccountInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpGetAllowList struct { } func (*awsRestjson1_serializeOpGetAllowList) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetAllowList) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetAllowListInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/allow-lists/{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_serializeOpHttpBindingsGetAllowListInput(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_serializeOpHttpBindingsGetAllowListInput(v *GetAllowListInput, 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_serializeOpGetAutomatedDiscoveryConfiguration struct { } func (*awsRestjson1_serializeOpGetAutomatedDiscoveryConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetAutomatedDiscoveryConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetAutomatedDiscoveryConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/automated-discovery/configuration") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if 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_serializeOpHttpBindingsGetAutomatedDiscoveryConfigurationInput(v *GetAutomatedDiscoveryConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpGetBucketStatistics struct { } func (*awsRestjson1_serializeOpGetBucketStatistics) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetBucketStatistics) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetBucketStatisticsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/datasources/s3/statistics") 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_serializeOpDocumentGetBucketStatisticsInput(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_serializeOpHttpBindingsGetBucketStatisticsInput(v *GetBucketStatisticsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentGetBucketStatisticsInput(v *GetBucketStatisticsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccountId != nil { ok := object.Key("accountId") ok.String(*v.AccountId) } return nil } type awsRestjson1_serializeOpGetClassificationExportConfiguration struct { } func (*awsRestjson1_serializeOpGetClassificationExportConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetClassificationExportConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetClassificationExportConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/classification-export-configuration") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if 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_serializeOpHttpBindingsGetClassificationExportConfigurationInput(v *GetClassificationExportConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpGetClassificationScope struct { } func (*awsRestjson1_serializeOpGetClassificationScope) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetClassificationScope) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetClassificationScopeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/classification-scopes/{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_serializeOpHttpBindingsGetClassificationScopeInput(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_serializeOpHttpBindingsGetClassificationScopeInput(v *GetClassificationScopeInput, 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_serializeOpGetCustomDataIdentifier struct { } func (*awsRestjson1_serializeOpGetCustomDataIdentifier) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetCustomDataIdentifier) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetCustomDataIdentifierInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/custom-data-identifiers/{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_serializeOpHttpBindingsGetCustomDataIdentifierInput(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_serializeOpHttpBindingsGetCustomDataIdentifierInput(v *GetCustomDataIdentifierInput, 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_serializeOpGetFindings struct { } func (*awsRestjson1_serializeOpGetFindings) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetFindings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetFindingsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/findings/describe") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentGetFindingsInput(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_serializeOpHttpBindingsGetFindingsInput(v *GetFindingsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentGetFindingsInput(v *GetFindingsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.FindingIds != nil { ok := object.Key("findingIds") if err := awsRestjson1_serializeDocument__listOf__string(v.FindingIds, ok); err != nil { return err } } if v.SortCriteria != nil { ok := object.Key("sortCriteria") if err := awsRestjson1_serializeDocumentSortCriteria(v.SortCriteria, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetFindingsFilter struct { } func (*awsRestjson1_serializeOpGetFindingsFilter) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetFindingsFilter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetFindingsFilterInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/findingsfilters/{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_serializeOpHttpBindingsGetFindingsFilterInput(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_serializeOpHttpBindingsGetFindingsFilterInput(v *GetFindingsFilterInput, 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_serializeOpGetFindingsPublicationConfiguration struct { } func (*awsRestjson1_serializeOpGetFindingsPublicationConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetFindingsPublicationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetFindingsPublicationConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/findings-publication-configuration") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if 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_serializeOpHttpBindingsGetFindingsPublicationConfigurationInput(v *GetFindingsPublicationConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpGetFindingStatistics struct { } func (*awsRestjson1_serializeOpGetFindingStatistics) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetFindingStatistics) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetFindingStatisticsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/findings/statistics") 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_serializeOpDocumentGetFindingStatisticsInput(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_serializeOpHttpBindingsGetFindingStatisticsInput(v *GetFindingStatisticsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentGetFindingStatisticsInput(v *GetFindingStatisticsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.FindingCriteria != nil { ok := object.Key("findingCriteria") if err := awsRestjson1_serializeDocumentFindingCriteria(v.FindingCriteria, ok); err != nil { return err } } if len(v.GroupBy) > 0 { ok := object.Key("groupBy") ok.String(string(v.GroupBy)) } if v.Size != 0 { ok := object.Key("size") ok.Integer(v.Size) } if v.SortCriteria != nil { ok := object.Key("sortCriteria") if err := awsRestjson1_serializeDocumentFindingStatisticsSortCriteria(v.SortCriteria, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetInvitationsCount struct { } func (*awsRestjson1_serializeOpGetInvitationsCount) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetInvitationsCount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetInvitationsCountInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/invitations/count") 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_serializeOpHttpBindingsGetInvitationsCountInput(v *GetInvitationsCountInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpGetMacieSession struct { } func (*awsRestjson1_serializeOpGetMacieSession) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetMacieSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetMacieSessionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/macie") 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_serializeOpHttpBindingsGetMacieSessionInput(v *GetMacieSessionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpGetMasterAccount struct { } func (*awsRestjson1_serializeOpGetMasterAccount) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetMasterAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetMasterAccountInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/master") 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_serializeOpHttpBindingsGetMasterAccountInput(v *GetMasterAccountInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpGetMember struct { } func (*awsRestjson1_serializeOpGetMember) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetMember) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetMemberInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/members/{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_serializeOpHttpBindingsGetMemberInput(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_serializeOpHttpBindingsGetMemberInput(v *GetMemberInput, 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_serializeOpGetResourceProfile struct { } func (*awsRestjson1_serializeOpGetResourceProfile) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetResourceProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetResourceProfileInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/resource-profiles") 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_serializeOpHttpBindingsGetResourceProfileInput(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_serializeOpHttpBindingsGetResourceProfileInput(v *GetResourceProfileInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn != nil { encoder.SetQuery("resourceArn").String(*v.ResourceArn) } return nil } type awsRestjson1_serializeOpGetRevealConfiguration struct { } func (*awsRestjson1_serializeOpGetRevealConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetRevealConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetRevealConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/reveal-configuration") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if 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_serializeOpHttpBindingsGetRevealConfigurationInput(v *GetRevealConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpGetSensitiveDataOccurrences struct { } func (*awsRestjson1_serializeOpGetSensitiveDataOccurrences) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetSensitiveDataOccurrences) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetSensitiveDataOccurrencesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/findings/{findingId}/reveal") 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_serializeOpHttpBindingsGetSensitiveDataOccurrencesInput(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_serializeOpHttpBindingsGetSensitiveDataOccurrencesInput(v *GetSensitiveDataOccurrencesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.FindingId == nil || len(*v.FindingId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member findingId must not be empty")} } if v.FindingId != nil { if err := encoder.SetURI("findingId").String(*v.FindingId); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetSensitiveDataOccurrencesAvailability struct { } func (*awsRestjson1_serializeOpGetSensitiveDataOccurrencesAvailability) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetSensitiveDataOccurrencesAvailability) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetSensitiveDataOccurrencesAvailabilityInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/findings/{findingId}/reveal/availability") 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_serializeOpHttpBindingsGetSensitiveDataOccurrencesAvailabilityInput(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_serializeOpHttpBindingsGetSensitiveDataOccurrencesAvailabilityInput(v *GetSensitiveDataOccurrencesAvailabilityInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.FindingId == nil || len(*v.FindingId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member findingId must not be empty")} } if v.FindingId != nil { if err := encoder.SetURI("findingId").String(*v.FindingId); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetSensitivityInspectionTemplate struct { } func (*awsRestjson1_serializeOpGetSensitivityInspectionTemplate) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetSensitivityInspectionTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetSensitivityInspectionTemplateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/templates/sensitivity-inspections/{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_serializeOpHttpBindingsGetSensitivityInspectionTemplateInput(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_serializeOpHttpBindingsGetSensitivityInspectionTemplateInput(v *GetSensitivityInspectionTemplateInput, 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_serializeOpGetUsageStatistics struct { } func (*awsRestjson1_serializeOpGetUsageStatistics) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetUsageStatistics) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetUsageStatisticsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/usage/statistics") 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_serializeOpDocumentGetUsageStatisticsInput(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_serializeOpHttpBindingsGetUsageStatisticsInput(v *GetUsageStatisticsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentGetUsageStatisticsInput(v *GetUsageStatisticsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.FilterBy != nil { ok := object.Key("filterBy") if err := awsRestjson1_serializeDocument__listOfUsageStatisticsFilter(v.FilterBy, ok); err != nil { return err } } if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if v.SortBy != nil { ok := object.Key("sortBy") if err := awsRestjson1_serializeDocumentUsageStatisticsSortBy(v.SortBy, ok); err != nil { return err } } if len(v.TimeRange) > 0 { ok := object.Key("timeRange") ok.String(string(v.TimeRange)) } return nil } type awsRestjson1_serializeOpGetUsageTotals struct { } func (*awsRestjson1_serializeOpGetUsageTotals) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetUsageTotals) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetUsageTotalsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/usage") 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_serializeOpHttpBindingsGetUsageTotalsInput(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_serializeOpHttpBindingsGetUsageTotalsInput(v *GetUsageTotalsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.TimeRange != nil { encoder.SetQuery("timeRange").String(*v.TimeRange) } return nil } type awsRestjson1_serializeOpListAllowLists struct { } func (*awsRestjson1_serializeOpListAllowLists) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListAllowLists) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListAllowListsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/allow-lists") 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_serializeOpHttpBindingsListAllowListsInput(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_serializeOpHttpBindingsListAllowListsInput(v *ListAllowListsInput, 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_serializeOpListClassificationJobs struct { } func (*awsRestjson1_serializeOpListClassificationJobs) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListClassificationJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListClassificationJobsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/jobs/list") 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_serializeOpDocumentListClassificationJobsInput(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_serializeOpHttpBindingsListClassificationJobsInput(v *ListClassificationJobsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListClassificationJobsInput(v *ListClassificationJobsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.FilterCriteria != nil { ok := object.Key("filterCriteria") if err := awsRestjson1_serializeDocumentListJobsFilterCriteria(v.FilterCriteria, ok); err != nil { return err } } if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if v.SortCriteria != nil { ok := object.Key("sortCriteria") if err := awsRestjson1_serializeDocumentListJobsSortCriteria(v.SortCriteria, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpListClassificationScopes struct { } func (*awsRestjson1_serializeOpListClassificationScopes) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListClassificationScopes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListClassificationScopesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/classification-scopes") 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_serializeOpHttpBindingsListClassificationScopesInput(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_serializeOpHttpBindingsListClassificationScopesInput(v *ListClassificationScopesInput, 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.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListCustomDataIdentifiers struct { } func (*awsRestjson1_serializeOpListCustomDataIdentifiers) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListCustomDataIdentifiers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListCustomDataIdentifiersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/custom-data-identifiers/list") 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_serializeOpDocumentListCustomDataIdentifiersInput(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_serializeOpHttpBindingsListCustomDataIdentifiersInput(v *ListCustomDataIdentifiersInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListCustomDataIdentifiersInput(v *ListCustomDataIdentifiersInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListFindings struct { } func (*awsRestjson1_serializeOpListFindings) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListFindings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListFindingsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/findings") 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_serializeOpDocumentListFindingsInput(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_serializeOpHttpBindingsListFindingsInput(v *ListFindingsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListFindingsInput(v *ListFindingsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.FindingCriteria != nil { ok := object.Key("findingCriteria") if err := awsRestjson1_serializeDocumentFindingCriteria(v.FindingCriteria, ok); err != nil { return err } } if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if v.SortCriteria != nil { ok := object.Key("sortCriteria") if err := awsRestjson1_serializeDocumentSortCriteria(v.SortCriteria, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpListFindingsFilters struct { } func (*awsRestjson1_serializeOpListFindingsFilters) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListFindingsFilters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListFindingsFiltersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/findingsfilters") 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_serializeOpHttpBindingsListFindingsFiltersInput(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_serializeOpHttpBindingsListFindingsFiltersInput(v *ListFindingsFiltersInput, 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_serializeOpListInvitations struct { } func (*awsRestjson1_serializeOpListInvitations) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListInvitations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListInvitationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/invitations") 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_serializeOpHttpBindingsListInvitationsInput(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_serializeOpHttpBindingsListInvitationsInput(v *ListInvitationsInput, 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_serializeOpListManagedDataIdentifiers struct { } func (*awsRestjson1_serializeOpListManagedDataIdentifiers) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListManagedDataIdentifiers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListManagedDataIdentifiersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/managed-data-identifiers/list") 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_serializeOpDocumentListManagedDataIdentifiersInput(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_serializeOpHttpBindingsListManagedDataIdentifiersInput(v *ListManagedDataIdentifiersInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListManagedDataIdentifiersInput(v *ListManagedDataIdentifiersInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListMembers struct { } func (*awsRestjson1_serializeOpListMembers) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListMembers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListMembersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/members") 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_serializeOpHttpBindingsListMembersInput(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_serializeOpHttpBindingsListMembersInput(v *ListMembersInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if v.OnlyAssociated != nil { encoder.SetQuery("onlyAssociated").String(*v.OnlyAssociated) } return nil } type awsRestjson1_serializeOpListOrganizationAdminAccounts struct { } func (*awsRestjson1_serializeOpListOrganizationAdminAccounts) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListOrganizationAdminAccounts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListOrganizationAdminAccountsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/admin") 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_serializeOpHttpBindingsListOrganizationAdminAccountsInput(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_serializeOpHttpBindingsListOrganizationAdminAccountsInput(v *ListOrganizationAdminAccountsInput, 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_serializeOpListResourceProfileArtifacts struct { } func (*awsRestjson1_serializeOpListResourceProfileArtifacts) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListResourceProfileArtifacts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListResourceProfileArtifactsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/resource-profiles/artifacts") 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_serializeOpHttpBindingsListResourceProfileArtifactsInput(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_serializeOpHttpBindingsListResourceProfileArtifactsInput(v *ListResourceProfileArtifactsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if v.ResourceArn != nil { encoder.SetQuery("resourceArn").String(*v.ResourceArn) } return nil } type awsRestjson1_serializeOpListResourceProfileDetections struct { } func (*awsRestjson1_serializeOpListResourceProfileDetections) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListResourceProfileDetections) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListResourceProfileDetectionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/resource-profiles/detections") 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_serializeOpHttpBindingsListResourceProfileDetectionsInput(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_serializeOpHttpBindingsListResourceProfileDetectionsInput(v *ListResourceProfileDetectionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if v.ResourceArn != nil { encoder.SetQuery("resourceArn").String(*v.ResourceArn) } return nil } type awsRestjson1_serializeOpListSensitivityInspectionTemplates struct { } func (*awsRestjson1_serializeOpListSensitivityInspectionTemplates) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListSensitivityInspectionTemplates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListSensitivityInspectionTemplatesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/templates/sensitivity-inspections") 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_serializeOpHttpBindingsListSensitivityInspectionTemplatesInput(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_serializeOpHttpBindingsListSensitivityInspectionTemplatesInput(v *ListSensitivityInspectionTemplatesInput, 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_serializeOpListTagsForResource struct { } func (*awsRestjson1_serializeOpListTagsForResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListTagsForResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpPutClassificationExportConfiguration struct { } func (*awsRestjson1_serializeOpPutClassificationExportConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpPutClassificationExportConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*PutClassificationExportConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/classification-export-configuration") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentPutClassificationExportConfigurationInput(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_serializeOpHttpBindingsPutClassificationExportConfigurationInput(v *PutClassificationExportConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentPutClassificationExportConfigurationInput(v *PutClassificationExportConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Configuration != nil { ok := object.Key("configuration") if err := awsRestjson1_serializeDocumentClassificationExportConfiguration(v.Configuration, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpPutFindingsPublicationConfiguration struct { } func (*awsRestjson1_serializeOpPutFindingsPublicationConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpPutFindingsPublicationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*PutFindingsPublicationConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/findings-publication-configuration") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentPutFindingsPublicationConfigurationInput(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_serializeOpHttpBindingsPutFindingsPublicationConfigurationInput(v *PutFindingsPublicationConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentPutFindingsPublicationConfigurationInput(v *PutFindingsPublicationConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.SecurityHubConfiguration != nil { ok := object.Key("securityHubConfiguration") if err := awsRestjson1_serializeDocumentSecurityHubConfiguration(v.SecurityHubConfiguration, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpSearchResources struct { } func (*awsRestjson1_serializeOpSearchResources) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpSearchResources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*SearchResourcesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/datasources/search-resources") 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_serializeOpDocumentSearchResourcesInput(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_serializeOpHttpBindingsSearchResourcesInput(v *SearchResourcesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentSearchResourcesInput(v *SearchResourcesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BucketCriteria != nil { ok := object.Key("bucketCriteria") if err := awsRestjson1_serializeDocumentSearchResourcesBucketCriteria(v.BucketCriteria, ok); err != nil { return err } } if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if v.SortCriteria != nil { ok := object.Key("sortCriteria") if err := awsRestjson1_serializeDocumentSearchResourcesSortCriteria(v.SortCriteria, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpTagResource struct { } func (*awsRestjson1_serializeOpTagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*TagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpTestCustomDataIdentifier struct { } func (*awsRestjson1_serializeOpTestCustomDataIdentifier) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpTestCustomDataIdentifier) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*TestCustomDataIdentifierInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/custom-data-identifiers/test") 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_serializeOpDocumentTestCustomDataIdentifierInput(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_serializeOpHttpBindingsTestCustomDataIdentifierInput(v *TestCustomDataIdentifierInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentTestCustomDataIdentifierInput(v *TestCustomDataIdentifierInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.IgnoreWords != nil { ok := object.Key("ignoreWords") if err := awsRestjson1_serializeDocument__listOf__string(v.IgnoreWords, ok); err != nil { return err } } if v.Keywords != nil { ok := object.Key("keywords") if err := awsRestjson1_serializeDocument__listOf__string(v.Keywords, ok); err != nil { return err } } if v.MaximumMatchDistance != 0 { ok := object.Key("maximumMatchDistance") ok.Integer(v.MaximumMatchDistance) } if v.Regex != nil { ok := object.Key("regex") ok.String(*v.Regex) } if v.SampleText != nil { ok := object.Key("sampleText") ok.String(*v.SampleText) } return nil } type awsRestjson1_serializeOpUntagResource struct { } func (*awsRestjson1_serializeOpUntagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UntagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { return err } } if v.TagKeys != nil { for i := range v.TagKeys { encoder.AddQuery("tagKeys").String(v.TagKeys[i]) } } return nil } type awsRestjson1_serializeOpUpdateAllowList struct { } func (*awsRestjson1_serializeOpUpdateAllowList) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateAllowList) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateAllowListInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/allow-lists/{id}") 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_serializeOpHttpBindingsUpdateAllowListInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateAllowListInput(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_serializeOpHttpBindingsUpdateAllowListInput(v *UpdateAllowListInput, 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 } func awsRestjson1_serializeOpDocumentUpdateAllowListInput(v *UpdateAllowListInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Criteria != nil { ok := object.Key("criteria") if err := awsRestjson1_serializeDocumentAllowListCriteria(v.Criteria, ok); err != nil { return err } } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } return nil } type awsRestjson1_serializeOpUpdateAutomatedDiscoveryConfiguration struct { } func (*awsRestjson1_serializeOpUpdateAutomatedDiscoveryConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateAutomatedDiscoveryConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateAutomatedDiscoveryConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/automated-discovery/configuration") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateAutomatedDiscoveryConfigurationInput(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_serializeOpHttpBindingsUpdateAutomatedDiscoveryConfigurationInput(v *UpdateAutomatedDiscoveryConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateAutomatedDiscoveryConfigurationInput(v *UpdateAutomatedDiscoveryConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Status) > 0 { ok := object.Key("status") ok.String(string(v.Status)) } return nil } type awsRestjson1_serializeOpUpdateClassificationJob struct { } func (*awsRestjson1_serializeOpUpdateClassificationJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateClassificationJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateClassificationJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/jobs/{jobId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateClassificationJobInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateClassificationJobInput(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_serializeOpHttpBindingsUpdateClassificationJobInput(v *UpdateClassificationJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.JobId == nil || len(*v.JobId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member jobId must not be empty")} } if v.JobId != nil { if err := encoder.SetURI("jobId").String(*v.JobId); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateClassificationJobInput(v *UpdateClassificationJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.JobStatus) > 0 { ok := object.Key("jobStatus") ok.String(string(v.JobStatus)) } return nil } type awsRestjson1_serializeOpUpdateClassificationScope struct { } func (*awsRestjson1_serializeOpUpdateClassificationScope) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateClassificationScope) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateClassificationScopeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/classification-scopes/{id}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateClassificationScopeInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateClassificationScopeInput(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_serializeOpHttpBindingsUpdateClassificationScopeInput(v *UpdateClassificationScopeInput, 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 } func awsRestjson1_serializeOpDocumentUpdateClassificationScopeInput(v *UpdateClassificationScopeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.S3 != nil { ok := object.Key("s3") if err := awsRestjson1_serializeDocumentS3ClassificationScopeUpdate(v.S3, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdateFindingsFilter struct { } func (*awsRestjson1_serializeOpUpdateFindingsFilter) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateFindingsFilter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateFindingsFilterInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/findingsfilters/{id}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateFindingsFilterInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateFindingsFilterInput(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_serializeOpHttpBindingsUpdateFindingsFilterInput(v *UpdateFindingsFilterInput, 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 } func awsRestjson1_serializeOpDocumentUpdateFindingsFilterInput(v *UpdateFindingsFilterInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Action) > 0 { ok := object.Key("action") ok.String(string(v.Action)) } if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.FindingCriteria != nil { ok := object.Key("findingCriteria") if err := awsRestjson1_serializeDocumentFindingCriteria(v.FindingCriteria, ok); err != nil { return err } } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Position != 0 { ok := object.Key("position") ok.Integer(v.Position) } return nil } type awsRestjson1_serializeOpUpdateMacieSession struct { } func (*awsRestjson1_serializeOpUpdateMacieSession) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateMacieSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateMacieSessionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/macie") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateMacieSessionInput(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_serializeOpHttpBindingsUpdateMacieSessionInput(v *UpdateMacieSessionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateMacieSessionInput(v *UpdateMacieSessionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.FindingPublishingFrequency) > 0 { ok := object.Key("findingPublishingFrequency") ok.String(string(v.FindingPublishingFrequency)) } if len(v.Status) > 0 { ok := object.Key("status") ok.String(string(v.Status)) } return nil } type awsRestjson1_serializeOpUpdateMemberSession struct { } func (*awsRestjson1_serializeOpUpdateMemberSession) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateMemberSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateMemberSessionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/macie/members/{id}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateMemberSessionInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateMemberSessionInput(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_serializeOpHttpBindingsUpdateMemberSessionInput(v *UpdateMemberSessionInput, 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 } func awsRestjson1_serializeOpDocumentUpdateMemberSessionInput(v *UpdateMemberSessionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Status) > 0 { ok := object.Key("status") ok.String(string(v.Status)) } return nil } type awsRestjson1_serializeOpUpdateOrganizationConfiguration struct { } func (*awsRestjson1_serializeOpUpdateOrganizationConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateOrganizationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateOrganizationConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/admin/configuration") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateOrganizationConfigurationInput(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_serializeOpHttpBindingsUpdateOrganizationConfigurationInput(v *UpdateOrganizationConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateOrganizationConfigurationInput(v *UpdateOrganizationConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("autoEnable") ok.Boolean(v.AutoEnable) } return nil } type awsRestjson1_serializeOpUpdateResourceProfile struct { } func (*awsRestjson1_serializeOpUpdateResourceProfile) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateResourceProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateResourceProfileInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/resource-profiles") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateResourceProfileInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateResourceProfileInput(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_serializeOpHttpBindingsUpdateResourceProfileInput(v *UpdateResourceProfileInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn != nil { encoder.SetQuery("resourceArn").String(*v.ResourceArn) } return nil } func awsRestjson1_serializeOpDocumentUpdateResourceProfileInput(v *UpdateResourceProfileInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SensitivityScoreOverride != 0 { ok := object.Key("sensitivityScoreOverride") ok.Integer(v.SensitivityScoreOverride) } return nil } type awsRestjson1_serializeOpUpdateResourceProfileDetections struct { } func (*awsRestjson1_serializeOpUpdateResourceProfileDetections) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateResourceProfileDetections) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateResourceProfileDetectionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/resource-profiles/detections") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateResourceProfileDetectionsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateResourceProfileDetectionsInput(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_serializeOpHttpBindingsUpdateResourceProfileDetectionsInput(v *UpdateResourceProfileDetectionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn != nil { encoder.SetQuery("resourceArn").String(*v.ResourceArn) } return nil } func awsRestjson1_serializeOpDocumentUpdateResourceProfileDetectionsInput(v *UpdateResourceProfileDetectionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SuppressDataIdentifiers != nil { ok := object.Key("suppressDataIdentifiers") if err := awsRestjson1_serializeDocument__listOfSuppressDataIdentifier(v.SuppressDataIdentifiers, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdateRevealConfiguration struct { } func (*awsRestjson1_serializeOpUpdateRevealConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateRevealConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateRevealConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/reveal-configuration") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateRevealConfigurationInput(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_serializeOpHttpBindingsUpdateRevealConfigurationInput(v *UpdateRevealConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateRevealConfigurationInput(v *UpdateRevealConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Configuration != nil { ok := object.Key("configuration") if err := awsRestjson1_serializeDocumentRevealConfiguration(v.Configuration, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdateSensitivityInspectionTemplate struct { } func (*awsRestjson1_serializeOpUpdateSensitivityInspectionTemplate) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateSensitivityInspectionTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateSensitivityInspectionTemplateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/templates/sensitivity-inspections/{id}") 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_serializeOpHttpBindingsUpdateSensitivityInspectionTemplateInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateSensitivityInspectionTemplateInput(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_serializeOpHttpBindingsUpdateSensitivityInspectionTemplateInput(v *UpdateSensitivityInspectionTemplateInput, 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 } func awsRestjson1_serializeOpDocumentUpdateSensitivityInspectionTemplateInput(v *UpdateSensitivityInspectionTemplateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Excludes != nil { ok := object.Key("excludes") if err := awsRestjson1_serializeDocumentSensitivityInspectionTemplateExcludes(v.Excludes, ok); err != nil { return err } } if v.Includes != nil { ok := object.Key("includes") if err := awsRestjson1_serializeDocumentSensitivityInspectionTemplateIncludes(v.Includes, ok); err != nil { return err } } 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__listOfCriteriaForJob(v []types.CriteriaForJob, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentCriteriaForJob(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocument__listOfFindingType(v []types.FindingType, 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_serializeDocument__listOfJobScopeTerm(v []types.JobScopeTerm, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentJobScopeTerm(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocument__listOfListJobsFilterTerm(v []types.ListJobsFilterTerm, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentListJobsFilterTerm(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocument__listOfS3BucketDefinitionForJob(v []types.S3BucketDefinitionForJob, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentS3BucketDefinitionForJob(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocument__listOfS3BucketName(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__listOfSearchResourcesCriteria(v []types.SearchResourcesCriteria, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentSearchResourcesCriteria(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocument__listOfSearchResourcesTagCriterionPair(v []types.SearchResourcesTagCriterionPair, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentSearchResourcesTagCriterionPair(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocument__listOfSuppressDataIdentifier(v []types.SuppressDataIdentifier, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentSuppressDataIdentifier(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocument__listOfTagCriterionPairForJob(v []types.TagCriterionPairForJob, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentTagCriterionPairForJob(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocument__listOfTagValuePair(v []types.TagValuePair, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentTagValuePair(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocument__listOfUsageStatisticsFilter(v []types.UsageStatisticsFilter, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentUsageStatisticsFilter(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentAccountDetail(v *types.AccountDetail, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccountId != nil { ok := object.Key("accountId") ok.String(*v.AccountId) } if v.Email != nil { ok := object.Key("email") ok.String(*v.Email) } return nil } func awsRestjson1_serializeDocumentAllowListCriteria(v *types.AllowListCriteria, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Regex != nil { ok := object.Key("regex") ok.String(*v.Regex) } if v.S3WordsList != nil { ok := object.Key("s3WordsList") if err := awsRestjson1_serializeDocumentS3WordsList(v.S3WordsList, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentBucketCriteria(v map[string]types.BucketCriteriaAdditionalProperties, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) mapVar := v[key] if err := awsRestjson1_serializeDocumentBucketCriteriaAdditionalProperties(&mapVar, om); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentBucketCriteriaAdditionalProperties(v *types.BucketCriteriaAdditionalProperties, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Eq != nil { ok := object.Key("eq") if err := awsRestjson1_serializeDocument__listOf__string(v.Eq, ok); err != nil { return err } } if v.Gt != 0 { ok := object.Key("gt") ok.Long(v.Gt) } if v.Gte != 0 { ok := object.Key("gte") ok.Long(v.Gte) } if v.Lt != 0 { ok := object.Key("lt") ok.Long(v.Lt) } if v.Lte != 0 { ok := object.Key("lte") ok.Long(v.Lte) } if v.Neq != nil { ok := object.Key("neq") if err := awsRestjson1_serializeDocument__listOf__string(v.Neq, ok); err != nil { return err } } if v.Prefix != nil { ok := object.Key("prefix") ok.String(*v.Prefix) } return nil } func awsRestjson1_serializeDocumentBucketSortCriteria(v *types.BucketSortCriteria, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AttributeName != nil { ok := object.Key("attributeName") ok.String(*v.AttributeName) } if len(v.OrderBy) > 0 { ok := object.Key("orderBy") ok.String(string(v.OrderBy)) } return nil } func awsRestjson1_serializeDocumentClassificationExportConfiguration(v *types.ClassificationExportConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.S3Destination != nil { ok := object.Key("s3Destination") if err := awsRestjson1_serializeDocumentS3Destination(v.S3Destination, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentCriteriaBlockForJob(v *types.CriteriaBlockForJob, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.And != nil { ok := object.Key("and") if err := awsRestjson1_serializeDocument__listOfCriteriaForJob(v.And, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentCriteriaForJob(v *types.CriteriaForJob, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SimpleCriterion != nil { ok := object.Key("simpleCriterion") if err := awsRestjson1_serializeDocumentSimpleCriterionForJob(v.SimpleCriterion, ok); err != nil { return err } } if v.TagCriterion != nil { ok := object.Key("tagCriterion") if err := awsRestjson1_serializeDocumentTagCriterionForJob(v.TagCriterion, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentCriterion(v map[string]types.CriterionAdditionalProperties, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) mapVar := v[key] if err := awsRestjson1_serializeDocumentCriterionAdditionalProperties(&mapVar, om); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentCriterionAdditionalProperties(v *types.CriterionAdditionalProperties, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Eq != nil { ok := object.Key("eq") if err := awsRestjson1_serializeDocument__listOf__string(v.Eq, ok); err != nil { return err } } if v.EqExactMatch != nil { ok := object.Key("eqExactMatch") if err := awsRestjson1_serializeDocument__listOf__string(v.EqExactMatch, ok); err != nil { return err } } if v.Gt != 0 { ok := object.Key("gt") ok.Long(v.Gt) } if v.Gte != 0 { ok := object.Key("gte") ok.Long(v.Gte) } if v.Lt != 0 { ok := object.Key("lt") ok.Long(v.Lt) } if v.Lte != 0 { ok := object.Key("lte") ok.Long(v.Lte) } if v.Neq != nil { ok := object.Key("neq") if err := awsRestjson1_serializeDocument__listOf__string(v.Neq, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentDailySchedule(v *types.DailySchedule, value smithyjson.Value) error { object := value.Object() defer object.Close() return nil } func awsRestjson1_serializeDocumentFindingCriteria(v *types.FindingCriteria, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Criterion != nil { ok := object.Key("criterion") if err := awsRestjson1_serializeDocumentCriterion(v.Criterion, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentFindingStatisticsSortCriteria(v *types.FindingStatisticsSortCriteria, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.AttributeName) > 0 { ok := object.Key("attributeName") ok.String(string(v.AttributeName)) } if len(v.OrderBy) > 0 { ok := object.Key("orderBy") ok.String(string(v.OrderBy)) } return nil } func awsRestjson1_serializeDocumentJobScheduleFrequency(v *types.JobScheduleFrequency, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DailySchedule != nil { ok := object.Key("dailySchedule") if err := awsRestjson1_serializeDocumentDailySchedule(v.DailySchedule, ok); err != nil { return err } } if v.MonthlySchedule != nil { ok := object.Key("monthlySchedule") if err := awsRestjson1_serializeDocumentMonthlySchedule(v.MonthlySchedule, ok); err != nil { return err } } if v.WeeklySchedule != nil { ok := object.Key("weeklySchedule") if err := awsRestjson1_serializeDocumentWeeklySchedule(v.WeeklySchedule, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentJobScopeTerm(v *types.JobScopeTerm, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SimpleScopeTerm != nil { ok := object.Key("simpleScopeTerm") if err := awsRestjson1_serializeDocumentSimpleScopeTerm(v.SimpleScopeTerm, ok); err != nil { return err } } if v.TagScopeTerm != nil { ok := object.Key("tagScopeTerm") if err := awsRestjson1_serializeDocumentTagScopeTerm(v.TagScopeTerm, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentJobScopingBlock(v *types.JobScopingBlock, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.And != nil { ok := object.Key("and") if err := awsRestjson1_serializeDocument__listOfJobScopeTerm(v.And, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentListJobsFilterCriteria(v *types.ListJobsFilterCriteria, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Excludes != nil { ok := object.Key("excludes") if err := awsRestjson1_serializeDocument__listOfListJobsFilterTerm(v.Excludes, ok); err != nil { return err } } if v.Includes != nil { ok := object.Key("includes") if err := awsRestjson1_serializeDocument__listOfListJobsFilterTerm(v.Includes, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentListJobsFilterTerm(v *types.ListJobsFilterTerm, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Comparator) > 0 { ok := object.Key("comparator") ok.String(string(v.Comparator)) } if len(v.Key) > 0 { ok := object.Key("key") ok.String(string(v.Key)) } if v.Values != nil { ok := object.Key("values") if err := awsRestjson1_serializeDocument__listOf__string(v.Values, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentListJobsSortCriteria(v *types.ListJobsSortCriteria, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.AttributeName) > 0 { ok := object.Key("attributeName") ok.String(string(v.AttributeName)) } if len(v.OrderBy) > 0 { ok := object.Key("orderBy") ok.String(string(v.OrderBy)) } return nil } func awsRestjson1_serializeDocumentMonthlySchedule(v *types.MonthlySchedule, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DayOfMonth != 0 { ok := object.Key("dayOfMonth") ok.Integer(v.DayOfMonth) } return nil } func awsRestjson1_serializeDocumentRevealConfiguration(v *types.RevealConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.KmsKeyId != nil { ok := object.Key("kmsKeyId") ok.String(*v.KmsKeyId) } if len(v.Status) > 0 { ok := object.Key("status") ok.String(string(v.Status)) } return nil } func awsRestjson1_serializeDocumentS3BucketCriteriaForJob(v *types.S3BucketCriteriaForJob, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Excludes != nil { ok := object.Key("excludes") if err := awsRestjson1_serializeDocumentCriteriaBlockForJob(v.Excludes, ok); err != nil { return err } } if v.Includes != nil { ok := object.Key("includes") if err := awsRestjson1_serializeDocumentCriteriaBlockForJob(v.Includes, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentS3BucketDefinitionForJob(v *types.S3BucketDefinitionForJob, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccountId != nil { ok := object.Key("accountId") ok.String(*v.AccountId) } if v.Buckets != nil { ok := object.Key("buckets") if err := awsRestjson1_serializeDocument__listOf__string(v.Buckets, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentS3ClassificationScopeExclusionUpdate(v *types.S3ClassificationScopeExclusionUpdate, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BucketNames != nil { ok := object.Key("bucketNames") if err := awsRestjson1_serializeDocument__listOfS3BucketName(v.BucketNames, ok); err != nil { return err } } if len(v.Operation) > 0 { ok := object.Key("operation") ok.String(string(v.Operation)) } return nil } func awsRestjson1_serializeDocumentS3ClassificationScopeUpdate(v *types.S3ClassificationScopeUpdate, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Excludes != nil { ok := object.Key("excludes") if err := awsRestjson1_serializeDocumentS3ClassificationScopeExclusionUpdate(v.Excludes, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentS3Destination(v *types.S3Destination, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BucketName != nil { ok := object.Key("bucketName") ok.String(*v.BucketName) } if v.KeyPrefix != nil { ok := object.Key("keyPrefix") ok.String(*v.KeyPrefix) } if v.KmsKeyArn != nil { ok := object.Key("kmsKeyArn") ok.String(*v.KmsKeyArn) } return nil } func awsRestjson1_serializeDocumentS3JobDefinition(v *types.S3JobDefinition, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BucketCriteria != nil { ok := object.Key("bucketCriteria") if err := awsRestjson1_serializeDocumentS3BucketCriteriaForJob(v.BucketCriteria, ok); err != nil { return err } } if v.BucketDefinitions != nil { ok := object.Key("bucketDefinitions") if err := awsRestjson1_serializeDocument__listOfS3BucketDefinitionForJob(v.BucketDefinitions, ok); err != nil { return err } } if v.Scoping != nil { ok := object.Key("scoping") if err := awsRestjson1_serializeDocumentScoping(v.Scoping, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentS3WordsList(v *types.S3WordsList, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BucketName != nil { ok := object.Key("bucketName") ok.String(*v.BucketName) } if v.ObjectKey != nil { ok := object.Key("objectKey") ok.String(*v.ObjectKey) } return nil } func awsRestjson1_serializeDocumentScoping(v *types.Scoping, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Excludes != nil { ok := object.Key("excludes") if err := awsRestjson1_serializeDocumentJobScopingBlock(v.Excludes, ok); err != nil { return err } } if v.Includes != nil { ok := object.Key("includes") if err := awsRestjson1_serializeDocumentJobScopingBlock(v.Includes, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSearchResourcesBucketCriteria(v *types.SearchResourcesBucketCriteria, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Excludes != nil { ok := object.Key("excludes") if err := awsRestjson1_serializeDocumentSearchResourcesCriteriaBlock(v.Excludes, ok); err != nil { return err } } if v.Includes != nil { ok := object.Key("includes") if err := awsRestjson1_serializeDocumentSearchResourcesCriteriaBlock(v.Includes, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSearchResourcesCriteria(v *types.SearchResourcesCriteria, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SimpleCriterion != nil { ok := object.Key("simpleCriterion") if err := awsRestjson1_serializeDocumentSearchResourcesSimpleCriterion(v.SimpleCriterion, ok); err != nil { return err } } if v.TagCriterion != nil { ok := object.Key("tagCriterion") if err := awsRestjson1_serializeDocumentSearchResourcesTagCriterion(v.TagCriterion, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSearchResourcesCriteriaBlock(v *types.SearchResourcesCriteriaBlock, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.And != nil { ok := object.Key("and") if err := awsRestjson1_serializeDocument__listOfSearchResourcesCriteria(v.And, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSearchResourcesSimpleCriterion(v *types.SearchResourcesSimpleCriterion, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Comparator) > 0 { ok := object.Key("comparator") ok.String(string(v.Comparator)) } if len(v.Key) > 0 { ok := object.Key("key") ok.String(string(v.Key)) } if v.Values != nil { ok := object.Key("values") if err := awsRestjson1_serializeDocument__listOf__string(v.Values, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSearchResourcesSortCriteria(v *types.SearchResourcesSortCriteria, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.AttributeName) > 0 { ok := object.Key("attributeName") ok.String(string(v.AttributeName)) } if len(v.OrderBy) > 0 { ok := object.Key("orderBy") ok.String(string(v.OrderBy)) } return nil } func awsRestjson1_serializeDocumentSearchResourcesTagCriterion(v *types.SearchResourcesTagCriterion, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Comparator) > 0 { ok := object.Key("comparator") ok.String(string(v.Comparator)) } if v.TagValues != nil { ok := object.Key("tagValues") if err := awsRestjson1_serializeDocument__listOfSearchResourcesTagCriterionPair(v.TagValues, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSearchResourcesTagCriterionPair(v *types.SearchResourcesTagCriterionPair, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Key != nil { ok := object.Key("key") ok.String(*v.Key) } if v.Value != nil { ok := object.Key("value") ok.String(*v.Value) } return nil } func awsRestjson1_serializeDocumentSecurityHubConfiguration(v *types.SecurityHubConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("publishClassificationFindings") ok.Boolean(v.PublishClassificationFindings) } { ok := object.Key("publishPolicyFindings") ok.Boolean(v.PublishPolicyFindings) } return nil } func awsRestjson1_serializeDocumentSensitivityInspectionTemplateExcludes(v *types.SensitivityInspectionTemplateExcludes, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ManagedDataIdentifierIds != nil { ok := object.Key("managedDataIdentifierIds") if err := awsRestjson1_serializeDocument__listOf__string(v.ManagedDataIdentifierIds, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSensitivityInspectionTemplateIncludes(v *types.SensitivityInspectionTemplateIncludes, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AllowListIds != nil { ok := object.Key("allowListIds") if err := awsRestjson1_serializeDocument__listOf__string(v.AllowListIds, ok); err != nil { return err } } if v.CustomDataIdentifierIds != nil { ok := object.Key("customDataIdentifierIds") if err := awsRestjson1_serializeDocument__listOf__string(v.CustomDataIdentifierIds, ok); err != nil { return err } } if v.ManagedDataIdentifierIds != nil { ok := object.Key("managedDataIdentifierIds") if err := awsRestjson1_serializeDocument__listOf__string(v.ManagedDataIdentifierIds, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSeverityLevel(v *types.SeverityLevel, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("occurrencesThreshold") ok.Long(v.OccurrencesThreshold) } if len(v.Severity) > 0 { ok := object.Key("severity") ok.String(string(v.Severity)) } return nil } func awsRestjson1_serializeDocumentSeverityLevelList(v []types.SeverityLevel, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentSeverityLevel(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSimpleCriterionForJob(v *types.SimpleCriterionForJob, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Comparator) > 0 { ok := object.Key("comparator") ok.String(string(v.Comparator)) } if len(v.Key) > 0 { ok := object.Key("key") ok.String(string(v.Key)) } if v.Values != nil { ok := object.Key("values") if err := awsRestjson1_serializeDocument__listOf__string(v.Values, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSimpleScopeTerm(v *types.SimpleScopeTerm, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Comparator) > 0 { ok := object.Key("comparator") ok.String(string(v.Comparator)) } if len(v.Key) > 0 { ok := object.Key("key") ok.String(string(v.Key)) } if v.Values != nil { ok := object.Key("values") if err := awsRestjson1_serializeDocument__listOf__string(v.Values, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSortCriteria(v *types.SortCriteria, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AttributeName != nil { ok := object.Key("attributeName") ok.String(*v.AttributeName) } if len(v.OrderBy) > 0 { ok := object.Key("orderBy") ok.String(string(v.OrderBy)) } return nil } func awsRestjson1_serializeDocumentSuppressDataIdentifier(v *types.SuppressDataIdentifier, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Id != nil { ok := object.Key("id") ok.String(*v.Id) } if len(v.Type) > 0 { ok := object.Key("type") ok.String(string(v.Type)) } return nil } func awsRestjson1_serializeDocumentTagCriterionForJob(v *types.TagCriterionForJob, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Comparator) > 0 { ok := object.Key("comparator") ok.String(string(v.Comparator)) } if v.TagValues != nil { ok := object.Key("tagValues") if err := awsRestjson1_serializeDocument__listOfTagCriterionPairForJob(v.TagValues, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentTagCriterionPairForJob(v *types.TagCriterionPairForJob, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Key != nil { ok := object.Key("key") ok.String(*v.Key) } if v.Value != nil { ok := object.Key("value") ok.String(*v.Value) } return nil } func awsRestjson1_serializeDocumentTagMap(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_serializeDocumentTagScopeTerm(v *types.TagScopeTerm, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Comparator) > 0 { ok := object.Key("comparator") ok.String(string(v.Comparator)) } if v.Key != nil { ok := object.Key("key") ok.String(*v.Key) } if v.TagValues != nil { ok := object.Key("tagValues") if err := awsRestjson1_serializeDocument__listOfTagValuePair(v.TagValues, ok); err != nil { return err } } if len(v.Target) > 0 { ok := object.Key("target") ok.String(string(v.Target)) } return nil } func awsRestjson1_serializeDocumentTagValuePair(v *types.TagValuePair, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Key != nil { ok := object.Key("key") ok.String(*v.Key) } if v.Value != nil { ok := object.Key("value") ok.String(*v.Value) } return nil } func awsRestjson1_serializeDocumentUsageStatisticsFilter(v *types.UsageStatisticsFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Comparator) > 0 { ok := object.Key("comparator") ok.String(string(v.Comparator)) } if len(v.Key) > 0 { ok := object.Key("key") ok.String(string(v.Key)) } if v.Values != nil { ok := object.Key("values") if err := awsRestjson1_serializeDocument__listOf__string(v.Values, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentUsageStatisticsSortBy(v *types.UsageStatisticsSortBy, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Key) > 0 { ok := object.Key("key") ok.String(string(v.Key)) } if len(v.OrderBy) > 0 { ok := object.Key("orderBy") ok.String(string(v.OrderBy)) } return nil } func awsRestjson1_serializeDocumentWeeklySchedule(v *types.WeeklySchedule, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.DayOfWeek) > 0 { ok := object.Key("dayOfWeek") ok.String(string(v.DayOfWeek)) } return nil }
6,587
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package macie2 import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/macie2/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpAcceptInvitation struct { } func (*validateOpAcceptInvitation) ID() string { return "OperationInputValidation" } func (m *validateOpAcceptInvitation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AcceptInvitationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAcceptInvitationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateAllowList struct { } func (*validateOpCreateAllowList) ID() string { return "OperationInputValidation" } func (m *validateOpCreateAllowList) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateAllowListInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateAllowListInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateClassificationJob struct { } func (*validateOpCreateClassificationJob) ID() string { return "OperationInputValidation" } func (m *validateOpCreateClassificationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateClassificationJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateClassificationJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateCustomDataIdentifier struct { } func (*validateOpCreateCustomDataIdentifier) ID() string { return "OperationInputValidation" } func (m *validateOpCreateCustomDataIdentifier) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateCustomDataIdentifierInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateCustomDataIdentifierInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateFindingsFilter struct { } func (*validateOpCreateFindingsFilter) ID() string { return "OperationInputValidation" } func (m *validateOpCreateFindingsFilter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateFindingsFilterInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateFindingsFilterInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateInvitations struct { } func (*validateOpCreateInvitations) ID() string { return "OperationInputValidation" } func (m *validateOpCreateInvitations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateInvitationsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateInvitationsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateMember struct { } func (*validateOpCreateMember) ID() string { return "OperationInputValidation" } func (m *validateOpCreateMember) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateMemberInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateMemberInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeclineInvitations struct { } func (*validateOpDeclineInvitations) ID() string { return "OperationInputValidation" } func (m *validateOpDeclineInvitations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeclineInvitationsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeclineInvitationsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteAllowList struct { } func (*validateOpDeleteAllowList) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteAllowList) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteAllowListInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteAllowListInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteCustomDataIdentifier struct { } func (*validateOpDeleteCustomDataIdentifier) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteCustomDataIdentifier) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteCustomDataIdentifierInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteCustomDataIdentifierInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteFindingsFilter struct { } func (*validateOpDeleteFindingsFilter) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteFindingsFilter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteFindingsFilterInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteFindingsFilterInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteInvitations struct { } func (*validateOpDeleteInvitations) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteInvitations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteInvitationsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteInvitationsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteMember struct { } func (*validateOpDeleteMember) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteMember) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteMemberInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteMemberInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeClassificationJob struct { } func (*validateOpDescribeClassificationJob) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeClassificationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeClassificationJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeClassificationJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDisableOrganizationAdminAccount struct { } func (*validateOpDisableOrganizationAdminAccount) ID() string { return "OperationInputValidation" } func (m *validateOpDisableOrganizationAdminAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DisableOrganizationAdminAccountInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDisableOrganizationAdminAccountInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDisassociateMember struct { } func (*validateOpDisassociateMember) ID() string { return "OperationInputValidation" } func (m *validateOpDisassociateMember) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DisassociateMemberInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDisassociateMemberInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpEnableOrganizationAdminAccount struct { } func (*validateOpEnableOrganizationAdminAccount) ID() string { return "OperationInputValidation" } func (m *validateOpEnableOrganizationAdminAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*EnableOrganizationAdminAccountInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpEnableOrganizationAdminAccountInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetAllowList struct { } func (*validateOpGetAllowList) ID() string { return "OperationInputValidation" } func (m *validateOpGetAllowList) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetAllowListInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetAllowListInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetClassificationScope struct { } func (*validateOpGetClassificationScope) ID() string { return "OperationInputValidation" } func (m *validateOpGetClassificationScope) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetClassificationScopeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetClassificationScopeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetCustomDataIdentifier struct { } func (*validateOpGetCustomDataIdentifier) ID() string { return "OperationInputValidation" } func (m *validateOpGetCustomDataIdentifier) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetCustomDataIdentifierInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetCustomDataIdentifierInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetFindingsFilter struct { } func (*validateOpGetFindingsFilter) ID() string { return "OperationInputValidation" } func (m *validateOpGetFindingsFilter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetFindingsFilterInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetFindingsFilterInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetFindings struct { } func (*validateOpGetFindings) ID() string { return "OperationInputValidation" } func (m *validateOpGetFindings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetFindingsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetFindingsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetFindingStatistics struct { } func (*validateOpGetFindingStatistics) ID() string { return "OperationInputValidation" } func (m *validateOpGetFindingStatistics) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetFindingStatisticsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetFindingStatisticsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetMember struct { } func (*validateOpGetMember) ID() string { return "OperationInputValidation" } func (m *validateOpGetMember) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetMemberInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetMemberInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetResourceProfile struct { } func (*validateOpGetResourceProfile) ID() string { return "OperationInputValidation" } func (m *validateOpGetResourceProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetResourceProfileInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetResourceProfileInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetSensitiveDataOccurrencesAvailability struct { } func (*validateOpGetSensitiveDataOccurrencesAvailability) ID() string { return "OperationInputValidation" } func (m *validateOpGetSensitiveDataOccurrencesAvailability) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetSensitiveDataOccurrencesAvailabilityInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetSensitiveDataOccurrencesAvailabilityInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetSensitiveDataOccurrences struct { } func (*validateOpGetSensitiveDataOccurrences) ID() string { return "OperationInputValidation" } func (m *validateOpGetSensitiveDataOccurrences) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetSensitiveDataOccurrencesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetSensitiveDataOccurrencesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetSensitivityInspectionTemplate struct { } func (*validateOpGetSensitivityInspectionTemplate) ID() string { return "OperationInputValidation" } func (m *validateOpGetSensitivityInspectionTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetSensitivityInspectionTemplateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetSensitivityInspectionTemplateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListResourceProfileArtifacts struct { } func (*validateOpListResourceProfileArtifacts) ID() string { return "OperationInputValidation" } func (m *validateOpListResourceProfileArtifacts) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListResourceProfileArtifactsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListResourceProfileArtifactsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListResourceProfileDetections struct { } func (*validateOpListResourceProfileDetections) ID() string { return "OperationInputValidation" } func (m *validateOpListResourceProfileDetections) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListResourceProfileDetectionsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListResourceProfileDetectionsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListTagsForResource struct { } func (*validateOpListTagsForResource) ID() string { return "OperationInputValidation" } func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListTagsForResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListTagsForResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpPutClassificationExportConfiguration struct { } func (*validateOpPutClassificationExportConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpPutClassificationExportConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PutClassificationExportConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPutClassificationExportConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpPutFindingsPublicationConfiguration struct { } func (*validateOpPutFindingsPublicationConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpPutFindingsPublicationConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PutFindingsPublicationConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPutFindingsPublicationConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpTagResource struct { } func (*validateOpTagResource) ID() string { return "OperationInputValidation" } func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpTestCustomDataIdentifier struct { } func (*validateOpTestCustomDataIdentifier) ID() string { return "OperationInputValidation" } func (m *validateOpTestCustomDataIdentifier) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TestCustomDataIdentifierInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTestCustomDataIdentifierInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUntagResource struct { } func (*validateOpUntagResource) ID() string { return "OperationInputValidation" } func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UntagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUntagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateAllowList struct { } func (*validateOpUpdateAllowList) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateAllowList) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateAllowListInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateAllowListInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateAutomatedDiscoveryConfiguration struct { } func (*validateOpUpdateAutomatedDiscoveryConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateAutomatedDiscoveryConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateAutomatedDiscoveryConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateAutomatedDiscoveryConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateClassificationJob struct { } func (*validateOpUpdateClassificationJob) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateClassificationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateClassificationJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateClassificationJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateClassificationScope struct { } func (*validateOpUpdateClassificationScope) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateClassificationScope) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateClassificationScopeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateClassificationScopeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateFindingsFilter struct { } func (*validateOpUpdateFindingsFilter) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateFindingsFilter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateFindingsFilterInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateFindingsFilterInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateMemberSession struct { } func (*validateOpUpdateMemberSession) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateMemberSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateMemberSessionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateMemberSessionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateOrganizationConfiguration struct { } func (*validateOpUpdateOrganizationConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateOrganizationConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateOrganizationConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateOrganizationConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateResourceProfileDetections struct { } func (*validateOpUpdateResourceProfileDetections) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateResourceProfileDetections) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateResourceProfileDetectionsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateResourceProfileDetectionsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateResourceProfile struct { } func (*validateOpUpdateResourceProfile) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateResourceProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateResourceProfileInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateResourceProfileInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateRevealConfiguration struct { } func (*validateOpUpdateRevealConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateRevealConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateRevealConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateRevealConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateSensitivityInspectionTemplate struct { } func (*validateOpUpdateSensitivityInspectionTemplate) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateSensitivityInspectionTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateSensitivityInspectionTemplateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateSensitivityInspectionTemplateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpAcceptInvitationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAcceptInvitation{}, middleware.After) } func addOpCreateAllowListValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateAllowList{}, middleware.After) } func addOpCreateClassificationJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateClassificationJob{}, middleware.After) } func addOpCreateCustomDataIdentifierValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateCustomDataIdentifier{}, middleware.After) } func addOpCreateFindingsFilterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateFindingsFilter{}, middleware.After) } func addOpCreateInvitationsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateInvitations{}, middleware.After) } func addOpCreateMemberValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateMember{}, middleware.After) } func addOpDeclineInvitationsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeclineInvitations{}, middleware.After) } func addOpDeleteAllowListValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteAllowList{}, middleware.After) } func addOpDeleteCustomDataIdentifierValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteCustomDataIdentifier{}, middleware.After) } func addOpDeleteFindingsFilterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteFindingsFilter{}, middleware.After) } func addOpDeleteInvitationsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteInvitations{}, middleware.After) } func addOpDeleteMemberValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteMember{}, middleware.After) } func addOpDescribeClassificationJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeClassificationJob{}, middleware.After) } func addOpDisableOrganizationAdminAccountValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisableOrganizationAdminAccount{}, middleware.After) } func addOpDisassociateMemberValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisassociateMember{}, middleware.After) } func addOpEnableOrganizationAdminAccountValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpEnableOrganizationAdminAccount{}, middleware.After) } func addOpGetAllowListValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetAllowList{}, middleware.After) } func addOpGetClassificationScopeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetClassificationScope{}, middleware.After) } func addOpGetCustomDataIdentifierValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetCustomDataIdentifier{}, middleware.After) } func addOpGetFindingsFilterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetFindingsFilter{}, middleware.After) } func addOpGetFindingsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetFindings{}, middleware.After) } func addOpGetFindingStatisticsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetFindingStatistics{}, middleware.After) } func addOpGetMemberValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetMember{}, middleware.After) } func addOpGetResourceProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetResourceProfile{}, middleware.After) } func addOpGetSensitiveDataOccurrencesAvailabilityValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetSensitiveDataOccurrencesAvailability{}, middleware.After) } func addOpGetSensitiveDataOccurrencesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetSensitiveDataOccurrences{}, middleware.After) } func addOpGetSensitivityInspectionTemplateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetSensitivityInspectionTemplate{}, middleware.After) } func addOpListResourceProfileArtifactsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListResourceProfileArtifacts{}, middleware.After) } func addOpListResourceProfileDetectionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListResourceProfileDetections{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } func addOpPutClassificationExportConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutClassificationExportConfiguration{}, middleware.After) } func addOpPutFindingsPublicationConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutFindingsPublicationConfiguration{}, middleware.After) } func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } func addOpTestCustomDataIdentifierValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTestCustomDataIdentifier{}, middleware.After) } func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } func addOpUpdateAllowListValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateAllowList{}, middleware.After) } func addOpUpdateAutomatedDiscoveryConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateAutomatedDiscoveryConfiguration{}, middleware.After) } func addOpUpdateClassificationJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateClassificationJob{}, middleware.After) } func addOpUpdateClassificationScopeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateClassificationScope{}, middleware.After) } func addOpUpdateFindingsFilterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateFindingsFilter{}, middleware.After) } func addOpUpdateMemberSessionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateMemberSession{}, middleware.After) } func addOpUpdateOrganizationConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateOrganizationConfiguration{}, middleware.After) } func addOpUpdateResourceProfileDetectionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateResourceProfileDetections{}, middleware.After) } func addOpUpdateResourceProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateResourceProfile{}, middleware.After) } func addOpUpdateRevealConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateRevealConfiguration{}, middleware.After) } func addOpUpdateSensitivityInspectionTemplateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateSensitivityInspectionTemplate{}, middleware.After) } func validate__listOfS3BucketDefinitionForJob(v []types.S3BucketDefinitionForJob) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListOfS3BucketDefinitionForJob"} for i := range v { if err := validateS3BucketDefinitionForJob(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateAccountDetail(v *types.AccountDetail) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AccountDetail"} if v.AccountId == nil { invalidParams.Add(smithy.NewErrParamRequired("AccountId")) } if v.Email == nil { invalidParams.Add(smithy.NewErrParamRequired("Email")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateAllowListCriteria(v *types.AllowListCriteria) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AllowListCriteria"} if v.S3WordsList != nil { if err := validateS3WordsList(v.S3WordsList); err != nil { invalidParams.AddNested("S3WordsList", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateClassificationExportConfiguration(v *types.ClassificationExportConfiguration) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ClassificationExportConfiguration"} if v.S3Destination != nil { if err := validateS3Destination(v.S3Destination); err != nil { invalidParams.AddNested("S3Destination", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateRevealConfiguration(v *types.RevealConfiguration) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RevealConfiguration"} if len(v.Status) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Status")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateS3BucketDefinitionForJob(v *types.S3BucketDefinitionForJob) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3BucketDefinitionForJob"} if v.AccountId == nil { invalidParams.Add(smithy.NewErrParamRequired("AccountId")) } if v.Buckets == nil { invalidParams.Add(smithy.NewErrParamRequired("Buckets")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateS3ClassificationScopeExclusionUpdate(v *types.S3ClassificationScopeExclusionUpdate) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3ClassificationScopeExclusionUpdate"} if v.BucketNames == nil { invalidParams.Add(smithy.NewErrParamRequired("BucketNames")) } if len(v.Operation) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Operation")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateS3ClassificationScopeUpdate(v *types.S3ClassificationScopeUpdate) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3ClassificationScopeUpdate"} if v.Excludes == nil { invalidParams.Add(smithy.NewErrParamRequired("Excludes")) } else if v.Excludes != nil { if err := validateS3ClassificationScopeExclusionUpdate(v.Excludes); err != nil { invalidParams.AddNested("Excludes", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateS3Destination(v *types.S3Destination) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3Destination"} if v.BucketName == nil { invalidParams.Add(smithy.NewErrParamRequired("BucketName")) } if v.KmsKeyArn == nil { invalidParams.Add(smithy.NewErrParamRequired("KmsKeyArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateS3JobDefinition(v *types.S3JobDefinition) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3JobDefinition"} if v.BucketDefinitions != nil { if err := validate__listOfS3BucketDefinitionForJob(v.BucketDefinitions); err != nil { invalidParams.AddNested("BucketDefinitions", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateS3WordsList(v *types.S3WordsList) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3WordsList"} if v.BucketName == nil { invalidParams.Add(smithy.NewErrParamRequired("BucketName")) } if v.ObjectKey == nil { invalidParams.Add(smithy.NewErrParamRequired("ObjectKey")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateSecurityHubConfiguration(v *types.SecurityHubConfiguration) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SecurityHubConfiguration"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateSeverityLevel(v *types.SeverityLevel) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SeverityLevel"} if len(v.Severity) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Severity")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateSeverityLevelList(v []types.SeverityLevel) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SeverityLevelList"} for i := range v { if err := validateSeverityLevel(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAcceptInvitationInput(v *AcceptInvitationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AcceptInvitationInput"} if v.InvitationId == nil { invalidParams.Add(smithy.NewErrParamRequired("InvitationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateAllowListInput(v *CreateAllowListInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateAllowListInput"} if v.ClientToken == nil { invalidParams.Add(smithy.NewErrParamRequired("ClientToken")) } if v.Criteria == nil { invalidParams.Add(smithy.NewErrParamRequired("Criteria")) } else if v.Criteria != nil { if err := validateAllowListCriteria(v.Criteria); err != nil { invalidParams.AddNested("Criteria", err.(smithy.InvalidParamsError)) } } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateClassificationJobInput(v *CreateClassificationJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateClassificationJobInput"} if v.ClientToken == nil { invalidParams.Add(smithy.NewErrParamRequired("ClientToken")) } if len(v.JobType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("JobType")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.S3JobDefinition == nil { invalidParams.Add(smithy.NewErrParamRequired("S3JobDefinition")) } else if v.S3JobDefinition != nil { if err := validateS3JobDefinition(v.S3JobDefinition); err != nil { invalidParams.AddNested("S3JobDefinition", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateCustomDataIdentifierInput(v *CreateCustomDataIdentifierInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateCustomDataIdentifierInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Regex == nil { invalidParams.Add(smithy.NewErrParamRequired("Regex")) } if v.SeverityLevels != nil { if err := validateSeverityLevelList(v.SeverityLevels); err != nil { invalidParams.AddNested("SeverityLevels", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateFindingsFilterInput(v *CreateFindingsFilterInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateFindingsFilterInput"} if len(v.Action) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Action")) } if v.FindingCriteria == nil { invalidParams.Add(smithy.NewErrParamRequired("FindingCriteria")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateInvitationsInput(v *CreateInvitationsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateInvitationsInput"} if v.AccountIds == nil { invalidParams.Add(smithy.NewErrParamRequired("AccountIds")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateMemberInput(v *CreateMemberInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateMemberInput"} if v.Account == nil { invalidParams.Add(smithy.NewErrParamRequired("Account")) } else if v.Account != nil { if err := validateAccountDetail(v.Account); err != nil { invalidParams.AddNested("Account", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeclineInvitationsInput(v *DeclineInvitationsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeclineInvitationsInput"} if v.AccountIds == nil { invalidParams.Add(smithy.NewErrParamRequired("AccountIds")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteAllowListInput(v *DeleteAllowListInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteAllowListInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteCustomDataIdentifierInput(v *DeleteCustomDataIdentifierInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteCustomDataIdentifierInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteFindingsFilterInput(v *DeleteFindingsFilterInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteFindingsFilterInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteInvitationsInput(v *DeleteInvitationsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteInvitationsInput"} if v.AccountIds == nil { invalidParams.Add(smithy.NewErrParamRequired("AccountIds")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteMemberInput(v *DeleteMemberInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteMemberInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeClassificationJobInput(v *DescribeClassificationJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeClassificationJobInput"} if v.JobId == nil { invalidParams.Add(smithy.NewErrParamRequired("JobId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDisableOrganizationAdminAccountInput(v *DisableOrganizationAdminAccountInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DisableOrganizationAdminAccountInput"} if v.AdminAccountId == nil { invalidParams.Add(smithy.NewErrParamRequired("AdminAccountId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDisassociateMemberInput(v *DisassociateMemberInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DisassociateMemberInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpEnableOrganizationAdminAccountInput(v *EnableOrganizationAdminAccountInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "EnableOrganizationAdminAccountInput"} if v.AdminAccountId == nil { invalidParams.Add(smithy.NewErrParamRequired("AdminAccountId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetAllowListInput(v *GetAllowListInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetAllowListInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetClassificationScopeInput(v *GetClassificationScopeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetClassificationScopeInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetCustomDataIdentifierInput(v *GetCustomDataIdentifierInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetCustomDataIdentifierInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetFindingsFilterInput(v *GetFindingsFilterInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetFindingsFilterInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetFindingsInput(v *GetFindingsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetFindingsInput"} if v.FindingIds == nil { invalidParams.Add(smithy.NewErrParamRequired("FindingIds")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetFindingStatisticsInput(v *GetFindingStatisticsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetFindingStatisticsInput"} if len(v.GroupBy) == 0 { invalidParams.Add(smithy.NewErrParamRequired("GroupBy")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetMemberInput(v *GetMemberInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetMemberInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetResourceProfileInput(v *GetResourceProfileInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetResourceProfileInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetSensitiveDataOccurrencesAvailabilityInput(v *GetSensitiveDataOccurrencesAvailabilityInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetSensitiveDataOccurrencesAvailabilityInput"} if v.FindingId == nil { invalidParams.Add(smithy.NewErrParamRequired("FindingId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetSensitiveDataOccurrencesInput(v *GetSensitiveDataOccurrencesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetSensitiveDataOccurrencesInput"} if v.FindingId == nil { invalidParams.Add(smithy.NewErrParamRequired("FindingId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetSensitivityInspectionTemplateInput(v *GetSensitivityInspectionTemplateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetSensitivityInspectionTemplateInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListResourceProfileArtifactsInput(v *ListResourceProfileArtifactsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListResourceProfileArtifactsInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListResourceProfileDetectionsInput(v *ListResourceProfileDetectionsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListResourceProfileDetectionsInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpPutClassificationExportConfigurationInput(v *PutClassificationExportConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PutClassificationExportConfigurationInput"} if v.Configuration == nil { invalidParams.Add(smithy.NewErrParamRequired("Configuration")) } else if v.Configuration != nil { if err := validateClassificationExportConfiguration(v.Configuration); err != nil { invalidParams.AddNested("Configuration", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpPutFindingsPublicationConfigurationInput(v *PutFindingsPublicationConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PutFindingsPublicationConfigurationInput"} if v.SecurityHubConfiguration != nil { if err := validateSecurityHubConfiguration(v.SecurityHubConfiguration); err != nil { invalidParams.AddNested("SecurityHubConfiguration", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.Tags == nil { invalidParams.Add(smithy.NewErrParamRequired("Tags")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTestCustomDataIdentifierInput(v *TestCustomDataIdentifierInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TestCustomDataIdentifierInput"} if v.Regex == nil { invalidParams.Add(smithy.NewErrParamRequired("Regex")) } if v.SampleText == nil { invalidParams.Add(smithy.NewErrParamRequired("SampleText")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUntagResourceInput(v *UntagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.TagKeys == nil { invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateAllowListInput(v *UpdateAllowListInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateAllowListInput"} if v.Criteria == nil { invalidParams.Add(smithy.NewErrParamRequired("Criteria")) } else if v.Criteria != nil { if err := validateAllowListCriteria(v.Criteria); err != nil { invalidParams.AddNested("Criteria", err.(smithy.InvalidParamsError)) } } if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateAutomatedDiscoveryConfigurationInput(v *UpdateAutomatedDiscoveryConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateAutomatedDiscoveryConfigurationInput"} if len(v.Status) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Status")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateClassificationJobInput(v *UpdateClassificationJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateClassificationJobInput"} if v.JobId == nil { invalidParams.Add(smithy.NewErrParamRequired("JobId")) } if len(v.JobStatus) == 0 { invalidParams.Add(smithy.NewErrParamRequired("JobStatus")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateClassificationScopeInput(v *UpdateClassificationScopeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateClassificationScopeInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if v.S3 != nil { if err := validateS3ClassificationScopeUpdate(v.S3); err != nil { invalidParams.AddNested("S3", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateFindingsFilterInput(v *UpdateFindingsFilterInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateFindingsFilterInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateMemberSessionInput(v *UpdateMemberSessionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateMemberSessionInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if len(v.Status) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Status")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateOrganizationConfigurationInput(v *UpdateOrganizationConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateOrganizationConfigurationInput"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateResourceProfileDetectionsInput(v *UpdateResourceProfileDetectionsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateResourceProfileDetectionsInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateResourceProfileInput(v *UpdateResourceProfileInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateResourceProfileInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateRevealConfigurationInput(v *UpdateRevealConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateRevealConfigurationInput"} if v.Configuration == nil { invalidParams.Add(smithy.NewErrParamRequired("Configuration")) } else if v.Configuration != nil { if err := validateRevealConfiguration(v.Configuration); err != nil { invalidParams.AddNested("Configuration", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateSensitivityInspectionTemplateInput(v *UpdateSensitivityInspectionTemplateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateSensitivityInspectionTemplateInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
2,159
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 Macie2 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: "macie2.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "macie2-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "macie2-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "macie2.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "af-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "fips-us-east-1", }: endpoints.Endpoint{ Hostname: "macie2-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: "macie2-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: "macie2-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: "macie2-fips.us-west-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-2", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "sa-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", Variant: endpoints.FIPSVariant, }: { Hostname: "macie2-fips.us-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", Variant: endpoints.FIPSVariant, }: { Hostname: "macie2-fips.us-east-2.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "macie2-fips.us-west-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", Variant: endpoints.FIPSVariant, }: { Hostname: "macie2-fips.us-west-2.amazonaws.com", }, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "macie2.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "macie2-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "macie2-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "macie2.{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: "macie2-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "macie2.{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: "macie2-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "macie2.{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: "macie2-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "macie2.{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: "macie2-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "macie2.{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: "macie2.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "macie2-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "macie2-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "macie2.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, }, }
422
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 AdminStatus string // Enum values for AdminStatus const ( AdminStatusEnabled AdminStatus = "ENABLED" AdminStatusDisablingInProgress AdminStatus = "DISABLING_IN_PROGRESS" ) // Values returns all known values for AdminStatus. 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 (AdminStatus) Values() []AdminStatus { return []AdminStatus{ "ENABLED", "DISABLING_IN_PROGRESS", } } type AllowListStatusCode string // Enum values for AllowListStatusCode const ( AllowListStatusCodeOk AllowListStatusCode = "OK" AllowListStatusCodeS3ObjectNotFound AllowListStatusCode = "S3_OBJECT_NOT_FOUND" AllowListStatusCodeS3UserAccessDenied AllowListStatusCode = "S3_USER_ACCESS_DENIED" AllowListStatusCodeS3ObjectAccessDenied AllowListStatusCode = "S3_OBJECT_ACCESS_DENIED" AllowListStatusCodeS3Throttled AllowListStatusCode = "S3_THROTTLED" AllowListStatusCodeS3ObjectOversize AllowListStatusCode = "S3_OBJECT_OVERSIZE" AllowListStatusCodeS3ObjectEmpty AllowListStatusCode = "S3_OBJECT_EMPTY" AllowListStatusCodeUnknownError AllowListStatusCode = "UNKNOWN_ERROR" ) // Values returns all known values for AllowListStatusCode. 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 (AllowListStatusCode) Values() []AllowListStatusCode { return []AllowListStatusCode{ "OK", "S3_OBJECT_NOT_FOUND", "S3_USER_ACCESS_DENIED", "S3_OBJECT_ACCESS_DENIED", "S3_THROTTLED", "S3_OBJECT_OVERSIZE", "S3_OBJECT_EMPTY", "UNKNOWN_ERROR", } } type AllowsUnencryptedObjectUploads string // Enum values for AllowsUnencryptedObjectUploads const ( AllowsUnencryptedObjectUploadsTrue AllowsUnencryptedObjectUploads = "TRUE" AllowsUnencryptedObjectUploadsFalse AllowsUnencryptedObjectUploads = "FALSE" AllowsUnencryptedObjectUploadsUnknown AllowsUnencryptedObjectUploads = "UNKNOWN" ) // Values returns all known values for AllowsUnencryptedObjectUploads. 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 (AllowsUnencryptedObjectUploads) Values() []AllowsUnencryptedObjectUploads { return []AllowsUnencryptedObjectUploads{ "TRUE", "FALSE", "UNKNOWN", } } type AutomatedDiscoveryStatus string // Enum values for AutomatedDiscoveryStatus const ( AutomatedDiscoveryStatusEnabled AutomatedDiscoveryStatus = "ENABLED" AutomatedDiscoveryStatusDisabled AutomatedDiscoveryStatus = "DISABLED" ) // Values returns all known values for AutomatedDiscoveryStatus. 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 (AutomatedDiscoveryStatus) Values() []AutomatedDiscoveryStatus { return []AutomatedDiscoveryStatus{ "ENABLED", "DISABLED", } } type AvailabilityCode string // Enum values for AvailabilityCode const ( AvailabilityCodeAvailable AvailabilityCode = "AVAILABLE" AvailabilityCodeUnavailable AvailabilityCode = "UNAVAILABLE" ) // Values returns all known values for AvailabilityCode. 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 (AvailabilityCode) Values() []AvailabilityCode { return []AvailabilityCode{ "AVAILABLE", "UNAVAILABLE", } } type BucketMetadataErrorCode string // Enum values for BucketMetadataErrorCode const ( BucketMetadataErrorCodeAccessDenied BucketMetadataErrorCode = "ACCESS_DENIED" ) // Values returns all known values for BucketMetadataErrorCode. 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 (BucketMetadataErrorCode) Values() []BucketMetadataErrorCode { return []BucketMetadataErrorCode{ "ACCESS_DENIED", } } type ClassificationScopeUpdateOperation string // Enum values for ClassificationScopeUpdateOperation const ( ClassificationScopeUpdateOperationAdd ClassificationScopeUpdateOperation = "ADD" ClassificationScopeUpdateOperationReplace ClassificationScopeUpdateOperation = "REPLACE" ClassificationScopeUpdateOperationRemove ClassificationScopeUpdateOperation = "REMOVE" ) // Values returns all known values for ClassificationScopeUpdateOperation. 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 (ClassificationScopeUpdateOperation) Values() []ClassificationScopeUpdateOperation { return []ClassificationScopeUpdateOperation{ "ADD", "REPLACE", "REMOVE", } } type Currency string // Enum values for Currency const ( CurrencyUsd Currency = "USD" ) // Values returns all known values for Currency. 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 (Currency) Values() []Currency { return []Currency{ "USD", } } type DataIdentifierSeverity string // Enum values for DataIdentifierSeverity const ( DataIdentifierSeverityLow DataIdentifierSeverity = "LOW" DataIdentifierSeverityMedium DataIdentifierSeverity = "MEDIUM" DataIdentifierSeverityHigh DataIdentifierSeverity = "HIGH" ) // Values returns all known values for DataIdentifierSeverity. 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 (DataIdentifierSeverity) Values() []DataIdentifierSeverity { return []DataIdentifierSeverity{ "LOW", "MEDIUM", "HIGH", } } type DataIdentifierType string // Enum values for DataIdentifierType const ( DataIdentifierTypeCustom DataIdentifierType = "CUSTOM" DataIdentifierTypeManaged DataIdentifierType = "MANAGED" ) // Values returns all known values for DataIdentifierType. 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 (DataIdentifierType) Values() []DataIdentifierType { return []DataIdentifierType{ "CUSTOM", "MANAGED", } } type DayOfWeek string // Enum values for DayOfWeek const ( DayOfWeekSunday DayOfWeek = "SUNDAY" DayOfWeekMonday DayOfWeek = "MONDAY" DayOfWeekTuesday DayOfWeek = "TUESDAY" DayOfWeekWednesday DayOfWeek = "WEDNESDAY" DayOfWeekThursday DayOfWeek = "THURSDAY" DayOfWeekFriday DayOfWeek = "FRIDAY" DayOfWeekSaturday DayOfWeek = "SATURDAY" ) // 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{ "SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", } } type EffectivePermission string // Enum values for EffectivePermission const ( EffectivePermissionPublic EffectivePermission = "PUBLIC" EffectivePermissionNotPublic EffectivePermission = "NOT_PUBLIC" EffectivePermissionUnknown EffectivePermission = "UNKNOWN" ) // Values returns all known values for EffectivePermission. 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 (EffectivePermission) Values() []EffectivePermission { return []EffectivePermission{ "PUBLIC", "NOT_PUBLIC", "UNKNOWN", } } type EncryptionType string // Enum values for EncryptionType const ( EncryptionTypeNone EncryptionType = "NONE" EncryptionTypeAes256 EncryptionType = "AES256" EncryptionTypeAwsKms EncryptionType = "aws:kms" EncryptionTypeUnknown EncryptionType = "UNKNOWN" ) // Values returns all known values for EncryptionType. 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 (EncryptionType) Values() []EncryptionType { return []EncryptionType{ "NONE", "AES256", "aws:kms", "UNKNOWN", } } type ErrorCode string // Enum values for ErrorCode const ( ErrorCodeClientError ErrorCode = "ClientError" ErrorCodeInternalError ErrorCode = "InternalError" ) // Values returns all known values for ErrorCode. 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 (ErrorCode) Values() []ErrorCode { return []ErrorCode{ "ClientError", "InternalError", } } type FindingActionType string // Enum values for FindingActionType const ( FindingActionTypeAwsApiCall FindingActionType = "AWS_API_CALL" ) // Values returns all known values for FindingActionType. 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 (FindingActionType) Values() []FindingActionType { return []FindingActionType{ "AWS_API_CALL", } } type FindingCategory string // Enum values for FindingCategory const ( FindingCategoryClassification FindingCategory = "CLASSIFICATION" FindingCategoryPolicy FindingCategory = "POLICY" ) // Values returns all known values for FindingCategory. 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 (FindingCategory) Values() []FindingCategory { return []FindingCategory{ "CLASSIFICATION", "POLICY", } } type FindingPublishingFrequency string // Enum values for FindingPublishingFrequency const ( FindingPublishingFrequencyFifteenMinutes FindingPublishingFrequency = "FIFTEEN_MINUTES" FindingPublishingFrequencyOneHour FindingPublishingFrequency = "ONE_HOUR" FindingPublishingFrequencySixHours FindingPublishingFrequency = "SIX_HOURS" ) // Values returns all known values for FindingPublishingFrequency. 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 (FindingPublishingFrequency) Values() []FindingPublishingFrequency { return []FindingPublishingFrequency{ "FIFTEEN_MINUTES", "ONE_HOUR", "SIX_HOURS", } } type FindingsFilterAction string // Enum values for FindingsFilterAction const ( FindingsFilterActionArchive FindingsFilterAction = "ARCHIVE" FindingsFilterActionNoop FindingsFilterAction = "NOOP" ) // Values returns all known values for FindingsFilterAction. 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 (FindingsFilterAction) Values() []FindingsFilterAction { return []FindingsFilterAction{ "ARCHIVE", "NOOP", } } type FindingStatisticsSortAttributeName string // Enum values for FindingStatisticsSortAttributeName const ( FindingStatisticsSortAttributeNameGroupKey FindingStatisticsSortAttributeName = "groupKey" FindingStatisticsSortAttributeNameCount FindingStatisticsSortAttributeName = "count" ) // Values returns all known values for FindingStatisticsSortAttributeName. 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 (FindingStatisticsSortAttributeName) Values() []FindingStatisticsSortAttributeName { return []FindingStatisticsSortAttributeName{ "groupKey", "count", } } type FindingType string // Enum values for FindingType const ( FindingTypeSensitiveDataS3ObjectMultiple FindingType = "SensitiveData:S3Object/Multiple" FindingTypeSensitiveDataS3ObjectFinancial FindingType = "SensitiveData:S3Object/Financial" FindingTypeSensitiveDataS3ObjectPersonal FindingType = "SensitiveData:S3Object/Personal" FindingTypeSensitiveDataS3ObjectCredentials FindingType = "SensitiveData:S3Object/Credentials" FindingTypeSensitiveDataS3ObjectCustomIdentifier FindingType = "SensitiveData:S3Object/CustomIdentifier" FindingTypePolicyIAMUserS3BucketPublic FindingType = "Policy:IAMUser/S3BucketPublic" FindingTypePolicyIAMUserS3BucketSharedExternally FindingType = "Policy:IAMUser/S3BucketSharedExternally" FindingTypePolicyIAMUserS3BucketReplicatedExternally FindingType = "Policy:IAMUser/S3BucketReplicatedExternally" FindingTypePolicyIAMUserS3BucketEncryptionDisabled FindingType = "Policy:IAMUser/S3BucketEncryptionDisabled" FindingTypePolicyIAMUserS3BlockPublicAccessDisabled FindingType = "Policy:IAMUser/S3BlockPublicAccessDisabled" FindingTypePolicyIAMUserS3BucketSharedWithCloudFront FindingType = "Policy:IAMUser/S3BucketSharedWithCloudFront" ) // Values returns all known values for FindingType. 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 (FindingType) Values() []FindingType { return []FindingType{ "SensitiveData:S3Object/Multiple", "SensitiveData:S3Object/Financial", "SensitiveData:S3Object/Personal", "SensitiveData:S3Object/Credentials", "SensitiveData:S3Object/CustomIdentifier", "Policy:IAMUser/S3BucketPublic", "Policy:IAMUser/S3BucketSharedExternally", "Policy:IAMUser/S3BucketReplicatedExternally", "Policy:IAMUser/S3BucketEncryptionDisabled", "Policy:IAMUser/S3BlockPublicAccessDisabled", "Policy:IAMUser/S3BucketSharedWithCloudFront", } } type GroupBy string // Enum values for GroupBy const ( GroupByResourcesAffectedS3BucketName GroupBy = "resourcesAffected.s3Bucket.name" GroupByType GroupBy = "type" GroupByClassificationDetailsJobId GroupBy = "classificationDetails.jobId" GroupBySeverityDescription GroupBy = "severity.description" ) // Values returns all known values for GroupBy. 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 (GroupBy) Values() []GroupBy { return []GroupBy{ "resourcesAffected.s3Bucket.name", "type", "classificationDetails.jobId", "severity.description", } } type IsDefinedInJob string // Enum values for IsDefinedInJob const ( IsDefinedInJobTrue IsDefinedInJob = "TRUE" IsDefinedInJobFalse IsDefinedInJob = "FALSE" IsDefinedInJobUnknown IsDefinedInJob = "UNKNOWN" ) // Values returns all known values for IsDefinedInJob. 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 (IsDefinedInJob) Values() []IsDefinedInJob { return []IsDefinedInJob{ "TRUE", "FALSE", "UNKNOWN", } } type IsMonitoredByJob string // Enum values for IsMonitoredByJob const ( IsMonitoredByJobTrue IsMonitoredByJob = "TRUE" IsMonitoredByJobFalse IsMonitoredByJob = "FALSE" IsMonitoredByJobUnknown IsMonitoredByJob = "UNKNOWN" ) // Values returns all known values for IsMonitoredByJob. 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 (IsMonitoredByJob) Values() []IsMonitoredByJob { return []IsMonitoredByJob{ "TRUE", "FALSE", "UNKNOWN", } } type JobComparator string // Enum values for JobComparator const ( JobComparatorEq JobComparator = "EQ" JobComparatorGt JobComparator = "GT" JobComparatorGte JobComparator = "GTE" JobComparatorLt JobComparator = "LT" JobComparatorLte JobComparator = "LTE" JobComparatorNe JobComparator = "NE" JobComparatorContains JobComparator = "CONTAINS" JobComparatorStartsWith JobComparator = "STARTS_WITH" ) // Values returns all known values for JobComparator. 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 (JobComparator) Values() []JobComparator { return []JobComparator{ "EQ", "GT", "GTE", "LT", "LTE", "NE", "CONTAINS", "STARTS_WITH", } } type JobStatus string // Enum values for JobStatus const ( JobStatusRunning JobStatus = "RUNNING" JobStatusPaused JobStatus = "PAUSED" JobStatusCancelled JobStatus = "CANCELLED" JobStatusComplete JobStatus = "COMPLETE" JobStatusIdle JobStatus = "IDLE" JobStatusUserPaused JobStatus = "USER_PAUSED" ) // Values returns all known values for JobStatus. Note that this can be expanded // in the future, and so it is only as up to date as the client. The ordering of // this slice is not guaranteed to be stable across updates. func (JobStatus) Values() []JobStatus { return []JobStatus{ "RUNNING", "PAUSED", "CANCELLED", "COMPLETE", "IDLE", "USER_PAUSED", } } type JobType string // Enum values for JobType const ( JobTypeOneTime JobType = "ONE_TIME" JobTypeScheduled JobType = "SCHEDULED" ) // Values returns all known values for JobType. Note that this can be expanded in // the future, and so it is only as up to date as the client. The ordering of this // slice is not guaranteed to be stable across updates. func (JobType) Values() []JobType { return []JobType{ "ONE_TIME", "SCHEDULED", } } type LastRunErrorStatusCode string // Enum values for LastRunErrorStatusCode const ( LastRunErrorStatusCodeNone LastRunErrorStatusCode = "NONE" LastRunErrorStatusCodeError LastRunErrorStatusCode = "ERROR" ) // Values returns all known values for LastRunErrorStatusCode. 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 (LastRunErrorStatusCode) Values() []LastRunErrorStatusCode { return []LastRunErrorStatusCode{ "NONE", "ERROR", } } type ListJobsFilterKey string // Enum values for ListJobsFilterKey const ( ListJobsFilterKeyJobType ListJobsFilterKey = "jobType" ListJobsFilterKeyJobStatus ListJobsFilterKey = "jobStatus" ListJobsFilterKeyCreatedAt ListJobsFilterKey = "createdAt" ListJobsFilterKeyName ListJobsFilterKey = "name" ) // Values returns all known values for ListJobsFilterKey. 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 (ListJobsFilterKey) Values() []ListJobsFilterKey { return []ListJobsFilterKey{ "jobType", "jobStatus", "createdAt", "name", } } type ListJobsSortAttributeName string // Enum values for ListJobsSortAttributeName const ( ListJobsSortAttributeNameCreatedAt ListJobsSortAttributeName = "createdAt" ListJobsSortAttributeNameJobStatus ListJobsSortAttributeName = "jobStatus" ListJobsSortAttributeNameName ListJobsSortAttributeName = "name" ListJobsSortAttributeNameJobType ListJobsSortAttributeName = "jobType" ) // Values returns all known values for ListJobsSortAttributeName. 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 (ListJobsSortAttributeName) Values() []ListJobsSortAttributeName { return []ListJobsSortAttributeName{ "createdAt", "jobStatus", "name", "jobType", } } type MacieStatus string // Enum values for MacieStatus const ( MacieStatusPaused MacieStatus = "PAUSED" MacieStatusEnabled MacieStatus = "ENABLED" ) // Values returns all known values for MacieStatus. 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 (MacieStatus) Values() []MacieStatus { return []MacieStatus{ "PAUSED", "ENABLED", } } type ManagedDataIdentifierSelector string // Enum values for ManagedDataIdentifierSelector const ( ManagedDataIdentifierSelectorAll ManagedDataIdentifierSelector = "ALL" ManagedDataIdentifierSelectorExclude ManagedDataIdentifierSelector = "EXCLUDE" ManagedDataIdentifierSelectorInclude ManagedDataIdentifierSelector = "INCLUDE" ManagedDataIdentifierSelectorNone ManagedDataIdentifierSelector = "NONE" ManagedDataIdentifierSelectorRecommended ManagedDataIdentifierSelector = "RECOMMENDED" ) // Values returns all known values for ManagedDataIdentifierSelector. 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 (ManagedDataIdentifierSelector) Values() []ManagedDataIdentifierSelector { return []ManagedDataIdentifierSelector{ "ALL", "EXCLUDE", "INCLUDE", "NONE", "RECOMMENDED", } } type OrderBy string // Enum values for OrderBy const ( OrderByAsc OrderBy = "ASC" OrderByDesc OrderBy = "DESC" ) // Values returns all known values for OrderBy. 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 (OrderBy) Values() []OrderBy { return []OrderBy{ "ASC", "DESC", } } type OriginType string // Enum values for OriginType const ( OriginTypeSensitiveDataDiscoveryJob OriginType = "SENSITIVE_DATA_DISCOVERY_JOB" OriginTypeAutomatedSensitiveDataDiscovery OriginType = "AUTOMATED_SENSITIVE_DATA_DISCOVERY" ) // Values returns all known values for OriginType. 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 (OriginType) Values() []OriginType { return []OriginType{ "SENSITIVE_DATA_DISCOVERY_JOB", "AUTOMATED_SENSITIVE_DATA_DISCOVERY", } } type RelationshipStatus string // Enum values for RelationshipStatus const ( RelationshipStatusEnabled RelationshipStatus = "Enabled" RelationshipStatusPaused RelationshipStatus = "Paused" RelationshipStatusInvited RelationshipStatus = "Invited" RelationshipStatusCreated RelationshipStatus = "Created" RelationshipStatusRemoved RelationshipStatus = "Removed" RelationshipStatusResigned RelationshipStatus = "Resigned" RelationshipStatusEmailVerificationInProgress RelationshipStatus = "EmailVerificationInProgress" RelationshipStatusEmailVerificationFailed RelationshipStatus = "EmailVerificationFailed" RelationshipStatusRegionDisabled RelationshipStatus = "RegionDisabled" RelationshipStatusAccountSuspended RelationshipStatus = "AccountSuspended" ) // Values returns all known values for RelationshipStatus. 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 (RelationshipStatus) Values() []RelationshipStatus { return []RelationshipStatus{ "Enabled", "Paused", "Invited", "Created", "Removed", "Resigned", "EmailVerificationInProgress", "EmailVerificationFailed", "RegionDisabled", "AccountSuspended", } } type RevealRequestStatus string // Enum values for RevealRequestStatus const ( RevealRequestStatusSuccess RevealRequestStatus = "SUCCESS" RevealRequestStatusProcessing RevealRequestStatus = "PROCESSING" RevealRequestStatusError RevealRequestStatus = "ERROR" ) // Values returns all known values for RevealRequestStatus. 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 (RevealRequestStatus) Values() []RevealRequestStatus { return []RevealRequestStatus{ "SUCCESS", "PROCESSING", "ERROR", } } type RevealStatus string // Enum values for RevealStatus const ( RevealStatusEnabled RevealStatus = "ENABLED" RevealStatusDisabled RevealStatus = "DISABLED" ) // Values returns all known values for RevealStatus. 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 (RevealStatus) Values() []RevealStatus { return []RevealStatus{ "ENABLED", "DISABLED", } } type ScopeFilterKey string // Enum values for ScopeFilterKey const ( ScopeFilterKeyObjectExtension ScopeFilterKey = "OBJECT_EXTENSION" ScopeFilterKeyObjectLastModifiedDate ScopeFilterKey = "OBJECT_LAST_MODIFIED_DATE" ScopeFilterKeyObjectSize ScopeFilterKey = "OBJECT_SIZE" ScopeFilterKeyObjectKey ScopeFilterKey = "OBJECT_KEY" ) // Values returns all known values for ScopeFilterKey. 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 (ScopeFilterKey) Values() []ScopeFilterKey { return []ScopeFilterKey{ "OBJECT_EXTENSION", "OBJECT_LAST_MODIFIED_DATE", "OBJECT_SIZE", "OBJECT_KEY", } } type SearchResourcesComparator string // Enum values for SearchResourcesComparator const ( SearchResourcesComparatorEq SearchResourcesComparator = "EQ" SearchResourcesComparatorNe SearchResourcesComparator = "NE" ) // Values returns all known values for SearchResourcesComparator. 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 (SearchResourcesComparator) Values() []SearchResourcesComparator { return []SearchResourcesComparator{ "EQ", "NE", } } type SearchResourcesSimpleCriterionKey string // Enum values for SearchResourcesSimpleCriterionKey const ( SearchResourcesSimpleCriterionKeyAccountId SearchResourcesSimpleCriterionKey = "ACCOUNT_ID" SearchResourcesSimpleCriterionKeyS3BucketName SearchResourcesSimpleCriterionKey = "S3_BUCKET_NAME" SearchResourcesSimpleCriterionKeyS3BucketEffectivePermission SearchResourcesSimpleCriterionKey = "S3_BUCKET_EFFECTIVE_PERMISSION" SearchResourcesSimpleCriterionKeyS3BucketSharedAccess SearchResourcesSimpleCriterionKey = "S3_BUCKET_SHARED_ACCESS" ) // Values returns all known values for SearchResourcesSimpleCriterionKey. 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 (SearchResourcesSimpleCriterionKey) Values() []SearchResourcesSimpleCriterionKey { return []SearchResourcesSimpleCriterionKey{ "ACCOUNT_ID", "S3_BUCKET_NAME", "S3_BUCKET_EFFECTIVE_PERMISSION", "S3_BUCKET_SHARED_ACCESS", } } type SearchResourcesSortAttributeName string // Enum values for SearchResourcesSortAttributeName const ( SearchResourcesSortAttributeNameAccountId SearchResourcesSortAttributeName = "ACCOUNT_ID" SearchResourcesSortAttributeNameResourceName SearchResourcesSortAttributeName = "RESOURCE_NAME" SearchResourcesSortAttributeNameS3ClassifiableObjectCount SearchResourcesSortAttributeName = "S3_CLASSIFIABLE_OBJECT_COUNT" SearchResourcesSortAttributeNameS3ClassifiableSizeInBytes SearchResourcesSortAttributeName = "S3_CLASSIFIABLE_SIZE_IN_BYTES" ) // Values returns all known values for SearchResourcesSortAttributeName. 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 (SearchResourcesSortAttributeName) Values() []SearchResourcesSortAttributeName { return []SearchResourcesSortAttributeName{ "ACCOUNT_ID", "RESOURCE_NAME", "S3_CLASSIFIABLE_OBJECT_COUNT", "S3_CLASSIFIABLE_SIZE_IN_BYTES", } } type SensitiveDataItemCategory string // Enum values for SensitiveDataItemCategory const ( SensitiveDataItemCategoryFinancialInformation SensitiveDataItemCategory = "FINANCIAL_INFORMATION" SensitiveDataItemCategoryPersonalInformation SensitiveDataItemCategory = "PERSONAL_INFORMATION" SensitiveDataItemCategoryCredentials SensitiveDataItemCategory = "CREDENTIALS" SensitiveDataItemCategoryCustomIdentifier SensitiveDataItemCategory = "CUSTOM_IDENTIFIER" ) // Values returns all known values for SensitiveDataItemCategory. 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 (SensitiveDataItemCategory) Values() []SensitiveDataItemCategory { return []SensitiveDataItemCategory{ "FINANCIAL_INFORMATION", "PERSONAL_INFORMATION", "CREDENTIALS", "CUSTOM_IDENTIFIER", } } type SeverityDescription string // Enum values for SeverityDescription const ( SeverityDescriptionLow SeverityDescription = "Low" SeverityDescriptionMedium SeverityDescription = "Medium" SeverityDescriptionHigh SeverityDescription = "High" ) // Values returns all known values for SeverityDescription. 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 (SeverityDescription) Values() []SeverityDescription { return []SeverityDescription{ "Low", "Medium", "High", } } type SharedAccess string // Enum values for SharedAccess const ( SharedAccessExternal SharedAccess = "EXTERNAL" SharedAccessInternal SharedAccess = "INTERNAL" SharedAccessNotShared SharedAccess = "NOT_SHARED" SharedAccessUnknown SharedAccess = "UNKNOWN" ) // Values returns all known values for SharedAccess. 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 (SharedAccess) Values() []SharedAccess { return []SharedAccess{ "EXTERNAL", "INTERNAL", "NOT_SHARED", "UNKNOWN", } } type SimpleCriterionKeyForJob string // Enum values for SimpleCriterionKeyForJob const ( SimpleCriterionKeyForJobAccountId SimpleCriterionKeyForJob = "ACCOUNT_ID" SimpleCriterionKeyForJobS3BucketName SimpleCriterionKeyForJob = "S3_BUCKET_NAME" SimpleCriterionKeyForJobS3BucketEffectivePermission SimpleCriterionKeyForJob = "S3_BUCKET_EFFECTIVE_PERMISSION" SimpleCriterionKeyForJobS3BucketSharedAccess SimpleCriterionKeyForJob = "S3_BUCKET_SHARED_ACCESS" ) // Values returns all known values for SimpleCriterionKeyForJob. 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 (SimpleCriterionKeyForJob) Values() []SimpleCriterionKeyForJob { return []SimpleCriterionKeyForJob{ "ACCOUNT_ID", "S3_BUCKET_NAME", "S3_BUCKET_EFFECTIVE_PERMISSION", "S3_BUCKET_SHARED_ACCESS", } } type StorageClass string // Enum values for StorageClass const ( StorageClassStandard StorageClass = "STANDARD" StorageClassReducedRedundancy StorageClass = "REDUCED_REDUNDANCY" StorageClassStandardIa StorageClass = "STANDARD_IA" StorageClassIntelligentTiering StorageClass = "INTELLIGENT_TIERING" StorageClassDeepArchive StorageClass = "DEEP_ARCHIVE" StorageClassOnezoneIa StorageClass = "ONEZONE_IA" StorageClassGlacier StorageClass = "GLACIER" StorageClassGlacierIr StorageClass = "GLACIER_IR" StorageClassOutposts StorageClass = "OUTPOSTS" ) // Values returns all known values for StorageClass. 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 (StorageClass) Values() []StorageClass { return []StorageClass{ "STANDARD", "REDUCED_REDUNDANCY", "STANDARD_IA", "INTELLIGENT_TIERING", "DEEP_ARCHIVE", "ONEZONE_IA", "GLACIER", "GLACIER_IR", "OUTPOSTS", } } type TagTarget string // Enum values for TagTarget const ( TagTargetS3Object TagTarget = "S3_OBJECT" ) // Values returns all known values for TagTarget. 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 (TagTarget) Values() []TagTarget { return []TagTarget{ "S3_OBJECT", } } type TimeRange string // Enum values for TimeRange const ( TimeRangeMonthToDate TimeRange = "MONTH_TO_DATE" TimeRangePast30Days TimeRange = "PAST_30_DAYS" ) // Values returns all known values for TimeRange. 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 (TimeRange) Values() []TimeRange { return []TimeRange{ "MONTH_TO_DATE", "PAST_30_DAYS", } } type Type string // Enum values for Type const ( TypeNone Type = "NONE" TypeAes256 Type = "AES256" TypeAwsKms Type = "aws:kms" ) // Values returns all known values for Type. 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 (Type) Values() []Type { return []Type{ "NONE", "AES256", "aws:kms", } } type UnavailabilityReasonCode string // Enum values for UnavailabilityReasonCode const ( UnavailabilityReasonCodeObjectExceedsSizeQuota UnavailabilityReasonCode = "OBJECT_EXCEEDS_SIZE_QUOTA" UnavailabilityReasonCodeUnsupportedObjectType UnavailabilityReasonCode = "UNSUPPORTED_OBJECT_TYPE" UnavailabilityReasonCodeUnsupportedFindingType UnavailabilityReasonCode = "UNSUPPORTED_FINDING_TYPE" UnavailabilityReasonCodeInvalidClassificationResult UnavailabilityReasonCode = "INVALID_CLASSIFICATION_RESULT" UnavailabilityReasonCodeObjectUnavailable UnavailabilityReasonCode = "OBJECT_UNAVAILABLE" ) // Values returns all known values for UnavailabilityReasonCode. 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 (UnavailabilityReasonCode) Values() []UnavailabilityReasonCode { return []UnavailabilityReasonCode{ "OBJECT_EXCEEDS_SIZE_QUOTA", "UNSUPPORTED_OBJECT_TYPE", "UNSUPPORTED_FINDING_TYPE", "INVALID_CLASSIFICATION_RESULT", "OBJECT_UNAVAILABLE", } } type Unit string // Enum values for Unit const ( UnitTerabytes Unit = "TERABYTES" ) // Values returns all known values for Unit. 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 (Unit) Values() []Unit { return []Unit{ "TERABYTES", } } type UsageStatisticsFilterComparator string // Enum values for UsageStatisticsFilterComparator const ( UsageStatisticsFilterComparatorGt UsageStatisticsFilterComparator = "GT" UsageStatisticsFilterComparatorGte UsageStatisticsFilterComparator = "GTE" UsageStatisticsFilterComparatorLt UsageStatisticsFilterComparator = "LT" UsageStatisticsFilterComparatorLte UsageStatisticsFilterComparator = "LTE" UsageStatisticsFilterComparatorEq UsageStatisticsFilterComparator = "EQ" UsageStatisticsFilterComparatorNe UsageStatisticsFilterComparator = "NE" UsageStatisticsFilterComparatorContains UsageStatisticsFilterComparator = "CONTAINS" ) // Values returns all known values for UsageStatisticsFilterComparator. 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 (UsageStatisticsFilterComparator) Values() []UsageStatisticsFilterComparator { return []UsageStatisticsFilterComparator{ "GT", "GTE", "LT", "LTE", "EQ", "NE", "CONTAINS", } } type UsageStatisticsFilterKey string // Enum values for UsageStatisticsFilterKey const ( UsageStatisticsFilterKeyAccountId UsageStatisticsFilterKey = "accountId" UsageStatisticsFilterKeyServiceLimit UsageStatisticsFilterKey = "serviceLimit" UsageStatisticsFilterKeyFreeTrialStartDate UsageStatisticsFilterKey = "freeTrialStartDate" UsageStatisticsFilterKeyTotal UsageStatisticsFilterKey = "total" ) // Values returns all known values for UsageStatisticsFilterKey. 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 (UsageStatisticsFilterKey) Values() []UsageStatisticsFilterKey { return []UsageStatisticsFilterKey{ "accountId", "serviceLimit", "freeTrialStartDate", "total", } } type UsageStatisticsSortKey string // Enum values for UsageStatisticsSortKey const ( UsageStatisticsSortKeyAccountId UsageStatisticsSortKey = "accountId" UsageStatisticsSortKeyTotal UsageStatisticsSortKey = "total" UsageStatisticsSortKeyServiceLimitValue UsageStatisticsSortKey = "serviceLimitValue" UsageStatisticsSortKeyFreeTrialStartDate UsageStatisticsSortKey = "freeTrialStartDate" ) // Values returns all known values for UsageStatisticsSortKey. 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 (UsageStatisticsSortKey) Values() []UsageStatisticsSortKey { return []UsageStatisticsSortKey{ "accountId", "total", "serviceLimitValue", "freeTrialStartDate", } } type UsageType string // Enum values for UsageType const ( UsageTypeDataInventoryEvaluation UsageType = "DATA_INVENTORY_EVALUATION" UsageTypeSensitiveDataDiscovery UsageType = "SENSITIVE_DATA_DISCOVERY" UsageTypeAutomatedSensitiveDataDiscovery UsageType = "AUTOMATED_SENSITIVE_DATA_DISCOVERY" UsageTypeAutomatedObjectMonitoring UsageType = "AUTOMATED_OBJECT_MONITORING" ) // Values returns all known values for UsageType. 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 (UsageType) Values() []UsageType { return []UsageType{ "DATA_INVENTORY_EVALUATION", "SENSITIVE_DATA_DISCOVERY", "AUTOMATED_SENSITIVE_DATA_DISCOVERY", "AUTOMATED_OBJECT_MONITORING", } } type UserIdentityType string // Enum values for UserIdentityType const ( UserIdentityTypeAssumedRole UserIdentityType = "AssumedRole" UserIdentityTypeIAMUser UserIdentityType = "IAMUser" UserIdentityTypeFederatedUser UserIdentityType = "FederatedUser" UserIdentityTypeRoot UserIdentityType = "Root" UserIdentityTypeAWSAccount UserIdentityType = "AWSAccount" UserIdentityTypeAWSService UserIdentityType = "AWSService" ) // Values returns all known values for UserIdentityType. 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 (UserIdentityType) Values() []UserIdentityType { return []UserIdentityType{ "AssumedRole", "IAMUser", "FederatedUser", "Root", "AWSAccount", "AWSService", } }
1,183
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" ) // Provides information about an error that occurred due to insufficient access to // a specified resource. type AccessDeniedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AccessDeniedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccessDeniedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccessDeniedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccessDeniedException" } return *e.ErrorCodeOverride } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Provides information about an error that occurred due to a versioning conflict // for a specified resource. 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 } // Provides information about an error that occurred due to an unknown internal // server error, exception, or failure. 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 } // Provides information about an error that occurred because a specified resource // wasn't 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 } // Provides information about an error that occurred due to one or more service // quotas for an 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 } // Provides information about an error that occurred because too many requests // were sent during a certain amount of time. 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 } // Provides information about an error that occurred due to an unprocessable // entity. type UnprocessableEntityException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *UnprocessableEntityException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *UnprocessableEntityException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *UnprocessableEntityException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "UnprocessableEntityException" } return *e.ErrorCodeOverride } func (e *UnprocessableEntityException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Provides information about an error that occurred due to a syntax error in a // request. 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 }
225
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" ) // Provides information about the permissions settings of the bucket-level access // control list (ACL) for an S3 bucket. type AccessControlList struct { // Specifies whether the ACL grants the general public with read access // permissions for the bucket. AllowsPublicReadAccess bool // Specifies whether the ACL grants the general public with write access // permissions for the bucket. AllowsPublicWriteAccess bool noSmithyDocumentSerde } // Specifies the details of an account to associate with an Amazon Macie // administrator account. type AccountDetail struct { // The Amazon Web Services account ID for the account. // // This member is required. AccountId *string // The email address for the account. // // This member is required. Email *string noSmithyDocumentSerde } // Provides information about the account-level permissions settings that apply to // an S3 bucket. type AccountLevelPermissions struct { // The block public access settings for the Amazon Web Services account that owns // the bucket. BlockPublicAccess *BlockPublicAccess noSmithyDocumentSerde } // Provides information about the delegated Amazon Macie administrator account for // an organization in Organizations. type AdminAccount struct { // The Amazon Web Services account ID for the account. AccountId *string // The current status of the account as the delegated Amazon Macie administrator // account for the organization. Status AdminStatus noSmithyDocumentSerde } // Specifies the criteria for an allow list. The criteria must specify a regular // expression (regex) or an S3 object (s3WordsList). It can't specify both. type AllowListCriteria struct { // The regular expression (regex) that defines the text pattern to ignore. The // expression can contain as many as 512 characters. Regex *string // The location and name of the S3 object that lists specific text to ignore. S3WordsList *S3WordsList noSmithyDocumentSerde } // Provides information about the current status of an allow list, which indicates // whether Amazon Macie can access and use the list's criteria. type AllowListStatus struct { // The current status of the allow list. If the list's criteria specify a regular // expression (regex), this value is typically OK. Amazon Macie can compile the // expression. If the list's criteria specify an S3 object, possible values are: // - OK - Macie can retrieve and parse the contents of the object. // - S3_OBJECT_ACCESS_DENIED - Macie isn't allowed to access the object or the // object is encrypted with a customer managed KMS key that Macie isn't allowed to // use. Check the bucket policy and other permissions settings for the bucket and // the object. If the object is encrypted, also ensure that it's encrypted with a // key that Macie is allowed to use. // - S3_OBJECT_EMPTY - Macie can retrieve the object but the object doesn't // contain any content. Ensure that the object contains the correct entries. Also // ensure that the list's criteria specify the correct bucket and object names. // - S3_OBJECT_NOT_FOUND - The object doesn't exist in Amazon S3. Ensure that // the list's criteria specify the correct bucket and object names. // - S3_OBJECT_OVERSIZE - Macie can retrieve the object. However, the object // contains too many entries or its storage size exceeds the quota for an allow // list. Try breaking the list into multiple files and ensure that each file // doesn't exceed any quotas. Then configure list settings in Macie for each file. // - S3_THROTTLED - Amazon S3 throttled the request to retrieve the object. Wait // a few minutes and then try again. // - S3_USER_ACCESS_DENIED - Amazon S3 denied the request to retrieve the // object. If the specified object exists, you're not allowed to access it or it's // encrypted with an KMS key that you're not allowed to use. Work with your Amazon // Web Services administrator to ensure that the list's criteria specify the // correct bucket and object names, and you have read access to the bucket and the // object. If the object is encrypted, also ensure that it's encrypted with a key // that you're allowed to use. // - UNKNOWN_ERROR - A transient or internal error occurred when Macie attempted // to retrieve or parse the object. Wait a few minutes and then try again. A list // can also have this status if it's encrypted with a key that Amazon S3 and Macie // can't access or use. // // This member is required. Code AllowListStatusCode // A brief description of the status of the allow list. Amazon Macie uses this // value to provide additional information about an error that occurred when Macie // tried to access and use the list's criteria. Description *string noSmithyDocumentSerde } // Provides a subset of information about an allow list. type AllowListSummary struct { // The Amazon Resource Name (ARN) of the allow list. Arn *string // The date and time, in UTC and extended ISO 8601 format, when the allow list was // created in Amazon Macie. CreatedAt *time.Time // The custom description of the allow list. Description *string // The unique identifier for the allow list. Id *string // The custom name of the allow list. Name *string // The date and time, in UTC and extended ISO 8601 format, when the allow list's // settings were most recently changed in Amazon Macie. UpdatedAt *time.Time noSmithyDocumentSerde } // Provides information about an API operation that an entity invoked for an // affected resource. type ApiCallDetails struct { // The name of the operation that was invoked most recently and produced the // finding. Api *string // The URL of the Amazon Web Service that provides the operation, for example: // s3.amazonaws.com. ApiServiceName *string // The first date and time, in UTC and extended ISO 8601 format, when any // operation was invoked and produced the finding. FirstSeen *time.Time // The most recent date and time, in UTC and extended ISO 8601 format, when the // specified operation (api) was invoked and produced the finding. LastSeen *time.Time noSmithyDocumentSerde } // Provides information about an identity that performed an action on an affected // resource by using temporary security credentials. The credentials were obtained // using the AssumeRole operation of the Security Token Service (STS) API. type AssumedRole struct { // The Amazon Web Services access key ID that identifies the credentials. AccessKeyId *string // The unique identifier for the Amazon Web Services account that owns the entity // that was used to get the credentials. AccountId *string // The Amazon Resource Name (ARN) of the entity that was used to get the // credentials. Arn *string // The unique identifier for the entity that was used to get the credentials. PrincipalId *string // The details of the session that was created for the credentials, including the // entity that issued the session. SessionContext *SessionContext noSmithyDocumentSerde } // Provides information about an Amazon Web Services account and entity that // performed an action on an affected resource. The action was performed using the // credentials for an Amazon Web Services account other than your own account. type AwsAccount struct { // The unique identifier for the Amazon Web Services account. AccountId *string // The unique identifier for the entity that performed the action. PrincipalId *string noSmithyDocumentSerde } // Provides information about an Amazon Web Service that performed an action on an // affected resource. type AwsService struct { // The name of the Amazon Web Service that performed the action. InvokedBy *string noSmithyDocumentSerde } // Provides information about a custom data identifier. type BatchGetCustomDataIdentifierSummary struct { // The Amazon Resource Name (ARN) of the custom data identifier. Arn *string // The date and time, in UTC and extended ISO 8601 format, when the custom data // identifier was created. CreatedAt *time.Time // Specifies whether the custom data identifier was deleted. If you delete a // custom data identifier, Amazon Macie doesn't delete it permanently. Instead, it // soft deletes the identifier. Deleted bool // The custom description of the custom data identifier. Description *string // The unique identifier for the custom data identifier. Id *string // The custom name of the custom data identifier. Name *string noSmithyDocumentSerde } // Provides information about the block public access settings for an S3 bucket. // These settings can apply to a bucket at the account or bucket level. For // detailed information about each setting, see Blocking public access to your // Amazon S3 storage (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html) // in the Amazon Simple Storage Service User Guide. type BlockPublicAccess struct { // Specifies whether Amazon S3 blocks public access control lists (ACLs) for the // bucket and objects in the bucket. BlockPublicAcls bool // Specifies whether Amazon S3 blocks public bucket policies for the bucket. BlockPublicPolicy bool // Specifies whether Amazon S3 ignores public ACLs for the bucket and objects in // the bucket. IgnorePublicAcls bool // Specifies whether Amazon S3 restricts public bucket policies for the bucket. RestrictPublicBuckets bool noSmithyDocumentSerde } // Provides information about the number of S3 buckets that are publicly // accessible due to a combination of permissions settings for each bucket. type BucketCountByEffectivePermission struct { // The total number of buckets that allow the general public to have read or write // access to the bucket. PubliclyAccessible int64 // The total number of buckets that allow the general public to have read access // to the bucket. PubliclyReadable int64 // The total number of buckets that allow the general public to have write access // to the bucket. PubliclyWritable int64 // The total number of buckets that Amazon Macie wasn't able to evaluate // permissions settings for. Macie can't determine whether these buckets are // publicly accessible. Unknown int64 noSmithyDocumentSerde } // Provides information about the number of S3 buckets whose settings do or don't // specify default server-side encryption behavior for objects that are added to // the buckets. For detailed information about these settings, see Setting default // server-side encryption behavior for Amazon S3 buckets (https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucket-encryption.html) // in the Amazon Simple Storage Service User Guide. type BucketCountByEncryptionType struct { // The total number of buckets whose default encryption settings are configured to // encrypt new objects with an Amazon Web Services managed KMS key or a customer // managed KMS key. By default, these buckets encrypt new objects automatically // using SSE-KMS encryption. KmsManaged int64 // The total number of buckets whose default encryption settings are configured to // encrypt new objects with an Amazon S3 managed key. By default, these buckets // encrypt new objects automatically using SSE-S3 encryption. S3Managed int64 // The total number of buckets that don't specify default server-side encryption // behavior for new objects. Default encryption settings aren't configured for // these buckets. Unencrypted int64 // The total number of buckets that Amazon Macie doesn't have current encryption // metadata for. Macie can't provide current data about the default encryption // settings for these buckets. Unknown int64 noSmithyDocumentSerde } // Provides information about the number of S3 buckets that are or aren't shared // with other Amazon Web Services accounts, Amazon CloudFront origin access // identities (OAIs), or CloudFront origin access controls (OACs). In this data, an // Amazon Macie organization is defined as a set of Macie accounts that are // centrally managed as a group of related accounts through Organizations or by // Macie invitation. type BucketCountBySharedAccessType struct { // The total number of buckets that are shared with one or more of the following // or any combination of the following: an Amazon CloudFront OAI, a CloudFront OAC, // or an Amazon Web Services account that isn't in the same Amazon Macie // organization. External int64 // The total number of buckets that are shared with one or more Amazon Web // Services accounts in the same Amazon Macie organization. These buckets aren't // shared with Amazon CloudFront OAIs or OACs. Internal int64 // The total number of buckets that aren't shared with other Amazon Web Services // accounts, Amazon CloudFront OAIs, or CloudFront OACs. NotShared int64 // The total number of buckets that Amazon Macie wasn't able to evaluate shared // access settings for. Macie can't determine whether these buckets are shared with // other Amazon Web Services accounts, Amazon CloudFront OAIs, or CloudFront OACs. Unknown int64 noSmithyDocumentSerde } // Provides information about the number of S3 buckets whose bucket policies do or // don't require server-side encryption of objects when objects are added to the // buckets. type BucketCountPolicyAllowsUnencryptedObjectUploads struct { // The total number of buckets that don't have a bucket policy or have a bucket // policy that doesn't require server-side encryption of new objects. If a bucket // policy exists, the policy doesn't require PutObject requests to include a valid // server-side encryption header: the x-amz-server-side-encryption header with a // value of AES256 or aws:kms, or the // x-amz-server-side-encryption-customer-algorithm header with a value of AES256. AllowsUnencryptedObjectUploads int64 // The total number of buckets whose bucket policies require server-side // encryption of new objects. PutObject requests for these buckets must include a // valid server-side encryption header: the x-amz-server-side-encryption header // with a value of AES256 or aws:kms, or the // x-amz-server-side-encryption-customer-algorithm header with a value of AES256. DeniesUnencryptedObjectUploads int64 // The total number of buckets that Amazon Macie wasn't able to evaluate // server-side encryption requirements for. Macie can't determine whether the // bucket policies for these buckets require server-side encryption of new objects. Unknown int64 noSmithyDocumentSerde } // Specifies the operator to use in a property-based condition that filters the // results of a query for information about S3 buckets. type BucketCriteriaAdditionalProperties struct { // The value for the property matches (equals) the specified value. If you specify // multiple values, Amazon Macie uses OR logic to join the values. Eq []string // The value for the property is greater than the specified value. Gt int64 // The value for the property is greater than or equal to the specified value. Gte int64 // The value for the property is less than the specified value. Lt int64 // The value for the property is less than or equal to the specified value. Lte int64 // The value for the property doesn't match (doesn't equal) the specified value. // If you specify multiple values, Amazon Macie uses OR logic to join the values. Neq []string // The name of the bucket begins with the specified value. Prefix *string noSmithyDocumentSerde } // Provides information about the bucket-level permissions settings for an S3 // bucket. type BucketLevelPermissions struct { // The permissions settings of the access control list (ACL) for the bucket. This // value is null if an ACL hasn't been defined for the bucket. AccessControlList *AccessControlList // The block public access settings for the bucket. BlockPublicAccess *BlockPublicAccess // The permissions settings of the bucket policy for the bucket. This value is // null if a bucket policy hasn't been defined for the bucket. BucketPolicy *BucketPolicy noSmithyDocumentSerde } // Provides statistical data and other information about an S3 bucket that Amazon // Macie monitors and analyzes for your account. By default, object count and // storage size values include data for object parts that are the result of // incomplete multipart uploads. For more information, see How Macie monitors // Amazon S3 data security (https://docs.aws.amazon.com/macie/latest/user/monitoring-s3-how-it-works.html) // in the Amazon Macie User Guide. If an error occurs when Macie attempts to // retrieve and process metadata from Amazon S3 for the bucket or the bucket's // objects, the value for the versioning property is false and the value for most // other properties is null. Key exceptions are accountId, bucketArn, // bucketCreatedAt, bucketName, lastUpdated, and region. To identify the cause of // the error, refer to the errorCode and errorMessage values. type BucketMetadata struct { // The unique identifier for the Amazon Web Services account that owns the bucket. AccountId *string // Specifies whether the bucket policy for the bucket requires server-side // encryption of objects when objects are added to the bucket. Possible values are: // // - FALSE - The bucket policy requires server-side encryption of new objects. // PutObject requests must include a valid server-side encryption header. // - TRUE - The bucket doesn't have a bucket policy or it has a bucket policy // that doesn't require server-side encryption of new objects. If a bucket policy // exists, it doesn't require PutObject requests to include a valid server-side // encryption header. // - UNKNOWN - Amazon Macie can't determine whether the bucket policy requires // server-side encryption of new objects. // Valid server-side encryption headers are: x-amz-server-side-encryption with a // value of AES256 or aws:kms, and x-amz-server-side-encryption-customer-algorithm // with a value of AES256. AllowsUnencryptedObjectUploads AllowsUnencryptedObjectUploads // The Amazon Resource Name (ARN) of the bucket. BucketArn *string // The date and time, in UTC and extended ISO 8601 format, when the bucket was // created. This value can also indicate when changes such as edits to the bucket's // policy were most recently made to the bucket. BucketCreatedAt *time.Time // The name of the bucket. BucketName *string // The total number of objects that Amazon Macie can analyze in the bucket. These // objects use a supported storage class and have a file name extension for a // supported file or storage format. ClassifiableObjectCount int64 // The total storage size, in bytes, of the objects that Amazon Macie can analyze // in the bucket. These objects use a supported storage class and have a file name // extension for a supported file or storage format. If versioning is enabled for // the bucket, Macie calculates this value based on the size of the latest version // of each applicable object in the bucket. This value doesn't reflect the storage // size of all versions of each applicable object in the bucket. ClassifiableSizeInBytes int64 // The error code for an error that prevented Amazon Macie from retrieving and // processing information about the bucket and the bucket's objects. If this value // is ACCESS_DENIED, Macie doesn't have permission to retrieve the information. For // example, the bucket has a restrictive bucket policy and Amazon S3 denied the // request. If this value is null, Macie was able to retrieve and process the // information. ErrorCode BucketMetadataErrorCode // A brief description of the error (errorCode) that prevented Amazon Macie from // retrieving and processing information about the bucket and the bucket's objects. // This value is null if Macie was able to retrieve and process the information. ErrorMessage *string // Specifies whether any one-time or recurring classification jobs are configured // to analyze data in the bucket, and, if so, the details of the job that ran most // recently. JobDetails *JobDetails // The date and time, in UTC and extended ISO 8601 format, when Amazon Macie most // recently analyzed data in the bucket while performing automated sensitive data // discovery for your account. This value is null if automated sensitive data // discovery is currently disabled for your account. LastAutomatedDiscoveryTime *time.Time // The date and time, in UTC and extended ISO 8601 format, when Amazon Macie most // recently retrieved bucket or object metadata from Amazon S3 for the bucket. LastUpdated *time.Time // The total number of objects in the bucket. ObjectCount int64 // The total number of objects in the bucket, grouped by server-side encryption // type. This includes a grouping that reports the total number of objects that // aren't encrypted or use client-side encryption. ObjectCountByEncryptionType *ObjectCountByEncryptionType // Specifies whether the bucket is publicly accessible due to the combination of // permissions settings that apply to the bucket, and provides information about // those settings. PublicAccess *BucketPublicAccess // The Amazon Web Services Region that hosts the bucket. Region *string // Specifies whether the bucket is configured to replicate one or more objects to // buckets for other Amazon Web Services accounts and, if so, which accounts. ReplicationDetails *ReplicationDetails // The sensitivity score for the bucket, ranging from -1 (classification error) to // 100 (sensitive). This value is null if automated sensitive data discovery is // currently disabled for your account. SensitivityScore int32 // The default server-side encryption settings for the bucket. ServerSideEncryption *BucketServerSideEncryption // Specifies whether the bucket is shared with another Amazon Web Services // account, an Amazon CloudFront origin access identity (OAI), or a CloudFront // origin access control (OAC). Possible values are: // - EXTERNAL - The bucket is shared with one or more of the following or any // combination of the following: a CloudFront OAI, a CloudFront OAC, or an Amazon // Web Services account that isn't part of your Amazon Macie organization. // - INTERNAL - The bucket is shared with one or more Amazon Web Services // accounts that are part of your Amazon Macie organization. It isn't shared with a // CloudFront OAI or OAC. // - NOT_SHARED - The bucket isn't shared with another Amazon Web Services // account, a CloudFront OAI, or a CloudFront OAC. // - UNKNOWN - Amazon Macie wasn't able to evaluate the shared access settings // for the bucket. // An Amazon Macie organization is a set of Macie accounts that are centrally // managed as a group of related accounts through Organizations or by Macie // invitation. SharedAccess SharedAccess // The total storage size, in bytes, of the bucket. If versioning is enabled for // the bucket, Amazon Macie calculates this value based on the size of the latest // version of each object in the bucket. This value doesn't reflect the storage // size of all versions of each object in the bucket. SizeInBytes int64 // The total storage size, in bytes, of the objects that are compressed (.gz, // .gzip, .zip) files in the bucket. If versioning is enabled for the bucket, // Amazon Macie calculates this value based on the size of the latest version of // each applicable object in the bucket. This value doesn't reflect the storage // size of all versions of each applicable object in the bucket. SizeInBytesCompressed int64 // An array that specifies the tags (keys and values) that are associated with the // bucket. Tags []KeyValuePair // The total number of objects that Amazon Macie can't analyze in the bucket. // These objects don't use a supported storage class or don't have a file name // extension for a supported file or storage format. UnclassifiableObjectCount *ObjectLevelStatistics // The total storage size, in bytes, of the objects that Amazon Macie can't // analyze in the bucket. These objects don't use a supported storage class or // don't have a file name extension for a supported file or storage format. UnclassifiableObjectSizeInBytes *ObjectLevelStatistics // Specifies whether versioning is enabled for the bucket. Versioning bool noSmithyDocumentSerde } // Provides information about the account-level and bucket-level permissions // settings for an S3 bucket. type BucketPermissionConfiguration struct { // The account-level permissions settings that apply to the bucket. AccountLevelPermissions *AccountLevelPermissions // The bucket-level permissions settings for the bucket. BucketLevelPermissions *BucketLevelPermissions noSmithyDocumentSerde } // Provides information about the permissions settings of the bucket policy for an // S3 bucket. type BucketPolicy struct { // Specifies whether the bucket policy allows the general public to have read // access to the bucket. AllowsPublicReadAccess bool // Specifies whether the bucket policy allows the general public to have write // access to the bucket. AllowsPublicWriteAccess bool noSmithyDocumentSerde } // Provides information about the permissions settings that determine whether an // S3 bucket is publicly accessible. type BucketPublicAccess struct { // Specifies whether the bucket is publicly accessible due to the combination of // permissions settings that apply to the bucket. Possible values are: // - NOT_PUBLIC - The bucket isn't publicly accessible. // - PUBLIC - The bucket is publicly accessible. // - UNKNOWN - Amazon Macie can't determine whether the bucket is publicly // accessible. EffectivePermission EffectivePermission // The account-level and bucket-level permissions settings for the bucket. PermissionConfiguration *BucketPermissionConfiguration noSmithyDocumentSerde } // Provides information about the default server-side encryption settings for an // S3 bucket. For detailed information about these settings, see Setting default // server-side encryption behavior for Amazon S3 buckets (https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucket-encryption.html) // in the Amazon Simple Storage Service User Guide. type BucketServerSideEncryption struct { // The Amazon Resource Name (ARN) or unique identifier (key ID) for the KMS key // that's used by default to encrypt objects that are added to the bucket. This // value is null if the bucket is configured to use an Amazon S3 managed key to // encrypt new objects. KmsMasterKeyId *string // The server-side encryption algorithm that's used by default to encrypt objects // that are added to the bucket. Possible values are: // - AES256 - New objects are encrypted with an Amazon S3 managed key. They use // SSE-S3 encryption. // - aws:kms - New objects are encrypted with an KMS key (kmsMasterKeyId), // either an Amazon Web Services managed key or a customer managed key. They use // SSE-KMS encryption. // - NONE - The bucket's default encryption settings don't specify server-side // encryption behavior for new objects. Type Type noSmithyDocumentSerde } // Specifies criteria for sorting the results of a query for information about S3 // buckets. type BucketSortCriteria struct { // The name of the bucket property to sort the results by. This value can be one // of the following properties that Amazon Macie defines as bucket metadata: // accountId, bucketName, classifiableObjectCount, classifiableSizeInBytes, // objectCount, sensitivityScore, or sizeInBytes. AttributeName *string // The sort order to apply to the results, based on the value specified by the // attributeName property. Valid values are: ASC, sort the results in ascending // order; and, DESC, sort the results in descending order. OrderBy OrderBy noSmithyDocumentSerde } // Provides aggregated statistical data for sensitive data discovery metrics that // apply to S3 buckets, grouped by bucket sensitivity score (sensitivityScore). If // automated sensitive data discovery is currently disabled for your account, the // value for each metric is 0. type BucketStatisticsBySensitivity struct { // The aggregated statistical data for all buckets that have a sensitivity score // of -1. ClassificationError *SensitivityAggregations // The aggregated statistical data for all buckets that have a sensitivity score // of 50. NotClassified *SensitivityAggregations // The aggregated statistical data for all buckets that have a sensitivity score // of 1-49. NotSensitive *SensitivityAggregations // The aggregated statistical data for all buckets that have a sensitivity score // of 51-100. Sensitive *SensitivityAggregations noSmithyDocumentSerde } // Specifies the location of an occurrence of sensitive data in a Microsoft Excel // workbook, CSV file, or TSV file. type Cell struct { // The location of the cell, as an absolute cell reference, that contains the // sensitive data, for example Sheet2!C5 for cell C5 on Sheet2 in a Microsoft Excel // workbook. This value is null for CSV and TSV files. CellReference *string // The column number of the column that contains the sensitive data. For a // Microsoft Excel workbook, this value correlates to the alphabetical character(s) // for a column identifier, for example: 1 for column A, 2 for column B, and so on. Column int64 // The name of the column that contains the sensitive data, if available. ColumnName *string // The row number of the row that contains the sensitive data. Row int64 noSmithyDocumentSerde } // Provides information about a sensitive data finding and the details of the // finding. type ClassificationDetails struct { // The path to the folder or file in Amazon S3 that contains the corresponding // sensitive data discovery result for the finding. If a finding applies to a large // archive or compressed file, this value is the path to a folder. Otherwise, this // value is the path to a file. DetailedResultsLocation *string // The Amazon Resource Name (ARN) of the classification job that produced the // finding. This value is null if the origin of the finding (originType) is // AUTOMATED_SENSITIVE_DATA_DISCOVERY. JobArn *string // The unique identifier for the classification job that produced the finding. // This value is null if the origin of the finding (originType) is // AUTOMATED_SENSITIVE_DATA_DISCOVERY. JobId *string // Specifies how Amazon Macie found the sensitive data that produced the finding. // Possible values are: SENSITIVE_DATA_DISCOVERY_JOB, for a classification job; // and, AUTOMATED_SENSITIVE_DATA_DISCOVERY, for automated sensitive data discovery. OriginType OriginType // The status and other details of the finding. Result *ClassificationResult noSmithyDocumentSerde } // Specifies where to store data classification results, and the encryption // settings to use when storing results in that location. The location must be an // S3 bucket. type ClassificationExportConfiguration struct { // The S3 bucket to store data classification results in, and the encryption // settings to use when storing results in that bucket. S3Destination *S3Destination noSmithyDocumentSerde } // Provides the details of a sensitive data finding, including the types, number // of occurrences, and locations of the sensitive data that was detected. type ClassificationResult struct { // Specifies whether Amazon Macie detected additional occurrences of sensitive // data in the S3 object. A finding includes location data for a maximum of 15 // occurrences of sensitive data. This value can help you determine whether to // investigate additional occurrences of sensitive data in an object. You can do // this by referring to the corresponding sensitive data discovery result for the // finding (classificationDetails.detailedResultsLocation). AdditionalOccurrences bool // The custom data identifiers that detected the sensitive data and the number of // occurrences of the data that they detected. CustomDataIdentifiers *CustomDataIdentifiers // The type of content, as a MIME type, that the finding applies to. For example, // application/gzip, for a GNU Gzip compressed archive file, or application/pdf, // for an Adobe Portable Document Format file. MimeType *string // The category, types, and number of occurrences of the sensitive data that // produced the finding. SensitiveData []SensitiveDataItem // The total size, in bytes, of the data that the finding applies to. SizeClassified int64 // The status of the finding. Status *ClassificationResultStatus noSmithyDocumentSerde } // Provides information about the status of a sensitive data finding. type ClassificationResultStatus struct { // The status of the finding. Possible values are: // - COMPLETE - Amazon Macie successfully completed its analysis of the S3 // object that the finding applies to. // - PARTIAL - Macie analyzed only a subset of the data in the S3 object that // the finding applies to. For example, the object is an archive file that contains // files in an unsupported format. // - SKIPPED - Macie wasn't able to analyze the S3 object that the finding // applies to. For example, the object is a file that uses an unsupported format. Code *string // A brief description of the status of the finding. This value is null if the // status (code) of the finding is COMPLETE. Amazon Macie uses this value to notify // you of any errors, warnings, or considerations that might impact your analysis // of the finding and the affected S3 object. Possible values are: // - ARCHIVE_CONTAINS_UNPROCESSED_FILES - The object is an archive file and // Macie extracted and analyzed only some or none of the files in the archive. To // determine which files Macie analyzed, if any, refer to the corresponding // sensitive data discovery result for the finding // (classificationDetails.detailedResultsLocation). // - ARCHIVE_EXCEEDS_SIZE_LIMIT - The object is an archive file whose total // storage size exceeds the size quota for this type of archive. // - ARCHIVE_NESTING_LEVEL_OVER_LIMIT - The object is an archive file whose // nested depth exceeds the quota for the maximum number of nested levels that // Macie analyzes for this type of archive. // - ARCHIVE_TOTAL_BYTES_EXTRACTED_OVER_LIMIT - The object is an archive file // that exceeds the quota for the maximum amount of data that Macie extracts and // analyzes for this type of archive. // - ARCHIVE_TOTAL_DOCUMENTS_PROCESSED_OVER_LIMIT - The object is an archive // file that contains more than the maximum number of files that Macie extracts and // analyzes for this type of archive. // - FILE_EXCEEDS_SIZE_LIMIT - The storage size of the object exceeds the size // quota for this type of file. // - INVALID_ENCRYPTION - The object is encrypted using server-side encryption // but Macie isn't allowed to use the key. Macie can't decrypt and analyze the // object. // - INVALID_KMS_KEY - The object is encrypted with an KMS key that was disabled // or is being deleted. Macie can't decrypt and analyze the object. // - INVALID_OBJECT_STATE - The object doesn't use a supported Amazon S3 storage // class. // - JSON_NESTING_LEVEL_OVER_LIMIT - The object contains JSON data and the // nested depth of the data exceeds the quota for the number of nested levels that // Macie analyzes for this type of file. // - MALFORMED_FILE - The object is a malformed or corrupted file. An error // occurred when Macie attempted to detect the file's type or extract data from the // file. // - MALFORMED_OR_FILE_SIZE_EXCEEDS_LIMIT - The object is a Microsoft Office // file that is malformed or exceeds the size quota for this type of file. If the // file is malformed, an error occurred when Macie attempted to extract data from // the file. // - NO_SUCH_BUCKET_AVAILABLE - The object was in a bucket that was deleted // shortly before or when Macie attempted to analyze the object. // - OBJECT_VERSION_MISMATCH - The object was changed while Macie was analyzing // it. // - OOXML_UNCOMPRESSED_RATIO_EXCEEDS_LIMIT - The object is an Office Open XML // file whose compression ratio exceeds the compression quota for this type of // file. // - OOXML_UNCOMPRESSED_SIZE_EXCEEDS_LIMIT - The object is an Office Open XML // file that exceeds the size quota for this type of file. // - PERMISSION_DENIED - Macie isn't allowed to access the object. The object's // permissions settings prevent Macie from analyzing the object. // - SOURCE_OBJECT_NO_LONGER_AVAILABLE - The object was deleted shortly before // or when Macie attempted to analyze it. // - TIME_CUT_OFF_REACHED - Macie started analyzing the object but additional // analysis would exceed the time quota for analyzing an object. // - UNABLE_TO_PARSE_FILE - The object is a file that contains structured data // and an error occurred when Macie attempted to parse the data. // - UNSUPPORTED_FILE_TYPE_EXCEPTION - The object is a file that uses an // unsupported file or storage format. // For information about quotas, supported storage classes, and supported file and // storage formats, see Quotas (https://docs.aws.amazon.com/macie/latest/user/macie-quotas.html) // and Supported storage classes and formats (https://docs.aws.amazon.com/macie/latest/user/discovery-supported-storage.html) // in the Amazon Macie User Guide. Reason *string noSmithyDocumentSerde } // Provides information about the classification scope for an Amazon Macie // account. Macie uses the scope's settings when it performs automated sensitive // data discovery for the account. type ClassificationScopeSummary struct { // The unique identifier for the classification scope. Id *string // The name of the classification scope: automated-sensitive-data-discovery. Name *string noSmithyDocumentSerde } // Specifies one or more property- and tag-based conditions that define criteria // for including or excluding S3 buckets from a classification job. type CriteriaBlockForJob struct { // An array of conditions, one for each condition that determines which buckets to // include or exclude from the job. If you specify more than one condition, Amazon // Macie uses AND logic to join the conditions. And []CriteriaForJob noSmithyDocumentSerde } // Specifies a property- or tag-based condition that defines criteria for // including or excluding S3 buckets from a classification job. type CriteriaForJob struct { // A property-based condition that defines a property, operator, and one or more // values for including or excluding buckets from the job. SimpleCriterion *SimpleCriterionForJob // A tag-based condition that defines an operator and tag keys, tag values, or tag // key and value pairs for including or excluding buckets from the job. TagCriterion *TagCriterionForJob noSmithyDocumentSerde } // Specifies the operator to use in a property-based condition that filters the // results of a query for findings. For detailed information and examples of each // operator, see Fundamentals of filtering findings (https://docs.aws.amazon.com/macie/latest/user/findings-filter-basics.html) // in the Amazon Macie User Guide. type CriterionAdditionalProperties struct { // The value for the property matches (equals) the specified value. If you specify // multiple values, Macie uses OR logic to join the values. Eq []string // The value for the property exclusively matches (equals an exact match for) all // the specified values. If you specify multiple values, Amazon Macie uses AND // logic to join the values. You can use this operator with the following // properties: customDataIdentifiers.detections.arn, // customDataIdentifiers.detections.name, resourcesAffected.s3Bucket.tags.key, // resourcesAffected.s3Bucket.tags.value, resourcesAffected.s3Object.tags.key, // resourcesAffected.s3Object.tags.value, sensitiveData.category, and // sensitiveData.detections.type. EqExactMatch []string // The value for the property is greater than the specified value. Gt int64 // The value for the property is greater than or equal to the specified value. Gte int64 // The value for the property is less than the specified value. Lt int64 // The value for the property is less than or equal to the specified value. Lte int64 // The value for the property doesn't match (doesn't equal) the specified value. // If you specify multiple values, Macie uses OR logic to join the values. Neq []string noSmithyDocumentSerde } // Provides information about custom data identifiers that produced a sensitive // data finding, and the number of occurrences of the data that they detected for // the finding. type CustomDataIdentifiers struct { // The custom data identifiers that detected the data, and the number of // occurrences of the data that each identifier detected. Detections []CustomDetection // The total number of occurrences of the data that was detected by the custom // data identifiers and produced the finding. TotalCount int64 noSmithyDocumentSerde } // Provides information about a custom data identifier. type CustomDataIdentifierSummary struct { // The Amazon Resource Name (ARN) of the custom data identifier. Arn *string // The date and time, in UTC and extended ISO 8601 format, when the custom data // identifier was created. CreatedAt *time.Time // The custom description of the custom data identifier. Description *string // The unique identifier for the custom data identifier. Id *string // The custom name of the custom data identifier. Name *string noSmithyDocumentSerde } // Provides information about a custom data identifier that produced a sensitive // data finding, and the sensitive data that it detected for the finding. type CustomDetection struct { // The unique identifier for the custom data identifier. Arn *string // The total number of occurrences of the sensitive data that the custom data // identifier detected. Count int64 // The name of the custom data identifier. Name *string // The location of 1-15 occurrences of the sensitive data that the custom data // identifier detected. A finding includes location data for a maximum of 15 // occurrences of sensitive data. Occurrences *Occurrences noSmithyDocumentSerde } // Specifies that a classification job runs once a day, every day. This is an // empty object. type DailySchedule struct { noSmithyDocumentSerde } // Provides information about a type of sensitive data that was detected by a // managed data identifier and produced a sensitive data finding. type DefaultDetection struct { // The total number of occurrences of the type of sensitive data that was detected. Count int64 // The location of 1-15 occurrences of the sensitive data that was detected. A // finding includes location data for a maximum of 15 occurrences of sensitive // data. Occurrences *Occurrences // The type of sensitive data that was detected. For example, AWS_CREDENTIALS, // PHONE_NUMBER, or ADDRESS. Type *string noSmithyDocumentSerde } // Specifies 1-10 occurrences of a specific type of sensitive data reported by a // finding. type DetectedDataDetails struct { // An occurrence of the specified type of sensitive data. Each occurrence can // contain 1-128 characters. // // This member is required. Value *string noSmithyDocumentSerde } // Provides information about a type of sensitive data that Amazon Macie found in // an S3 bucket while performing automated sensitive data discovery for the bucket. // The information also specifies the custom data identifier or managed data // identifier that detected the data. This information is available only if // automated sensitive data discovery is currently enabled for your account. type Detection struct { // If the sensitive data was detected by a custom data identifier, the Amazon // Resource Name (ARN) of the custom data identifier that detected the data. // Otherwise, this value is null. Arn *string // The total number of occurrences of the sensitive data. Count int64 // The unique identifier for the custom data identifier or managed data identifier // that detected the sensitive data. For additional details about a specified // managed data identifier, see Using managed data identifiers (https://docs.aws.amazon.com/macie/latest/user/managed-data-identifiers.html) // in the Amazon Macie User Guide. Id *string // The name of the custom data identifier or managed data identifier that detected // the sensitive data. For a managed data identifier, this value is the same as the // unique identifier (id). Name *string // Specifies whether occurrences of this type of sensitive data are excluded // (true) or included (false) in the bucket's sensitivity score. Suppressed bool // The type of data identifier that detected the sensitive data. Possible values // are: CUSTOM, for a custom data identifier; and, MANAGED, for a managed data // identifier. Type DataIdentifierType noSmithyDocumentSerde } // Provides information about the domain name of the device that an entity used to // perform an action on an affected resource. type DomainDetails struct { // The name of the domain. DomainName *string noSmithyDocumentSerde } // Provides information about an identity that performed an action on an affected // resource by using temporary security credentials. The credentials were obtained // using the GetFederationToken operation of the Security Token Service (STS) API. type FederatedUser struct { // The Amazon Web Services access key ID that identifies the credentials. AccessKeyId *string // The unique identifier for the Amazon Web Services account that owns the entity // that was used to get the credentials. AccountId *string // The Amazon Resource Name (ARN) of the entity that was used to get the // credentials. Arn *string // The unique identifier for the entity that was used to get the credentials. PrincipalId *string // The details of the session that was created for the credentials, including the // entity that issued the session. SessionContext *SessionContext noSmithyDocumentSerde } // Provides the details of a finding. type Finding struct { // The unique identifier for the Amazon Web Services account that the finding // applies to. This is typically the account that owns the affected resource. AccountId *string // Specifies whether the finding is archived (suppressed). Archived bool // The category of the finding. Possible values are: CLASSIFICATION, for a // sensitive data finding; and, POLICY, for a policy finding. Category FindingCategory // The details of a sensitive data finding. This value is null for a policy // finding. ClassificationDetails *ClassificationDetails // The total number of occurrences of the finding. For sensitive data findings, // this value is always 1. All sensitive data findings are considered unique. Count int64 // The date and time, in UTC and extended ISO 8601 format, when Amazon Macie // created the finding. CreatedAt *time.Time // The description of the finding. Description *string // The unique identifier for the finding. This is a random string that Amazon // Macie generates and assigns to a finding when it creates the finding. Id *string // The Amazon Web Services partition that Amazon Macie created the finding in. Partition *string // The details of a policy finding. This value is null for a sensitive data // finding. PolicyDetails *PolicyDetails // The Amazon Web Services Region that Amazon Macie created the finding in. Region *string // The resources that the finding applies to. ResourcesAffected *ResourcesAffected // Specifies whether the finding is a sample finding. A sample finding is a // finding that uses example data to demonstrate what a finding might contain. Sample bool // The version of the schema that was used to define the data structures in the // finding. SchemaVersion *string // The severity level and score for the finding. Severity *Severity // The brief description of the finding. Title *string // The type of the finding. Type FindingType // The date and time, in UTC and extended ISO 8601 format, when Amazon Macie last // updated the finding. For sensitive data findings, this value is the same as the // value for the createdAt property. All sensitive data findings are considered // new. UpdatedAt *time.Time noSmithyDocumentSerde } // Provides information about an action that occurred for a resource and produced // a policy finding. type FindingAction struct { // The type of action that occurred for the affected resource. This value is // typically AWS_API_CALL, which indicates that an entity invoked an API operation // for the resource. ActionType FindingActionType // The invocation details of the API operation that an entity invoked for the // affected resource, if the value for the actionType property is AWS_API_CALL. ApiCallDetails *ApiCallDetails noSmithyDocumentSerde } // Provides information about an entity that performed an action that produced a // policy finding for a resource. type FindingActor struct { // The domain name of the device that the entity used to perform the action on the // affected resource. DomainDetails *DomainDetails // The IP address of the device that the entity used to perform the action on the // affected resource. This object also provides information such as the owner and // geographic location for the IP address. IpAddressDetails *IpAddressDetails // The type and other characteristics of the entity that performed the action on // the affected resource. UserIdentity *UserIdentity noSmithyDocumentSerde } // Specifies, as a map, one or more property-based conditions that filter the // results of a query for findings. type FindingCriteria struct { // A condition that specifies the property, operator, and one or more values to // use to filter the results. Criterion map[string]CriterionAdditionalProperties noSmithyDocumentSerde } // Provides information about a findings filter. type FindingsFilterListItem struct { // The action that's performed on findings that match the filter criteria. // Possible values are: ARCHIVE, suppress (automatically archive) the findings; // and, NOOP, don't perform any action on the findings. Action FindingsFilterAction // The Amazon Resource Name (ARN) of the filter. Arn *string // The unique identifier for the filter. Id *string // The custom name of the filter. Name *string // A map of key-value pairs that specifies which tags (keys and values) are // associated with the filter. Tags map[string]string noSmithyDocumentSerde } // Specifies criteria for sorting the results of a query that retrieves aggregated // statistical data about findings. type FindingStatisticsSortCriteria struct { // The grouping to sort the results by. Valid values are: count, sort the results // by the number of findings in each group of results; and, groupKey, sort the // results by the name of each group of results. AttributeName FindingStatisticsSortAttributeName // The sort order to apply to the results, based on the value for the property // specified by the attributeName property. Valid values are: ASC, sort the results // in ascending order; and, DESC, sort the results in descending order. OrderBy OrderBy noSmithyDocumentSerde } // Provides a group of results for a query that retrieved aggregated statistical // data about findings. type GroupCount struct { // The total number of findings in the group of query results. Count int64 // The name of the property that defines the group in the query results, as // specified by the groupBy property in the query request. GroupKey *string noSmithyDocumentSerde } // Provides information about an Identity and Access Management (IAM) user who // performed an action on an affected resource. type IamUser struct { // The unique identifier for the Amazon Web Services account that's associated // with the IAM user who performed the action. AccountId *string // The Amazon Resource Name (ARN) of the principal that performed the action. The // last section of the ARN contains the name of the user who performed the action. Arn *string // The unique identifier for the IAM user who performed the action. PrincipalId *string // The username of the IAM user who performed the action. UserName *string noSmithyDocumentSerde } // Provides information about an Amazon Macie membership invitation. type Invitation struct { // The Amazon Web Services account ID for the account that sent the invitation. AccountId *string // The unique identifier for the invitation. InvitationId *string // The date and time, in UTC and extended ISO 8601 format, when the invitation was // sent. InvitedAt *time.Time // The status of the relationship between the account that sent the invitation and // the account that received the invitation. RelationshipStatus RelationshipStatus noSmithyDocumentSerde } // Provides information about the IP address of the device that an entity used to // perform an action on an affected resource. type IpAddressDetails struct { // The Internet Protocol version 4 (IPv4) address of the device. IpAddressV4 *string // The city that the IP address originated from. IpCity *IpCity // The country that the IP address originated from. IpCountry *IpCountry // The geographic coordinates of the location that the IP address originated from. IpGeoLocation *IpGeoLocation // The registered owner of the IP address. IpOwner *IpOwner noSmithyDocumentSerde } // Provides information about the city that an IP address originated from. type IpCity struct { // The name of the city. Name *string noSmithyDocumentSerde } // Provides information about the country that an IP address originated from. type IpCountry struct { // The two-character code, in ISO 3166-1 alpha-2 format, for the country that the // IP address originated from. For example, US for the United States. Code *string // The name of the country that the IP address originated from. Name *string noSmithyDocumentSerde } // Provides geographic coordinates that indicate where a specified IP address // originated from. type IpGeoLocation struct { // The latitude coordinate of the location, rounded to four decimal places. Lat float64 // The longitude coordinate of the location, rounded to four decimal places. Lon float64 noSmithyDocumentSerde } // Provides information about the registered owner of an IP address. type IpOwner struct { // The autonomous system number (ASN) for the autonomous system that included the // IP address. Asn *string // The organization identifier that's associated with the autonomous system number // (ASN) for the autonomous system that included the IP address. AsnOrg *string // The name of the internet service provider (ISP) that owned the IP address. Isp *string // The name of the organization that owned the IP address. Org *string noSmithyDocumentSerde } // Specifies whether any one-time or recurring classification jobs are configured // to analyze data in an S3 bucket, and, if so, the details of the job that ran // most recently. type JobDetails struct { // Specifies whether any one-time or recurring jobs are configured to analyze data // in the bucket. Possible values are: // - TRUE - The bucket is explicitly included in the bucket definition // (S3BucketDefinitionForJob) for one or more jobs and at least one of those jobs // has a status other than CANCELLED. Or the bucket matched the bucket criteria // (S3BucketCriteriaForJob) for at least one job that previously ran. // - FALSE - The bucket isn't explicitly included in the bucket definition // (S3BucketDefinitionForJob) for any jobs, all the jobs that explicitly include // the bucket in their bucket definitions have a status of CANCELLED, or the bucket // didn't match the bucket criteria (S3BucketCriteriaForJob) for any jobs that // previously ran. // - UNKNOWN - An exception occurred when Amazon Macie attempted to retrieve job // data for the bucket. IsDefinedInJob IsDefinedInJob // Specifies whether any recurring jobs are configured to analyze data in the // bucket. Possible values are: // - TRUE - The bucket is explicitly included in the bucket definition // (S3BucketDefinitionForJob) for one or more recurring jobs or the bucket matches // the bucket criteria (S3BucketCriteriaForJob) for one or more recurring jobs. At // least one of those jobs has a status other than CANCELLED. // - FALSE - The bucket isn't explicitly included in the bucket definition // (S3BucketDefinitionForJob) for any recurring jobs, the bucket doesn't match the // bucket criteria (S3BucketCriteriaForJob) for any recurring jobs, or all the // recurring jobs that are configured to analyze data in the bucket have a status // of CANCELLED. // - UNKNOWN - An exception occurred when Amazon Macie attempted to retrieve job // data for the bucket. IsMonitoredByJob IsMonitoredByJob // The unique identifier for the job that ran most recently and is configured to // analyze data in the bucket, either the latest run of a recurring job or the only // run of a one-time job. This value is typically null if the value for the // isDefinedInJob property is FALSE or UNKNOWN. LastJobId *string // The date and time, in UTC and extended ISO 8601 format, when the job // (lastJobId) started. If the job is a recurring job, this value indicates when // the most recent run started. This value is typically null if the value for the // isDefinedInJob property is FALSE or UNKNOWN. LastJobRunTime *time.Time noSmithyDocumentSerde } // Specifies the recurrence pattern for running a classification job. type JobScheduleFrequency struct { // Specifies a daily recurrence pattern for running the job. DailySchedule *DailySchedule // Specifies a monthly recurrence pattern for running the job. MonthlySchedule *MonthlySchedule // Specifies a weekly recurrence pattern for running the job. WeeklySchedule *WeeklySchedule noSmithyDocumentSerde } // Specifies a property- or tag-based condition that defines criteria for // including or excluding S3 objects from a classification job. A JobScopeTerm // object can contain only one simpleScopeTerm object or one tagScopeTerm object. type JobScopeTerm struct { // A property-based condition that defines a property, operator, and one or more // values for including or excluding objects from the job. SimpleScopeTerm *SimpleScopeTerm // A tag-based condition that defines the operator and tag keys or tag key and // value pairs for including or excluding objects from the job. TagScopeTerm *TagScopeTerm noSmithyDocumentSerde } // Specifies one or more property- and tag-based conditions that define criteria // for including or excluding S3 objects from a classification job. type JobScopingBlock struct { // An array of conditions, one for each property- or tag-based condition that // determines which objects to include or exclude from the job. If you specify more // than one condition, Amazon Macie uses AND logic to join the conditions. And []JobScopeTerm noSmithyDocumentSerde } // Provides information about a classification job, including the current status // of the job. type JobSummary struct { // The property- and tag-based conditions that determine which S3 buckets are // included or excluded from the job's analysis. Each time the job runs, the job // uses these criteria to determine which buckets to analyze. A job's definition // can contain a bucketCriteria object or a bucketDefinitions array, not both. BucketCriteria *S3BucketCriteriaForJob // An array of objects, one for each Amazon Web Services account that owns // specific S3 buckets for the job to analyze. Each object specifies the account ID // for an account and one or more buckets to analyze for that account. A job's // definition can contain a bucketDefinitions array or a bucketCriteria object, not // both. BucketDefinitions []S3BucketDefinitionForJob // The date and time, in UTC and extended ISO 8601 format, when the job was // created. CreatedAt *time.Time // The unique identifier for the job. JobId *string // The current status of the job. Possible values are: // - CANCELLED - You cancelled the job or, if it's a one-time job, you paused // the job and didn't resume it within 30 days. // - COMPLETE - For a one-time job, Amazon Macie finished processing the data // specified for the job. This value doesn't apply to recurring jobs. // - IDLE - For a recurring job, the previous scheduled run is complete and the // next scheduled run is pending. This value doesn't apply to one-time jobs. // - PAUSED - Macie started running the job but additional processing would // exceed the monthly sensitive data discovery quota for your account or one or // more member accounts that the job analyzes data for. // - RUNNING - For a one-time job, the job is in progress. For a recurring job, // a scheduled run is in progress. // - USER_PAUSED - You paused the job. If you paused the job while it had a // status of RUNNING and you don't resume it within 30 days of pausing it, the job // or job run will expire and be cancelled, depending on the job's type. To check // the expiration date, refer to the UserPausedDetails.jobExpiresAt property. JobStatus JobStatus // The schedule for running the job. Possible values are: // - ONE_TIME - The job runs only once. // - SCHEDULED - The job runs on a daily, weekly, or monthly basis. JobType JobType // Specifies whether any account- or bucket-level access errors occurred when the // job ran. For a recurring job, this value indicates the error status of the job's // most recent run. LastRunErrorStatus *LastRunErrorStatus // The custom name of the job. Name *string // If the current status of the job is USER_PAUSED, specifies when the job was // paused and when the job or job run will expire and be cancelled if it isn't // resumed. This value is present only if the value for jobStatus is USER_PAUSED. UserPausedDetails *UserPausedDetails noSmithyDocumentSerde } // Provides information about the tags that are associated with an S3 bucket or // object. Each tag consists of a required tag key and an associated tag value. type KeyValuePair struct { // One part of a key-value pair that comprises a tag. A tag key is a general label // that acts as a category for more specific tag values. Key *string // One part of a key-value pair that comprises a tag. A tag value acts as a // descriptor for a tag key. A tag value can be an empty string. Value *string noSmithyDocumentSerde } // Specifies whether any account- or bucket-level access errors occurred when a // classification job ran. For information about using logging data to investigate // these errors, see Monitoring sensitive data discovery jobs (https://docs.aws.amazon.com/macie/latest/user/discovery-jobs-monitor-cw-logs.html) // in the Amazon Macie User Guide. type LastRunErrorStatus struct { // Specifies whether any account- or bucket-level access errors occurred when the // job ran. For a recurring job, this value indicates the error status of the job's // most recent run. Possible values are: // - ERROR - One or more errors occurred. Amazon Macie didn't process all the // data specified for the job. // - NONE - No errors occurred. Macie processed all the data specified for the // job. Code LastRunErrorStatusCode noSmithyDocumentSerde } // Specifies criteria for filtering the results of a request for information about // classification jobs. type ListJobsFilterCriteria struct { // An array of objects, one for each condition that determines which jobs to // exclude from the results. Excludes []ListJobsFilterTerm // An array of objects, one for each condition that determines which jobs to // include in the results. Includes []ListJobsFilterTerm noSmithyDocumentSerde } // Specifies a condition that filters the results of a request for information // about classification jobs. Each condition consists of a property, an operator, // and one or more values. type ListJobsFilterTerm struct { // The operator to use to filter the results. Comparator JobComparator // The property to use to filter the results. Key ListJobsFilterKey // An array that lists one or more values to use to filter the results. Values []string noSmithyDocumentSerde } // Specifies criteria for sorting the results of a request for information about // classification jobs. type ListJobsSortCriteria struct { // The property to sort the results by. AttributeName ListJobsSortAttributeName // The sort order to apply to the results, based on the value for the property // specified by the attributeName property. Valid values are: ASC, sort the results // in ascending order; and, DESC, sort the results in descending order. OrderBy OrderBy noSmithyDocumentSerde } // Provides information about a managed data identifier. For additional // information, see Using managed data identifiers (https://docs.aws.amazon.com/macie/latest/user/managed-data-identifiers.html) // in the Amazon Macie User Guide. type ManagedDataIdentifierSummary struct { // The category of sensitive data that the managed data identifier detects: // CREDENTIALS, for credentials data such as private keys or Amazon Web Services // secret access keys; FINANCIAL_INFORMATION, for financial data such as credit // card numbers; or, PERSONAL_INFORMATION, for personal health information, such as // health insurance identification numbers, or personally identifiable information, // such as passport numbers. Category SensitiveDataItemCategory // The unique identifier for the managed data identifier. This is a string that // describes the type of sensitive data that the managed data identifier detects. // For example: OPENSSH_PRIVATE_KEY for OpenSSH private keys, CREDIT_CARD_NUMBER // for credit card numbers, or USA_PASSPORT_NUMBER for US passport numbers. Id *string noSmithyDocumentSerde } // Provides statistical data and other information about an S3 bucket that Amazon // Macie monitors and analyzes for your account. By default, object count and // storage size values include data for object parts that are the result of // incomplete multipart uploads. For more information, see How Macie monitors // Amazon S3 data security (https://docs.aws.amazon.com/macie/latest/user/monitoring-s3-how-it-works.html) // in the Amazon Macie User Guide. If an error occurs when Macie attempts to // retrieve and process information about the bucket or the bucket's objects, the // value for most of these properties is null. Key exceptions are accountId and // bucketName. To identify the cause of the error, refer to the errorCode and // errorMessage values. type MatchingBucket struct { // The unique identifier for the Amazon Web Services account that owns the bucket. AccountId *string // The name of the bucket. BucketName *string // The total number of objects that Amazon Macie can analyze in the bucket. These // objects use a supported storage class and have a file name extension for a // supported file or storage format. ClassifiableObjectCount int64 // The total storage size, in bytes, of the objects that Amazon Macie can analyze // in the bucket. These objects use a supported storage class and have a file name // extension for a supported file or storage format. If versioning is enabled for // the bucket, Macie calculates this value based on the size of the latest version // of each applicable object in the bucket. This value doesn't reflect the storage // size of all versions of each applicable object in the bucket. ClassifiableSizeInBytes int64 // The error code for an error that prevented Amazon Macie from retrieving and // processing information about the bucket and the bucket's objects. If this value // is ACCESS_DENIED, Macie doesn't have permission to retrieve the information. For // example, the bucket has a restrictive bucket policy and Amazon S3 denied the // request. If this value is null, Macie was able to retrieve and process the // information. ErrorCode BucketMetadataErrorCode // A brief description of the error (errorCode) that prevented Amazon Macie from // retrieving and processing information about the bucket and the bucket's objects. // This value is null if Macie was able to retrieve and process the information. ErrorMessage *string // Specifies whether any one-time or recurring classification jobs are configured // to analyze objects in the bucket, and, if so, the details of the job that ran // most recently. JobDetails *JobDetails // The date and time, in UTC and extended ISO 8601 format, when Amazon Macie most // recently analyzed data in the bucket while performing automated sensitive data // discovery for your account. This value is null if automated sensitive data // discovery is currently disabled for your account. LastAutomatedDiscoveryTime *time.Time // The total number of objects in the bucket. ObjectCount int64 // The total number of objects in the bucket, grouped by server-side encryption // type. This includes a grouping that reports the total number of objects that // aren't encrypted or use client-side encryption. ObjectCountByEncryptionType *ObjectCountByEncryptionType // The current sensitivity score for the bucket, ranging from -1 (classification // error) to 100 (sensitive). This value is null if automated sensitive data // discovery is currently disabled for your account. SensitivityScore int32 // The total storage size, in bytes, of the bucket. If versioning is enabled for // the bucket, Amazon Macie calculates this value based on the size of the latest // version of each object in the bucket. This value doesn't reflect the storage // size of all versions of each object in the bucket. SizeInBytes int64 // The total storage size, in bytes, of the objects that are compressed (.gz, // .gzip, .zip) files in the bucket. If versioning is enabled for the bucket, // Amazon Macie calculates this value based on the size of the latest version of // each applicable object in the bucket. This value doesn't reflect the storage // size of all versions of each applicable object in the bucket. SizeInBytesCompressed int64 // The total number of objects that Amazon Macie can't analyze in the bucket. // These objects don't use a supported storage class or don't have a file name // extension for a supported file or storage format. UnclassifiableObjectCount *ObjectLevelStatistics // The total storage size, in bytes, of the objects that Amazon Macie can't // analyze in the bucket. These objects don't use a supported storage class or // don't have a file name extension for a supported file or storage format. UnclassifiableObjectSizeInBytes *ObjectLevelStatistics noSmithyDocumentSerde } // Provides statistical data and other information about an Amazon Web Services // resource that Amazon Macie monitors and analyzes for your account. type MatchingResource struct { // The details of an S3 bucket that Amazon Macie monitors and analyzes. MatchingBucket *MatchingBucket noSmithyDocumentSerde } // Provides information about an account that's associated with an Amazon Macie // administrator account. type Member struct { // The Amazon Web Services account ID for the account. AccountId *string // The Amazon Web Services account ID for the administrator account. AdministratorAccountId *string // The Amazon Resource Name (ARN) of the account. Arn *string // The email address for the account. This value is null if the account is // associated with the administrator account through Organizations. Email *string // The date and time, in UTC and extended ISO 8601 format, when an Amazon Macie // membership invitation was last sent to the account. This value is null if a // Macie membership invitation hasn't been sent to the account. InvitedAt *time.Time // (Deprecated) The Amazon Web Services account ID for the administrator account. // This property has been replaced by the administratorAccountId property and is // retained only for backward compatibility. MasterAccountId *string // The current status of the relationship between the account and the // administrator account. RelationshipStatus RelationshipStatus // A map of key-value pairs that specifies which tags (keys and values) are // associated with the account in Amazon Macie. Tags map[string]string // The date and time, in UTC and extended ISO 8601 format, of the most recent // change to the status of the relationship between the account and the // administrator account. UpdatedAt *time.Time noSmithyDocumentSerde } // Specifies a monthly recurrence pattern for running a classification job. type MonthlySchedule struct { // The numeric day of the month when Amazon Macie runs the job. This value can be // an integer from 1 through 31. If this value exceeds the number of days in a // certain month, Macie doesn't run the job that month. Macie runs the job only // during months that have the specified day. For example, if this value is 31 and // a month has only 30 days, Macie doesn't run the job that month. To run the job // every month, specify a value that's less than 29. DayOfMonth int32 noSmithyDocumentSerde } // Provides information about the number of objects that are in an S3 bucket and // use certain types of server-side encryption, use client-side encryption, or // aren't encrypted. type ObjectCountByEncryptionType struct { // The total number of objects that are encrypted with a customer-provided key. // The objects use customer-provided server-side encryption (SSE-C). CustomerManaged int64 // The total number of objects that are encrypted with an KMS key, either an // Amazon Web Services managed key or a customer managed key. The objects use KMS // encryption (SSE-KMS). KmsManaged int64 // The total number of objects that are encrypted with an Amazon S3 managed key. // The objects use Amazon S3 managed encryption (SSE-S3). S3Managed int64 // The total number of objects that use client-side encryption or aren't encrypted. Unencrypted int64 // The total number of objects that Amazon Macie doesn't have current encryption // metadata for. Macie can't provide current data about the encryption settings for // these objects. Unknown int64 noSmithyDocumentSerde } // Provides information about the total storage size (in bytes) or number of // objects that Amazon Macie can't analyze in one or more S3 buckets. In a // BucketMetadata or MatchingBucket object, this data is for a specific bucket. In // a GetBucketStatisticsResponse object, this data is aggregated for all the // buckets in the query results. If versioning is enabled for a bucket, storage // size values are based on the size of the latest version of each applicable // object in the bucket. type ObjectLevelStatistics struct { // The total storage size (in bytes) or number of objects that Amazon Macie can't // analyze because the objects don't have a file name extension for a supported // file or storage format. FileType int64 // The total storage size (in bytes) or number of objects that Amazon Macie can't // analyze because the objects use an unsupported storage class. StorageClass int64 // The total storage size (in bytes) or number of objects that Amazon Macie can't // analyze because the objects use an unsupported storage class or don't have a // file name extension for a supported file or storage format. Total int64 noSmithyDocumentSerde } // Specifies the location of 1-15 occurrences of sensitive data that was detected // by a managed data identifier or a custom data identifier and produced a // sensitive data finding. type Occurrences struct { // An array of objects, one for each occurrence of sensitive data in a Microsoft // Excel workbook, CSV file, or TSV file. This value is null for all other types of // files. Each Cell object specifies a cell or field that contains the sensitive // data. Cells []Cell // An array of objects, one for each occurrence of sensitive data in an email // message or a non-binary text file such as an HTML, TXT, or XML file. Each Range // object specifies a line or inclusive range of lines that contains the sensitive // data, and the position of the data on the specified line or lines. This value is // often null for file types that are supported by Cell, Page, or Record objects. // Exceptions are the location of sensitive data in: unstructured sections of an // otherwise structured file, such as a comment in a file; a malformed file that // Amazon Macie analyzes as plain text; and, a CSV or TSV file that has any column // names that contain sensitive data. LineRanges []Range // Reserved for future use. OffsetRanges []Range // An array of objects, one for each occurrence of sensitive data in an Adobe // Portable Document Format file. This value is null for all other types of files. // Each Page object specifies a page that contains the sensitive data. Pages []Page // An array of objects, one for each occurrence of sensitive data in an Apache // Avro object container, Apache Parquet file, JSON file, or JSON Lines file. This // value is null for all other types of files. For an Avro object container or // Parquet file, each Record object specifies a record index and the path to a // field in a record that contains the sensitive data. For a JSON or JSON Lines // file, each Record object specifies the path to a field or array that contains // the sensitive data. For a JSON Lines file, it also specifies the index of the // line that contains the data. Records []Record noSmithyDocumentSerde } // Specifies the location of an occurrence of sensitive data in an Adobe Portable // Document Format file. type Page struct { // Reserved for future use. LineRange *Range // Reserved for future use. OffsetRange *Range // The page number of the page that contains the sensitive data. PageNumber int64 noSmithyDocumentSerde } // Provides the details of a policy finding. type PolicyDetails struct { // The action that produced the finding. Action *FindingAction // The entity that performed the action that produced the finding. Actor *FindingActor noSmithyDocumentSerde } // Specifies the location of an occurrence of sensitive data in an email message // or a non-binary text file such as an HTML, TXT, or XML file. type Range struct { // The number of lines from the beginning of the file to the end of the sensitive // data. End int64 // The number of lines from the beginning of the file to the beginning of the // sensitive data. Start int64 // The number of characters, with spaces and starting from 1, from the beginning // of the first line that contains the sensitive data (start) to the beginning of // the sensitive data. StartColumn int64 noSmithyDocumentSerde } // Specifies the location of an occurrence of sensitive data in an Apache Avro // object container, Apache Parquet file, JSON file, or JSON Lines file. type Record struct { // The path, as a JSONPath expression, to the sensitive data. For an Avro object // container or Parquet file, this is the path to the field in the record // (recordIndex) that contains the data. For a JSON or JSON Lines file, this is the // path to the field or array that contains the data. If the data is a value in an // array, the path also indicates which value contains the data. If Amazon Macie // detects sensitive data in the name of any element in the path, Macie omits this // field. If the name of an element exceeds 20 characters, Macie truncates the name // by removing characters from the beginning of the name. If the resulting full // path exceeds 250 characters, Macie also truncates the path, starting with the // first element in the path, until the path contains 250 or fewer characters. JsonPath *string // For an Avro object container or Parquet file, the record index, starting from // 0, for the record that contains the sensitive data. For a JSON Lines file, the // line index, starting from 0, for the line that contains the sensitive data. This // value is always 0 for JSON files. RecordIndex int64 noSmithyDocumentSerde } // Provides information about settings that define whether one or more objects in // an S3 bucket are replicated to S3 buckets for other Amazon Web Services accounts // and, if so, which accounts. type ReplicationDetails struct { // Specifies whether the bucket is configured to replicate one or more objects to // any destination. Replicated bool // Specifies whether the bucket is configured to replicate one or more objects to // a bucket for an Amazon Web Services account that isn't part of your Amazon Macie // organization. An Amazon Macie organization is a set of Macie accounts that are // centrally managed as a group of related accounts through Organizations or by // Macie invitation. ReplicatedExternally bool // An array of Amazon Web Services account IDs, one for each Amazon Web Services // account that owns a bucket that the bucket is configured to replicate one or // more objects to. ReplicationAccounts []string noSmithyDocumentSerde } // Provides information about an S3 object that Amazon Macie selected for analysis // while performing automated sensitive data discovery for an S3 bucket, and the // status and results of the analysis. This information is available only if // automated sensitive data discovery is currently enabled for your account. type ResourceProfileArtifact struct { // The Amazon Resource Name (ARN) of the object. // // This member is required. Arn *string // The status of the analysis. Possible values are: // - COMPLETE - Amazon Macie successfully completed its analysis of the object. // - PARTIAL - Macie analyzed only a subset of data in the object. For example, // the object is an archive file that contains files in an unsupported format. // - SKIPPED - Macie wasn't able to analyze the object. For example, the object // is a malformed file. // // This member is required. ClassificationResultStatus *string // Specifies whether Amazon Macie found sensitive data in the object. Sensitive bool noSmithyDocumentSerde } // Provides information about the resources that a finding applies to. type ResourcesAffected struct { // The details of the S3 bucket that the finding applies to. S3Bucket *S3Bucket // The details of the S3 object that the finding applies to. S3Object *S3Object noSmithyDocumentSerde } // Provides statistical data for sensitive data discovery metrics that apply to an // S3 bucket that Amazon Macie monitors and analyzes for your account. The // statistics capture the results of automated sensitive data discovery activities // that Macie has performed for the bucket. The data is available only if automated // sensitive data discovery is currently enabled for your account. type ResourceStatistics struct { // The total amount of data, in bytes, that Amazon Macie has analyzed in the // bucket. TotalBytesClassified int64 // The total number of occurrences of sensitive data that Amazon Macie has found // in the bucket's objects. This includes occurrences that are currently suppressed // by the sensitivity scoring settings for the bucket (totalDetectionsSuppressed). TotalDetections int64 // The total number of occurrences of sensitive data that are currently suppressed // by the sensitivity scoring settings for the bucket. These represent occurrences // of sensitive data that Amazon Macie found in the bucket's objects, but the // occurrences were manually suppressed. By default, suppressed occurrences are // excluded from the bucket's sensitivity score. TotalDetectionsSuppressed int64 // The total number of objects that Amazon Macie has analyzed in the bucket. TotalItemsClassified int64 // The total number of the bucket's objects that Amazon Macie has found sensitive // data in. TotalItemsSensitive int64 // The total number of objects that Amazon Macie wasn't able to analyze in the // bucket due to an object-level issue or error. For example, the object is a // malformed file. This value includes objects that Macie wasn't able to analyze // for reasons reported by other statistics in the ResourceStatistics object. TotalItemsSkipped int64 // The total number of objects that Amazon Macie wasn't able to analyze in the // bucket because the objects are encrypted with a key that Macie can't access. The // objects use server-side encryption with customer-provided keys (SSE-C). TotalItemsSkippedInvalidEncryption int64 // The total number of objects that Amazon Macie wasn't able to analyze in the // bucket because the objects are encrypted with KMS keys that were disabled, are // scheduled for deletion, or were deleted. TotalItemsSkippedInvalidKms int64 // The total number of objects that Amazon Macie wasn't able to analyze in the // bucket due to the permissions settings for the objects or the permissions // settings for the keys that were used to encrypt the objects. TotalItemsSkippedPermissionDenied int64 noSmithyDocumentSerde } // Specifies the configuration settings for retrieving occurrences of sensitive // data reported by findings, and the status of the configuration for an Amazon // Macie account. When you enable the configuration for the first time, your // request must specify an Key Management Service (KMS) key. Otherwise, an error // occurs. Macie uses the specified key to encrypt the sensitive data that you // retrieve. type RevealConfiguration struct { // The status of the configuration for the Amazon Macie account. In a request, // valid values are: ENABLED, enable the configuration for the account; and, // DISABLED, disable the configuration for the account. In a response, possible // values are: ENABLED, the configuration is currently enabled for the account; // and, DISABLED, the configuration is currently disabled for the account. // // This member is required. Status RevealStatus // The Amazon Resource Name (ARN), ID, or alias of the KMS key to use to encrypt // sensitive data that's retrieved. The key must be an existing, customer managed, // symmetric encryption key that's in the same Amazon Web Services Region as the // Amazon Macie account. If this value specifies an alias, it must include the // following prefix: alias/. If this value specifies a key that's owned by another // Amazon Web Services account, it must specify the ARN of the key or the ARN of // the key's alias. KmsKeyId *string noSmithyDocumentSerde } // Provides information about the S3 bucket that a finding applies to. type S3Bucket struct { // Specifies whether the bucket policy for the bucket requires server-side // encryption of objects when objects are added to the bucket. Possible values are: // // - FALSE - The bucket policy requires server-side encryption of new objects. // PutObject requests must include a valid server-side encryption header. // - TRUE - The bucket doesn't have a bucket policy or it has a bucket policy // that doesn't require server-side encryption of new objects. If a bucket policy // exists, it doesn't require PutObject requests to include a valid server-side // encryption header. // - UNKNOWN - Amazon Macie can't determine whether the bucket policy requires // server-side encryption of new objects. // Valid server-side encryption headers are: x-amz-server-side-encryption with a // value of AES256 or aws:kms, and x-amz-server-side-encryption-customer-algorithm // with a value of AES256. AllowsUnencryptedObjectUploads AllowsUnencryptedObjectUploads // The Amazon Resource Name (ARN) of the bucket. Arn *string // The date and time, in UTC and extended ISO 8601 format, when the bucket was // created. This value can also indicate when changes such as edits to the bucket's // policy were most recently made to the bucket, relative to when the finding was // created or last updated. CreatedAt *time.Time // The default server-side encryption settings for the bucket. DefaultServerSideEncryption *ServerSideEncryption // The name of the bucket. Name *string // The display name and canonical user ID for the Amazon Web Services account that // owns the bucket. Owner *S3BucketOwner // The permissions settings that determine whether the bucket is publicly // accessible. PublicAccess *BucketPublicAccess // The tags that are associated with the bucket. Tags []KeyValuePair noSmithyDocumentSerde } // Specifies property- and tag-based conditions that define criteria for including // or excluding S3 buckets from a classification job. Exclude conditions take // precedence over include conditions. type S3BucketCriteriaForJob struct { // The property- and tag-based conditions that determine which buckets to exclude // from the job. Excludes *CriteriaBlockForJob // The property- and tag-based conditions that determine which buckets to include // in the job. Includes *CriteriaBlockForJob noSmithyDocumentSerde } // Specifies an Amazon Web Services account that owns S3 buckets for a // classification job to analyze, and one or more specific buckets to analyze for // that account. type S3BucketDefinitionForJob struct { // The unique identifier for the Amazon Web Services account that owns the buckets. // // This member is required. AccountId *string // An array that lists the names of the buckets. // // This member is required. Buckets []string noSmithyDocumentSerde } // Provides information about the Amazon Web Services account that owns an S3 // bucket. type S3BucketOwner struct { // The display name of the account that owns the bucket. DisplayName *string // The canonical user ID for the account that owns the bucket. Id *string noSmithyDocumentSerde } // Specifies the S3 buckets that are excluded from automated sensitive data // discovery for an Amazon Macie account. type S3ClassificationScope struct { // The S3 buckets that are excluded. // // This member is required. Excludes *S3ClassificationScopeExclusion noSmithyDocumentSerde } // Specifies the names of the S3 buckets that are excluded from automated // sensitive data discovery. type S3ClassificationScopeExclusion struct { // An array of strings, one for each S3 bucket that is excluded. Each string is // the full name of an excluded bucket. // // This member is required. BucketNames []string noSmithyDocumentSerde } // Specifies S3 buckets to add or remove from the exclusion list defined by the // classification scope for an Amazon Macie account. type S3ClassificationScopeExclusionUpdate struct { // Depending on the value specified for the update operation // (ClassificationScopeUpdateOperation), an array of strings that: lists the names // of buckets to add or remove from the list, or specifies a new set of bucket // names that overwrites all existing names in the list. Each string must be the // full name of an S3 bucket. Values are case sensitive. // // This member is required. BucketNames []string // Specifies how to apply the changes to the exclusion list. Valid values are: // - ADD - Append the specified bucket names to the current list. // - REMOVE - Remove the specified bucket names from the current list. // - REPLACE - Overwrite the current list with the specified list of bucket // names. If you specify this value, Amazon Macie removes all existing names from // the list and adds all the specified names to the list. // // This member is required. Operation ClassificationScopeUpdateOperation noSmithyDocumentSerde } // Specifies changes to the list of S3 buckets that are excluded from automated // sensitive data discovery for an Amazon Macie account. type S3ClassificationScopeUpdate struct { // The names of the S3 buckets to add or remove from the list. // // This member is required. Excludes *S3ClassificationScopeExclusionUpdate noSmithyDocumentSerde } // Specifies an S3 bucket to store data classification results in, and the // encryption settings to use when storing results in that bucket. type S3Destination struct { // The name of the bucket. // // This member is required. BucketName *string // The Amazon Resource Name (ARN) of the customer managed KMS key to use for // encryption of the results. This must be the ARN of an existing, symmetric // encryption KMS key that's in the same Amazon Web Services Region as the bucket. // // This member is required. KmsKeyArn *string // The path prefix to use in the path to the location in the bucket. This prefix // specifies where to store classification results in the bucket. KeyPrefix *string noSmithyDocumentSerde } // Specifies which S3 buckets contain the objects that a classification job // analyzes, and the scope of that analysis. The bucket specification can be static // (bucketDefinitions) or dynamic (bucketCriteria). If it's static, the job // analyzes objects in the same predefined set of buckets each time the job runs. // If it's dynamic, the job analyzes objects in any buckets that match the // specified criteria each time the job starts to run. type S3JobDefinition struct { // The property- and tag-based conditions that determine which S3 buckets to // include or exclude from the analysis. Each time the job runs, the job uses these // criteria to determine which buckets contain objects to analyze. A job's // definition can contain a bucketCriteria object or a bucketDefinitions array, not // both. BucketCriteria *S3BucketCriteriaForJob // An array of objects, one for each Amazon Web Services account that owns // specific S3 buckets to analyze. Each object specifies the account ID for an // account and one or more buckets to analyze for that account. A job's definition // can contain a bucketDefinitions array or a bucketCriteria object, not both. BucketDefinitions []S3BucketDefinitionForJob // The property- and tag-based conditions that determine which S3 objects to // include or exclude from the analysis. Each time the job runs, the job uses these // criteria to determine which objects to analyze. Scoping *Scoping noSmithyDocumentSerde } // Provides information about the S3 object that a finding applies to. type S3Object struct { // The Amazon Resource Name (ARN) of the bucket that contains the object. BucketArn *string // The entity tag (ETag) that identifies the affected version of the object. If // the object was overwritten or changed after Amazon Macie produced the finding, // this value might be different from the current ETag for the object. ETag *string // The file name extension of the object. If the object doesn't have a file name // extension, this value is "". Extension *string // The full name (key) of the object, including the object's prefix if applicable. Key *string // The date and time, in UTC and extended ISO 8601 format, when the object was // last modified. LastModified *time.Time // The full path to the affected object, including the name of the affected bucket // and the object's name (key). Path *string // Specifies whether the object is publicly accessible due to the combination of // permissions settings that apply to the object. PublicAccess bool // The type of server-side encryption that was used to encrypt the object. ServerSideEncryption *ServerSideEncryption // The total storage size, in bytes, of the object. Size int64 // The storage class of the object. StorageClass StorageClass // The tags that are associated with the object. Tags []KeyValuePair // The identifier for the affected version of the object. VersionId *string noSmithyDocumentSerde } // Provides information about an S3 object that lists specific text to ignore. type S3WordsList struct { // The full name of the S3 bucket that contains the object. // // This member is required. BucketName *string // The full name (key) of the object. // // This member is required. ObjectKey *string noSmithyDocumentSerde } // Specifies one or more property- and tag-based conditions that define criteria // for including or excluding S3 objects from a classification job. Exclude // conditions take precedence over include conditions. type Scoping struct { // The property- and tag-based conditions that determine which objects to exclude // from the analysis. Excludes *JobScopingBlock // The property- and tag-based conditions that determine which objects to include // in the analysis. Includes *JobScopingBlock noSmithyDocumentSerde } // Specifies property- and tag-based conditions that define filter criteria for // including or excluding S3 buckets from the query results. Exclude conditions // take precedence over include conditions. type SearchResourcesBucketCriteria struct { // The property- and tag-based conditions that determine which buckets to exclude // from the results. Excludes *SearchResourcesCriteriaBlock // The property- and tag-based conditions that determine which buckets to include // in the results. Includes *SearchResourcesCriteriaBlock noSmithyDocumentSerde } // Specifies a property- or tag-based filter condition for including or excluding // Amazon Web Services resources from the query results. type SearchResourcesCriteria struct { // A property-based condition that defines a property, operator, and one or more // values for including or excluding resources from the results. SimpleCriterion *SearchResourcesSimpleCriterion // A tag-based condition that defines an operator and tag keys, tag values, or tag // key and value pairs for including or excluding resources from the results. TagCriterion *SearchResourcesTagCriterion noSmithyDocumentSerde } // Specifies property- and tag-based conditions that define filter criteria for // including or excluding Amazon Web Services resources from the query results. type SearchResourcesCriteriaBlock struct { // An array of objects, one for each property- or tag-based condition that // includes or excludes resources from the query results. If you specify more than // one condition, Amazon Macie uses AND logic to join the conditions. And []SearchResourcesCriteria noSmithyDocumentSerde } // Specifies a property-based filter condition that determines which Amazon Web // Services resources are included or excluded from the query results. type SearchResourcesSimpleCriterion struct { // The operator to use in the condition. Valid values are EQ (equals) and NE (not // equals). Comparator SearchResourcesComparator // The property to use in the condition. Key SearchResourcesSimpleCriterionKey // An array that lists one or more values to use in the condition. If you specify // multiple values, Amazon Macie uses OR logic to join the values. Valid values for // each supported property (key) are: // - ACCOUNT_ID - A string that represents the unique identifier for the Amazon // Web Services account that owns the resource. // - S3_BUCKET_EFFECTIVE_PERMISSION - A string that represents an enumerated // value that Macie defines for the BucketPublicAccess.effectivePermission (https://docs.aws.amazon.com/macie/latest/APIReference/datasources-s3.html#datasources-s3-prop-bucketpublicaccess-effectivepermission) // property of an S3 bucket. // - S3_BUCKET_NAME - A string that represents the name of an S3 bucket. // - S3_BUCKET_SHARED_ACCESS - A string that represents an enumerated value that // Macie defines for the BucketMetadata.sharedAccess (https://docs.aws.amazon.com/macie/latest/APIReference/datasources-s3.html#datasources-s3-prop-bucketmetadata-sharedaccess) // property of an S3 bucket. // Values are case sensitive. Also, Macie doesn't support use of partial values or // wildcard characters in values. Values []string noSmithyDocumentSerde } // Specifies criteria for sorting the results of a query for information about // Amazon Web Services resources that Amazon Macie monitors and analyzes. type SearchResourcesSortCriteria struct { // The property to sort the results by. AttributeName SearchResourcesSortAttributeName // The sort order to apply to the results, based on the value for the property // specified by the attributeName property. Valid values are: ASC, sort the results // in ascending order; and, DESC, sort the results in descending order. OrderBy OrderBy noSmithyDocumentSerde } // Specifies a tag-based filter condition that determines which Amazon Web // Services resources are included or excluded from the query results. type SearchResourcesTagCriterion struct { // The operator to use in the condition. Valid values are EQ (equals) and NE (not // equals). Comparator SearchResourcesComparator // The tag keys, tag values, or tag key and value pairs to use in the condition. TagValues []SearchResourcesTagCriterionPair noSmithyDocumentSerde } // Specifies a tag key, a tag value, or a tag key and value (as a pair) to use in // a tag-based filter condition for a query. Tag keys and values are case // sensitive. Also, Amazon Macie doesn't support use of partial values or wildcard // characters in tag-based filter conditions. type SearchResourcesTagCriterionPair struct { // The value for the tag key to use in the condition. Key *string // The tag value to use in the condition. Value *string noSmithyDocumentSerde } // Specifies configuration settings that determine which findings are published to // Security Hub automatically. For information about how Macie publishes findings // to Security Hub, see Amazon Macie integration with Security Hub (https://docs.aws.amazon.com/macie/latest/user/securityhub-integration.html) // in the Amazon Macie User Guide. type SecurityHubConfiguration struct { // Specifies whether to publish sensitive data findings to Security Hub. If you // set this value to true, Amazon Macie automatically publishes all sensitive data // findings that weren't suppressed by a findings filter. The default value is // false. // // This member is required. PublishClassificationFindings bool // Specifies whether to publish policy findings to Security Hub. If you set this // value to true, Amazon Macie automatically publishes all new and updated policy // findings that weren't suppressed by a findings filter. The default value is // true. // // This member is required. PublishPolicyFindings bool noSmithyDocumentSerde } // Provides information about the category, types, and occurrences of sensitive // data that produced a sensitive data finding. type SensitiveDataItem struct { // The category of sensitive data that was detected. For example: CREDENTIALS, for // credentials data such as private keys or Amazon Web Services secret access keys; // FINANCIAL_INFORMATION, for financial data such as credit card numbers; or, // PERSONAL_INFORMATION, for personal health information, such as health insurance // identification numbers, or personally identifiable information, such as passport // numbers. Category SensitiveDataItemCategory // An array of objects, one for each type of sensitive data that was detected. // Each object reports the number of occurrences of a specific type of sensitive // data that was detected, and the location of up to 15 of those occurrences. Detections []DefaultDetection // The total number of occurrences of the sensitive data that was detected. TotalCount int64 noSmithyDocumentSerde } // Provides aggregated statistical data for sensitive data discovery metrics that // apply to S3 buckets. Each field contains aggregated data for all the buckets // that have a sensitivity score (sensitivityScore) of a specified value or within // a specified range (BucketStatisticsBySensitivity). If automated sensitive data // discovery is currently disabled for your account, the value for each field is 0. type SensitivityAggregations struct { // The total storage size, in bytes, of all the objects that Amazon Macie can // analyze in the buckets. These objects use a supported storage class and have a // file name extension for a supported file or storage format. If versioning is // enabled for any of the buckets, this value is based on the size of the latest // version of each applicable object in the buckets. This value doesn't reflect the // storage size of all versions of all applicable objects in the buckets. ClassifiableSizeInBytes int64 // The total number of buckets that are publicly accessible due to a combination // of permissions settings for each bucket. PubliclyAccessibleCount int64 // The total number of buckets. TotalCount int64 // The total storage size, in bytes, of the buckets. If versioning is enabled for // any of the buckets, this value is based on the size of the latest version of // each object in the buckets. This value doesn't reflect the storage size of all // versions of the objects in the buckets. TotalSizeInBytes int64 noSmithyDocumentSerde } // Specifies managed data identifiers to exclude (not use) when performing // automated sensitive data discovery for an Amazon Macie account. For information // about the managed data identifiers that Amazon Macie currently provides, see // Using managed data identifiers (https://docs.aws.amazon.com/macie/latest/user/managed-data-identifiers.html) // in the Amazon Macie User Guide. type SensitivityInspectionTemplateExcludes struct { // An array of unique identifiers, one for each managed data identifier to // exclude. To retrieve a list of valid values, use the ListManagedDataIdentifiers // operation. ManagedDataIdentifierIds []string noSmithyDocumentSerde } // Specifies the allow lists, custom data identifiers, and managed data // identifiers to include (use) when performing automated sensitive data discovery // for an Amazon Macie account. The configuration must specify at least one custom // data identifier or managed data identifier. For information about the managed // data identifiers that Amazon Macie currently provides, see Using managed data // identifiers (https://docs.aws.amazon.com/macie/latest/user/managed-data-identifiers.html) // in the Amazon Macie User Guide. type SensitivityInspectionTemplateIncludes struct { // An array of unique identifiers, one for each allow list to include. AllowListIds []string // An array of unique identifiers, one for each custom data identifier to include. CustomDataIdentifierIds []string // An array of unique identifiers, one for each managed data identifier to // include. Amazon Macie uses these managed data identifiers in addition to managed // data identifiers that are subsequently released and recommended for automated // sensitive data discovery. To retrieve a list of valid values for the managed // data identifiers that are currently available, use the // ListManagedDataIdentifiers operation. ManagedDataIdentifierIds []string noSmithyDocumentSerde } // Provides information about the sensitivity inspection template for an Amazon // Macie account. Macie uses the template's settings when it performs automated // sensitive data discovery for the account. type SensitivityInspectionTemplatesEntry struct { // The unique identifier for the sensitivity inspection template. Id *string // The name of the sensitivity inspection template: // automated-sensitive-data-discovery. Name *string noSmithyDocumentSerde } // Provides information about the default server-side encryption settings for an // S3 bucket or the encryption settings for an S3 object. type ServerSideEncryption struct { // The server-side encryption algorithm that's used when storing data in the // bucket or object. If default encryption settings aren't configured for the // bucket or the object isn't encrypted using server-side encryption, this value is // NONE. EncryptionType EncryptionType // The Amazon Resource Name (ARN) or unique identifier (key ID) for the KMS key // that's used to encrypt data in the bucket or the object. This value is null if // an KMS key isn't used to encrypt the data. KmsMasterKeyId *string noSmithyDocumentSerde } // Specifies a current quota for an Amazon Macie account. type ServiceLimit struct { // Specifies whether the account has met the quota that corresponds to the metric // specified by the UsageByAccount.type field in the response. IsServiceLimited bool // The unit of measurement for the value specified by the value field. Unit Unit // The value for the metric specified by the UsageByAccount.type field in the // response. Value int64 noSmithyDocumentSerde } // Provides information about a session that was created for an entity that // performed an action by using temporary security credentials. type SessionContext struct { // The date and time when the credentials were issued, and whether the credentials // were authenticated with a multi-factor authentication (MFA) device. Attributes *SessionContextAttributes // The source and type of credentials that were issued to the entity. SessionIssuer *SessionIssuer noSmithyDocumentSerde } // Provides information about the context in which temporary security credentials // were issued to an entity. type SessionContextAttributes struct { // The date and time, in UTC and ISO 8601 format, when the credentials were issued. CreationDate *time.Time // Specifies whether the credentials were authenticated with a multi-factor // authentication (MFA) device. MfaAuthenticated bool noSmithyDocumentSerde } // Provides information about the source and type of temporary security // credentials that were issued to an entity. type SessionIssuer struct { // The unique identifier for the Amazon Web Services account that owns the entity // that was used to get the credentials. AccountId *string // The Amazon Resource Name (ARN) of the source account, Identity and Access // Management (IAM) user, or role that was used to get the credentials. Arn *string // The unique identifier for the entity that was used to get the credentials. PrincipalId *string // The source of the temporary security credentials, such as Root, IAMUser, or // Role. Type *string // The name or alias of the user or role that issued the session. This value is // null if the credentials were obtained from a root account that doesn't have an // alias. UserName *string noSmithyDocumentSerde } // Provides the numerical and qualitative representations of a finding's severity. type Severity struct { // The qualitative representation of the finding's severity, ranging from Low // (least severe) to High (most severe). Description SeverityDescription // The numerical representation of the finding's severity, ranging from 1 (least // severe) to 3 (most severe). Score int64 noSmithyDocumentSerde } // Specifies a severity level for findings that a custom data identifier produces. // A severity level determines which severity is assigned to the findings, based on // the number of occurrences of text that match the custom data identifier's // detection criteria. type SeverityLevel struct { // The minimum number of occurrences of text that must match the custom data // identifier's detection criteria in order to produce a finding with the specified // severity (severity). // // This member is required. OccurrencesThreshold int64 // The severity to assign to a finding: if the number of occurrences is greater // than or equal to the specified threshold (occurrencesThreshold); and, if // applicable, the number of occurrences is less than the threshold for the next // consecutive severity level for the custom data identifier, moving from LOW to // HIGH. // // This member is required. Severity DataIdentifierSeverity noSmithyDocumentSerde } // Specifies a property-based condition that determines whether an S3 bucket is // included or excluded from a classification job. type SimpleCriterionForJob struct { // The operator to use in the condition. Valid values are EQ (equals) and NE (not // equals). Comparator JobComparator // The property to use in the condition. Key SimpleCriterionKeyForJob // An array that lists one or more values to use in the condition. If you specify // multiple values, Amazon Macie uses OR logic to join the values. Valid values for // each supported property (key) are: // - ACCOUNT_ID - A string that represents the unique identifier for the Amazon // Web Services account that owns the bucket. // - S3_BUCKET_EFFECTIVE_PERMISSION - A string that represents an enumerated // value that Macie defines for the BucketPublicAccess.effectivePermission (https://docs.aws.amazon.com/macie/latest/APIReference/datasources-s3.html#datasources-s3-prop-bucketpublicaccess-effectivepermission) // property of a bucket. // - S3_BUCKET_NAME - A string that represents the name of a bucket. // - S3_BUCKET_SHARED_ACCESS - A string that represents an enumerated value that // Macie defines for the BucketMetadata.sharedAccess (https://docs.aws.amazon.com/macie/latest/APIReference/datasources-s3.html#datasources-s3-prop-bucketmetadata-sharedaccess) // property of a bucket. // Values are case sensitive. Also, Macie doesn't support use of partial values or // wildcard characters in these values. Values []string noSmithyDocumentSerde } // Specifies a property-based condition that determines whether an S3 object is // included or excluded from a classification job. type SimpleScopeTerm struct { // The operator to use in the condition. Valid values for each supported property // (key) are: // - OBJECT_EXTENSION - EQ (equals) or NE (not equals) // - OBJECT_KEY - STARTS_WITH // - OBJECT_LAST_MODIFIED_DATE - Any operator except CONTAINS // - OBJECT_SIZE - Any operator except CONTAINS Comparator JobComparator // The object property to use in the condition. Key ScopeFilterKey // An array that lists the values to use in the condition. If the value for the // key property is OBJECT_EXTENSION or OBJECT_KEY, this array can specify multiple // values and Amazon Macie uses OR logic to join the values. Otherwise, this array // can specify only one value. Valid values for each supported property (key) are: // - OBJECT_EXTENSION - A string that represents the file name extension of an // object. For example: docx or pdf // - OBJECT_KEY - A string that represents the key prefix (folder name or path) // of an object. For example: logs or awslogs/eventlogs. This value applies a // condition to objects whose keys (names) begin with the specified value. // - OBJECT_LAST_MODIFIED_DATE - The date and time (in UTC and extended ISO 8601 // format) when an object was created or last changed, whichever is latest. For // example: 2020-09-28T14:31:13Z // - OBJECT_SIZE - An integer that represents the storage size (in bytes) of an // object. // Macie doesn't support use of wildcard characters in these values. Also, string // values are case sensitive. Values []string noSmithyDocumentSerde } // Specifies criteria for sorting the results of a request for findings. type SortCriteria struct { // The name of the property to sort the results by. Valid values are: count, // createdAt, policyDetails.action.apiCallDetails.firstSeen, // policyDetails.action.apiCallDetails.lastSeen, resourcesAffected, severity.score, // type, and updatedAt. AttributeName *string // The sort order to apply to the results, based on the value for the property // specified by the attributeName property. Valid values are: ASC, sort the results // in ascending order; and, DESC, sort the results in descending order. OrderBy OrderBy noSmithyDocumentSerde } // Provides processing statistics for a classification job. type Statistics struct { // The approximate number of objects that the job has yet to process during its // current run. ApproximateNumberOfObjectsToProcess float64 // The number of times that the job has run. NumberOfRuns float64 noSmithyDocumentSerde } // Specifies a custom data identifier or managed data identifier that detected a // type of sensitive data to start excluding or including in an S3 bucket's // sensitivity score. type SuppressDataIdentifier struct { // The unique identifier for the custom data identifier or managed data identifier // that detected the type of sensitive data to exclude or include in the score. Id *string // The type of data identifier that detected the sensitive data. Possible values // are: CUSTOM, for a custom data identifier; and, MANAGED, for a managed data // identifier. Type DataIdentifierType noSmithyDocumentSerde } // Specifies a tag-based condition that determines whether an S3 bucket is // included or excluded from a classification job. type TagCriterionForJob struct { // The operator to use in the condition. Valid values are EQ (equals) and NE (not // equals). Comparator JobComparator // The tag keys, tag values, or tag key and value pairs to use in the condition. TagValues []TagCriterionPairForJob noSmithyDocumentSerde } // Specifies a tag key, a tag value, or a tag key and value (as a pair) to use in // a tag-based condition that determines whether an S3 bucket is included or // excluded from a classification job. Tag keys and values are case sensitive. // Also, Amazon Macie doesn't support use of partial values or wildcard characters // in tag-based conditions. type TagCriterionPairForJob struct { // The value for the tag key to use in the condition. Key *string // The tag value to use in the condition. Value *string noSmithyDocumentSerde } // Specifies a tag-based condition that determines whether an S3 object is // included or excluded from a classification job. type TagScopeTerm struct { // The operator to use in the condition. Valid values are EQ (equals) or NE (not // equals). Comparator JobComparator // The object property to use in the condition. The only valid value is TAG. Key *string // The tag keys or tag key and value pairs to use in the condition. To specify // only tag keys in a condition, specify the keys in this array and set the value // for each associated tag value to an empty string. TagValues []TagValuePair // The type of object to apply the condition to. Target TagTarget noSmithyDocumentSerde } // Specifies a tag key or tag key and value pair to use in a tag-based condition // that determines whether an S3 object is included or excluded from a // classification job. Tag keys and values are case sensitive. Also, Amazon Macie // doesn't support use of partial values or wildcard characters in tag-based // conditions. type TagValuePair struct { // The value for the tag key to use in the condition. Key *string // The tag value, associated with the specified tag key (key), to use in the // condition. To specify only a tag key for a condition, specify the tag key for // the key property and set this value to an empty string. Value *string noSmithyDocumentSerde } // Provides information about an account-related request that hasn't been // processed. type UnprocessedAccount struct { // The Amazon Web Services account ID for the account that the request applies to. AccountId *string // The source of the issue or delay in processing the request. ErrorCode ErrorCode // The reason why the request hasn't been processed. ErrorMessage *string noSmithyDocumentSerde } // Provides data for a specific usage metric and the corresponding quota for an // Amazon Macie account. type UsageByAccount struct { // The type of currency that the value for the metric (estimatedCost) is reported // in. Currency Currency // The estimated value for the metric. EstimatedCost *string // The current value for the quota that corresponds to the metric specified by the // type field. ServiceLimit *ServiceLimit // The name of the metric. Possible values are: AUTOMATED_OBJECT_MONITORING, to // monitor S3 objects for automated sensitive data discovery; // AUTOMATED_SENSITIVE_DATA_DISCOVERY, to analyze S3 objects for automated // sensitive data discovery; DATA_INVENTORY_EVALUATION, to monitor S3 buckets; and, // SENSITIVE_DATA_DISCOVERY, to run classification jobs. Type UsageType noSmithyDocumentSerde } // Provides quota and aggregated usage data for an Amazon Macie account. type UsageRecord struct { // The unique identifier for the Amazon Web Services account that the data applies // to. AccountId *string // The date and time, in UTC and extended ISO 8601 format, when the free trial of // automated sensitive data discovery started for the account. If the account is a // member account in an organization, this value is the same as the value for the // organization's Amazon Macie administrator account. AutomatedDiscoveryFreeTrialStartDate *time.Time // The date and time, in UTC and extended ISO 8601 format, when the Amazon Macie // free trial started for the account. FreeTrialStartDate *time.Time // An array of objects that contains usage data and quotas for the account. Each // object contains the data for a specific usage metric and the corresponding // quota. Usage []UsageByAccount noSmithyDocumentSerde } // Specifies a condition for filtering the results of a query for quota and usage // data for one or more Amazon Macie accounts. type UsageStatisticsFilter struct { // The operator to use in the condition. If the value for the key property is // accountId, this value must be CONTAINS. If the value for the key property is any // other supported field, this value can be EQ, GT, GTE, LT, LTE, or NE. Comparator UsageStatisticsFilterComparator // The field to use in the condition. Key UsageStatisticsFilterKey // An array that lists values to use in the condition, based on the value for the // field specified by the key property. If the value for the key property is // accountId, this array can specify multiple values. Otherwise, this array can // specify only one value. Valid values for each supported field are: // - accountId - The unique identifier for an Amazon Web Services account. // - freeTrialStartDate - The date and time, in UTC and extended ISO 8601 // format, when the Amazon Macie free trial started for an account. // - serviceLimit - A Boolean (true or false) value that indicates whether an // account has reached its monthly quota. // - total - A string that represents the current estimated cost for an account. Values []string noSmithyDocumentSerde } // Specifies criteria for sorting the results of a query for Amazon Macie account // quotas and usage data. type UsageStatisticsSortBy struct { // The field to sort the results by. Key UsageStatisticsSortKey // The sort order to apply to the results, based on the value for the field // specified by the key property. Valid values are: ASC, sort the results in // ascending order; and, DESC, sort the results in descending order. OrderBy OrderBy noSmithyDocumentSerde } // Provides aggregated data for an Amazon Macie usage metric. The value for the // metric reports estimated usage data for an account for the preceding 30 days or // the current calendar month to date, depending on the time period (timeRange) // specified in the request. type UsageTotal struct { // The type of currency that the value for the metric (estimatedCost) is reported // in. Currency Currency // The estimated value for the metric. EstimatedCost *string // The name of the metric. Possible values are: AUTOMATED_OBJECT_MONITORING, to // monitor S3 objects for automated sensitive data discovery; // AUTOMATED_SENSITIVE_DATA_DISCOVERY, to analyze S3 objects for automated // sensitive data discovery; DATA_INVENTORY_EVALUATION, to monitor S3 buckets; and, // SENSITIVE_DATA_DISCOVERY, to run classification jobs. Type UsageType noSmithyDocumentSerde } // Provides information about the type and other characteristics of an entity that // performed an action on an affected resource. type UserIdentity struct { // If the action was performed with temporary security credentials that were // obtained using the AssumeRole operation of the Security Token Service (STS) API, // the identifiers, session context, and other details about the identity. AssumedRole *AssumedRole // If the action was performed using the credentials for another Amazon Web // Services account, the details of that account. AwsAccount *AwsAccount // If the action was performed by an Amazon Web Services account that belongs to // an Amazon Web Service, the name of the service. AwsService *AwsService // If the action was performed with temporary security credentials that were // obtained using the GetFederationToken operation of the Security Token Service // (STS) API, the identifiers, session context, and other details about the // identity. FederatedUser *FederatedUser // If the action was performed using the credentials for an Identity and Access // Management (IAM) user, the name and other details about the user. IamUser *IamUser // If the action was performed using the credentials for your Amazon Web Services // account, the details of your account. Root *UserIdentityRoot // The type of entity that performed the action. Type UserIdentityType noSmithyDocumentSerde } // Provides information about an Amazon Web Services account and entity that // performed an action on an affected resource. The action was performed using the // credentials for your Amazon Web Services account. type UserIdentityRoot struct { // The unique identifier for the Amazon Web Services account. AccountId *string // The Amazon Resource Name (ARN) of the principal that performed the action. The // last section of the ARN contains the name of the user or role that performed the // action. Arn *string // The unique identifier for the entity that performed the action. PrincipalId *string noSmithyDocumentSerde } // Provides information about when a classification job was paused. For a one-time // job, this object also specifies when the job will expire and be cancelled if it // isn't resumed. For a recurring job, this object also specifies when the paused // job run will expire and be cancelled if it isn't resumed. This object is present // only if a job's current status (jobStatus) is USER_PAUSED. The information in // this object applies only to a job that was paused while it had a status of // RUNNING. type UserPausedDetails struct { // The date and time, in UTC and extended ISO 8601 format, when the job or job run // will expire and be cancelled if you don't resume it first. JobExpiresAt *time.Time // The Amazon Resource Name (ARN) of the Health event that Amazon Macie sent to // notify you of the job or job run's pending expiration and cancellation. This // value is null if a job has been paused for less than 23 days. JobImminentExpirationHealthEventArn *string // The date and time, in UTC and extended ISO 8601 format, when you paused the job. JobPausedAt *time.Time noSmithyDocumentSerde } // Specifies a weekly recurrence pattern for running a classification job. type WeeklySchedule struct { // The day of the week when Amazon Macie runs the job. DayOfWeek DayOfWeek noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
3,253
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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 = "ManagedBlockchain" const ServiceAPIVersion = "2018-09-24" // Client provides the API client to make operations call for Amazon Managed // Blockchain. 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, "managedblockchain", goModuleVersion)(stack) } func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ CredentialsProvider: o.Credentials, Signer: o.HTTPSignerV4, LogSigning: o.ClientLogMode.IsSigning(), }) return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error } func resolveHTTPSignerV4(o *Options) { if o.HTTPSignerV4 != nil { return } o.HTTPSignerV4 = newDefaultV4Signer(*o) } func newDefaultV4Signer(o Options) *v4.Signer { return v4.NewSigner(func(so *v4.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() }) } func resolveIdempotencyTokenProvider(o *Options) { if o.IdempotencyTokenProvider != nil { return } o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, LogRetryAttempts: o.ClientLogMode.IsRetries(), } return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseDualStackEndpoint = value } return nil } // resolves FIPS endpoint configuration func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseFIPSEndpoint = value } return nil } // IdempotencyTokenProvider interface for providing idempotency token type IdempotencyTokenProvider interface { GetIdempotencyToken() (string, error) } func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ LogRequest: o.ClientLogMode.IsRequest(), LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), LogResponse: o.ClientLogMode.IsResponse(), LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) }
455
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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 managedblockchain 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/managedblockchain/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new accessor for use with Managed Blockchain Ethereum nodes. An // accessor contains information required for token based access to your Ethereum // nodes. func (c *Client) CreateAccessor(ctx context.Context, params *CreateAccessorInput, optFns ...func(*Options)) (*CreateAccessorOutput, error) { if params == nil { params = &CreateAccessorInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateAccessor", params, optFns, c.addOperationCreateAccessorMiddlewares) if err != nil { return nil, err } out := result.(*CreateAccessorOutput) out.ResultMetadata = metadata return out, nil } type CreateAccessorInput struct { // The type of accessor. Currently, accessor type is restricted to BILLING_TOKEN . // // This member is required. AccessorType types.AccessorType // This is a unique, case-sensitive identifier that you provide to ensure the // idempotency of the operation. An idempotent operation completes no more than // once. This identifier is required only if you make a service request directly // using an HTTP client. It is generated automatically if you use an Amazon Web // Services SDK or the Amazon Web Services CLI. // // This member is required. ClientRequestToken *string // Tags to assign to the Accessor. Each tag consists of a key and an optional // value. You can specify multiple key-value pairs in a single request with an // overall maximum of 50 tags allowed per resource. For more information about // tags, see Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html) // in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html) // in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. Tags map[string]string noSmithyDocumentSerde } type CreateAccessorOutput struct { // The unique identifier of the accessor. AccessorId *string // The billing token is a property of the Accessor. Use this token to make // Ethereum API calls to your Ethereum node. The billing token is used to track // your accessor object for billing Ethereum API requests made to your Ethereum // nodes. BillingToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateAccessorMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateAccessor{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateAccessor{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opCreateAccessorMiddleware(stack, options); err != nil { return err } if err = addOpCreateAccessorValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAccessor(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateAccessor struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateAccessor) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateAccessor) 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.(*CreateAccessorInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateAccessorInput ") } if input.ClientRequestToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientRequestToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateAccessorMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateAccessor{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateAccessor(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "CreateAccessor", } }
187
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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/managedblockchain/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a member within a Managed Blockchain network. Applies only to // Hyperledger Fabric. func (c *Client) CreateMember(ctx context.Context, params *CreateMemberInput, optFns ...func(*Options)) (*CreateMemberOutput, error) { if params == nil { params = &CreateMemberInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateMember", params, optFns, c.addOperationCreateMemberMiddlewares) if err != nil { return nil, err } out := result.(*CreateMemberOutput) out.ResultMetadata = metadata return out, nil } type CreateMemberInput struct { // A unique, case-sensitive identifier that you provide to ensure the idempotency // of the operation. An idempotent operation completes no more than one time. This // identifier is required only if you make a service request directly using an HTTP // client. It is generated automatically if you use an Amazon Web Services SDK or // the CLI. // // This member is required. ClientRequestToken *string // The unique identifier of the invitation that is sent to the member to join the // network. // // This member is required. InvitationId *string // Member configuration parameters. // // This member is required. MemberConfiguration *types.MemberConfiguration // The unique identifier of the network in which the member is created. // // This member is required. NetworkId *string noSmithyDocumentSerde } type CreateMemberOutput struct { // The unique identifier of the member. MemberId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateMemberMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateMember{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateMember{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opCreateMemberMiddleware(stack, options); err != nil { return err } if err = addOpCreateMemberValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateMember(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateMember struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateMember) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateMember) 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.(*CreateMemberInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateMemberInput ") } if input.ClientRequestToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientRequestToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateMemberMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateMember{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateMember(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "CreateMember", } }
183
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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/managedblockchain/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new blockchain network using Amazon Managed Blockchain. Applies only // to Hyperledger Fabric. func (c *Client) CreateNetwork(ctx context.Context, params *CreateNetworkInput, optFns ...func(*Options)) (*CreateNetworkOutput, error) { if params == nil { params = &CreateNetworkInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateNetwork", params, optFns, c.addOperationCreateNetworkMiddlewares) if err != nil { return nil, err } out := result.(*CreateNetworkOutput) out.ResultMetadata = metadata return out, nil } type CreateNetworkInput struct { // This is a unique, case-sensitive identifier that you provide to ensure the // idempotency of the operation. An idempotent operation completes no more than // once. This identifier is required only if you make a service request directly // using an HTTP client. It is generated automatically if you use an Amazon Web // Services SDK or the Amazon Web Services CLI. // // This member is required. ClientRequestToken *string // The blockchain framework that the network uses. // // This member is required. Framework types.Framework // The version of the blockchain framework that the network uses. // // This member is required. FrameworkVersion *string // Configuration properties for the first member within the network. // // This member is required. MemberConfiguration *types.MemberConfiguration // The name of the network. // // This member is required. Name *string // The voting rules used by the network to determine if a proposal is approved. // // This member is required. VotingPolicy *types.VotingPolicy // An optional description for the network. Description *string // Configuration properties of the blockchain framework relevant to the network // configuration. FrameworkConfiguration *types.NetworkFrameworkConfiguration // Tags to assign to the network. Each tag consists of a key and an optional // value. You can specify multiple key-value pairs in a single request with an // overall maximum of 50 tags allowed per resource. For more information about // tags, see Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html) // in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html) // in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. Tags map[string]string noSmithyDocumentSerde } type CreateNetworkOutput struct { // The unique identifier for the first member within the network. MemberId *string // The unique identifier for the network. NetworkId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateNetworkMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateNetwork{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateNetwork{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opCreateNetworkMiddleware(stack, options); err != nil { return err } if err = addOpCreateNetworkValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateNetwork(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateNetwork struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateNetwork) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateNetwork) 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.(*CreateNetworkInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateNetworkInput ") } if input.ClientRequestToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientRequestToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateNetworkMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateNetwork{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateNetwork(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "CreateNetwork", } }
210
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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/managedblockchain/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a node on the specified blockchain network. Applies to Hyperledger // Fabric and Ethereum. func (c *Client) CreateNode(ctx context.Context, params *CreateNodeInput, optFns ...func(*Options)) (*CreateNodeOutput, error) { if params == nil { params = &CreateNodeInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateNode", params, optFns, c.addOperationCreateNodeMiddlewares) if err != nil { return nil, err } out := result.(*CreateNodeOutput) out.ResultMetadata = metadata return out, nil } type CreateNodeInput struct { // A unique, case-sensitive identifier that you provide to ensure the idempotency // of the operation. An idempotent operation completes no more than one time. This // identifier is required only if you make a service request directly using an HTTP // client. It is generated automatically if you use an Amazon Web Services SDK or // the CLI. // // This member is required. ClientRequestToken *string // The unique identifier of the network for the node. Ethereum public networks // have the following NetworkId s: // - n-ethereum-mainnet // - n-ethereum-goerli // - n-ethereum-rinkeby // // This member is required. NetworkId *string // The properties of a node configuration. // // This member is required. NodeConfiguration *types.NodeConfiguration // The unique identifier of the member that owns this node. Applies only to // Hyperledger Fabric. MemberId *string // Tags to assign to the node. Each tag consists of a key and an optional value. // You can specify multiple key-value pairs in a single request with an overall // maximum of 50 tags allowed per resource. For more information about tags, see // Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html) // in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html) // in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. Tags map[string]string noSmithyDocumentSerde } type CreateNodeOutput struct { // The unique identifier of the node. NodeId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateNodeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateNode{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateNode{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opCreateNodeMiddleware(stack, options); err != nil { return err } if err = addOpCreateNodeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateNode(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateNode struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateNode) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateNode) 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.(*CreateNodeInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateNodeInput ") } if input.ClientRequestToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientRequestToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateNodeMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateNode{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateNode(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "CreateNode", } }
193
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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/managedblockchain/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a proposal for a change to the network that other members of the // network can vote on, for example, a proposal to add a new member to the network. // Any member can create a proposal. Applies only to Hyperledger Fabric. func (c *Client) CreateProposal(ctx context.Context, params *CreateProposalInput, optFns ...func(*Options)) (*CreateProposalOutput, error) { if params == nil { params = &CreateProposalInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateProposal", params, optFns, c.addOperationCreateProposalMiddlewares) if err != nil { return nil, err } out := result.(*CreateProposalOutput) out.ResultMetadata = metadata return out, nil } type CreateProposalInput struct { // The type of actions proposed, such as inviting a member or removing a member. // The types of Actions in a proposal are mutually exclusive. For example, a // proposal with Invitations actions cannot also contain Removals actions. // // This member is required. Actions *types.ProposalActions // A unique, case-sensitive identifier that you provide to ensure the idempotency // of the operation. An idempotent operation completes no more than one time. This // identifier is required only if you make a service request directly using an HTTP // client. It is generated automatically if you use an Amazon Web Services SDK or // the CLI. // // This member is required. ClientRequestToken *string // The unique identifier of the member that is creating the proposal. This // identifier is especially useful for identifying the member making the proposal // when multiple members exist in a single Amazon Web Services account. // // This member is required. MemberId *string // The unique identifier of the network for which the proposal is made. // // This member is required. NetworkId *string // A description for the proposal that is visible to voting members, for example, // "Proposal to add Example Corp. as member." Description *string // Tags to assign to the proposal. Each tag consists of a key and an optional // value. You can specify multiple key-value pairs in a single request with an // overall maximum of 50 tags allowed per resource. For more information about // tags, see Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html) // in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html) // in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. Tags map[string]string noSmithyDocumentSerde } type CreateProposalOutput struct { // The unique identifier of the proposal. ProposalId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateProposalMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateProposal{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateProposal{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opCreateProposalMiddleware(stack, options); err != nil { return err } if err = addOpCreateProposalValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateProposal(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateProposal struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateProposal) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateProposal) 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.(*CreateProposalInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateProposalInput ") } if input.ClientRequestToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientRequestToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateProposalMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateProposal{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateProposal(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "CreateProposal", } }
199
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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 accessor that your Amazon Web Services account owns. An accessor // object is a container that has the information required for token based access // to your Ethereum nodes including, the BILLING_TOKEN . After an accessor is // deleted, the status of the accessor changes from AVAILABLE to PENDING_DELETION . // An accessor in the PENDING_DELETION state can’t be used for new WebSocket // requests or HTTP requests. However, WebSocket connections that were initiated // while the accessor was in the AVAILABLE state remain open until they expire (up // to 2 hours). func (c *Client) DeleteAccessor(ctx context.Context, params *DeleteAccessorInput, optFns ...func(*Options)) (*DeleteAccessorOutput, error) { if params == nil { params = &DeleteAccessorInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteAccessor", params, optFns, c.addOperationDeleteAccessorMiddlewares) if err != nil { return nil, err } out := result.(*DeleteAccessorOutput) out.ResultMetadata = metadata return out, nil } type DeleteAccessorInput struct { // The unique identifier of the accessor. // // This member is required. AccessorId *string noSmithyDocumentSerde } type DeleteAccessorOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteAccessorMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAccessor{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAccessor{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteAccessorValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAccessor(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteAccessor(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "DeleteAccessor", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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 member. Deleting a member removes the member and all associated // resources from the network. DeleteMember can only be called for a specified // MemberId if the principal performing the action is associated with the Amazon // Web Services account that owns the member. In all other cases, the DeleteMember // action is carried out as the result of an approved proposal to remove a member. // If MemberId is the last member in a network specified by the last Amazon Web // Services account, the network is deleted also. Applies only to Hyperledger // Fabric. func (c *Client) DeleteMember(ctx context.Context, params *DeleteMemberInput, optFns ...func(*Options)) (*DeleteMemberOutput, error) { if params == nil { params = &DeleteMemberInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteMember", params, optFns, c.addOperationDeleteMemberMiddlewares) if err != nil { return nil, err } out := result.(*DeleteMemberOutput) out.ResultMetadata = metadata return out, nil } type DeleteMemberInput struct { // The unique identifier of the member to remove. // // This member is required. MemberId *string // The unique identifier of the network from which the member is removed. // // This member is required. NetworkId *string noSmithyDocumentSerde } type DeleteMemberOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteMemberMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteMember{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteMember{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteMemberValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteMember(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteMember(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "DeleteMember", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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 node that your Amazon Web Services account owns. All data on the node // is lost and cannot be recovered. Applies to Hyperledger Fabric and Ethereum. func (c *Client) DeleteNode(ctx context.Context, params *DeleteNodeInput, optFns ...func(*Options)) (*DeleteNodeOutput, error) { if params == nil { params = &DeleteNodeInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteNode", params, optFns, c.addOperationDeleteNodeMiddlewares) if err != nil { return nil, err } out := result.(*DeleteNodeOutput) out.ResultMetadata = metadata return out, nil } type DeleteNodeInput struct { // The unique identifier of the network that the node is on. Ethereum public // networks have the following NetworkId s: // - n-ethereum-mainnet // - n-ethereum-goerli // - n-ethereum-rinkeby // // This member is required. NetworkId *string // The unique identifier of the node. // // This member is required. NodeId *string // The unique identifier of the member that owns this node. Applies only to // Hyperledger Fabric and is required for Hyperledger Fabric. MemberId *string noSmithyDocumentSerde } type DeleteNodeOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteNodeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteNode{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteNode{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteNodeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteNode(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteNode(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "DeleteNode", } }
134
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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/managedblockchain/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns detailed information about an accessor. An accessor object is a // container that has the information required for token based access to your // Ethereum nodes. func (c *Client) GetAccessor(ctx context.Context, params *GetAccessorInput, optFns ...func(*Options)) (*GetAccessorOutput, error) { if params == nil { params = &GetAccessorInput{} } result, metadata, err := c.invokeOperation(ctx, "GetAccessor", params, optFns, c.addOperationGetAccessorMiddlewares) if err != nil { return nil, err } out := result.(*GetAccessorOutput) out.ResultMetadata = metadata return out, nil } type GetAccessorInput struct { // The unique identifier of the accessor. // // This member is required. AccessorId *string noSmithyDocumentSerde } type GetAccessorOutput struct { // The properties of the accessor. Accessor *types.Accessor // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetAccessorMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetAccessor{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetAccessor{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetAccessorValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAccessor(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetAccessor(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "GetAccessor", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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/managedblockchain/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns detailed information about a member. Applies only to Hyperledger Fabric. func (c *Client) GetMember(ctx context.Context, params *GetMemberInput, optFns ...func(*Options)) (*GetMemberOutput, error) { if params == nil { params = &GetMemberInput{} } result, metadata, err := c.invokeOperation(ctx, "GetMember", params, optFns, c.addOperationGetMemberMiddlewares) if err != nil { return nil, err } out := result.(*GetMemberOutput) out.ResultMetadata = metadata return out, nil } type GetMemberInput struct { // The unique identifier of the member. // // This member is required. MemberId *string // The unique identifier of the network to which the member belongs. // // This member is required. NetworkId *string noSmithyDocumentSerde } type GetMemberOutput struct { // The properties of a member. Member *types.Member // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetMemberMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetMember{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetMember{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetMemberValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMember(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetMember(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "GetMember", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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/managedblockchain/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns detailed information about a network. Applies to Hyperledger Fabric and // Ethereum. func (c *Client) GetNetwork(ctx context.Context, params *GetNetworkInput, optFns ...func(*Options)) (*GetNetworkOutput, error) { if params == nil { params = &GetNetworkInput{} } result, metadata, err := c.invokeOperation(ctx, "GetNetwork", params, optFns, c.addOperationGetNetworkMiddlewares) if err != nil { return nil, err } out := result.(*GetNetworkOutput) out.ResultMetadata = metadata return out, nil } type GetNetworkInput struct { // The unique identifier of the network to get information about. // // This member is required. NetworkId *string noSmithyDocumentSerde } type GetNetworkOutput struct { // An object containing network configuration parameters. Network *types.Network // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetNetworkMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetNetwork{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetNetwork{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetNetworkValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetNetwork(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetNetwork(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "GetNetwork", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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/managedblockchain/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns detailed information about a node. Applies to Hyperledger Fabric and // Ethereum. func (c *Client) GetNode(ctx context.Context, params *GetNodeInput, optFns ...func(*Options)) (*GetNodeOutput, error) { if params == nil { params = &GetNodeInput{} } result, metadata, err := c.invokeOperation(ctx, "GetNode", params, optFns, c.addOperationGetNodeMiddlewares) if err != nil { return nil, err } out := result.(*GetNodeOutput) out.ResultMetadata = metadata return out, nil } type GetNodeInput struct { // The unique identifier of the network that the node is on. // // This member is required. NetworkId *string // The unique identifier of the node. // // This member is required. NodeId *string // The unique identifier of the member that owns the node. Applies only to // Hyperledger Fabric and is required for Hyperledger Fabric. MemberId *string noSmithyDocumentSerde } type GetNodeOutput struct { // Properties of the node configuration. Node *types.Node // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetNodeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetNode{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetNode{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetNodeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetNode(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetNode(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "GetNode", } }
135
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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/managedblockchain/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns detailed information about a proposal. Applies only to Hyperledger // Fabric. func (c *Client) GetProposal(ctx context.Context, params *GetProposalInput, optFns ...func(*Options)) (*GetProposalOutput, error) { if params == nil { params = &GetProposalInput{} } result, metadata, err := c.invokeOperation(ctx, "GetProposal", params, optFns, c.addOperationGetProposalMiddlewares) if err != nil { return nil, err } out := result.(*GetProposalOutput) out.ResultMetadata = metadata return out, nil } type GetProposalInput struct { // The unique identifier of the network for which the proposal is made. // // This member is required. NetworkId *string // The unique identifier of the proposal. // // This member is required. ProposalId *string noSmithyDocumentSerde } type GetProposalOutput struct { // Information about a proposal. Proposal *types.Proposal // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetProposalMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetProposal{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetProposal{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetProposalValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetProposal(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetProposal(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "GetProposal", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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/managedblockchain/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of the accessors and their properties. Accessor objects are // containers that have the information required for token based access to your // Ethereum nodes. func (c *Client) ListAccessors(ctx context.Context, params *ListAccessorsInput, optFns ...func(*Options)) (*ListAccessorsOutput, error) { if params == nil { params = &ListAccessorsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListAccessors", params, optFns, c.addOperationListAccessorsMiddlewares) if err != nil { return nil, err } out := result.(*ListAccessorsOutput) out.ResultMetadata = metadata return out, nil } type ListAccessorsInput struct { // The maximum number of accessors to list. MaxResults *int32 // The pagination token that indicates the next set of results to retrieve. NextToken *string noSmithyDocumentSerde } type ListAccessorsOutput struct { // An array of AccessorSummary objects that contain configuration properties for // each accessor. Accessors []types.AccessorSummary // The pagination token that indicates the next set of results to retrieve. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListAccessorsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListAccessors{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAccessors{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListAccessors(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListAccessorsAPIClient is a client that implements the ListAccessors operation. type ListAccessorsAPIClient interface { ListAccessors(context.Context, *ListAccessorsInput, ...func(*Options)) (*ListAccessorsOutput, error) } var _ ListAccessorsAPIClient = (*Client)(nil) // ListAccessorsPaginatorOptions is the paginator options for ListAccessors type ListAccessorsPaginatorOptions struct { // The maximum number of accessors to list. 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 } // ListAccessorsPaginator is a paginator for ListAccessors type ListAccessorsPaginator struct { options ListAccessorsPaginatorOptions client ListAccessorsAPIClient params *ListAccessorsInput nextToken *string firstPage bool } // NewListAccessorsPaginator returns a new ListAccessorsPaginator func NewListAccessorsPaginator(client ListAccessorsAPIClient, params *ListAccessorsInput, optFns ...func(*ListAccessorsPaginatorOptions)) *ListAccessorsPaginator { if params == nil { params = &ListAccessorsInput{} } options := ListAccessorsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListAccessorsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListAccessorsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListAccessors page. func (p *ListAccessorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccessorsOutput, 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.ListAccessors(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_opListAccessors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "ListAccessors", } }
219
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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/managedblockchain/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of all invitations for the current Amazon Web Services account. // Applies only to Hyperledger Fabric. func (c *Client) ListInvitations(ctx context.Context, params *ListInvitationsInput, optFns ...func(*Options)) (*ListInvitationsOutput, error) { if params == nil { params = &ListInvitationsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListInvitations", params, optFns, c.addOperationListInvitationsMiddlewares) if err != nil { return nil, err } out := result.(*ListInvitationsOutput) out.ResultMetadata = metadata return out, nil } type ListInvitationsInput struct { // The maximum number of invitations to return. MaxResults *int32 // The pagination token that indicates the next set of results to retrieve. NextToken *string noSmithyDocumentSerde } type ListInvitationsOutput struct { // The invitations for the network. Invitations []types.Invitation // The pagination token that indicates the next set of results to retrieve. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListInvitationsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListInvitations{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListInvitations{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListInvitations(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListInvitationsAPIClient is a client that implements the ListInvitations // operation. type ListInvitationsAPIClient interface { ListInvitations(context.Context, *ListInvitationsInput, ...func(*Options)) (*ListInvitationsOutput, error) } var _ ListInvitationsAPIClient = (*Client)(nil) // ListInvitationsPaginatorOptions is the paginator options for ListInvitations type ListInvitationsPaginatorOptions struct { // The maximum number of invitations to return. 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 } // ListInvitationsPaginator is a paginator for ListInvitations type ListInvitationsPaginator struct { options ListInvitationsPaginatorOptions client ListInvitationsAPIClient params *ListInvitationsInput nextToken *string firstPage bool } // NewListInvitationsPaginator returns a new ListInvitationsPaginator func NewListInvitationsPaginator(client ListInvitationsAPIClient, params *ListInvitationsInput, optFns ...func(*ListInvitationsPaginatorOptions)) *ListInvitationsPaginator { if params == nil { params = &ListInvitationsInput{} } options := ListInvitationsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListInvitationsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListInvitationsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListInvitations page. func (p *ListInvitationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInvitationsOutput, 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.ListInvitations(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_opListInvitations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "ListInvitations", } }
218
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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/managedblockchain/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of the members in a network and properties of their // configurations. Applies only to Hyperledger Fabric. func (c *Client) ListMembers(ctx context.Context, params *ListMembersInput, optFns ...func(*Options)) (*ListMembersOutput, error) { if params == nil { params = &ListMembersInput{} } result, metadata, err := c.invokeOperation(ctx, "ListMembers", params, optFns, c.addOperationListMembersMiddlewares) if err != nil { return nil, err } out := result.(*ListMembersOutput) out.ResultMetadata = metadata return out, nil } type ListMembersInput struct { // The unique identifier of the network for which to list members. // // This member is required. NetworkId *string // An optional Boolean value. If provided, the request is limited either to // members that the current Amazon Web Services account owns ( true ) or that other // Amazon Web Services accountsn own ( false ). If omitted, all members are listed. IsOwned *bool // The maximum number of members to return in the request. MaxResults *int32 // The optional name of the member to list. Name *string // The pagination token that indicates the next set of results to retrieve. NextToken *string // An optional status specifier. If provided, only members currently in this // status are listed. Status types.MemberStatus noSmithyDocumentSerde } type ListMembersOutput struct { // An array of MemberSummary objects. Each object contains details about a network // member. Members []types.MemberSummary // The pagination token that indicates the next set of results to retrieve. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListMembersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListMembers{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListMembers{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListMembersValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListMembers(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListMembersAPIClient is a client that implements the ListMembers operation. type ListMembersAPIClient interface { ListMembers(context.Context, *ListMembersInput, ...func(*Options)) (*ListMembersOutput, error) } var _ ListMembersAPIClient = (*Client)(nil) // ListMembersPaginatorOptions is the paginator options for ListMembers type ListMembersPaginatorOptions struct { // The maximum number of members to return in the request. 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 } // ListMembersPaginator is a paginator for ListMembers type ListMembersPaginator struct { options ListMembersPaginatorOptions client ListMembersAPIClient params *ListMembersInput nextToken *string firstPage bool } // NewListMembersPaginator returns a new ListMembersPaginator func NewListMembersPaginator(client ListMembersAPIClient, params *ListMembersInput, optFns ...func(*ListMembersPaginatorOptions)) *ListMembersPaginator { if params == nil { params = &ListMembersInput{} } options := ListMembersPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListMembersPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListMembersPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListMembers page. func (p *ListMembersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMembersOutput, 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.ListMembers(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_opListMembers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "ListMembers", } }
238
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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/managedblockchain/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns information about the networks in which the current Amazon Web Services // account participates. Applies to Hyperledger Fabric and Ethereum. func (c *Client) ListNetworks(ctx context.Context, params *ListNetworksInput, optFns ...func(*Options)) (*ListNetworksOutput, error) { if params == nil { params = &ListNetworksInput{} } result, metadata, err := c.invokeOperation(ctx, "ListNetworks", params, optFns, c.addOperationListNetworksMiddlewares) if err != nil { return nil, err } out := result.(*ListNetworksOutput) out.ResultMetadata = metadata return out, nil } type ListNetworksInput struct { // An optional framework specifier. If provided, only networks of this framework // type are listed. Framework types.Framework // The maximum number of networks to list. MaxResults *int32 // The name of the network. Name *string // The pagination token that indicates the next set of results to retrieve. NextToken *string // An optional status specifier. If provided, only networks currently in this // status are listed. Applies only to Hyperledger Fabric. Status types.NetworkStatus noSmithyDocumentSerde } type ListNetworksOutput struct { // An array of NetworkSummary objects that contain configuration properties for // each network. Networks []types.NetworkSummary // The pagination token that indicates the next set of results to retrieve. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListNetworksMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListNetworks{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListNetworks{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListNetworks(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListNetworksAPIClient is a client that implements the ListNetworks operation. type ListNetworksAPIClient interface { ListNetworks(context.Context, *ListNetworksInput, ...func(*Options)) (*ListNetworksOutput, error) } var _ ListNetworksAPIClient = (*Client)(nil) // ListNetworksPaginatorOptions is the paginator options for ListNetworks type ListNetworksPaginatorOptions struct { // The maximum number of networks to list. 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 } // ListNetworksPaginator is a paginator for ListNetworks type ListNetworksPaginator struct { options ListNetworksPaginatorOptions client ListNetworksAPIClient params *ListNetworksInput nextToken *string firstPage bool } // NewListNetworksPaginator returns a new ListNetworksPaginator func NewListNetworksPaginator(client ListNetworksAPIClient, params *ListNetworksInput, optFns ...func(*ListNetworksPaginatorOptions)) *ListNetworksPaginator { if params == nil { params = &ListNetworksInput{} } options := ListNetworksPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListNetworksPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListNetworksPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListNetworks page. func (p *ListNetworksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNetworksOutput, 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.ListNetworks(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_opListNetworks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "ListNetworks", } }
229
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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/managedblockchain/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns information about the nodes within a network. Applies to Hyperledger // Fabric and Ethereum. func (c *Client) ListNodes(ctx context.Context, params *ListNodesInput, optFns ...func(*Options)) (*ListNodesOutput, error) { if params == nil { params = &ListNodesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListNodes", params, optFns, c.addOperationListNodesMiddlewares) if err != nil { return nil, err } out := result.(*ListNodesOutput) out.ResultMetadata = metadata return out, nil } type ListNodesInput struct { // The unique identifier of the network for which to list nodes. // // This member is required. NetworkId *string // The maximum number of nodes to list. MaxResults *int32 // The unique identifier of the member who owns the nodes to list. Applies only to // Hyperledger Fabric and is required for Hyperledger Fabric. MemberId *string // The pagination token that indicates the next set of results to retrieve. NextToken *string // An optional status specifier. If provided, only nodes currently in this status // are listed. Status types.NodeStatus noSmithyDocumentSerde } type ListNodesOutput struct { // The pagination token that indicates the next set of results to retrieve. NextToken *string // An array of NodeSummary objects that contain configuration properties for each // node. Nodes []types.NodeSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListNodesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListNodes{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListNodes{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListNodesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListNodes(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListNodesAPIClient is a client that implements the ListNodes operation. type ListNodesAPIClient interface { ListNodes(context.Context, *ListNodesInput, ...func(*Options)) (*ListNodesOutput, error) } var _ ListNodesAPIClient = (*Client)(nil) // ListNodesPaginatorOptions is the paginator options for ListNodes type ListNodesPaginatorOptions struct { // The maximum number of nodes to list. 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 } // ListNodesPaginator is a paginator for ListNodes type ListNodesPaginator struct { options ListNodesPaginatorOptions client ListNodesAPIClient params *ListNodesInput nextToken *string firstPage bool } // NewListNodesPaginator returns a new ListNodesPaginator func NewListNodesPaginator(client ListNodesAPIClient, params *ListNodesInput, optFns ...func(*ListNodesPaginatorOptions)) *ListNodesPaginator { if params == nil { params = &ListNodesInput{} } options := ListNodesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListNodesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListNodesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListNodes page. func (p *ListNodesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNodesOutput, 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.ListNodes(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_opListNodes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "ListNodes", } }
234
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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/managedblockchain/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of proposals for the network. Applies only to Hyperledger Fabric. func (c *Client) ListProposals(ctx context.Context, params *ListProposalsInput, optFns ...func(*Options)) (*ListProposalsOutput, error) { if params == nil { params = &ListProposalsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListProposals", params, optFns, c.addOperationListProposalsMiddlewares) if err != nil { return nil, err } out := result.(*ListProposalsOutput) out.ResultMetadata = metadata return out, nil } type ListProposalsInput struct { // The unique identifier of the network. // // This member is required. NetworkId *string // The maximum number of proposals to return. MaxResults *int32 // The pagination token that indicates the next set of results to retrieve. NextToken *string noSmithyDocumentSerde } type ListProposalsOutput struct { // The pagination token that indicates the next set of results to retrieve. NextToken *string // The summary of each proposal made on the network. Proposals []types.ProposalSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListProposalsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListProposals{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListProposals{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListProposalsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListProposals(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListProposalsAPIClient is a client that implements the ListProposals operation. type ListProposalsAPIClient interface { ListProposals(context.Context, *ListProposalsInput, ...func(*Options)) (*ListProposalsOutput, error) } var _ ListProposalsAPIClient = (*Client)(nil) // ListProposalsPaginatorOptions is the paginator options for ListProposals type ListProposalsPaginatorOptions struct { // The maximum number of proposals to return. 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 } // ListProposalsPaginator is a paginator for ListProposals type ListProposalsPaginator struct { options ListProposalsPaginatorOptions client ListProposalsAPIClient params *ListProposalsInput nextToken *string firstPage bool } // NewListProposalsPaginator returns a new ListProposalsPaginator func NewListProposalsPaginator(client ListProposalsAPIClient, params *ListProposalsInput, optFns ...func(*ListProposalsPaginatorOptions)) *ListProposalsPaginator { if params == nil { params = &ListProposalsInput{} } options := ListProposalsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListProposalsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListProposalsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListProposals page. func (p *ListProposalsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProposalsOutput, 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.ListProposals(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_opListProposals(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "ListProposals", } }
224
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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/managedblockchain/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the list of votes for a specified proposal, including the value of each // vote and the unique identifier of the member that cast the vote. Applies only to // Hyperledger Fabric. func (c *Client) ListProposalVotes(ctx context.Context, params *ListProposalVotesInput, optFns ...func(*Options)) (*ListProposalVotesOutput, error) { if params == nil { params = &ListProposalVotesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListProposalVotes", params, optFns, c.addOperationListProposalVotesMiddlewares) if err != nil { return nil, err } out := result.(*ListProposalVotesOutput) out.ResultMetadata = metadata return out, nil } type ListProposalVotesInput struct { // The unique identifier of the network. // // This member is required. NetworkId *string // The unique identifier of the proposal. // // This member is required. ProposalId *string // The maximum number of votes to return. MaxResults *int32 // The pagination token that indicates the next set of results to retrieve. NextToken *string noSmithyDocumentSerde } type ListProposalVotesOutput struct { // The pagination token that indicates the next set of results to retrieve. NextToken *string // The list of votes. ProposalVotes []types.VoteSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListProposalVotesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListProposalVotes{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListProposalVotes{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListProposalVotesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListProposalVotes(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListProposalVotesAPIClient is a client that implements the ListProposalVotes // operation. type ListProposalVotesAPIClient interface { ListProposalVotes(context.Context, *ListProposalVotesInput, ...func(*Options)) (*ListProposalVotesOutput, error) } var _ ListProposalVotesAPIClient = (*Client)(nil) // ListProposalVotesPaginatorOptions is the paginator options for ListProposalVotes type ListProposalVotesPaginatorOptions struct { // The maximum number of votes to return. 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 } // ListProposalVotesPaginator is a paginator for ListProposalVotes type ListProposalVotesPaginator struct { options ListProposalVotesPaginatorOptions client ListProposalVotesAPIClient params *ListProposalVotesInput nextToken *string firstPage bool } // NewListProposalVotesPaginator returns a new ListProposalVotesPaginator func NewListProposalVotesPaginator(client ListProposalVotesAPIClient, params *ListProposalVotesInput, optFns ...func(*ListProposalVotesPaginatorOptions)) *ListProposalVotesPaginator { if params == nil { params = &ListProposalVotesInput{} } options := ListProposalVotesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListProposalVotesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListProposalVotesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListProposalVotes page. func (p *ListProposalVotesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProposalVotesOutput, 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.ListProposalVotes(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_opListProposalVotes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "ListProposalVotes", } }
232
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of tags for the specified resource. Each tag consists of a key // and optional value. For more information about tags, see Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html) // in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html) // in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { params = &ListTagsForResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) if err != nil { return nil, err } out := result.(*ListTagsForResourceOutput) out.ResultMetadata = metadata return out, nil } type ListTagsForResourceInput struct { // The Amazon Resource Name (ARN) of the resource. For more information about ARNs // and their format, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. // // This member is required. ResourceArn *string noSmithyDocumentSerde } type ListTagsForResourceOutput struct { // The tags assigned to the resource. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "ListTagsForResource", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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" ) // Rejects an invitation to join a network. This action can be called by a // principal in an Amazon Web Services account that has received an invitation to // create a member and join a network. Applies only to Hyperledger Fabric. func (c *Client) RejectInvitation(ctx context.Context, params *RejectInvitationInput, optFns ...func(*Options)) (*RejectInvitationOutput, error) { if params == nil { params = &RejectInvitationInput{} } result, metadata, err := c.invokeOperation(ctx, "RejectInvitation", params, optFns, c.addOperationRejectInvitationMiddlewares) if err != nil { return nil, err } out := result.(*RejectInvitationOutput) out.ResultMetadata = metadata return out, nil } type RejectInvitationInput struct { // The unique identifier of the invitation to reject. // // This member is required. InvitationId *string noSmithyDocumentSerde } type RejectInvitationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRejectInvitationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpRejectInvitation{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRejectInvitation{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpRejectInvitationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRejectInvitation(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opRejectInvitation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "RejectInvitation", } }
122
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Adds or overwrites the specified tags for the specified Amazon Managed // Blockchain resource. Each tag consists of a key and optional value. When you // specify a tag key that already exists, the tag value is overwritten with the new // value. Use UntagResource to remove tag keys. A resource can have up to 50 tags. // If you try to create more than 50 tags for a resource, your request fails and // returns an error. For more information about tags, see Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html) // in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html) // in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { params = &TagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) if err != nil { return nil, err } out := result.(*TagResourceOutput) out.ResultMetadata = metadata return out, nil } type TagResourceInput struct { // The Amazon Resource Name (ARN) of the resource. For more information about ARNs // and their format, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. // // This member is required. ResourceArn *string // The tags to assign to the specified resource. Tag values can be empty, for // example, "MyTagKey" : "" . You can specify multiple key-value pairs in a single // request, with an overall maximum of 50 tags added to each resource. // // This member is required. Tags map[string]string noSmithyDocumentSerde } type TagResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpTagResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "TagResource", } }
136
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Removes the specified tags from the Amazon Managed Blockchain resource. For // more information about tags, see Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html) // in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html) // in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { params = &UntagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) if err != nil { return nil, err } out := result.(*UntagResourceOutput) out.ResultMetadata = metadata return out, nil } type UntagResourceInput struct { // The Amazon Resource Name (ARN) of the resource. For more information about ARNs // and their format, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. // // This member is required. ResourceArn *string // The tag keys. // // This member is required. TagKeys []string noSmithyDocumentSerde } type UntagResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUntagResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "UntagResource", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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/managedblockchain/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates a member configuration with new parameters. Applies only to Hyperledger // Fabric. func (c *Client) UpdateMember(ctx context.Context, params *UpdateMemberInput, optFns ...func(*Options)) (*UpdateMemberOutput, error) { if params == nil { params = &UpdateMemberInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateMember", params, optFns, c.addOperationUpdateMemberMiddlewares) if err != nil { return nil, err } out := result.(*UpdateMemberOutput) out.ResultMetadata = metadata return out, nil } type UpdateMemberInput struct { // The unique identifier of the member. // // This member is required. MemberId *string // The unique identifier of the Managed Blockchain network to which the member // belongs. // // This member is required. NetworkId *string // Configuration properties for publishing to Amazon CloudWatch Logs. LogPublishingConfiguration *types.MemberLogPublishingConfiguration noSmithyDocumentSerde } type UpdateMemberOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateMemberMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateMember{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateMember{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateMemberValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateMember(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateMember(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "UpdateMember", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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/managedblockchain/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates a node configuration with new parameters. Applies only to Hyperledger // Fabric. func (c *Client) UpdateNode(ctx context.Context, params *UpdateNodeInput, optFns ...func(*Options)) (*UpdateNodeOutput, error) { if params == nil { params = &UpdateNodeInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateNode", params, optFns, c.addOperationUpdateNodeMiddlewares) if err != nil { return nil, err } out := result.(*UpdateNodeOutput) out.ResultMetadata = metadata return out, nil } type UpdateNodeInput struct { // The unique identifier of the network that the node is on. // // This member is required. NetworkId *string // The unique identifier of the node. // // This member is required. NodeId *string // Configuration properties for publishing to Amazon CloudWatch Logs. LogPublishingConfiguration *types.NodeLogPublishingConfiguration // The unique identifier of the member that owns the node. Applies only to // Hyperledger Fabric. MemberId *string noSmithyDocumentSerde } type UpdateNodeOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateNodeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateNode{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateNode{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateNodeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateNode(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateNode(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "UpdateNode", } }
134
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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/managedblockchain/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Casts a vote for a specified ProposalId on behalf of a member. The member to // vote as, specified by VoterMemberId , must be in the same Amazon Web Services // account as the principal that calls the action. Applies only to Hyperledger // Fabric. func (c *Client) VoteOnProposal(ctx context.Context, params *VoteOnProposalInput, optFns ...func(*Options)) (*VoteOnProposalOutput, error) { if params == nil { params = &VoteOnProposalInput{} } result, metadata, err := c.invokeOperation(ctx, "VoteOnProposal", params, optFns, c.addOperationVoteOnProposalMiddlewares) if err != nil { return nil, err } out := result.(*VoteOnProposalOutput) out.ResultMetadata = metadata return out, nil } type VoteOnProposalInput struct { // The unique identifier of the network. // // This member is required. NetworkId *string // The unique identifier of the proposal. // // This member is required. ProposalId *string // The value of the vote. // // This member is required. Vote types.VoteValue // The unique identifier of the member casting the vote. // // This member is required. VoterMemberId *string noSmithyDocumentSerde } type VoteOnProposalOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationVoteOnProposalMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpVoteOnProposal{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpVoteOnProposal{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpVoteOnProposalValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opVoteOnProposal(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opVoteOnProposal(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "managedblockchain", OperationName: "VoteOnProposal", } }
139
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/managedblockchain/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_deserializeOpCreateAccessor struct { } func (*awsRestjson1_deserializeOpCreateAccessor) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateAccessor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateAccessor(response, &metadata) } output := &CreateAccessorOutput{} 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_deserializeOpDocumentCreateAccessorOutput(&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_deserializeOpErrorCreateAccessor(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) case strings.EqualFold("ResourceLimitExceededException", errorCode): return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("TooManyTagsException", errorCode): return awsRestjson1_deserializeErrorTooManyTagsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateAccessorOutput(v **CreateAccessorOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateAccessorOutput if *v == nil { sv = &CreateAccessorOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AccessorId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.AccessorId = ptr.String(jtv) } case "BillingToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccessorBillingTokenString to be of type string, got %T instead", value) } sv.BillingToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateMember struct { } func (*awsRestjson1_deserializeOpCreateMember) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateMember) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateMember(response, &metadata) } output := &CreateMemberOutput{} 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_deserializeOpDocumentCreateMemberOutput(&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_deserializeOpErrorCreateMember(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) case strings.EqualFold("ResourceLimitExceededException", errorCode): return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceNotReadyException", errorCode): return awsRestjson1_deserializeErrorResourceNotReadyException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("TooManyTagsException", errorCode): return awsRestjson1_deserializeErrorTooManyTagsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateMemberOutput(v **CreateMemberOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateMemberOutput if *v == nil { sv = &CreateMemberOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MemberId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.MemberId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateNetwork struct { } func (*awsRestjson1_deserializeOpCreateNetwork) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateNetwork) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateNetwork(response, &metadata) } output := &CreateNetworkOutput{} 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_deserializeOpDocumentCreateNetworkOutput(&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_deserializeOpErrorCreateNetwork(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) case strings.EqualFold("ResourceLimitExceededException", errorCode): return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("TooManyTagsException", errorCode): return awsRestjson1_deserializeErrorTooManyTagsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateNetworkOutput(v **CreateNetworkOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateNetworkOutput if *v == nil { sv = &CreateNetworkOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MemberId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.MemberId = ptr.String(jtv) } case "NetworkId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.NetworkId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateNode struct { } func (*awsRestjson1_deserializeOpCreateNode) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateNode) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateNode(response, &metadata) } output := &CreateNodeOutput{} 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_deserializeOpDocumentCreateNodeOutput(&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_deserializeOpErrorCreateNode(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) case strings.EqualFold("ResourceLimitExceededException", errorCode): return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceNotReadyException", errorCode): return awsRestjson1_deserializeErrorResourceNotReadyException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("TooManyTagsException", errorCode): return awsRestjson1_deserializeErrorTooManyTagsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateNodeOutput(v **CreateNodeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateNodeOutput if *v == nil { sv = &CreateNodeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NodeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.NodeId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateProposal struct { } func (*awsRestjson1_deserializeOpCreateProposal) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateProposal) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateProposal(response, &metadata) } output := &CreateProposalOutput{} 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_deserializeOpDocumentCreateProposalOutput(&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_deserializeOpErrorCreateProposal(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceNotReadyException", errorCode): return awsRestjson1_deserializeErrorResourceNotReadyException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("TooManyTagsException", errorCode): return awsRestjson1_deserializeErrorTooManyTagsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateProposalOutput(v **CreateProposalOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateProposalOutput if *v == nil { sv = &CreateProposalOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ProposalId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.ProposalId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteAccessor struct { } func (*awsRestjson1_deserializeOpDeleteAccessor) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteAccessor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDeleteAccessor(response, &metadata) } output := &DeleteAccessorOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteAccessor(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteMember struct { } func (*awsRestjson1_deserializeOpDeleteMember) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteMember) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDeleteMember(response, &metadata) } output := &DeleteMemberOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteMember(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceNotReadyException", errorCode): return awsRestjson1_deserializeErrorResourceNotReadyException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteNode struct { } func (*awsRestjson1_deserializeOpDeleteNode) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteNode) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDeleteNode(response, &metadata) } output := &DeleteNodeOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteNode(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceNotReadyException", errorCode): return awsRestjson1_deserializeErrorResourceNotReadyException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpGetAccessor struct { } func (*awsRestjson1_deserializeOpGetAccessor) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetAccessor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetAccessor(response, &metadata) } output := &GetAccessorOutput{} 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_deserializeOpDocumentGetAccessorOutput(&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_deserializeOpErrorGetAccessor(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetAccessorOutput(v **GetAccessorOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetAccessorOutput if *v == nil { sv = &GetAccessorOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Accessor": if err := awsRestjson1_deserializeDocumentAccessor(&sv.Accessor, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetMember struct { } func (*awsRestjson1_deserializeOpGetMember) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetMember) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetMember(response, &metadata) } output := &GetMemberOutput{} 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_deserializeOpDocumentGetMemberOutput(&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_deserializeOpErrorGetMember(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetMemberOutput(v **GetMemberOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetMemberOutput if *v == nil { sv = &GetMemberOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Member": if err := awsRestjson1_deserializeDocumentMember(&sv.Member, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetNetwork struct { } func (*awsRestjson1_deserializeOpGetNetwork) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetNetwork) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetNetwork(response, &metadata) } output := &GetNetworkOutput{} 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_deserializeOpDocumentGetNetworkOutput(&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_deserializeOpErrorGetNetwork(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetNetworkOutput(v **GetNetworkOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetNetworkOutput if *v == nil { sv = &GetNetworkOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Network": if err := awsRestjson1_deserializeDocumentNetwork(&sv.Network, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetNode struct { } func (*awsRestjson1_deserializeOpGetNode) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetNode) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetNode(response, &metadata) } output := &GetNodeOutput{} 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_deserializeOpDocumentGetNodeOutput(&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_deserializeOpErrorGetNode(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetNodeOutput(v **GetNodeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetNodeOutput if *v == nil { sv = &GetNodeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Node": if err := awsRestjson1_deserializeDocumentNode(&sv.Node, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetProposal struct { } func (*awsRestjson1_deserializeOpGetProposal) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetProposal) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetProposal(response, &metadata) } output := &GetProposalOutput{} 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_deserializeOpDocumentGetProposalOutput(&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_deserializeOpErrorGetProposal(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetProposalOutput(v **GetProposalOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetProposalOutput if *v == nil { sv = &GetProposalOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Proposal": if err := awsRestjson1_deserializeDocumentProposal(&sv.Proposal, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListAccessors struct { } func (*awsRestjson1_deserializeOpListAccessors) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListAccessors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListAccessors(response, &metadata) } output := &ListAccessorsOutput{} 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_deserializeOpDocumentListAccessorsOutput(&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_deserializeOpErrorListAccessors(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListAccessorsOutput(v **ListAccessorsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListAccessorsOutput if *v == nil { sv = &ListAccessorsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Accessors": if err := awsRestjson1_deserializeDocumentAccessorSummaryList(&sv.Accessors, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListInvitations struct { } func (*awsRestjson1_deserializeOpListInvitations) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListInvitations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListInvitations(response, &metadata) } output := &ListInvitationsOutput{} 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_deserializeOpDocumentListInvitationsOutput(&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_deserializeOpErrorListInvitations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceLimitExceededException", errorCode): return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListInvitationsOutput(v **ListInvitationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListInvitationsOutput if *v == nil { sv = &ListInvitationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Invitations": if err := awsRestjson1_deserializeDocumentInvitationList(&sv.Invitations, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListMembers struct { } func (*awsRestjson1_deserializeOpListMembers) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListMembers(response, &metadata) } output := &ListMembersOutput{} 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_deserializeOpDocumentListMembersOutput(&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_deserializeOpErrorListMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListMembersOutput(v **ListMembersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListMembersOutput if *v == nil { sv = &ListMembersOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Members": if err := awsRestjson1_deserializeDocumentMemberSummaryList(&sv.Members, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListNetworks struct { } func (*awsRestjson1_deserializeOpListNetworks) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListNetworks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListNetworks(response, &metadata) } output := &ListNetworksOutput{} 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_deserializeOpDocumentListNetworksOutput(&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_deserializeOpErrorListNetworks(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListNetworksOutput(v **ListNetworksOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListNetworksOutput if *v == nil { sv = &ListNetworksOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Networks": if err := awsRestjson1_deserializeDocumentNetworkSummaryList(&sv.Networks, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListNodes struct { } func (*awsRestjson1_deserializeOpListNodes) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListNodes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListNodes(response, &metadata) } output := &ListNodesOutput{} 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_deserializeOpDocumentListNodesOutput(&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_deserializeOpErrorListNodes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListNodesOutput(v **ListNodesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListNodesOutput if *v == nil { sv = &ListNodesOutput{} } 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 PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "Nodes": if err := awsRestjson1_deserializeDocumentNodeSummaryList(&sv.Nodes, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListProposals struct { } func (*awsRestjson1_deserializeOpListProposals) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListProposals) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListProposals(response, &metadata) } output := &ListProposalsOutput{} 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_deserializeOpDocumentListProposalsOutput(&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_deserializeOpErrorListProposals(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListProposalsOutput(v **ListProposalsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListProposalsOutput if *v == nil { sv = &ListProposalsOutput{} } 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 PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "Proposals": if err := awsRestjson1_deserializeDocumentProposalSummaryList(&sv.Proposals, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListProposalVotes struct { } func (*awsRestjson1_deserializeOpListProposalVotes) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListProposalVotes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListProposalVotes(response, &metadata) } output := &ListProposalVotesOutput{} 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_deserializeOpDocumentListProposalVotesOutput(&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_deserializeOpErrorListProposalVotes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListProposalVotesOutput(v **ListProposalVotesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListProposalVotesOutput if *v == nil { sv = &ListProposalVotesOutput{} } 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 PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "ProposalVotes": if err := awsRestjson1_deserializeDocumentProposalVoteList(&sv.ProposalVotes, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTagsForResource struct { } func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceNotReadyException", errorCode): return awsRestjson1_deserializeErrorResourceNotReadyException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTagsForResourceOutput if *v == nil { sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Tags": if err := awsRestjson1_deserializeDocumentOutputTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpRejectInvitation struct { } func (*awsRestjson1_deserializeOpRejectInvitation) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpRejectInvitation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorRejectInvitation(response, &metadata) } output := &RejectInvitationOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorRejectInvitation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("IllegalActionException", errorCode): return awsRestjson1_deserializeErrorIllegalActionException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpTagResource struct { } func (*awsRestjson1_deserializeOpTagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) } output := &TagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceNotReadyException", errorCode): return awsRestjson1_deserializeErrorResourceNotReadyException(response, errorBody) case strings.EqualFold("TooManyTagsException", errorCode): return awsRestjson1_deserializeErrorTooManyTagsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUntagResource struct { } func (*awsRestjson1_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) } output := &UntagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceNotReadyException", errorCode): return awsRestjson1_deserializeErrorResourceNotReadyException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUpdateMember struct { } func (*awsRestjson1_deserializeOpUpdateMember) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateMember) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorUpdateMember(response, &metadata) } output := &UpdateMemberOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateMember(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUpdateNode struct { } func (*awsRestjson1_deserializeOpUpdateNode) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateNode) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorUpdateNode(response, &metadata) } output := &UpdateNodeOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateNode(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpVoteOnProposal struct { } func (*awsRestjson1_deserializeOpVoteOnProposal) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpVoteOnProposal) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorVoteOnProposal(response, &metadata) } output := &VoteOnProposalOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorVoteOnProposal(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("IllegalActionException", errorCode): return awsRestjson1_deserializeErrorIllegalActionException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.AccessDeniedException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorIllegalActionException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.IllegalActionException{} 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_deserializeDocumentIllegalActionException(&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_deserializeErrorInternalServiceErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalServiceErrorException{} return output } func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidRequestException{} 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_deserializeDocumentInvalidRequestException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorResourceAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceAlreadyExistsException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentResourceAlreadyExistsException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorResourceLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceLimitExceededException{} 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_deserializeDocumentResourceLimitExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceNotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorResourceNotReadyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceNotReadyException{} 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_deserializeDocumentResourceNotReadyException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ThrottlingException{} return output } func awsRestjson1_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.TooManyTagsException{} 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_deserializeDocumentTooManyTagsException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AccessDeniedException if *v == nil { sv = &types.AccessDeniedException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAccessor(v **types.Accessor, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Accessor if *v == nil { sv = &types.Accessor{} } 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 ArnString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "BillingToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccessorBillingTokenString to be of type string, got %T instead", value) } sv.BillingToken = ptr.String(jtv) } case "CreationDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationDate = ptr.Time(t) } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccessorStatus to be of type string, got %T instead", value) } sv.Status = types.AccessorStatus(jtv) } case "Tags": if err := awsRestjson1_deserializeDocumentOutputTagMap(&sv.Tags, value); err != nil { return err } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccessorType to be of type string, got %T instead", value) } sv.Type = types.AccessorType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAccessorSummary(v **types.AccessorSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AccessorSummary if *v == nil { sv = &types.AccessorSummary{} } 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 ArnString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationDate = ptr.Time(t) } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccessorStatus to be of type string, got %T instead", value) } sv.Status = types.AccessorStatus(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccessorType to be of type string, got %T instead", value) } sv.Type = types.AccessorType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAccessorSummaryList(v *[]types.AccessorSummary, 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.AccessorSummary if *v == nil { cv = []types.AccessorSummary{} } else { cv = *v } for _, value := range shape { var col types.AccessorSummary destAddr := &col if err := awsRestjson1_deserializeDocumentAccessorSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentApprovalThresholdPolicy(v **types.ApprovalThresholdPolicy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ApprovalThresholdPolicy if *v == nil { sv = &types.ApprovalThresholdPolicy{} } else { sv = *v } for key, value := range shape { switch key { case "ProposalDurationInHours": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected ProposalDurationInt to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ProposalDurationInHours = ptr.Int32(int32(i64)) } case "ThresholdComparator": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ThresholdComparator to be of type string, got %T instead", value) } sv.ThresholdComparator = types.ThresholdComparator(jtv) } case "ThresholdPercentage": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected ThresholdPercentageInt to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ThresholdPercentage = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIllegalActionException(v **types.IllegalActionException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.IllegalActionException if *v == nil { sv = &types.IllegalActionException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInternalServiceErrorException(v **types.InternalServiceErrorException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InternalServiceErrorException if *v == nil { sv = &types.InternalServiceErrorException{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InvalidRequestException if *v == nil { sv = &types.InvalidRequestException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInvitation(v **types.Invitation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Invitation if *v == nil { sv = &types.Invitation{} } 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 ArnString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationDate = ptr.Time(t) } case "ExpirationDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.ExpirationDate = ptr.Time(t) } case "InvitationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.InvitationId = ptr.String(jtv) } case "NetworkSummary": if err := awsRestjson1_deserializeDocumentNetworkSummary(&sv.NetworkSummary, value); err != nil { return err } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected InvitationStatus to be of type string, got %T instead", value) } sv.Status = types.InvitationStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInvitationList(v *[]types.Invitation, 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.Invitation if *v == nil { cv = []types.Invitation{} } else { cv = *v } for _, value := range shape { var col types.Invitation destAddr := &col if err := awsRestjson1_deserializeDocumentInvitation(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInviteAction(v **types.InviteAction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InviteAction if *v == nil { sv = &types.InviteAction{} } else { sv = *v } for key, value := range shape { switch key { case "Principal": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PrincipalString to be of type string, got %T instead", value) } sv.Principal = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInviteActionList(v *[]types.InviteAction, 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.InviteAction if *v == nil { cv = []types.InviteAction{} } else { cv = *v } for _, value := range shape { var col types.InviteAction destAddr := &col if err := awsRestjson1_deserializeDocumentInviteAction(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentLogConfiguration(v **types.LogConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LogConfiguration if *v == nil { sv = &types.LogConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLogConfigurations(v **types.LogConfigurations, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LogConfigurations if *v == nil { sv = &types.LogConfigurations{} } else { sv = *v } for key, value := range shape { switch key { case "Cloudwatch": if err := awsRestjson1_deserializeDocumentLogConfiguration(&sv.Cloudwatch, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMember(v **types.Member, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Member if *v == nil { sv = &types.Member{} } 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 ArnString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationDate = ptr.Time(t) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DescriptionString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "FrameworkAttributes": if err := awsRestjson1_deserializeDocumentMemberFrameworkAttributes(&sv.FrameworkAttributes, value); err != nil { return err } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "KmsKeyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.KmsKeyArn = ptr.String(jtv) } case "LogPublishingConfiguration": if err := awsRestjson1_deserializeDocumentMemberLogPublishingConfiguration(&sv.LogPublishingConfiguration, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NetworkMemberNameString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "NetworkId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.NetworkId = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MemberStatus to be of type string, got %T instead", value) } sv.Status = types.MemberStatus(jtv) } case "Tags": if err := awsRestjson1_deserializeDocumentOutputTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMemberFabricAttributes(v **types.MemberFabricAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MemberFabricAttributes if *v == nil { sv = &types.MemberFabricAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "AdminUsername": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UsernameString to be of type string, got %T instead", value) } sv.AdminUsername = ptr.String(jtv) } case "CaEndpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.CaEndpoint = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMemberFabricLogPublishingConfiguration(v **types.MemberFabricLogPublishingConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MemberFabricLogPublishingConfiguration if *v == nil { sv = &types.MemberFabricLogPublishingConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CaLogs": if err := awsRestjson1_deserializeDocumentLogConfigurations(&sv.CaLogs, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMemberFrameworkAttributes(v **types.MemberFrameworkAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MemberFrameworkAttributes if *v == nil { sv = &types.MemberFrameworkAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "Fabric": if err := awsRestjson1_deserializeDocumentMemberFabricAttributes(&sv.Fabric, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMemberLogPublishingConfiguration(v **types.MemberLogPublishingConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MemberLogPublishingConfiguration if *v == nil { sv = &types.MemberLogPublishingConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Fabric": if err := awsRestjson1_deserializeDocumentMemberFabricLogPublishingConfiguration(&sv.Fabric, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMemberSummary(v **types.MemberSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MemberSummary if *v == nil { sv = &types.MemberSummary{} } 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 ArnString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationDate = ptr.Time(t) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DescriptionString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "IsOwned": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected IsOwned to be of type *bool, got %T instead", value) } sv.IsOwned = ptr.Bool(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NetworkMemberNameString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MemberStatus to be of type string, got %T instead", value) } sv.Status = types.MemberStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMemberSummaryList(v *[]types.MemberSummary, 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.MemberSummary if *v == nil { cv = []types.MemberSummary{} } else { cv = *v } for _, value := range shape { var col types.MemberSummary destAddr := &col if err := awsRestjson1_deserializeDocumentMemberSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentNetwork(v **types.Network, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Network if *v == nil { sv = &types.Network{} } 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 ArnString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationDate = ptr.Time(t) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DescriptionString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "Framework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Framework to be of type string, got %T instead", value) } sv.Framework = types.Framework(jtv) } case "FrameworkAttributes": if err := awsRestjson1_deserializeDocumentNetworkFrameworkAttributes(&sv.FrameworkAttributes, value); err != nil { return err } case "FrameworkVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FrameworkVersionString to be of type string, got %T instead", value) } sv.FrameworkVersion = ptr.String(jtv) } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NameString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NetworkStatus to be of type string, got %T instead", value) } sv.Status = types.NetworkStatus(jtv) } case "Tags": if err := awsRestjson1_deserializeDocumentOutputTagMap(&sv.Tags, value); err != nil { return err } case "VotingPolicy": if err := awsRestjson1_deserializeDocumentVotingPolicy(&sv.VotingPolicy, value); err != nil { return err } case "VpcEndpointServiceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.VpcEndpointServiceName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNetworkEthereumAttributes(v **types.NetworkEthereumAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NetworkEthereumAttributes if *v == nil { sv = &types.NetworkEthereumAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "ChainId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ChainId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNetworkFabricAttributes(v **types.NetworkFabricAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NetworkFabricAttributes if *v == nil { sv = &types.NetworkFabricAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "Edition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Edition to be of type string, got %T instead", value) } sv.Edition = types.Edition(jtv) } case "OrderingServiceEndpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.OrderingServiceEndpoint = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNetworkFrameworkAttributes(v **types.NetworkFrameworkAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NetworkFrameworkAttributes if *v == nil { sv = &types.NetworkFrameworkAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "Ethereum": if err := awsRestjson1_deserializeDocumentNetworkEthereumAttributes(&sv.Ethereum, value); err != nil { return err } case "Fabric": if err := awsRestjson1_deserializeDocumentNetworkFabricAttributes(&sv.Fabric, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNetworkSummary(v **types.NetworkSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NetworkSummary if *v == nil { sv = &types.NetworkSummary{} } 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 ArnString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationDate = ptr.Time(t) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DescriptionString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "Framework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Framework to be of type string, got %T instead", value) } sv.Framework = types.Framework(jtv) } case "FrameworkVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FrameworkVersionString to be of type string, got %T instead", value) } sv.FrameworkVersion = ptr.String(jtv) } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NameString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NetworkStatus to be of type string, got %T instead", value) } sv.Status = types.NetworkStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNetworkSummaryList(v *[]types.NetworkSummary, 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.NetworkSummary if *v == nil { cv = []types.NetworkSummary{} } else { cv = *v } for _, value := range shape { var col types.NetworkSummary destAddr := &col if err := awsRestjson1_deserializeDocumentNetworkSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentNode(v **types.Node, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Node if *v == nil { sv = &types.Node{} } 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 ArnString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AvailabilityZone": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AvailabilityZoneString to be of type string, got %T instead", value) } sv.AvailabilityZone = ptr.String(jtv) } case "CreationDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationDate = ptr.Time(t) } case "FrameworkAttributes": if err := awsRestjson1_deserializeDocumentNodeFrameworkAttributes(&sv.FrameworkAttributes, value); err != nil { return err } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "InstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected InstanceTypeString to be of type string, got %T instead", value) } sv.InstanceType = ptr.String(jtv) } case "KmsKeyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.KmsKeyArn = ptr.String(jtv) } case "LogPublishingConfiguration": if err := awsRestjson1_deserializeDocumentNodeLogPublishingConfiguration(&sv.LogPublishingConfiguration, value); err != nil { return err } case "MemberId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.MemberId = ptr.String(jtv) } case "NetworkId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.NetworkId = ptr.String(jtv) } case "StateDB": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StateDBType to be of type string, got %T instead", value) } sv.StateDB = types.StateDBType(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NodeStatus to be of type string, got %T instead", value) } sv.Status = types.NodeStatus(jtv) } case "Tags": if err := awsRestjson1_deserializeDocumentOutputTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNodeEthereumAttributes(v **types.NodeEthereumAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NodeEthereumAttributes if *v == nil { sv = &types.NodeEthereumAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "HttpEndpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.HttpEndpoint = ptr.String(jtv) } case "WebSocketEndpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.WebSocketEndpoint = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNodeFabricAttributes(v **types.NodeFabricAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NodeFabricAttributes if *v == nil { sv = &types.NodeFabricAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "PeerEndpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.PeerEndpoint = ptr.String(jtv) } case "PeerEventEndpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.PeerEventEndpoint = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNodeFabricLogPublishingConfiguration(v **types.NodeFabricLogPublishingConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NodeFabricLogPublishingConfiguration if *v == nil { sv = &types.NodeFabricLogPublishingConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ChaincodeLogs": if err := awsRestjson1_deserializeDocumentLogConfigurations(&sv.ChaincodeLogs, value); err != nil { return err } case "PeerLogs": if err := awsRestjson1_deserializeDocumentLogConfigurations(&sv.PeerLogs, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNodeFrameworkAttributes(v **types.NodeFrameworkAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NodeFrameworkAttributes if *v == nil { sv = &types.NodeFrameworkAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "Ethereum": if err := awsRestjson1_deserializeDocumentNodeEthereumAttributes(&sv.Ethereum, value); err != nil { return err } case "Fabric": if err := awsRestjson1_deserializeDocumentNodeFabricAttributes(&sv.Fabric, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNodeLogPublishingConfiguration(v **types.NodeLogPublishingConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NodeLogPublishingConfiguration if *v == nil { sv = &types.NodeLogPublishingConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Fabric": if err := awsRestjson1_deserializeDocumentNodeFabricLogPublishingConfiguration(&sv.Fabric, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNodeSummary(v **types.NodeSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NodeSummary if *v == nil { sv = &types.NodeSummary{} } 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 ArnString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AvailabilityZone": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AvailabilityZoneString to be of type string, got %T instead", value) } sv.AvailabilityZone = ptr.String(jtv) } case "CreationDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationDate = ptr.Time(t) } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "InstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected InstanceTypeString to be of type string, got %T instead", value) } sv.InstanceType = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NodeStatus to be of type string, got %T instead", value) } sv.Status = types.NodeStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNodeSummaryList(v *[]types.NodeSummary, 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.NodeSummary if *v == nil { cv = []types.NodeSummary{} } else { cv = *v } for _, value := range shape { var col types.NodeSummary destAddr := &col if err := awsRestjson1_deserializeDocumentNodeSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentOutputTagMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var mv map[string]string if *v == nil { mv = map[string]string{} } else { mv = *v } for key, value := range shape { var parsedVal string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentProposal(v **types.Proposal, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Proposal if *v == nil { sv = &types.Proposal{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentProposalActions(&sv.Actions, value); err != nil { return err } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ArnString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationDate = ptr.Time(t) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DescriptionString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "ExpirationDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.ExpirationDate = ptr.Time(t) } case "NetworkId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.NetworkId = ptr.String(jtv) } case "NoVoteCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected VoteCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.NoVoteCount = ptr.Int32(int32(i64)) } case "OutstandingVoteCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected VoteCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.OutstandingVoteCount = ptr.Int32(int32(i64)) } case "ProposalId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.ProposalId = ptr.String(jtv) } case "ProposedByMemberId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.ProposedByMemberId = ptr.String(jtv) } case "ProposedByMemberName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NetworkMemberNameString to be of type string, got %T instead", value) } sv.ProposedByMemberName = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProposalStatus to be of type string, got %T instead", value) } sv.Status = types.ProposalStatus(jtv) } case "Tags": if err := awsRestjson1_deserializeDocumentOutputTagMap(&sv.Tags, value); err != nil { return err } case "YesVoteCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected VoteCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.YesVoteCount = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentProposalActions(v **types.ProposalActions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ProposalActions if *v == nil { sv = &types.ProposalActions{} } else { sv = *v } for key, value := range shape { switch key { case "Invitations": if err := awsRestjson1_deserializeDocumentInviteActionList(&sv.Invitations, value); err != nil { return err } case "Removals": if err := awsRestjson1_deserializeDocumentRemoveActionList(&sv.Removals, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentProposalSummary(v **types.ProposalSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ProposalSummary if *v == nil { sv = &types.ProposalSummary{} } 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 ArnString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationDate = ptr.Time(t) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DescriptionString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "ExpirationDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.ExpirationDate = ptr.Time(t) } case "ProposalId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.ProposalId = ptr.String(jtv) } case "ProposedByMemberId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.ProposedByMemberId = ptr.String(jtv) } case "ProposedByMemberName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NetworkMemberNameString to be of type string, got %T instead", value) } sv.ProposedByMemberName = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProposalStatus to be of type string, got %T instead", value) } sv.Status = types.ProposalStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentProposalSummaryList(v *[]types.ProposalSummary, 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.ProposalSummary if *v == nil { cv = []types.ProposalSummary{} } else { cv = *v } for _, value := range shape { var col types.ProposalSummary destAddr := &col if err := awsRestjson1_deserializeDocumentProposalSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentProposalVoteList(v *[]types.VoteSummary, 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.VoteSummary if *v == nil { cv = []types.VoteSummary{} } else { cv = *v } for _, value := range shape { var col types.VoteSummary destAddr := &col if err := awsRestjson1_deserializeDocumentVoteSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRemoveAction(v **types.RemoveAction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RemoveAction if *v == nil { sv = &types.RemoveAction{} } else { sv = *v } for key, value := range shape { switch key { case "MemberId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.MemberId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRemoveActionList(v *[]types.RemoveAction, 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.RemoveAction if *v == nil { cv = []types.RemoveAction{} } else { cv = *v } for _, value := range shape { var col types.RemoveAction destAddr := &col if err := awsRestjson1_deserializeDocumentRemoveAction(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentResourceAlreadyExistsException(v **types.ResourceAlreadyExistsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceAlreadyExistsException if *v == nil { sv = &types.ResourceAlreadyExistsException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceLimitExceededException(v **types.ResourceLimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceLimitExceededException if *v == nil { sv = &types.ResourceLimitExceededException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceNotFoundException if *v == nil { sv = &types.ResourceNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "ResourceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ArnString to be of type string, got %T instead", value) } sv.ResourceName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceNotReadyException(v **types.ResourceNotReadyException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceNotReadyException if *v == nil { sv = &types.ResourceNotReadyException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ThrottlingException if *v == nil { sv = &types.ThrottlingException{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.TooManyTagsException if *v == nil { sv = &types.TooManyTagsException{} } 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 ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "ResourceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ArnString to be of type string, got %T instead", value) } sv.ResourceName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVoteSummary(v **types.VoteSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.VoteSummary if *v == nil { sv = &types.VoteSummary{} } else { sv = *v } for key, value := range shape { switch key { case "MemberId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.MemberId = ptr.String(jtv) } case "MemberName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NetworkMemberNameString to be of type string, got %T instead", value) } sv.MemberName = ptr.String(jtv) } case "Vote": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VoteValue to be of type string, got %T instead", value) } sv.Vote = types.VoteValue(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVotingPolicy(v **types.VotingPolicy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.VotingPolicy if *v == nil { sv = &types.VotingPolicy{} } else { sv = *v } for key, value := range shape { switch key { case "ApprovalThresholdPolicy": if err := awsRestjson1_deserializeDocumentApprovalThresholdPolicy(&sv.ApprovalThresholdPolicy, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil }
7,005
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package managedblockchain provides the API client, operations, and parameter // types for Amazon Managed Blockchain. // // Amazon Managed Blockchain is a fully managed service for creating and managing // blockchain networks using open-source frameworks. Blockchain allows you to build // applications where multiple parties can securely and transparently run // transactions and share data without the need for a trusted, central authority. // Managed Blockchain supports the Hyperledger Fabric and Ethereum open-source // frameworks. Because of fundamental differences between the frameworks, some API // actions or data types may only apply in the context of one framework and not the // other. For example, actions related to Hyperledger Fabric network members such // as CreateMember and DeleteMember don't apply to Ethereum. The description for // each action indicates the framework or frameworks to which it applies. Data // types and properties that apply only in the context of a particular framework // are similarly indicated. package managedblockchain
19
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain 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/managedblockchain/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 = "managedblockchain" } 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 managedblockchain // goModuleVersion is the tagged release for this module const goModuleVersion = "1.15.9"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/managedblockchain/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_serializeOpCreateAccessor struct { } func (*awsRestjson1_serializeOpCreateAccessor) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateAccessor) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateAccessorInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/accessors") 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_serializeOpDocumentCreateAccessorInput(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_serializeOpHttpBindingsCreateAccessorInput(v *CreateAccessorInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateAccessorInput(v *CreateAccessorInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.AccessorType) > 0 { ok := object.Key("AccessorType") ok.String(string(v.AccessorType)) } if v.ClientRequestToken != nil { ok := object.Key("ClientRequestToken") ok.String(*v.ClientRequestToken) } if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocumentInputTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateMember struct { } func (*awsRestjson1_serializeOpCreateMember) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateMember) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateMemberInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/members") 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_serializeOpHttpBindingsCreateMemberInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateMemberInput(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_serializeOpHttpBindingsCreateMemberInput(v *CreateMemberInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.NetworkId == nil || len(*v.NetworkId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NetworkId must not be empty")} } if v.NetworkId != nil { if err := encoder.SetURI("NetworkId").String(*v.NetworkId); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentCreateMemberInput(v *CreateMemberInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientRequestToken != nil { ok := object.Key("ClientRequestToken") ok.String(*v.ClientRequestToken) } if v.InvitationId != nil { ok := object.Key("InvitationId") ok.String(*v.InvitationId) } if v.MemberConfiguration != nil { ok := object.Key("MemberConfiguration") if err := awsRestjson1_serializeDocumentMemberConfiguration(v.MemberConfiguration, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateNetwork struct { } func (*awsRestjson1_serializeOpCreateNetwork) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateNetwork) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateNetworkInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/networks") 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_serializeOpDocumentCreateNetworkInput(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_serializeOpHttpBindingsCreateNetworkInput(v *CreateNetworkInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateNetworkInput(v *CreateNetworkInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientRequestToken != nil { ok := object.Key("ClientRequestToken") ok.String(*v.ClientRequestToken) } if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if len(v.Framework) > 0 { ok := object.Key("Framework") ok.String(string(v.Framework)) } if v.FrameworkConfiguration != nil { ok := object.Key("FrameworkConfiguration") if err := awsRestjson1_serializeDocumentNetworkFrameworkConfiguration(v.FrameworkConfiguration, ok); err != nil { return err } } if v.FrameworkVersion != nil { ok := object.Key("FrameworkVersion") ok.String(*v.FrameworkVersion) } if v.MemberConfiguration != nil { ok := object.Key("MemberConfiguration") if err := awsRestjson1_serializeDocumentMemberConfiguration(v.MemberConfiguration, ok); err != nil { return err } } if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocumentInputTagMap(v.Tags, ok); err != nil { return err } } if v.VotingPolicy != nil { ok := object.Key("VotingPolicy") if err := awsRestjson1_serializeDocumentVotingPolicy(v.VotingPolicy, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateNode struct { } func (*awsRestjson1_serializeOpCreateNode) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateNode) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateNodeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/nodes") 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_serializeOpHttpBindingsCreateNodeInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateNodeInput(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_serializeOpHttpBindingsCreateNodeInput(v *CreateNodeInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.NetworkId == nil || len(*v.NetworkId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NetworkId must not be empty")} } if v.NetworkId != nil { if err := encoder.SetURI("NetworkId").String(*v.NetworkId); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentCreateNodeInput(v *CreateNodeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientRequestToken != nil { ok := object.Key("ClientRequestToken") ok.String(*v.ClientRequestToken) } if v.MemberId != nil { ok := object.Key("MemberId") ok.String(*v.MemberId) } if v.NodeConfiguration != nil { ok := object.Key("NodeConfiguration") if err := awsRestjson1_serializeDocumentNodeConfiguration(v.NodeConfiguration, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocumentInputTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateProposal struct { } func (*awsRestjson1_serializeOpCreateProposal) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateProposal) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateProposalInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/proposals") 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_serializeOpHttpBindingsCreateProposalInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateProposalInput(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_serializeOpHttpBindingsCreateProposalInput(v *CreateProposalInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.NetworkId == nil || len(*v.NetworkId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NetworkId must not be empty")} } if v.NetworkId != nil { if err := encoder.SetURI("NetworkId").String(*v.NetworkId); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentCreateProposalInput(v *CreateProposalInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Actions != nil { ok := object.Key("Actions") if err := awsRestjson1_serializeDocumentProposalActions(v.Actions, ok); err != nil { return err } } if v.ClientRequestToken != nil { ok := object.Key("ClientRequestToken") ok.String(*v.ClientRequestToken) } if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.MemberId != nil { ok := object.Key("MemberId") ok.String(*v.MemberId) } if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocumentInputTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteAccessor struct { } func (*awsRestjson1_serializeOpDeleteAccessor) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteAccessor) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteAccessorInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/accessors/{AccessorId}") 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_serializeOpHttpBindingsDeleteAccessorInput(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_serializeOpHttpBindingsDeleteAccessorInput(v *DeleteAccessorInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.AccessorId == nil || len(*v.AccessorId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member AccessorId must not be empty")} } if v.AccessorId != nil { if err := encoder.SetURI("AccessorId").String(*v.AccessorId); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteMember struct { } func (*awsRestjson1_serializeOpDeleteMember) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteMember) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteMemberInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/members/{MemberId}") 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_serializeOpHttpBindingsDeleteMemberInput(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_serializeOpHttpBindingsDeleteMemberInput(v *DeleteMemberInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MemberId == nil || len(*v.MemberId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member MemberId must not be empty")} } if v.MemberId != nil { if err := encoder.SetURI("MemberId").String(*v.MemberId); err != nil { return err } } if v.NetworkId == nil || len(*v.NetworkId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NetworkId must not be empty")} } if v.NetworkId != nil { if err := encoder.SetURI("NetworkId").String(*v.NetworkId); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteNode struct { } func (*awsRestjson1_serializeOpDeleteNode) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteNode) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteNodeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/nodes/{NodeId}") 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_serializeOpHttpBindingsDeleteNodeInput(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_serializeOpHttpBindingsDeleteNodeInput(v *DeleteNodeInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MemberId != nil { encoder.SetQuery("memberId").String(*v.MemberId) } if v.NetworkId == nil || len(*v.NetworkId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NetworkId must not be empty")} } if v.NetworkId != nil { if err := encoder.SetURI("NetworkId").String(*v.NetworkId); err != nil { return err } } if v.NodeId == nil || len(*v.NodeId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NodeId must not be empty")} } if v.NodeId != nil { if err := encoder.SetURI("NodeId").String(*v.NodeId); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetAccessor struct { } func (*awsRestjson1_serializeOpGetAccessor) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetAccessor) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetAccessorInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/accessors/{AccessorId}") 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_serializeOpHttpBindingsGetAccessorInput(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_serializeOpHttpBindingsGetAccessorInput(v *GetAccessorInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.AccessorId == nil || len(*v.AccessorId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member AccessorId must not be empty")} } if v.AccessorId != nil { if err := encoder.SetURI("AccessorId").String(*v.AccessorId); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetMember struct { } func (*awsRestjson1_serializeOpGetMember) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetMember) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetMemberInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/members/{MemberId}") 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_serializeOpHttpBindingsGetMemberInput(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_serializeOpHttpBindingsGetMemberInput(v *GetMemberInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MemberId == nil || len(*v.MemberId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member MemberId must not be empty")} } if v.MemberId != nil { if err := encoder.SetURI("MemberId").String(*v.MemberId); err != nil { return err } } if v.NetworkId == nil || len(*v.NetworkId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NetworkId must not be empty")} } if v.NetworkId != nil { if err := encoder.SetURI("NetworkId").String(*v.NetworkId); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetNetwork struct { } func (*awsRestjson1_serializeOpGetNetwork) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetNetwork) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetNetworkInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}") 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_serializeOpHttpBindingsGetNetworkInput(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_serializeOpHttpBindingsGetNetworkInput(v *GetNetworkInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.NetworkId == nil || len(*v.NetworkId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NetworkId must not be empty")} } if v.NetworkId != nil { if err := encoder.SetURI("NetworkId").String(*v.NetworkId); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetNode struct { } func (*awsRestjson1_serializeOpGetNode) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetNode) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetNodeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/nodes/{NodeId}") 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_serializeOpHttpBindingsGetNodeInput(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_serializeOpHttpBindingsGetNodeInput(v *GetNodeInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MemberId != nil { encoder.SetQuery("memberId").String(*v.MemberId) } if v.NetworkId == nil || len(*v.NetworkId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NetworkId must not be empty")} } if v.NetworkId != nil { if err := encoder.SetURI("NetworkId").String(*v.NetworkId); err != nil { return err } } if v.NodeId == nil || len(*v.NodeId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NodeId must not be empty")} } if v.NodeId != nil { if err := encoder.SetURI("NodeId").String(*v.NodeId); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetProposal struct { } func (*awsRestjson1_serializeOpGetProposal) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetProposal) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetProposalInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/proposals/{ProposalId}") 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_serializeOpHttpBindingsGetProposalInput(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_serializeOpHttpBindingsGetProposalInput(v *GetProposalInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.NetworkId == nil || len(*v.NetworkId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NetworkId must not be empty")} } if v.NetworkId != nil { if err := encoder.SetURI("NetworkId").String(*v.NetworkId); err != nil { return err } } if v.ProposalId == nil || len(*v.ProposalId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ProposalId must not be empty")} } if v.ProposalId != nil { if err := encoder.SetURI("ProposalId").String(*v.ProposalId); err != nil { return err } } return nil } type awsRestjson1_serializeOpListAccessors struct { } func (*awsRestjson1_serializeOpListAccessors) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListAccessors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListAccessorsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/accessors") 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_serializeOpHttpBindingsListAccessorsInput(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_serializeOpHttpBindingsListAccessorsInput(v *ListAccessorsInput, 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_serializeOpListInvitations struct { } func (*awsRestjson1_serializeOpListInvitations) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListInvitations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListInvitationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/invitations") 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_serializeOpHttpBindingsListInvitationsInput(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_serializeOpHttpBindingsListInvitationsInput(v *ListInvitationsInput, 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_serializeOpListMembers struct { } func (*awsRestjson1_serializeOpListMembers) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListMembers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListMembersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/members") 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_serializeOpHttpBindingsListMembersInput(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_serializeOpHttpBindingsListMembersInput(v *ListMembersInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.IsOwned != nil { encoder.SetQuery("isOwned").Boolean(*v.IsOwned) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.Name != nil { encoder.SetQuery("name").String(*v.Name) } if v.NetworkId == nil || len(*v.NetworkId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NetworkId must not be empty")} } if v.NetworkId != nil { if err := encoder.SetURI("NetworkId").String(*v.NetworkId); err != nil { return err } } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if len(v.Status) > 0 { encoder.SetQuery("status").String(string(v.Status)) } return nil } type awsRestjson1_serializeOpListNetworks struct { } func (*awsRestjson1_serializeOpListNetworks) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListNetworks) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListNetworksInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/networks") 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_serializeOpHttpBindingsListNetworksInput(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_serializeOpHttpBindingsListNetworksInput(v *ListNetworksInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if len(v.Framework) > 0 { encoder.SetQuery("framework").String(string(v.Framework)) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.Name != nil { encoder.SetQuery("name").String(*v.Name) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if len(v.Status) > 0 { encoder.SetQuery("status").String(string(v.Status)) } return nil } type awsRestjson1_serializeOpListNodes struct { } func (*awsRestjson1_serializeOpListNodes) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListNodes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListNodesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/nodes") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListNodesInput(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_serializeOpHttpBindingsListNodesInput(v *ListNodesInput, 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.MemberId != nil { encoder.SetQuery("memberId").String(*v.MemberId) } if v.NetworkId == nil || len(*v.NetworkId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NetworkId must not be empty")} } if v.NetworkId != nil { if err := encoder.SetURI("NetworkId").String(*v.NetworkId); err != nil { return err } } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if len(v.Status) > 0 { encoder.SetQuery("status").String(string(v.Status)) } return nil } type awsRestjson1_serializeOpListProposals struct { } func (*awsRestjson1_serializeOpListProposals) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListProposals) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListProposalsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/proposals") 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_serializeOpHttpBindingsListProposalsInput(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_serializeOpHttpBindingsListProposalsInput(v *ListProposalsInput, 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.NetworkId == nil || len(*v.NetworkId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NetworkId must not be empty")} } if v.NetworkId != nil { if err := encoder.SetURI("NetworkId").String(*v.NetworkId); err != nil { return err } } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListProposalVotes struct { } func (*awsRestjson1_serializeOpListProposalVotes) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListProposalVotes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListProposalVotesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/proposals/{ProposalId}/votes") 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_serializeOpHttpBindingsListProposalVotesInput(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_serializeOpHttpBindingsListProposalVotesInput(v *ListProposalVotesInput, 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.NetworkId == nil || len(*v.NetworkId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NetworkId must not be empty")} } if v.NetworkId != nil { if err := encoder.SetURI("NetworkId").String(*v.NetworkId); err != nil { return err } } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if v.ProposalId == nil || len(*v.ProposalId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ProposalId must not be empty")} } if v.ProposalId != nil { if err := encoder.SetURI("ProposalId").String(*v.ProposalId); err != nil { return err } } return nil } type awsRestjson1_serializeOpListTagsForResource struct { } func (*awsRestjson1_serializeOpListTagsForResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListTagsForResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpRejectInvitation struct { } func (*awsRestjson1_serializeOpRejectInvitation) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpRejectInvitation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RejectInvitationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/invitations/{InvitationId}") 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_serializeOpHttpBindingsRejectInvitationInput(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_serializeOpHttpBindingsRejectInvitationInput(v *RejectInvitationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.InvitationId == nil || len(*v.InvitationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member InvitationId must not be empty")} } if v.InvitationId != nil { if err := encoder.SetURI("InvitationId").String(*v.InvitationId); err != nil { return err } } return nil } type awsRestjson1_serializeOpTagResource struct { } func (*awsRestjson1_serializeOpTagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*TagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocumentInputTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUntagResource struct { } func (*awsRestjson1_serializeOpUntagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UntagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { return err } } if v.TagKeys != nil { for i := range v.TagKeys { encoder.AddQuery("tagKeys").String(v.TagKeys[i]) } } return nil } type awsRestjson1_serializeOpUpdateMember struct { } func (*awsRestjson1_serializeOpUpdateMember) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateMember) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateMemberInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/members/{MemberId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateMemberInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateMemberInput(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_serializeOpHttpBindingsUpdateMemberInput(v *UpdateMemberInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MemberId == nil || len(*v.MemberId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member MemberId must not be empty")} } if v.MemberId != nil { if err := encoder.SetURI("MemberId").String(*v.MemberId); err != nil { return err } } if v.NetworkId == nil || len(*v.NetworkId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NetworkId must not be empty")} } if v.NetworkId != nil { if err := encoder.SetURI("NetworkId").String(*v.NetworkId); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateMemberInput(v *UpdateMemberInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.LogPublishingConfiguration != nil { ok := object.Key("LogPublishingConfiguration") if err := awsRestjson1_serializeDocumentMemberLogPublishingConfiguration(v.LogPublishingConfiguration, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdateNode struct { } func (*awsRestjson1_serializeOpUpdateNode) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateNode) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateNodeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/nodes/{NodeId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateNodeInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateNodeInput(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_serializeOpHttpBindingsUpdateNodeInput(v *UpdateNodeInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.NetworkId == nil || len(*v.NetworkId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NetworkId must not be empty")} } if v.NetworkId != nil { if err := encoder.SetURI("NetworkId").String(*v.NetworkId); err != nil { return err } } if v.NodeId == nil || len(*v.NodeId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NodeId must not be empty")} } if v.NodeId != nil { if err := encoder.SetURI("NodeId").String(*v.NodeId); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateNodeInput(v *UpdateNodeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.LogPublishingConfiguration != nil { ok := object.Key("LogPublishingConfiguration") if err := awsRestjson1_serializeDocumentNodeLogPublishingConfiguration(v.LogPublishingConfiguration, ok); err != nil { return err } } if v.MemberId != nil { ok := object.Key("MemberId") ok.String(*v.MemberId) } return nil } type awsRestjson1_serializeOpVoteOnProposal struct { } func (*awsRestjson1_serializeOpVoteOnProposal) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpVoteOnProposal) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*VoteOnProposalInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/proposals/{ProposalId}/votes") 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_serializeOpHttpBindingsVoteOnProposalInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentVoteOnProposalInput(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_serializeOpHttpBindingsVoteOnProposalInput(v *VoteOnProposalInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.NetworkId == nil || len(*v.NetworkId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NetworkId must not be empty")} } if v.NetworkId != nil { if err := encoder.SetURI("NetworkId").String(*v.NetworkId); err != nil { return err } } if v.ProposalId == nil || len(*v.ProposalId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ProposalId must not be empty")} } if v.ProposalId != nil { if err := encoder.SetURI("ProposalId").String(*v.ProposalId); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentVoteOnProposalInput(v *VoteOnProposalInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Vote) > 0 { ok := object.Key("Vote") ok.String(string(v.Vote)) } if v.VoterMemberId != nil { ok := object.Key("VoterMemberId") ok.String(*v.VoterMemberId) } return nil } func awsRestjson1_serializeDocumentApprovalThresholdPolicy(v *types.ApprovalThresholdPolicy, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ProposalDurationInHours != nil { ok := object.Key("ProposalDurationInHours") ok.Integer(*v.ProposalDurationInHours) } if len(v.ThresholdComparator) > 0 { ok := object.Key("ThresholdComparator") ok.String(string(v.ThresholdComparator)) } if v.ThresholdPercentage != nil { ok := object.Key("ThresholdPercentage") ok.Integer(*v.ThresholdPercentage) } return nil } func awsRestjson1_serializeDocumentInputTagMap(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_serializeDocumentInviteAction(v *types.InviteAction, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Principal != nil { ok := object.Key("Principal") ok.String(*v.Principal) } return nil } func awsRestjson1_serializeDocumentInviteActionList(v []types.InviteAction, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentInviteAction(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentLogConfiguration(v *types.LogConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Enabled != nil { ok := object.Key("Enabled") ok.Boolean(*v.Enabled) } return nil } func awsRestjson1_serializeDocumentLogConfigurations(v *types.LogConfigurations, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Cloudwatch != nil { ok := object.Key("Cloudwatch") if err := awsRestjson1_serializeDocumentLogConfiguration(v.Cloudwatch, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentMemberConfiguration(v *types.MemberConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.FrameworkConfiguration != nil { ok := object.Key("FrameworkConfiguration") if err := awsRestjson1_serializeDocumentMemberFrameworkConfiguration(v.FrameworkConfiguration, ok); err != nil { return err } } if v.KmsKeyArn != nil { ok := object.Key("KmsKeyArn") ok.String(*v.KmsKeyArn) } if v.LogPublishingConfiguration != nil { ok := object.Key("LogPublishingConfiguration") if err := awsRestjson1_serializeDocumentMemberLogPublishingConfiguration(v.LogPublishingConfiguration, ok); err != nil { return err } } if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocumentInputTagMap(v.Tags, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentMemberFabricConfiguration(v *types.MemberFabricConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AdminPassword != nil { ok := object.Key("AdminPassword") ok.String(*v.AdminPassword) } if v.AdminUsername != nil { ok := object.Key("AdminUsername") ok.String(*v.AdminUsername) } return nil } func awsRestjson1_serializeDocumentMemberFabricLogPublishingConfiguration(v *types.MemberFabricLogPublishingConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CaLogs != nil { ok := object.Key("CaLogs") if err := awsRestjson1_serializeDocumentLogConfigurations(v.CaLogs, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentMemberFrameworkConfiguration(v *types.MemberFrameworkConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Fabric != nil { ok := object.Key("Fabric") if err := awsRestjson1_serializeDocumentMemberFabricConfiguration(v.Fabric, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentMemberLogPublishingConfiguration(v *types.MemberLogPublishingConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Fabric != nil { ok := object.Key("Fabric") if err := awsRestjson1_serializeDocumentMemberFabricLogPublishingConfiguration(v.Fabric, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentNetworkFabricConfiguration(v *types.NetworkFabricConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Edition) > 0 { ok := object.Key("Edition") ok.String(string(v.Edition)) } return nil } func awsRestjson1_serializeDocumentNetworkFrameworkConfiguration(v *types.NetworkFrameworkConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Fabric != nil { ok := object.Key("Fabric") if err := awsRestjson1_serializeDocumentNetworkFabricConfiguration(v.Fabric, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentNodeConfiguration(v *types.NodeConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AvailabilityZone != nil { ok := object.Key("AvailabilityZone") ok.String(*v.AvailabilityZone) } if v.InstanceType != nil { ok := object.Key("InstanceType") ok.String(*v.InstanceType) } if v.LogPublishingConfiguration != nil { ok := object.Key("LogPublishingConfiguration") if err := awsRestjson1_serializeDocumentNodeLogPublishingConfiguration(v.LogPublishingConfiguration, ok); err != nil { return err } } if len(v.StateDB) > 0 { ok := object.Key("StateDB") ok.String(string(v.StateDB)) } return nil } func awsRestjson1_serializeDocumentNodeFabricLogPublishingConfiguration(v *types.NodeFabricLogPublishingConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ChaincodeLogs != nil { ok := object.Key("ChaincodeLogs") if err := awsRestjson1_serializeDocumentLogConfigurations(v.ChaincodeLogs, ok); err != nil { return err } } if v.PeerLogs != nil { ok := object.Key("PeerLogs") if err := awsRestjson1_serializeDocumentLogConfigurations(v.PeerLogs, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentNodeLogPublishingConfiguration(v *types.NodeLogPublishingConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Fabric != nil { ok := object.Key("Fabric") if err := awsRestjson1_serializeDocumentNodeFabricLogPublishingConfiguration(v.Fabric, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentProposalActions(v *types.ProposalActions, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Invitations != nil { ok := object.Key("Invitations") if err := awsRestjson1_serializeDocumentInviteActionList(v.Invitations, ok); err != nil { return err } } if v.Removals != nil { ok := object.Key("Removals") if err := awsRestjson1_serializeDocumentRemoveActionList(v.Removals, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentRemoveAction(v *types.RemoveAction, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MemberId != nil { ok := object.Key("MemberId") ok.String(*v.MemberId) } return nil } func awsRestjson1_serializeDocumentRemoveActionList(v []types.RemoveAction, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentRemoveAction(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentVotingPolicy(v *types.VotingPolicy, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ApprovalThresholdPolicy != nil { ok := object.Key("ApprovalThresholdPolicy") if err := awsRestjson1_serializeDocumentApprovalThresholdPolicy(v.ApprovalThresholdPolicy, ok); err != nil { return err } } return nil }
2,386
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package managedblockchain import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/managedblockchain/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpCreateAccessor struct { } func (*validateOpCreateAccessor) ID() string { return "OperationInputValidation" } func (m *validateOpCreateAccessor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateAccessorInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateAccessorInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateMember struct { } func (*validateOpCreateMember) ID() string { return "OperationInputValidation" } func (m *validateOpCreateMember) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateMemberInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateMemberInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateNetwork struct { } func (*validateOpCreateNetwork) ID() string { return "OperationInputValidation" } func (m *validateOpCreateNetwork) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateNetworkInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateNetworkInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateNode struct { } func (*validateOpCreateNode) ID() string { return "OperationInputValidation" } func (m *validateOpCreateNode) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateNodeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateNodeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateProposal struct { } func (*validateOpCreateProposal) ID() string { return "OperationInputValidation" } func (m *validateOpCreateProposal) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateProposalInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateProposalInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteAccessor struct { } func (*validateOpDeleteAccessor) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteAccessor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteAccessorInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteAccessorInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteMember struct { } func (*validateOpDeleteMember) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteMember) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteMemberInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteMemberInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteNode struct { } func (*validateOpDeleteNode) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteNode) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteNodeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteNodeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetAccessor struct { } func (*validateOpGetAccessor) ID() string { return "OperationInputValidation" } func (m *validateOpGetAccessor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetAccessorInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetAccessorInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetMember struct { } func (*validateOpGetMember) ID() string { return "OperationInputValidation" } func (m *validateOpGetMember) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetMemberInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetMemberInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetNetwork struct { } func (*validateOpGetNetwork) ID() string { return "OperationInputValidation" } func (m *validateOpGetNetwork) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetNetworkInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetNetworkInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetNode struct { } func (*validateOpGetNode) ID() string { return "OperationInputValidation" } func (m *validateOpGetNode) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetNodeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetNodeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetProposal struct { } func (*validateOpGetProposal) ID() string { return "OperationInputValidation" } func (m *validateOpGetProposal) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetProposalInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetProposalInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListMembers struct { } func (*validateOpListMembers) ID() string { return "OperationInputValidation" } func (m *validateOpListMembers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListMembersInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListMembersInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListNodes struct { } func (*validateOpListNodes) ID() string { return "OperationInputValidation" } func (m *validateOpListNodes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListNodesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListNodesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListProposals struct { } func (*validateOpListProposals) ID() string { return "OperationInputValidation" } func (m *validateOpListProposals) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListProposalsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListProposalsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListProposalVotes struct { } func (*validateOpListProposalVotes) ID() string { return "OperationInputValidation" } func (m *validateOpListProposalVotes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListProposalVotesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListProposalVotesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListTagsForResource struct { } func (*validateOpListTagsForResource) ID() string { return "OperationInputValidation" } func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListTagsForResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListTagsForResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRejectInvitation struct { } func (*validateOpRejectInvitation) ID() string { return "OperationInputValidation" } func (m *validateOpRejectInvitation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RejectInvitationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRejectInvitationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpTagResource struct { } func (*validateOpTagResource) ID() string { return "OperationInputValidation" } func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUntagResource struct { } func (*validateOpUntagResource) ID() string { return "OperationInputValidation" } func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UntagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUntagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateMember struct { } func (*validateOpUpdateMember) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateMember) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateMemberInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateMemberInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateNode struct { } func (*validateOpUpdateNode) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateNode) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateNodeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateNodeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpVoteOnProposal struct { } func (*validateOpVoteOnProposal) ID() string { return "OperationInputValidation" } func (m *validateOpVoteOnProposal) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*VoteOnProposalInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpVoteOnProposalInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpCreateAccessorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateAccessor{}, middleware.After) } func addOpCreateMemberValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateMember{}, middleware.After) } func addOpCreateNetworkValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateNetwork{}, middleware.After) } func addOpCreateNodeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateNode{}, middleware.After) } func addOpCreateProposalValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateProposal{}, middleware.After) } func addOpDeleteAccessorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteAccessor{}, middleware.After) } func addOpDeleteMemberValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteMember{}, middleware.After) } func addOpDeleteNodeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteNode{}, middleware.After) } func addOpGetAccessorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetAccessor{}, middleware.After) } func addOpGetMemberValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetMember{}, middleware.After) } func addOpGetNetworkValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetNetwork{}, middleware.After) } func addOpGetNodeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetNode{}, middleware.After) } func addOpGetProposalValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetProposal{}, middleware.After) } func addOpListMembersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListMembers{}, middleware.After) } func addOpListNodesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListNodes{}, middleware.After) } func addOpListProposalsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListProposals{}, middleware.After) } func addOpListProposalVotesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListProposalVotes{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } func addOpRejectInvitationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRejectInvitation{}, middleware.After) } func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } func addOpUpdateMemberValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateMember{}, middleware.After) } func addOpUpdateNodeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateNode{}, middleware.After) } func addOpVoteOnProposalValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpVoteOnProposal{}, middleware.After) } func validateInviteAction(v *types.InviteAction) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "InviteAction"} if v.Principal == nil { invalidParams.Add(smithy.NewErrParamRequired("Principal")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateInviteActionList(v []types.InviteAction) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "InviteActionList"} for i := range v { if err := validateInviteAction(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateMemberConfiguration(v *types.MemberConfiguration) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "MemberConfiguration"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.FrameworkConfiguration == nil { invalidParams.Add(smithy.NewErrParamRequired("FrameworkConfiguration")) } else if v.FrameworkConfiguration != nil { if err := validateMemberFrameworkConfiguration(v.FrameworkConfiguration); err != nil { invalidParams.AddNested("FrameworkConfiguration", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateMemberFabricConfiguration(v *types.MemberFabricConfiguration) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "MemberFabricConfiguration"} if v.AdminUsername == nil { invalidParams.Add(smithy.NewErrParamRequired("AdminUsername")) } if v.AdminPassword == nil { invalidParams.Add(smithy.NewErrParamRequired("AdminPassword")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateMemberFrameworkConfiguration(v *types.MemberFrameworkConfiguration) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "MemberFrameworkConfiguration"} if v.Fabric != nil { if err := validateMemberFabricConfiguration(v.Fabric); err != nil { invalidParams.AddNested("Fabric", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateNetworkFabricConfiguration(v *types.NetworkFabricConfiguration) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "NetworkFabricConfiguration"} if len(v.Edition) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Edition")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateNetworkFrameworkConfiguration(v *types.NetworkFrameworkConfiguration) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "NetworkFrameworkConfiguration"} if v.Fabric != nil { if err := validateNetworkFabricConfiguration(v.Fabric); err != nil { invalidParams.AddNested("Fabric", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateNodeConfiguration(v *types.NodeConfiguration) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "NodeConfiguration"} if v.InstanceType == nil { invalidParams.Add(smithy.NewErrParamRequired("InstanceType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateProposalActions(v *types.ProposalActions) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ProposalActions"} if v.Invitations != nil { if err := validateInviteActionList(v.Invitations); err != nil { invalidParams.AddNested("Invitations", err.(smithy.InvalidParamsError)) } } if v.Removals != nil { if err := validateRemoveActionList(v.Removals); err != nil { invalidParams.AddNested("Removals", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateRemoveAction(v *types.RemoveAction) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RemoveAction"} if v.MemberId == nil { invalidParams.Add(smithy.NewErrParamRequired("MemberId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateRemoveActionList(v []types.RemoveAction) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RemoveActionList"} for i := range v { if err := validateRemoveAction(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateAccessorInput(v *CreateAccessorInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateAccessorInput"} if v.ClientRequestToken == nil { invalidParams.Add(smithy.NewErrParamRequired("ClientRequestToken")) } if len(v.AccessorType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("AccessorType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateMemberInput(v *CreateMemberInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateMemberInput"} if v.ClientRequestToken == nil { invalidParams.Add(smithy.NewErrParamRequired("ClientRequestToken")) } if v.InvitationId == nil { invalidParams.Add(smithy.NewErrParamRequired("InvitationId")) } if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } if v.MemberConfiguration == nil { invalidParams.Add(smithy.NewErrParamRequired("MemberConfiguration")) } else if v.MemberConfiguration != nil { if err := validateMemberConfiguration(v.MemberConfiguration); err != nil { invalidParams.AddNested("MemberConfiguration", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateNetworkInput(v *CreateNetworkInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateNetworkInput"} if v.ClientRequestToken == nil { invalidParams.Add(smithy.NewErrParamRequired("ClientRequestToken")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if len(v.Framework) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Framework")) } if v.FrameworkVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("FrameworkVersion")) } if v.FrameworkConfiguration != nil { if err := validateNetworkFrameworkConfiguration(v.FrameworkConfiguration); err != nil { invalidParams.AddNested("FrameworkConfiguration", err.(smithy.InvalidParamsError)) } } if v.VotingPolicy == nil { invalidParams.Add(smithy.NewErrParamRequired("VotingPolicy")) } if v.MemberConfiguration == nil { invalidParams.Add(smithy.NewErrParamRequired("MemberConfiguration")) } else if v.MemberConfiguration != nil { if err := validateMemberConfiguration(v.MemberConfiguration); err != nil { invalidParams.AddNested("MemberConfiguration", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateNodeInput(v *CreateNodeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateNodeInput"} if v.ClientRequestToken == nil { invalidParams.Add(smithy.NewErrParamRequired("ClientRequestToken")) } if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } if v.NodeConfiguration == nil { invalidParams.Add(smithy.NewErrParamRequired("NodeConfiguration")) } else if v.NodeConfiguration != nil { if err := validateNodeConfiguration(v.NodeConfiguration); err != nil { invalidParams.AddNested("NodeConfiguration", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateProposalInput(v *CreateProposalInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateProposalInput"} if v.ClientRequestToken == nil { invalidParams.Add(smithy.NewErrParamRequired("ClientRequestToken")) } if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } if v.MemberId == nil { invalidParams.Add(smithy.NewErrParamRequired("MemberId")) } if v.Actions == nil { invalidParams.Add(smithy.NewErrParamRequired("Actions")) } else if v.Actions != nil { if err := validateProposalActions(v.Actions); err != nil { invalidParams.AddNested("Actions", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteAccessorInput(v *DeleteAccessorInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteAccessorInput"} if v.AccessorId == nil { invalidParams.Add(smithy.NewErrParamRequired("AccessorId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteMemberInput(v *DeleteMemberInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteMemberInput"} if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } if v.MemberId == nil { invalidParams.Add(smithy.NewErrParamRequired("MemberId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteNodeInput(v *DeleteNodeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteNodeInput"} if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } if v.NodeId == nil { invalidParams.Add(smithy.NewErrParamRequired("NodeId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetAccessorInput(v *GetAccessorInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetAccessorInput"} if v.AccessorId == nil { invalidParams.Add(smithy.NewErrParamRequired("AccessorId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetMemberInput(v *GetMemberInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetMemberInput"} if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } if v.MemberId == nil { invalidParams.Add(smithy.NewErrParamRequired("MemberId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetNetworkInput(v *GetNetworkInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetNetworkInput"} if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetNodeInput(v *GetNodeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetNodeInput"} if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } if v.NodeId == nil { invalidParams.Add(smithy.NewErrParamRequired("NodeId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetProposalInput(v *GetProposalInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetProposalInput"} if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } if v.ProposalId == nil { invalidParams.Add(smithy.NewErrParamRequired("ProposalId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListMembersInput(v *ListMembersInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListMembersInput"} if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListNodesInput(v *ListNodesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListNodesInput"} if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListProposalsInput(v *ListProposalsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListProposalsInput"} if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListProposalVotesInput(v *ListProposalVotesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListProposalVotesInput"} if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } if v.ProposalId == nil { invalidParams.Add(smithy.NewErrParamRequired("ProposalId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRejectInvitationInput(v *RejectInvitationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RejectInvitationInput"} if v.InvitationId == nil { invalidParams.Add(smithy.NewErrParamRequired("InvitationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.Tags == nil { invalidParams.Add(smithy.NewErrParamRequired("Tags")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUntagResourceInput(v *UntagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.TagKeys == nil { invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateMemberInput(v *UpdateMemberInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateMemberInput"} if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } if v.MemberId == nil { invalidParams.Add(smithy.NewErrParamRequired("MemberId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateNodeInput(v *UpdateNodeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateNodeInput"} if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } if v.NodeId == nil { invalidParams.Add(smithy.NewErrParamRequired("NodeId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpVoteOnProposalInput(v *VoteOnProposalInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "VoteOnProposalInput"} if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } if v.ProposalId == nil { invalidParams.Add(smithy.NewErrParamRequired("ProposalId")) } if v.VoterMemberId == nil { invalidParams.Add(smithy.NewErrParamRequired("VoterMemberId")) } if len(v.Vote) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Vote")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
1,240
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 ManagedBlockchain 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: "managedblockchain.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "managedblockchain-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "managedblockchain-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "managedblockchain.{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-northeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-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{}, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "managedblockchain.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "managedblockchain-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "managedblockchain-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "managedblockchain.{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: "managedblockchain-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "managedblockchain.{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: "managedblockchain-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "managedblockchain.{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: "managedblockchain-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "managedblockchain.{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: "managedblockchain-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "managedblockchain.{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: "managedblockchain.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "managedblockchain-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "managedblockchain-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "managedblockchain.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{}, }, }, }
322
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 AccessorStatus string // Enum values for AccessorStatus const ( AccessorStatusAvailable AccessorStatus = "AVAILABLE" AccessorStatusPendingDeletion AccessorStatus = "PENDING_DELETION" AccessorStatusDeleted AccessorStatus = "DELETED" ) // Values returns all known values for AccessorStatus. 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 (AccessorStatus) Values() []AccessorStatus { return []AccessorStatus{ "AVAILABLE", "PENDING_DELETION", "DELETED", } } type AccessorType string // Enum values for AccessorType const ( AccessorTypeBillingToken AccessorType = "BILLING_TOKEN" ) // Values returns all known values for AccessorType. 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 (AccessorType) Values() []AccessorType { return []AccessorType{ "BILLING_TOKEN", } } type Edition string // Enum values for Edition const ( EditionStarter Edition = "STARTER" EditionStandard Edition = "STANDARD" ) // Values returns all known values for Edition. 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 (Edition) Values() []Edition { return []Edition{ "STARTER", "STANDARD", } } type Framework string // Enum values for Framework const ( FrameworkHyperledgerFabric Framework = "HYPERLEDGER_FABRIC" FrameworkEthereum Framework = "ETHEREUM" ) // Values returns all known values for Framework. 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 (Framework) Values() []Framework { return []Framework{ "HYPERLEDGER_FABRIC", "ETHEREUM", } } type InvitationStatus string // Enum values for InvitationStatus const ( InvitationStatusPending InvitationStatus = "PENDING" InvitationStatusAccepted InvitationStatus = "ACCEPTED" InvitationStatusAccepting InvitationStatus = "ACCEPTING" InvitationStatusRejected InvitationStatus = "REJECTED" InvitationStatusExpired InvitationStatus = "EXPIRED" ) // Values returns all known values for InvitationStatus. 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 (InvitationStatus) Values() []InvitationStatus { return []InvitationStatus{ "PENDING", "ACCEPTED", "ACCEPTING", "REJECTED", "EXPIRED", } } type MemberStatus string // Enum values for MemberStatus const ( MemberStatusCreating MemberStatus = "CREATING" MemberStatusAvailable MemberStatus = "AVAILABLE" MemberStatusCreateFailed MemberStatus = "CREATE_FAILED" MemberStatusUpdating MemberStatus = "UPDATING" MemberStatusDeleting MemberStatus = "DELETING" MemberStatusDeleted MemberStatus = "DELETED" MemberStatusInaccessibleEncryptionKey MemberStatus = "INACCESSIBLE_ENCRYPTION_KEY" ) // Values returns all known values for MemberStatus. 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 (MemberStatus) Values() []MemberStatus { return []MemberStatus{ "CREATING", "AVAILABLE", "CREATE_FAILED", "UPDATING", "DELETING", "DELETED", "INACCESSIBLE_ENCRYPTION_KEY", } } type NetworkStatus string // Enum values for NetworkStatus const ( NetworkStatusCreating NetworkStatus = "CREATING" NetworkStatusAvailable NetworkStatus = "AVAILABLE" NetworkStatusCreateFailed NetworkStatus = "CREATE_FAILED" NetworkStatusDeleting NetworkStatus = "DELETING" NetworkStatusDeleted NetworkStatus = "DELETED" ) // Values returns all known values for NetworkStatus. 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 (NetworkStatus) Values() []NetworkStatus { return []NetworkStatus{ "CREATING", "AVAILABLE", "CREATE_FAILED", "DELETING", "DELETED", } } type NodeStatus string // Enum values for NodeStatus const ( NodeStatusCreating NodeStatus = "CREATING" NodeStatusAvailable NodeStatus = "AVAILABLE" NodeStatusUnhealthy NodeStatus = "UNHEALTHY" NodeStatusCreateFailed NodeStatus = "CREATE_FAILED" NodeStatusUpdating NodeStatus = "UPDATING" NodeStatusDeleting NodeStatus = "DELETING" NodeStatusDeleted NodeStatus = "DELETED" NodeStatusFailed NodeStatus = "FAILED" NodeStatusInaccessibleEncryptionKey NodeStatus = "INACCESSIBLE_ENCRYPTION_KEY" ) // Values returns all known values for NodeStatus. Note that this can be expanded // in the future, and so it is only as up to date as the client. The ordering of // this slice is not guaranteed to be stable across updates. func (NodeStatus) Values() []NodeStatus { return []NodeStatus{ "CREATING", "AVAILABLE", "UNHEALTHY", "CREATE_FAILED", "UPDATING", "DELETING", "DELETED", "FAILED", "INACCESSIBLE_ENCRYPTION_KEY", } } type ProposalStatus string // Enum values for ProposalStatus const ( ProposalStatusInProgress ProposalStatus = "IN_PROGRESS" ProposalStatusApproved ProposalStatus = "APPROVED" ProposalStatusRejected ProposalStatus = "REJECTED" ProposalStatusExpired ProposalStatus = "EXPIRED" ProposalStatusActionFailed ProposalStatus = "ACTION_FAILED" ) // Values returns all known values for ProposalStatus. 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 (ProposalStatus) Values() []ProposalStatus { return []ProposalStatus{ "IN_PROGRESS", "APPROVED", "REJECTED", "EXPIRED", "ACTION_FAILED", } } type StateDBType string // Enum values for StateDBType const ( StateDBTypeLevelDB StateDBType = "LevelDB" StateDBTypeCouchDB StateDBType = "CouchDB" ) // Values returns all known values for StateDBType. 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 (StateDBType) Values() []StateDBType { return []StateDBType{ "LevelDB", "CouchDB", } } type ThresholdComparator string // Enum values for ThresholdComparator const ( ThresholdComparatorGreaterThan ThresholdComparator = "GREATER_THAN" ThresholdComparatorGreaterThanOrEqualTo ThresholdComparator = "GREATER_THAN_OR_EQUAL_TO" ) // Values returns all known values for ThresholdComparator. 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 (ThresholdComparator) Values() []ThresholdComparator { return []ThresholdComparator{ "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", } } type VoteValue string // Enum values for VoteValue const ( VoteValueYes VoteValue = "YES" VoteValueNo VoteValue = "NO" ) // Values returns all known values for VoteValue. 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 (VoteValue) Values() []VoteValue { return []VoteValue{ "YES", "NO", } }
262
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( "fmt" smithy "github.com/aws/smithy-go" ) // You don't have sufficient access to perform this action. type AccessDeniedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AccessDeniedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccessDeniedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccessDeniedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccessDeniedException" } return *e.ErrorCodeOverride } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } type IllegalActionException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *IllegalActionException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *IllegalActionException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *IllegalActionException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "IllegalActionException" } return *e.ErrorCodeOverride } func (e *IllegalActionException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request processing has failed because of an unknown error, exception or // failure. type InternalServiceErrorException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InternalServiceErrorException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalServiceErrorException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalServiceErrorException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalServiceErrorException" } return *e.ErrorCodeOverride } func (e *InternalServiceErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // The action or operation requested is invalid. Verify that the action is typed // correctly. type InvalidRequestException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidRequestException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidRequestException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidRequestException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidRequestException" } return *e.ErrorCodeOverride } func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // A resource request is issued for a resource that already exists. type ResourceAlreadyExistsException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ResourceAlreadyExistsException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceAlreadyExistsException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceAlreadyExistsException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceAlreadyExistsException" } return *e.ErrorCodeOverride } func (e *ResourceAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The maximum number of resources of that type already exist. Ensure the // resources requested are within the boundaries of the service edition and your // account limits. type ResourceLimitExceededException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ResourceLimitExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceLimitExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceLimitExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceLimitExceededException" } return *e.ErrorCodeOverride } func (e *ResourceLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // A requested resource doesn't exist. It may have been deleted or referenced // incorrectly. type ResourceNotFoundException struct { Message *string ErrorCodeOverride *string ResourceName *string noSmithyDocumentSerde } func (e *ResourceNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceNotFoundException" } return *e.ErrorCodeOverride } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The requested resource exists but isn't in a status that can complete the // operation. type ResourceNotReadyException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ResourceNotReadyException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceNotReadyException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceNotReadyException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceNotReadyException" } return *e.ErrorCodeOverride } func (e *ResourceNotReadyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request or operation couldn't be performed because a service is throttling // requests. The most common source of throttling errors is creating resources that // exceed your service limit for this resource type. Request a limit increase or // delete unused resources if possible. 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 } type TooManyTagsException struct { Message *string ErrorCodeOverride *string ResourceName *string noSmithyDocumentSerde } func (e *TooManyTagsException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TooManyTagsException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TooManyTagsException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "TooManyTagsException" } return *e.ErrorCodeOverride } func (e *TooManyTagsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
280
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 properties of the Accessor. type Accessor struct { // The Amazon Resource Name (ARN) of the accessor. For more information about ARNs // and their format, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. Arn *string // The billing token is a property of the accessor. Use this token to make // Ethereum API calls to your Ethereum node. The billing token is used to track // your accessor object for billing Ethereum API requests made to your Ethereum // nodes. BillingToken *string // The creation date and time of the accessor. CreationDate *time.Time // The unique identifier of the accessor. Id *string // The current status of the accessor. Status AccessorStatus // The tags assigned to the Accessor. For more information about tags, see Tagging // Resources (https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html) // in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html) // in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. Tags map[string]string // The type of the accessor. Currently, accessor type is restricted to // BILLING_TOKEN . Type AccessorType noSmithyDocumentSerde } // A summary of accessor properties. type AccessorSummary struct { // The Amazon Resource Name (ARN) of the accessor. For more information about ARNs // and their format, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. Arn *string // The creation date and time of the accessor. CreationDate *time.Time // The unique identifier of the accessor. Id *string // The current status of the accessor. Status AccessorStatus // The type of the accessor. Currently accessor type is restricted to BILLING_TOKEN // . Type AccessorType noSmithyDocumentSerde } // A policy type that defines the voting rules for the network. The rules decide // if a proposal is approved. Approval may be based on criteria such as the // percentage of YES votes and the duration of the proposal. The policy applies to // all proposals and is specified when the network is created. Applies only to // Hyperledger Fabric. type ApprovalThresholdPolicy struct { // The duration from the time that a proposal is created until it expires. If // members cast neither the required number of YES votes to approve the proposal // nor the number of NO votes required to reject it before the duration expires, // the proposal is EXPIRED and ProposalActions aren't carried out. ProposalDurationInHours *int32 // Determines whether the vote percentage must be greater than the // ThresholdPercentage or must be greater than or equal to the ThreholdPercentage // to be approved. ThresholdComparator ThresholdComparator // The percentage of votes among all members that must be YES for a proposal to be // approved. For example, a ThresholdPercentage value of 50 indicates 50%. The // ThresholdComparator determines the precise comparison. If a ThresholdPercentage // value of 50 is specified on a network with 10 members, along with a // ThresholdComparator value of GREATER_THAN , this indicates that 6 YES votes are // required for the proposal to be approved. ThresholdPercentage *int32 noSmithyDocumentSerde } // An invitation to an Amazon Web Services account to create a member and join the // network. Applies only to Hyperledger Fabric. type Invitation struct { // The Amazon Resource Name (ARN) of the invitation. For more information about // ARNs and their format, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. Arn *string // The date and time that the invitation was created. CreationDate *time.Time // The date and time that the invitation expires. This is the CreationDate plus // the ProposalDurationInHours that is specified in the ProposalThresholdPolicy . // After this date and time, the invitee can no longer create a member and join the // network using this InvitationId . ExpirationDate *time.Time // The unique identifier for the invitation. InvitationId *string // A summary of network configuration properties. NetworkSummary *NetworkSummary // The status of the invitation: // - PENDING - The invitee hasn't created a member to join the network, and the // invitation hasn't yet expired. // - ACCEPTING - The invitee has begun creating a member, and creation hasn't yet // completed. // - ACCEPTED - The invitee created a member and joined the network using the // InvitationID . // - REJECTED - The invitee rejected the invitation. // - EXPIRED - The invitee neither created a member nor rejected the invitation // before the ExpirationDate . Status InvitationStatus noSmithyDocumentSerde } // An action to invite a specific Amazon Web Services account to create a member // and join the network. The InviteAction is carried out when a Proposal is // APPROVED . Applies only to Hyperledger Fabric. type InviteAction struct { // The Amazon Web Services account ID to invite. // // This member is required. Principal *string noSmithyDocumentSerde } // A configuration for logging events. type LogConfiguration struct { // Indicates whether logging is enabled. Enabled *bool noSmithyDocumentSerde } // A collection of log configurations. type LogConfigurations struct { // Parameters for publishing logs to Amazon CloudWatch Logs. Cloudwatch *LogConfiguration noSmithyDocumentSerde } // Member configuration properties. Applies only to Hyperledger Fabric. type Member struct { // The Amazon Resource Name (ARN) of the member. For more information about ARNs // and their format, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. Arn *string // The date and time that the member was created. CreationDate *time.Time // An optional description for the member. Description *string // Attributes relevant to a member for the blockchain framework that the Managed // Blockchain network uses. FrameworkAttributes *MemberFrameworkAttributes // The unique identifier of the member. Id *string // The Amazon Resource Name (ARN) of the customer managed key in Key Management // Service (KMS) that the member uses for encryption at rest. If the value of this // parameter is "AWS Owned KMS Key" , the member uses an Amazon Web Services owned // KMS key for encryption. This parameter is inherited by the nodes that this // member owns. For more information, see Encryption at Rest (https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/managed-blockchain-encryption-at-rest.html) // in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. KmsKeyArn *string // Configuration properties for logging events associated with a member. LogPublishingConfiguration *MemberLogPublishingConfiguration // The name of the member. Name *string // The unique identifier of the network to which the member belongs. NetworkId *string // The status of a member. // - CREATING - The Amazon Web Services account is in the process of creating a // member. // - AVAILABLE - The member has been created and can participate in the network. // - CREATE_FAILED - The Amazon Web Services account attempted to create a member // and creation failed. // - UPDATING - The member is in the process of being updated. // - DELETING - The member and all associated resources are in the process of // being deleted. Either the Amazon Web Services account that owns the member // deleted it, or the member is being deleted as the result of an APPROVED // PROPOSAL to remove the member. // - DELETED - The member can no longer participate on the network and all // associated resources are deleted. Either the Amazon Web Services account that // owns the member deleted it, or the member is being deleted as the result of an // APPROVED PROPOSAL to remove the member. // - INACCESSIBLE_ENCRYPTION_KEY - The member is impaired and might not function // as expected because it cannot access the specified customer managed key in KMS // for encryption at rest. Either the KMS key was disabled or deleted, or the // grants on the key were revoked. The effect of disabling or deleting a key or of // revoking a grant isn't immediate. It might take some time for the member // resource to discover that the key is inaccessible. When a resource is in this // state, we recommend deleting and recreating the resource. Status MemberStatus // Tags assigned to the member. Tags consist of a key and optional value. For more // information about tags, see Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html) // in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html) // in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. Tags map[string]string noSmithyDocumentSerde } // Configuration properties of the member. Applies only to Hyperledger Fabric. type MemberConfiguration struct { // Configuration properties of the blockchain framework relevant to the member. // // This member is required. FrameworkConfiguration *MemberFrameworkConfiguration // The name of the member. // // This member is required. Name *string // An optional description of the member. Description *string // The Amazon Resource Name (ARN) of the customer managed key in Key Management // Service (KMS) to use for encryption at rest in the member. This parameter is // inherited by any nodes that this member creates. For more information, see // Encryption at Rest (https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/managed-blockchain-encryption-at-rest.html) // in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. Use one of // the following options to specify this parameter: // - Undefined or empty string - By default, use an KMS key that is owned and // managed by Amazon Web Services on your behalf. // - A valid symmetric customer managed KMS key - Use the specified KMS key in // your account that you create, own, and manage. Amazon Managed Blockchain doesn't // support asymmetric keys. For more information, see Using symmetric and // asymmetric keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) // in the Key Management Service Developer Guide. The following is an example of a // KMS key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab KmsKeyArn *string // Configuration properties for logging events associated with a member of a // Managed Blockchain network. LogPublishingConfiguration *MemberLogPublishingConfiguration // Tags assigned to the member. Tags consist of a key and optional value. When // specifying tags during creation, you can specify multiple key-value pairs in a // single request, with an overall maximum of 50 tags added to each resource. For // more information about tags, see Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html) // in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html) // in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. Tags map[string]string noSmithyDocumentSerde } // Attributes of Hyperledger Fabric for a member in a Managed Blockchain network // using the Hyperledger Fabric framework. type MemberFabricAttributes struct { // The user name for the initial administrator user for the member. AdminUsername *string // The endpoint used to access the member's certificate authority. CaEndpoint *string noSmithyDocumentSerde } // Configuration properties for Hyperledger Fabric for a member in a Managed // Blockchain network that is using the Hyperledger Fabric framework. type MemberFabricConfiguration struct { // The password for the member's initial administrative user. The AdminPassword // must be at least 8 characters long and no more than 32 characters. It must // contain at least one uppercase letter, one lowercase letter, and one digit. It // cannot have a single quotation mark (‘), a double quotation marks (“), a forward // slash(/), a backward slash(\), @, or a space. // // This member is required. AdminPassword *string // The user name for the member's initial administrative user. // // This member is required. AdminUsername *string noSmithyDocumentSerde } // Configuration properties for logging events associated with a member of a // Managed Blockchain network using the Hyperledger Fabric framework. type MemberFabricLogPublishingConfiguration struct { // Configuration properties for logging events associated with a member's // Certificate Authority (CA). CA logs help you determine when a member in your // account joins the network, or when new peers register with a member CA. CaLogs *LogConfigurations noSmithyDocumentSerde } // Attributes relevant to a member for the blockchain framework that the Managed // Blockchain network uses. type MemberFrameworkAttributes struct { // Attributes of Hyperledger Fabric relevant to a member on a Managed Blockchain // network that uses Hyperledger Fabric. Fabric *MemberFabricAttributes noSmithyDocumentSerde } // Configuration properties relevant to a member for the blockchain framework that // the Managed Blockchain network uses. type MemberFrameworkConfiguration struct { // Attributes of Hyperledger Fabric for a member on a Managed Blockchain network // that uses Hyperledger Fabric. Fabric *MemberFabricConfiguration noSmithyDocumentSerde } // Configuration properties for logging events associated with a member of a // Managed Blockchain network. type MemberLogPublishingConfiguration struct { // Configuration properties for logging events associated with a member of a // Managed Blockchain network using the Hyperledger Fabric framework. Fabric *MemberFabricLogPublishingConfiguration noSmithyDocumentSerde } // A summary of configuration properties for a member. Applies only to Hyperledger // Fabric. type MemberSummary struct { // The Amazon Resource Name (ARN) of the member. For more information about ARNs // and their format, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. Arn *string // The date and time that the member was created. CreationDate *time.Time // An optional description of the member. Description *string // The unique identifier of the member. Id *string // An indicator of whether the member is owned by your Amazon Web Services account // or a different Amazon Web Services account. IsOwned *bool // The name of the member. Name *string // The status of the member. // - CREATING - The Amazon Web Services account is in the process of creating a // member. // - AVAILABLE - The member has been created and can participate in the network. // - CREATE_FAILED - The Amazon Web Services account attempted to create a member // and creation failed. // - UPDATING - The member is in the process of being updated. // - DELETING - The member and all associated resources are in the process of // being deleted. Either the Amazon Web Services account that owns the member // deleted it, or the member is being deleted as the result of an APPROVED // PROPOSAL to remove the member. // - DELETED - The member can no longer participate on the network and all // associated resources are deleted. Either the Amazon Web Services account that // owns the member deleted it, or the member is being deleted as the result of an // APPROVED PROPOSAL to remove the member. // - INACCESSIBLE_ENCRYPTION_KEY - The member is impaired and might not function // as expected because it cannot access the specified customer managed key in Key // Management Service (KMS) for encryption at rest. Either the KMS key was disabled // or deleted, or the grants on the key were revoked. The effect of disabling or // deleting a key or of revoking a grant isn't immediate. It might take some time // for the member resource to discover that the key is inaccessible. When a // resource is in this state, we recommend deleting and recreating the resource. Status MemberStatus noSmithyDocumentSerde } // Network configuration properties. type Network struct { // The Amazon Resource Name (ARN) of the network. For more information about ARNs // and their format, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. Arn *string // The date and time that the network was created. CreationDate *time.Time // Attributes of the blockchain framework for the network. Description *string // The blockchain framework that the network uses. Framework Framework // Attributes of the blockchain framework that the network uses. FrameworkAttributes *NetworkFrameworkAttributes // The version of the blockchain framework that the network uses. FrameworkVersion *string // The unique identifier of the network. Id *string // The name of the network. Name *string // The current status of the network. Status NetworkStatus // Tags assigned to the network. Each tag consists of a key and optional value. // For more information about tags, see Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html) // in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html) // in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. Tags map[string]string // The voting rules that the network uses to decide if a proposal is accepted. VotingPolicy *VotingPolicy // The VPC endpoint service name of the VPC endpoint service of the network. // Members use the VPC endpoint service name to create a VPC endpoint to access // network resources. VpcEndpointServiceName *string noSmithyDocumentSerde } // Attributes of Ethereum for a network. type NetworkEthereumAttributes struct { // The Ethereum CHAIN_ID associated with the Ethereum network. Chain IDs are as // follows: // - mainnet = 1 // - goerli = 5 // - rinkeby = 4 ChainId *string noSmithyDocumentSerde } // Attributes of Hyperledger Fabric for a network. type NetworkFabricAttributes struct { // The edition of Amazon Managed Blockchain that Hyperledger Fabric uses. For more // information, see Amazon Managed Blockchain Pricing (http://aws.amazon.com/managed-blockchain/pricing/) // . Edition Edition // The endpoint of the ordering service for the network. OrderingServiceEndpoint *string noSmithyDocumentSerde } // Hyperledger Fabric configuration properties for the network. type NetworkFabricConfiguration struct { // The edition of Amazon Managed Blockchain that the network uses. For more // information, see Amazon Managed Blockchain Pricing (http://aws.amazon.com/managed-blockchain/pricing/) // . // // This member is required. Edition Edition noSmithyDocumentSerde } // Attributes relevant to the network for the blockchain framework that the // network uses. type NetworkFrameworkAttributes struct { // Attributes of an Ethereum network for Managed Blockchain resources // participating in an Ethereum network. Ethereum *NetworkEthereumAttributes // Attributes of Hyperledger Fabric for a Managed Blockchain network that uses // Hyperledger Fabric. Fabric *NetworkFabricAttributes noSmithyDocumentSerde } // Configuration properties relevant to the network for the blockchain framework // that the network uses. type NetworkFrameworkConfiguration struct { // Hyperledger Fabric configuration properties for a Managed Blockchain network // that uses Hyperledger Fabric. Fabric *NetworkFabricConfiguration noSmithyDocumentSerde } // A summary of network configuration properties. type NetworkSummary struct { // The Amazon Resource Name (ARN) of the network. For more information about ARNs // and their format, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. Arn *string // The date and time that the network was created. CreationDate *time.Time // An optional description of the network. Description *string // The blockchain framework that the network uses. Framework Framework // The version of the blockchain framework that the network uses. FrameworkVersion *string // The unique identifier of the network. Id *string // The name of the network. Name *string // The current status of the network. Status NetworkStatus noSmithyDocumentSerde } // Configuration properties of a node. type Node struct { // The Amazon Resource Name (ARN) of the node. For more information about ARNs and // their format, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. Arn *string // The Availability Zone in which the node exists. Required for Ethereum nodes. AvailabilityZone *string // The date and time that the node was created. CreationDate *time.Time // Attributes of the blockchain framework being used. FrameworkAttributes *NodeFrameworkAttributes // The unique identifier of the node. Id *string // The instance type of the node. InstanceType *string // The Amazon Resource Name (ARN) of the customer managed key in Key Management // Service (KMS) that the node uses for encryption at rest. If the value of this // parameter is "AWS Owned KMS Key" , the node uses an Amazon Web Services owned // KMS key for encryption. The node inherits this parameter from the member that it // belongs to. For more information, see Encryption at Rest (https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/managed-blockchain-encryption-at-rest.html) // in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. Applies // only to Hyperledger Fabric. KmsKeyArn *string // Configuration properties for logging events associated with a peer node on a // Hyperledger Fabric network on Managed Blockchain. LogPublishingConfiguration *NodeLogPublishingConfiguration // The unique identifier of the member to which the node belongs. Applies only to // Hyperledger Fabric. MemberId *string // The unique identifier of the network that the node is on. NetworkId *string // The state database that the node uses. Values are LevelDB or CouchDB . Applies // only to Hyperledger Fabric. StateDB StateDBType // The status of the node. // - CREATING - The Amazon Web Services account is in the process of creating a // node. // - AVAILABLE - The node has been created and can participate in the network. // - UNHEALTHY - The node is impaired and might not function as expected. Amazon // Managed Blockchain automatically finds nodes in this state and tries to recover // them. If a node is recoverable, it returns to AVAILABLE . Otherwise, it moves // to FAILED status. // - CREATE_FAILED - The Amazon Web Services account attempted to create a node // and creation failed. // - UPDATING - The node is in the process of being updated. // - DELETING - The node is in the process of being deleted. // - DELETED - The node can no longer participate on the network. // - FAILED - The node is no longer functional, cannot be recovered, and must be // deleted. // - INACCESSIBLE_ENCRYPTION_KEY - The node is impaired and might not function as // expected because it cannot access the specified customer managed key in KMS for // encryption at rest. Either the KMS key was disabled or deleted, or the grants on // the key were revoked. The effect of disabling or deleting a key or of revoking a // grant isn't immediate. It might take some time for the node resource to discover // that the key is inaccessible. When a resource is in this state, we recommend // deleting and recreating the resource. Status NodeStatus // Tags assigned to the node. Each tag consists of a key and optional value. For // more information about tags, see Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html) // in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html) // in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. Tags map[string]string noSmithyDocumentSerde } // Configuration properties of a node. type NodeConfiguration struct { // The Amazon Managed Blockchain instance type for the node. // // This member is required. InstanceType *string // The Availability Zone in which the node exists. Required for Ethereum nodes. AvailabilityZone *string // Configuration properties for logging events associated with a peer node on a // Hyperledger Fabric network on Managed Blockchain. LogPublishingConfiguration *NodeLogPublishingConfiguration // The state database that the node uses. Values are LevelDB or CouchDB . When // using an Amazon Managed Blockchain network with Hyperledger Fabric version 1.4 // or later, the default is CouchDB . Applies only to Hyperledger Fabric. StateDB StateDBType noSmithyDocumentSerde } // Attributes of an Ethereum node. type NodeEthereumAttributes struct { // The endpoint on which the Ethereum node listens to run Ethereum API methods // over HTTP connections from a client. Use this endpoint in client code for smart // contracts when using an HTTP connection. Connections to this endpoint are // authenticated using Signature Version 4 (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html) // . HttpEndpoint *string // The endpoint on which the Ethereum node listens to run Ethereum JSON-RPC // methods over WebSocket connections from a client. Use this endpoint in client // code for smart contracts when using a WebSocket connection. Connections to this // endpoint are authenticated using Signature Version 4 (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html) // . WebSocketEndpoint *string noSmithyDocumentSerde } // Attributes of Hyperledger Fabric for a peer node on a Hyperledger Fabric // network on Managed Blockchain. type NodeFabricAttributes struct { // The endpoint that identifies the peer node for all services except peer // channel-based event services. PeerEndpoint *string // The endpoint that identifies the peer node for peer channel-based event // services. PeerEventEndpoint *string noSmithyDocumentSerde } // Configuration properties for logging events associated with a peer node owned // by a member in a Managed Blockchain network. type NodeFabricLogPublishingConfiguration struct { // Configuration properties for logging events associated with chaincode execution // on a peer node. Chaincode logs contain the results of instantiating, invoking, // and querying the chaincode. A peer can run multiple instances of chaincode. When // enabled, a log stream is created for all chaincodes, with an individual log // stream for each chaincode. ChaincodeLogs *LogConfigurations // Configuration properties for a peer node log. Peer node logs contain messages // generated when your client submits transaction proposals to peer nodes, requests // to join channels, enrolls an admin peer, and lists the chaincode instances on a // peer node. PeerLogs *LogConfigurations noSmithyDocumentSerde } // Attributes relevant to a node on a Managed Blockchain network for the // blockchain framework that the network uses. type NodeFrameworkAttributes struct { // Attributes of Ethereum for a node on a Managed Blockchain network that uses // Ethereum. Ethereum *NodeEthereumAttributes // Attributes of Hyperledger Fabric for a peer node on a Managed Blockchain // network that uses Hyperledger Fabric. Fabric *NodeFabricAttributes noSmithyDocumentSerde } // Configuration properties for logging events associated with a peer node on a // Hyperledger Fabric network on Managed Blockchain. type NodeLogPublishingConfiguration struct { // Configuration properties for logging events associated with a node that is // owned by a member of a Managed Blockchain network using the Hyperledger Fabric // framework. Fabric *NodeFabricLogPublishingConfiguration noSmithyDocumentSerde } // A summary of configuration properties for a node. type NodeSummary struct { // The Amazon Resource Name (ARN) of the node. For more information about ARNs and // their format, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. Arn *string // The Availability Zone in which the node exists. AvailabilityZone *string // The date and time that the node was created. CreationDate *time.Time // The unique identifier of the node. Id *string // The EC2 instance type for the node. InstanceType *string // The status of the node. Status NodeStatus noSmithyDocumentSerde } // Properties of a proposal on a Managed Blockchain network. Applies only to // Hyperledger Fabric. type Proposal struct { // The actions to perform on the network if the proposal is APPROVED . Actions *ProposalActions // The Amazon Resource Name (ARN) of the proposal. For more information about ARNs // and their format, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. Arn *string // The date and time that the proposal was created. CreationDate *time.Time // The description of the proposal. Description *string // The date and time that the proposal expires. This is the CreationDate plus the // ProposalDurationInHours that is specified in the ProposalThresholdPolicy . After // this date and time, if members haven't cast enough votes to determine the // outcome according to the voting policy, the proposal is EXPIRED and Actions // aren't carried out. ExpirationDate *time.Time // The unique identifier of the network for which the proposal is made. NetworkId *string // The current total of NO votes cast on the proposal by members. NoVoteCount *int32 // The number of votes remaining to be cast on the proposal by members. In other // words, the number of members minus the sum of YES votes and NO votes. OutstandingVoteCount *int32 // The unique identifier of the proposal. ProposalId *string // The unique identifier of the member that created the proposal. ProposedByMemberId *string // The name of the member that created the proposal. ProposedByMemberName *string // The status of the proposal. Values are as follows: // - IN_PROGRESS - The proposal is active and open for member voting. // - APPROVED - The proposal was approved with sufficient YES votes among members // according to the VotingPolicy specified for the Network . The specified // proposal actions are carried out. // - REJECTED - The proposal was rejected with insufficient YES votes among // members according to the VotingPolicy specified for the Network . The // specified ProposalActions aren't carried out. // - EXPIRED - Members didn't cast the number of votes required to determine the // proposal outcome before the proposal expired. The specified ProposalActions // aren't carried out. // - ACTION_FAILED - One or more of the specified ProposalActions in a proposal // that was approved couldn't be completed because of an error. The ACTION_FAILED // status occurs even if only one ProposalAction fails and other actions are // successful. Status ProposalStatus // Tags assigned to the proposal. Each tag consists of a key and optional value. // For more information about tags, see Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html) // in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources (https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html) // in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. Tags map[string]string // The current total of YES votes cast on the proposal by members. YesVoteCount *int32 noSmithyDocumentSerde } // The actions to carry out if a proposal is APPROVED . Applies only to Hyperledger // Fabric. type ProposalActions struct { // The actions to perform for an APPROVED proposal to invite an Amazon Web // Services account to create a member and join the network. Invitations []InviteAction // The actions to perform for an APPROVED proposal to remove a member from the // network, which deletes the member and all associated member resources from the // network. Removals []RemoveAction noSmithyDocumentSerde } // Properties of a proposal. Applies only to Hyperledger Fabric. type ProposalSummary struct { // The Amazon Resource Name (ARN) of the proposal. For more information about ARNs // and their format, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. Arn *string // The date and time that the proposal was created. CreationDate *time.Time // The description of the proposal. Description *string // The date and time that the proposal expires. This is the CreationDate plus the // ProposalDurationInHours that is specified in the ProposalThresholdPolicy . After // this date and time, if members haven't cast enough votes to determine the // outcome according to the voting policy, the proposal is EXPIRED and Actions // aren't carried out. ExpirationDate *time.Time // The unique identifier of the proposal. ProposalId *string // The unique identifier of the member that created the proposal. ProposedByMemberId *string // The name of the member that created the proposal. ProposedByMemberName *string // The status of the proposal. Values are as follows: // - IN_PROGRESS - The proposal is active and open for member voting. // - APPROVED - The proposal was approved with sufficient YES votes among members // according to the VotingPolicy specified for the Network . The specified // proposal actions are carried out. // - REJECTED - The proposal was rejected with insufficient YES votes among // members according to the VotingPolicy specified for the Network . The // specified ProposalActions aren't carried out. // - EXPIRED - Members didn't cast the number of votes required to determine the // proposal outcome before the proposal expired. The specified ProposalActions // aren't carried out. // - ACTION_FAILED - One or more of the specified ProposalActions in a proposal // that was approved couldn't be completed because of an error. Status ProposalStatus noSmithyDocumentSerde } // An action to remove a member from a Managed Blockchain network as the result of // a removal proposal that is APPROVED . The member and all associated resources // are deleted from the network. Applies only to Hyperledger Fabric. type RemoveAction struct { // The unique identifier of the member to remove. // // This member is required. MemberId *string noSmithyDocumentSerde } // Properties of an individual vote that a member cast for a proposal. Applies // only to Hyperledger Fabric. type VoteSummary struct { // The unique identifier of the member that cast the vote. MemberId *string // The name of the member that cast the vote. MemberName *string // The vote value, either YES or NO . Vote VoteValue noSmithyDocumentSerde } // The voting rules for the network to decide if a proposal is accepted Applies // only to Hyperledger Fabric. type VotingPolicy struct { // Defines the rules for the network for voting on proposals, such as the // percentage of YES votes required for the proposal to be approved and the // duration of the proposal. The policy applies to all proposals and is specified // when the network is created. ApprovalThresholdPolicy *ApprovalThresholdPolicy noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
957
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecatalog 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 = "Marketplace Catalog" const ServiceAPIVersion = "2018-09-17" // Client provides the API client to make operations call for AWS Marketplace // Catalog Service. type Client struct { options Options } // New returns an initialized Client based on the functional options. Provide // additional functional options to further configure the behavior of the client, // such as changing the client's endpoint or adding custom middleware behavior. func New(options Options, optFns ...func(*Options)) *Client { options = options.Copy() resolveDefaultLogger(&options) setResolvedDefaultsMode(&options) resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) resolveDefaultEndpointConfiguration(&options) resolveIdempotencyTokenProvider(&options) for _, fn := range optFns { fn(&options) } client := &Client{ options: options, } return client } type Options struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // Configures the events that will be sent to the configured logger. ClientLogMode aws.ClientLogMode // The credentials object to use when signing requests. Credentials aws.CredentialsProvider // The configuration DefaultsMode that the SDK should use when constructing the // clients initial default settings. DefaultsMode aws.DefaultsMode // The endpoint options to be used when attempting to resolve an endpoint. EndpointOptions EndpointResolverOptions // The service endpoint resolver. EndpointResolver EndpointResolver // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 // Provides idempotency tokens values that will be automatically populated into // idempotent API operations. IdempotencyTokenProvider IdempotencyTokenProvider // The logger writer interface to write logging messages to. Logger logging.Logger // The region to send requests to. (Required) Region string // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify // per operation call's retry max attempts. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. If specified in an operation call's functional // options with a value that is different than the constructed client's Options, // the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if // Retryer option is not also specified. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. Currently does not support per operation call // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. The kind of // default retry created by the API client can be changed with the RetryMode // option. Retryer aws.Retryer // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You // should not populate this structure programmatically, or rely on the values here // within your applications. RuntimeEnvironment aws.RuntimeEnvironment // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved // value was at that point in time. Currently does not support per operation call // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient } // WithAPIOptions returns a functional option for setting the Client's APIOptions // option. func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { return func(o *Options) { o.APIOptions = append(o.APIOptions, optFns...) } } // WithEndpointResolver returns a functional option for setting the Client's // EndpointResolver option. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v } } type HTTPClient interface { Do(*http.Request) (*http.Response, error) } // Copy creates a clone where the APIOptions list is deep copied. func (o Options) Copy() Options { to := o to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) copy(to.APIOptions, o.APIOptions) return to } func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() for _, fn := range optFns { fn(&options) } finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err } } for _, fn := range options.APIOptions { if err := fn(stack); err != nil { return nil, metadata, err } } handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) result, metadata, err = handler.Handle(ctx, params) if err != nil { err = &smithy.OperationError{ ServiceID: ServiceID, OperationName: opID, Err: err, } } return result, metadata, err } type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { if o.Logger != nil { return } o.Logger = logging.Nop{} } func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } func setResolvedDefaultsMode(o *Options) { if len(o.resolvedDefaultsMode) > 0 { return } var mode aws.DefaultsMode mode.SetFromString(string(o.DefaultsMode)) if mode == aws.DefaultsModeAuto { mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) } o.resolvedDefaultsMode = mode } // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, DefaultsMode: cfg.DefaultsMode, RuntimeEnvironment: cfg.RuntimeEnvironment, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { var buildable *awshttp.BuildableClient if o.HTTPClient != nil { var ok bool buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) if !ok { return } } else { buildable = awshttp.NewBuildableClient() } modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { dialer.Timeout = dialerTimeout } }) buildable = buildable.WithTransportOptions(func(transport *http.Transport) { if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { transport.TLSHandshakeTimeout = tlsHandshakeTimeout } }) } o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } if len(o.RetryMode) == 0 { modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { o.RetryMode = modeConfig.RetryMode } } if len(o.RetryMode) == 0 { o.RetryMode = aws.RetryModeStandard } var standardOptions []func(*retry.StandardOptions) if v := o.RetryMaxAttempts; v != 0 { standardOptions = append(standardOptions, func(so *retry.StandardOptions) { so.MaxAttempts = v }) } switch o.RetryMode { case aws.RetryModeAdaptive: var adaptiveOptions []func(*retry.AdaptiveModeOptions) if len(standardOptions) != 0 { adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { ao.StandardOptions = append(ao.StandardOptions, standardOptions...) }) } o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) default: o.Retryer = retry.NewStandard(standardOptions...) } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { if cfg.Retryer == nil { return } o.Retryer = cfg.Retryer() } func resolveAWSRetryMode(cfg aws.Config, o *Options) { if len(cfg.RetryMode) == 0 { return } o.RetryMode = cfg.RetryMode } func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { if cfg.RetryMaxAttempts == 0 { return } o.RetryMaxAttempts = cfg.RetryMaxAttempts } func finalizeRetryMaxAttemptOptions(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { return } o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) } func addClientUserAgent(stack *middleware.Stack) error { return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "marketplacecatalog", goModuleVersion)(stack) } func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ CredentialsProvider: o.Credentials, Signer: o.HTTPSignerV4, LogSigning: o.ClientLogMode.IsSigning(), }) return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error } func resolveHTTPSignerV4(o *Options) { if o.HTTPSignerV4 != nil { return } o.HTTPSignerV4 = newDefaultV4Signer(*o) } func newDefaultV4Signer(o Options) *v4.Signer { return v4.NewSigner(func(so *v4.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() }) } func resolveIdempotencyTokenProvider(o *Options) { if o.IdempotencyTokenProvider != nil { return } o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, LogRetryAttempts: o.ClientLogMode.IsRetries(), } return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseDualStackEndpoint = value } return nil } // resolves FIPS endpoint configuration func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseFIPSEndpoint = value } return nil } // IdempotencyTokenProvider interface for providing idempotency token type IdempotencyTokenProvider interface { GetIdempotencyToken() (string, error) } func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ LogRequest: o.ClientLogMode.IsRequest(), LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), LogResponse: o.ClientLogMode.IsResponse(), LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) }
455
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecatalog 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 marketplacecatalog 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" ) // Used to cancel an open change request. Must be sent before the status of the // request changes to APPLYING , the final stage of completing your change request. // You can describe a change during the 60-day request history retention period for // API calls. func (c *Client) CancelChangeSet(ctx context.Context, params *CancelChangeSetInput, optFns ...func(*Options)) (*CancelChangeSetOutput, error) { if params == nil { params = &CancelChangeSetInput{} } result, metadata, err := c.invokeOperation(ctx, "CancelChangeSet", params, optFns, c.addOperationCancelChangeSetMiddlewares) if err != nil { return nil, err } out := result.(*CancelChangeSetOutput) out.ResultMetadata = metadata return out, nil } type CancelChangeSetInput struct { // Required. The catalog related to the request. Fixed value: AWSMarketplace . // // This member is required. Catalog *string // Required. The unique identifier of the StartChangeSet request that you want to // cancel. // // This member is required. ChangeSetId *string noSmithyDocumentSerde } type CancelChangeSetOutput struct { // The ARN associated with the change set referenced in this request. ChangeSetArn *string // The unique identifier for the change set referenced in this request. ChangeSetId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCancelChangeSetMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCancelChangeSet{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCancelChangeSet{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCancelChangeSetValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelChangeSet(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCancelChangeSet(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aws-marketplace", OperationName: "CancelChangeSet", } }
136
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecatalog import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a resource-based policy on an Entity that is identified by its resource // ARN. func (c *Client) DeleteResourcePolicy(ctx context.Context, params *DeleteResourcePolicyInput, optFns ...func(*Options)) (*DeleteResourcePolicyOutput, error) { if params == nil { params = &DeleteResourcePolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteResourcePolicy", params, optFns, c.addOperationDeleteResourcePolicyMiddlewares) if err != nil { return nil, err } out := result.(*DeleteResourcePolicyOutput) out.ResultMetadata = metadata return out, nil } type DeleteResourcePolicyInput struct { // The Amazon Resource Name (ARN) of the Entity resource that is associated with // the resource policy. // // This member is required. ResourceArn *string noSmithyDocumentSerde } type DeleteResourcePolicyOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteResourcePolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteResourcePolicy{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteResourcePolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResourcePolicy(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opDeleteResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aws-marketplace", OperationName: "DeleteResourcePolicy", } }
122
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecatalog 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/marketplacecatalog/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Provides information about a given change set. func (c *Client) DescribeChangeSet(ctx context.Context, params *DescribeChangeSetInput, optFns ...func(*Options)) (*DescribeChangeSetOutput, error) { if params == nil { params = &DescribeChangeSetInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeChangeSet", params, optFns, c.addOperationDescribeChangeSetMiddlewares) if err != nil { return nil, err } out := result.(*DescribeChangeSetOutput) out.ResultMetadata = metadata return out, nil } type DescribeChangeSetInput struct { // Required. The catalog related to the request. Fixed value: AWSMarketplace // // This member is required. Catalog *string // Required. The unique identifier for the StartChangeSet request that you want to // describe the details for. // // This member is required. ChangeSetId *string noSmithyDocumentSerde } type DescribeChangeSetOutput struct { // An array of ChangeSummary objects. ChangeSet []types.ChangeSummary // The ARN associated with the unique identifier for the change set referenced in // this request. ChangeSetArn *string // Required. The unique identifier for the change set referenced in this request. ChangeSetId *string // The optional name provided in the StartChangeSet request. If you do not provide // a name, one is set by default. ChangeSetName *string // The date and time, in ISO 8601 format (2018-02-27T13:45:22Z), the request // transitioned to a terminal state. The change cannot transition to a different // state. Null if the request is not in a terminal state. EndTime *string // Returned if the change set is in FAILED status. Can be either CLIENT_ERROR , // which means that there are issues with the request (see the ErrorDetailList ), // or SERVER_FAULT , which means that there is a problem in the system, and you // should retry your request. FailureCode types.FailureCode // Returned if there is a failure on the change set, but that failure is not // related to any of the changes in the request. FailureDescription *string // The date and time, in ISO 8601 format (2018-02-27T13:45:22Z), the request // started. StartTime *string // The status of the change request. Status types.ChangeStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeChangeSetMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeChangeSet{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeChangeSet{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeChangeSetValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeChangeSet(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeChangeSet(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aws-marketplace", OperationName: "DescribeChangeSet", } }
164
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecatalog import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the metadata and content of the entity. func (c *Client) DescribeEntity(ctx context.Context, params *DescribeEntityInput, optFns ...func(*Options)) (*DescribeEntityOutput, error) { if params == nil { params = &DescribeEntityInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeEntity", params, optFns, c.addOperationDescribeEntityMiddlewares) if err != nil { return nil, err } out := result.(*DescribeEntityOutput) out.ResultMetadata = metadata return out, nil } type DescribeEntityInput struct { // Required. The catalog related to the request. Fixed value: AWSMarketplace // // This member is required. Catalog *string // Required. The unique ID of the entity to describe. // // This member is required. EntityId *string noSmithyDocumentSerde } type DescribeEntityOutput struct { // This stringified JSON object includes the details of the entity. Details *string // The ARN associated to the unique identifier for the entity referenced in this // request. EntityArn *string // The identifier of the entity, in the format of EntityId@RevisionId . EntityIdentifier *string // The named type of the entity, in the format of EntityType@Version . EntityType *string // The last modified date of the entity, in ISO 8601 format (2018-02-27T13:45:22Z). LastModifiedDate *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeEntityMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeEntity{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeEntity{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeEntityValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEntity(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeEntity(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aws-marketplace", OperationName: "DescribeEntity", } }
142
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecatalog 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" ) // Gets a resource-based policy of an Entity that is identified by its resource // ARN. func (c *Client) GetResourcePolicy(ctx context.Context, params *GetResourcePolicyInput, optFns ...func(*Options)) (*GetResourcePolicyOutput, error) { if params == nil { params = &GetResourcePolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "GetResourcePolicy", params, optFns, c.addOperationGetResourcePolicyMiddlewares) if err != nil { return nil, err } out := result.(*GetResourcePolicyOutput) out.ResultMetadata = metadata return out, nil } type GetResourcePolicyInput struct { // The Amazon Resource Name (ARN) of the Entity resource that is associated with // the resource policy. // // This member is required. ResourceArn *string noSmithyDocumentSerde } type GetResourcePolicyOutput struct { // The policy document to set; formatted in JSON. Policy *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetResourcePolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetResourcePolicy{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetResourcePolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetResourcePolicy(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aws-marketplace", OperationName: "GetResourcePolicy", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecatalog 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/marketplacecatalog/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the list of change sets owned by the account being used to make the // call. You can filter this list by providing any combination of entityId , // ChangeSetName , and status. If you provide more than one filter, the API // operation applies a logical AND between the filters. You can describe a change // during the 60-day request history retention period for API calls. func (c *Client) ListChangeSets(ctx context.Context, params *ListChangeSetsInput, optFns ...func(*Options)) (*ListChangeSetsOutput, error) { if params == nil { params = &ListChangeSetsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListChangeSets", params, optFns, c.addOperationListChangeSetsMiddlewares) if err != nil { return nil, err } out := result.(*ListChangeSetsOutput) out.ResultMetadata = metadata return out, nil } type ListChangeSetsInput struct { // The catalog related to the request. Fixed value: AWSMarketplace // // This member is required. Catalog *string // An array of filter objects. FilterList []types.Filter // The maximum number of results returned by a single call. This value must be // provided in the next call to retrieve the next set of results. By default, this // value is 20. MaxResults *int32 // The token value retrieved from a previous call to access the next page of // results. NextToken *string // An object that contains two attributes, SortBy and SortOrder . Sort *types.Sort noSmithyDocumentSerde } type ListChangeSetsOutput struct { // Array of ChangeSetSummaryListItem objects. ChangeSetSummaryList []types.ChangeSetSummaryListItem // The value of the next token, if it exists. Null if there are no more results. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListChangeSetsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListChangeSets{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListChangeSets{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListChangeSetsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListChangeSets(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListChangeSetsAPIClient is a client that implements the ListChangeSets // operation. type ListChangeSetsAPIClient interface { ListChangeSets(context.Context, *ListChangeSetsInput, ...func(*Options)) (*ListChangeSetsOutput, error) } var _ ListChangeSetsAPIClient = (*Client)(nil) // ListChangeSetsPaginatorOptions is the paginator options for ListChangeSets type ListChangeSetsPaginatorOptions struct { // The maximum number of results returned by a single call. This value must be // provided in the next call to retrieve the next set of results. By default, this // value is 20. 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 } // ListChangeSetsPaginator is a paginator for ListChangeSets type ListChangeSetsPaginator struct { options ListChangeSetsPaginatorOptions client ListChangeSetsAPIClient params *ListChangeSetsInput nextToken *string firstPage bool } // NewListChangeSetsPaginator returns a new ListChangeSetsPaginator func NewListChangeSetsPaginator(client ListChangeSetsAPIClient, params *ListChangeSetsInput, optFns ...func(*ListChangeSetsPaginatorOptions)) *ListChangeSetsPaginator { if params == nil { params = &ListChangeSetsInput{} } options := ListChangeSetsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListChangeSetsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListChangeSetsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListChangeSets page. func (p *ListChangeSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChangeSetsOutput, 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.ListChangeSets(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_opListChangeSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aws-marketplace", OperationName: "ListChangeSets", } }
240
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecatalog 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/marketplacecatalog/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Provides the list of entities of a given type. func (c *Client) ListEntities(ctx context.Context, params *ListEntitiesInput, optFns ...func(*Options)) (*ListEntitiesOutput, error) { if params == nil { params = &ListEntitiesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListEntities", params, optFns, c.addOperationListEntitiesMiddlewares) if err != nil { return nil, err } out := result.(*ListEntitiesOutput) out.ResultMetadata = metadata return out, nil } type ListEntitiesInput struct { // The catalog related to the request. Fixed value: AWSMarketplace // // This member is required. Catalog *string // The type of entities to retrieve. // // This member is required. EntityType *string // An array of filter objects. Each filter object contains two attributes, // filterName and filterValues . FilterList []types.Filter // Specifies the upper limit of the elements on a single page. If a value isn't // provided, the default value is 20. MaxResults *int32 // The value of the next token, if it exists. Null if there are no more results. NextToken *string OwnershipType types.OwnershipType // An object that contains two attributes, SortBy and SortOrder . Sort *types.Sort noSmithyDocumentSerde } type ListEntitiesOutput struct { // Array of EntitySummary object. EntitySummaryList []types.EntitySummary // The value of the next token if it exists. Null if there is no more result. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListEntitiesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListEntities{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListEntities{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListEntitiesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListEntities(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListEntitiesAPIClient is a client that implements the ListEntities operation. type ListEntitiesAPIClient interface { ListEntities(context.Context, *ListEntitiesInput, ...func(*Options)) (*ListEntitiesOutput, error) } var _ ListEntitiesAPIClient = (*Client)(nil) // ListEntitiesPaginatorOptions is the paginator options for ListEntities type ListEntitiesPaginatorOptions struct { // Specifies the upper limit of the elements on a single page. If a value isn't // provided, the default value is 20. 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 } // ListEntitiesPaginator is a paginator for ListEntities type ListEntitiesPaginator struct { options ListEntitiesPaginatorOptions client ListEntitiesAPIClient params *ListEntitiesInput nextToken *string firstPage bool } // NewListEntitiesPaginator returns a new ListEntitiesPaginator func NewListEntitiesPaginator(client ListEntitiesAPIClient, params *ListEntitiesInput, optFns ...func(*ListEntitiesPaginatorOptions)) *ListEntitiesPaginator { if params == nil { params = &ListEntitiesInput{} } options := ListEntitiesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListEntitiesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListEntitiesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListEntities page. func (p *ListEntitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEntitiesOutput, 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.ListEntities(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_opListEntities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aws-marketplace", OperationName: "ListEntities", } }
240
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecatalog 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/marketplacecatalog/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all tags that have been added to a resource (either an entity (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/welcome.html#catalog-api-entities) // or change set (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/welcome.html#working-with-change-sets) // ). func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { params = &ListTagsForResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) if err != nil { return nil, err } out := result.(*ListTagsForResourceOutput) out.ResultMetadata = metadata return out, nil } type ListTagsForResourceInput struct { // Required. The Amazon Resource Name (ARN) associated with the resource you want // to list tags on. // // This member is required. ResourceArn *string noSmithyDocumentSerde } type ListTagsForResourceOutput struct { // Required. The ARN associated with the resource you want to list tags on. ResourceArn *string // Required. A list of objects specifying each key name and value. Number of // objects allowed: 1-50. Tags []types.Tag // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aws-marketplace", OperationName: "ListTagsForResource", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecatalog import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Attaches a resource-based policy to an Entity. Examples of an entity include: // AmiProduct and ContainerProduct . func (c *Client) PutResourcePolicy(ctx context.Context, params *PutResourcePolicyInput, optFns ...func(*Options)) (*PutResourcePolicyOutput, error) { if params == nil { params = &PutResourcePolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "PutResourcePolicy", params, optFns, c.addOperationPutResourcePolicyMiddlewares) if err != nil { return nil, err } out := result.(*PutResourcePolicyOutput) out.ResultMetadata = metadata return out, nil } type PutResourcePolicyInput struct { // The policy document to set; formatted in JSON. // // This member is required. Policy *string // The Amazon Resource Name (ARN) of the Entity resource you want to associate // with a resource policy. // // This member is required. ResourceArn *string noSmithyDocumentSerde } type PutResourcePolicyOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationPutResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpPutResourcePolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutResourcePolicy{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpPutResourcePolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutResourcePolicy(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opPutResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aws-marketplace", OperationName: "PutResourcePolicy", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecatalog 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/marketplacecatalog/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Allows you to request changes for your entities. Within a single ChangeSet , you // can't start the same change type against the same entity multiple times. // Additionally, when a ChangeSet is running, all the entities targeted by the // different changes are locked until the change set has completed (either // succeeded, cancelled, or failed). If you try to start a change set containing a // change against an entity that is already locked, you will receive a // ResourceInUseException error. For example, you can't start the ChangeSet // described in the example (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/API_StartChangeSet.html#API_StartChangeSet_Examples) // later in this topic because it contains two changes to run the same change type // ( AddRevisions ) against the same entity ( entity-id@1 ). For more information // about working with change sets, see Working with change sets (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/welcome.html#working-with-change-sets) // . For information on change types for single-AMI products, see Working with // single-AMI products (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/ami-products.html#working-with-single-AMI-products) // . Als, for more information on change types available for container-based // products, see Working with container products (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/container-products.html#working-with-container-products) // . func (c *Client) StartChangeSet(ctx context.Context, params *StartChangeSetInput, optFns ...func(*Options)) (*StartChangeSetOutput, error) { if params == nil { params = &StartChangeSetInput{} } result, metadata, err := c.invokeOperation(ctx, "StartChangeSet", params, optFns, c.addOperationStartChangeSetMiddlewares) if err != nil { return nil, err } out := result.(*StartChangeSetOutput) out.ResultMetadata = metadata return out, nil } type StartChangeSetInput struct { // The catalog related to the request. Fixed value: AWSMarketplace // // This member is required. Catalog *string // Array of change object. // // This member is required. ChangeSet []types.Change // Optional case sensitive string of up to 100 ASCII characters. The change set // name can be used to filter the list of change sets. ChangeSetName *string // A list of objects specifying each key name and value for the ChangeSetTags // property. ChangeSetTags []types.Tag // A unique token to identify the request to ensure idempotency. ClientRequestToken *string noSmithyDocumentSerde } type StartChangeSetOutput struct { // The ARN associated to the unique identifier generated for the request. ChangeSetArn *string // Unique identifier generated for the request. ChangeSetId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartChangeSetMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpStartChangeSet{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartChangeSet{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opStartChangeSetMiddleware(stack, options); err != nil { return err } if err = addOpStartChangeSetValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartChangeSet(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_initializeOpStartChangeSet struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpStartChangeSet) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpStartChangeSet) 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.(*StartChangeSetInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *StartChangeSetInput ") } if input.ClientRequestToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientRequestToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opStartChangeSetMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpStartChangeSet{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opStartChangeSet(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aws-marketplace", OperationName: "StartChangeSet", } }
196
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecatalog 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/marketplacecatalog/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Tags a resource (either an entity (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/welcome.html#catalog-api-entities) // or change set (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/welcome.html#working-with-change-sets) // ). func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { params = &TagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) if err != nil { return nil, err } out := result.(*TagResourceOutput) out.ResultMetadata = metadata return out, nil } type TagResourceInput struct { // Required. The Amazon Resource Name (ARN) associated with the resource you want // to tag. // // This member is required. ResourceArn *string // Required. A list of objects specifying each key name and value. Number of // objects allowed: 1-50. // // This member is required. Tags []types.Tag noSmithyDocumentSerde } type TagResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpTagResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aws-marketplace", OperationName: "TagResource", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecatalog import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Removes a tag or list of tags from a resource (either an entity (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/welcome.html#catalog-api-entities) // or change set (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/welcome.html#working-with-change-sets) // ). func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { params = &UntagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) if err != nil { return nil, err } out := result.(*UntagResourceOutput) out.ResultMetadata = metadata return out, nil } type UntagResourceInput struct { // Required. The Amazon Resource Name (ARN) associated with the resource you want // to remove the tag from. // // This member is required. ResourceArn *string // Required. A list of key names of tags to be removed. Number of strings allowed: // 0-256. // // This member is required. TagKeys []string noSmithyDocumentSerde } type UntagResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUntagResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aws-marketplace", OperationName: "UntagResource", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecatalog import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/marketplacecatalog/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "strings" ) type awsRestjson1_deserializeOpCancelChangeSet struct { } func (*awsRestjson1_deserializeOpCancelChangeSet) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCancelChangeSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCancelChangeSet(response, &metadata) } output := &CancelChangeSetOutput{} 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_deserializeOpDocumentCancelChangeSetOutput(&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_deserializeOpErrorCancelChangeSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCancelChangeSetOutput(v **CancelChangeSetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CancelChangeSetOutput if *v == nil { sv = &CancelChangeSetOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ChangeSetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.ChangeSetArn = ptr.String(jtv) } case "ChangeSetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.ChangeSetId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteResourcePolicy struct { } func (*awsRestjson1_deserializeOpDeleteResourcePolicy) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDeleteResourcePolicy(response, &metadata) } output := &DeleteResourcePolicyOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDescribeChangeSet struct { } func (*awsRestjson1_deserializeOpDescribeChangeSet) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeChangeSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDescribeChangeSet(response, &metadata) } output := &DescribeChangeSetOutput{} 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_deserializeOpDocumentDescribeChangeSetOutput(&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_deserializeOpErrorDescribeChangeSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeChangeSetOutput(v **DescribeChangeSetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeChangeSetOutput if *v == nil { sv = &DescribeChangeSetOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ChangeSet": if err := awsRestjson1_deserializeDocumentChangeSetDescription(&sv.ChangeSet, value); err != nil { return err } case "ChangeSetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.ChangeSetArn = ptr.String(jtv) } case "ChangeSetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.ChangeSetId = ptr.String(jtv) } case "ChangeSetName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChangeSetName to be of type string, got %T instead", value) } sv.ChangeSetName = ptr.String(jtv) } case "EndTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTimeISO8601 to be of type string, got %T instead", value) } sv.EndTime = ptr.String(jtv) } case "FailureCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FailureCode to be of type string, got %T instead", value) } sv.FailureCode = types.FailureCode(jtv) } case "FailureDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessageContent to be of type string, got %T instead", value) } sv.FailureDescription = ptr.String(jtv) } case "StartTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTimeISO8601 to be of type string, got %T instead", value) } sv.StartTime = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChangeStatus to be of type string, got %T instead", value) } sv.Status = types.ChangeStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeEntity struct { } func (*awsRestjson1_deserializeOpDescribeEntity) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeEntity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDescribeEntity(response, &metadata) } output := &DescribeEntityOutput{} 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_deserializeOpDocumentDescribeEntityOutput(&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_deserializeOpErrorDescribeEntity(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceNotSupportedException", errorCode): return awsRestjson1_deserializeErrorResourceNotSupportedException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeEntityOutput(v **DescribeEntityOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeEntityOutput if *v == nil { sv = &DescribeEntityOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Details": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Json to be of type string, got %T instead", value) } sv.Details = ptr.String(jtv) } case "EntityArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.EntityArn = ptr.String(jtv) } case "EntityIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.EntityIdentifier = ptr.String(jtv) } case "EntityType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityType to be of type string, got %T instead", value) } sv.EntityType = ptr.String(jtv) } case "LastModifiedDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTimeISO8601 to be of type string, got %T instead", value) } sv.LastModifiedDate = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetResourcePolicy struct { } func (*awsRestjson1_deserializeOpGetResourcePolicy) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetResourcePolicy(response, &metadata) } output := &GetResourcePolicyOutput{} 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_deserializeOpDocumentGetResourcePolicyOutput(&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_deserializeOpErrorGetResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetResourcePolicyOutput(v **GetResourcePolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetResourcePolicyOutput if *v == nil { sv = &GetResourcePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Policy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourcePolicyJson to be of type string, got %T instead", value) } sv.Policy = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListChangeSets struct { } func (*awsRestjson1_deserializeOpListChangeSets) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListChangeSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListChangeSets(response, &metadata) } output := &ListChangeSetsOutput{} 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_deserializeOpDocumentListChangeSetsOutput(&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_deserializeOpErrorListChangeSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListChangeSetsOutput(v **ListChangeSetsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListChangeSetsOutput if *v == nil { sv = &ListChangeSetsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ChangeSetSummaryList": if err := awsRestjson1_deserializeDocumentChangeSetSummaryList(&sv.ChangeSetSummaryList, 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_deserializeOpListEntities struct { } func (*awsRestjson1_deserializeOpListEntities) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListEntities) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListEntities(response, &metadata) } output := &ListEntitiesOutput{} 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_deserializeOpDocumentListEntitiesOutput(&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_deserializeOpErrorListEntities(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListEntitiesOutput(v **ListEntitiesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListEntitiesOutput if *v == nil { sv = &ListEntitiesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "EntitySummaryList": if err := awsRestjson1_deserializeDocumentEntitySummaryList(&sv.EntitySummaryList, 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_deserializeOpListTagsForResource struct { } func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTagsForResourceOutput if *v == nil { sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ResourceArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceARN to be of type string, got %T instead", value) } sv.ResourceArn = ptr.String(jtv) } case "Tags": if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpPutResourcePolicy struct { } func (*awsRestjson1_deserializeOpPutResourcePolicy) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpPutResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorPutResourcePolicy(response, &metadata) } output := &PutResourcePolicyOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpStartChangeSet struct { } func (*awsRestjson1_deserializeOpStartChangeSet) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartChangeSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorStartChangeSet(response, &metadata) } output := &StartChangeSetOutput{} 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_deserializeOpDocumentStartChangeSetOutput(&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_deserializeOpErrorStartChangeSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentStartChangeSetOutput(v **StartChangeSetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartChangeSetOutput if *v == nil { sv = &StartChangeSetOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ChangeSetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.ChangeSetArn = ptr.String(jtv) } case "ChangeSetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.ChangeSetId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpTagResource struct { } func (*awsRestjson1_deserializeOpTagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) } output := &TagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUntagResource struct { } func (*awsRestjson1_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) } output := &UntagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.AccessDeniedException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorInternalServiceException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalServiceException{} 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_deserializeDocumentInternalServiceException(&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_deserializeErrorResourceInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceInUseException{} 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_deserializeDocumentResourceInUseException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceNotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorResourceNotSupportedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceNotSupportedException{} 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_deserializeDocumentResourceNotSupportedException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ServiceQuotaExceededException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ThrottlingException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ValidationException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentValidationException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AccessDeniedException if *v == nil { sv = &types.AccessDeniedException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessageContent to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentChangeSetDescription(v *[]types.ChangeSummary, 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.ChangeSummary if *v == nil { cv = []types.ChangeSummary{} } else { cv = *v } for _, value := range shape { var col types.ChangeSummary destAddr := &col if err := awsRestjson1_deserializeDocumentChangeSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentChangeSetSummaryList(v *[]types.ChangeSetSummaryListItem, 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.ChangeSetSummaryListItem if *v == nil { cv = []types.ChangeSetSummaryListItem{} } else { cv = *v } for _, value := range shape { var col types.ChangeSetSummaryListItem destAddr := &col if err := awsRestjson1_deserializeDocumentChangeSetSummaryListItem(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentChangeSetSummaryListItem(v **types.ChangeSetSummaryListItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ChangeSetSummaryListItem if *v == nil { sv = &types.ChangeSetSummaryListItem{} } else { sv = *v } for key, value := range shape { switch key { case "ChangeSetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.ChangeSetArn = ptr.String(jtv) } case "ChangeSetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.ChangeSetId = ptr.String(jtv) } case "ChangeSetName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChangeSetName to be of type string, got %T instead", value) } sv.ChangeSetName = ptr.String(jtv) } case "EndTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTimeISO8601 to be of type string, got %T instead", value) } sv.EndTime = ptr.String(jtv) } case "EntityIdList": if err := awsRestjson1_deserializeDocumentResourceIdList(&sv.EntityIdList, value); err != nil { return err } case "FailureCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FailureCode to be of type string, got %T instead", value) } sv.FailureCode = types.FailureCode(jtv) } case "StartTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTimeISO8601 to be of type string, got %T instead", value) } sv.StartTime = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChangeStatus to be of type string, got %T instead", value) } sv.Status = types.ChangeStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentChangeSummary(v **types.ChangeSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ChangeSummary if *v == nil { sv = &types.ChangeSummary{} } else { sv = *v } for key, value := range shape { switch key { case "ChangeName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChangeName to be of type string, got %T instead", value) } sv.ChangeName = ptr.String(jtv) } case "ChangeType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChangeType to be of type string, got %T instead", value) } sv.ChangeType = ptr.String(jtv) } case "Details": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Json to be of type string, got %T instead", value) } sv.Details = ptr.String(jtv) } case "Entity": if err := awsRestjson1_deserializeDocumentEntity(&sv.Entity, value); err != nil { return err } case "ErrorDetailList": if err := awsRestjson1_deserializeDocumentErrorDetailList(&sv.ErrorDetailList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEntity(v **types.Entity, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Entity if *v == nil { sv = &types.Entity{} } else { sv = *v } for key, value := range shape { switch key { case "Identifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.Identifier = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityType to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEntitySummary(v **types.EntitySummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.EntitySummary if *v == nil { sv = &types.EntitySummary{} } else { sv = *v } for key, value := range shape { switch key { case "EntityArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.EntityArn = ptr.String(jtv) } case "EntityId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.EntityId = ptr.String(jtv) } case "EntityType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityType to be of type string, got %T instead", value) } sv.EntityType = ptr.String(jtv) } case "LastModifiedDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTimeISO8601 to be of type string, got %T instead", value) } sv.LastModifiedDate = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityNameString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VisibilityValue to be of type string, got %T instead", value) } sv.Visibility = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEntitySummaryList(v *[]types.EntitySummary, 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.EntitySummary if *v == nil { cv = []types.EntitySummary{} } else { cv = *v } for _, value := range shape { var col types.EntitySummary destAddr := &col if err := awsRestjson1_deserializeDocumentEntitySummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentErrorDetail(v **types.ErrorDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ErrorDetail if *v == nil { sv = &types.ErrorDetail{} } else { sv = *v } for key, value := range shape { switch key { case "ErrorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorCodeString to be of type string, got %T instead", value) } sv.ErrorCode = ptr.String(jtv) } case "ErrorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessageContent to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentErrorDetailList(v *[]types.ErrorDetail, 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.ErrorDetail if *v == nil { cv = []types.ErrorDetail{} } else { cv = *v } for _, value := range shape { var col types.ErrorDetail destAddr := &col if err := awsRestjson1_deserializeDocumentErrorDetail(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInternalServiceException(v **types.InternalServiceException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InternalServiceException if *v == nil { sv = &types.InternalServiceException{} } 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 ExceptionMessageContent to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceIdList(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 ResourceId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentResourceInUseException(v **types.ResourceInUseException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceInUseException if *v == nil { sv = &types.ResourceInUseException{} } 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 ExceptionMessageContent to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceNotFoundException if *v == nil { sv = &types.ResourceNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessageContent to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceNotSupportedException(v **types.ResourceNotSupportedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceNotSupportedException if *v == nil { sv = &types.ResourceNotSupportedException{} } 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 ExceptionMessageContent to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ServiceQuotaExceededException if *v == nil { sv = &types.ServiceQuotaExceededException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessageContent to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTag(v **types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Tag if *v == nil { sv = &types.Tag{} } else { sv = *v } for key, value := range shape { switch key { case "Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) } sv.Key = ptr.String(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.Tag if *v == nil { cv = []types.Tag{} } else { cv = *v } for _, value := range shape { var col types.Tag destAddr := &col if err := awsRestjson1_deserializeDocumentTag(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ThrottlingException if *v == nil { sv = &types.ThrottlingException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessageContent to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ValidationException if *v == nil { sv = &types.ValidationException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessageContent to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil }
3,063
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package marketplacecatalog provides the API client, operations, and parameter // types for AWS Marketplace Catalog Service. // // Catalog API actions allow you to manage your entities through list, describe, // and update capabilities. An entity can be a product or an offer on AWS // Marketplace. You can automate your entity update process by integrating the AWS // Marketplace Catalog API with your AWS Marketplace product build or deployment // pipelines. You can also create your own applications on top of the Catalog API // to manage your products on AWS Marketplace. package marketplacecatalog
13
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecatalog 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/marketplacecatalog/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 = "aws-marketplace" } 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 marketplacecatalog // goModuleVersion is the tagged release for this module const goModuleVersion = "1.16.4"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecatalog
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecatalog import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/marketplacecatalog/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_serializeOpCancelChangeSet struct { } func (*awsRestjson1_serializeOpCancelChangeSet) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCancelChangeSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CancelChangeSetInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/CancelChangeSet") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsCancelChangeSetInput(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_serializeOpHttpBindingsCancelChangeSetInput(v *CancelChangeSetInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Catalog != nil { encoder.SetQuery("catalog").String(*v.Catalog) } if v.ChangeSetId != nil { encoder.SetQuery("changeSetId").String(*v.ChangeSetId) } return nil } type awsRestjson1_serializeOpDeleteResourcePolicy struct { } func (*awsRestjson1_serializeOpDeleteResourcePolicy) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteResourcePolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/DeleteResourcePolicy") 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_serializeOpHttpBindingsDeleteResourcePolicyInput(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_serializeOpHttpBindingsDeleteResourcePolicyInput(v *DeleteResourcePolicyInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn != nil { encoder.SetQuery("resourceArn").String(*v.ResourceArn) } return nil } type awsRestjson1_serializeOpDescribeChangeSet struct { } func (*awsRestjson1_serializeOpDescribeChangeSet) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeChangeSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeChangeSetInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/DescribeChangeSet") 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_serializeOpHttpBindingsDescribeChangeSetInput(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_serializeOpHttpBindingsDescribeChangeSetInput(v *DescribeChangeSetInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Catalog != nil { encoder.SetQuery("catalog").String(*v.Catalog) } if v.ChangeSetId != nil { encoder.SetQuery("changeSetId").String(*v.ChangeSetId) } return nil } type awsRestjson1_serializeOpDescribeEntity struct { } func (*awsRestjson1_serializeOpDescribeEntity) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeEntity) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeEntityInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/DescribeEntity") 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_serializeOpHttpBindingsDescribeEntityInput(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_serializeOpHttpBindingsDescribeEntityInput(v *DescribeEntityInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Catalog != nil { encoder.SetQuery("catalog").String(*v.Catalog) } if v.EntityId != nil { encoder.SetQuery("entityId").String(*v.EntityId) } return nil } type awsRestjson1_serializeOpGetResourcePolicy struct { } func (*awsRestjson1_serializeOpGetResourcePolicy) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetResourcePolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/GetResourcePolicy") 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_serializeOpHttpBindingsGetResourcePolicyInput(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_serializeOpHttpBindingsGetResourcePolicyInput(v *GetResourcePolicyInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn != nil { encoder.SetQuery("resourceArn").String(*v.ResourceArn) } return nil } type awsRestjson1_serializeOpListChangeSets struct { } func (*awsRestjson1_serializeOpListChangeSets) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListChangeSets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListChangeSetsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/ListChangeSets") 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_serializeOpDocumentListChangeSetsInput(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_serializeOpHttpBindingsListChangeSetsInput(v *ListChangeSetsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListChangeSetsInput(v *ListChangeSetsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Catalog != nil { ok := object.Key("Catalog") ok.String(*v.Catalog) } if v.FilterList != nil { ok := object.Key("FilterList") if err := awsRestjson1_serializeDocumentFilterList(v.FilterList, 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 v.Sort != nil { ok := object.Key("Sort") if err := awsRestjson1_serializeDocumentSort(v.Sort, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpListEntities struct { } func (*awsRestjson1_serializeOpListEntities) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListEntities) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListEntitiesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/ListEntities") 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_serializeOpDocumentListEntitiesInput(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_serializeOpHttpBindingsListEntitiesInput(v *ListEntitiesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListEntitiesInput(v *ListEntitiesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Catalog != nil { ok := object.Key("Catalog") ok.String(*v.Catalog) } if v.EntityType != nil { ok := object.Key("EntityType") ok.String(*v.EntityType) } if v.FilterList != nil { ok := object.Key("FilterList") if err := awsRestjson1_serializeDocumentFilterList(v.FilterList, 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.OwnershipType) > 0 { ok := object.Key("OwnershipType") ok.String(string(v.OwnershipType)) } if v.Sort != nil { ok := object.Key("Sort") if err := awsRestjson1_serializeDocumentSort(v.Sort, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpListTagsForResource struct { } func (*awsRestjson1_serializeOpListTagsForResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListTagsForResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/ListTagsForResource") 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_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ResourceArn != nil { ok := object.Key("ResourceArn") ok.String(*v.ResourceArn) } return nil } type awsRestjson1_serializeOpPutResourcePolicy struct { } func (*awsRestjson1_serializeOpPutResourcePolicy) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpPutResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*PutResourcePolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/PutResourcePolicy") 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_serializeOpDocumentPutResourcePolicyInput(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_serializeOpHttpBindingsPutResourcePolicyInput(v *PutResourcePolicyInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentPutResourcePolicyInput(v *PutResourcePolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Policy != nil { ok := object.Key("Policy") ok.String(*v.Policy) } if v.ResourceArn != nil { ok := object.Key("ResourceArn") ok.String(*v.ResourceArn) } return nil } type awsRestjson1_serializeOpStartChangeSet struct { } func (*awsRestjson1_serializeOpStartChangeSet) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartChangeSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartChangeSetInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/StartChangeSet") 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_serializeOpDocumentStartChangeSetInput(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_serializeOpHttpBindingsStartChangeSetInput(v *StartChangeSetInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentStartChangeSetInput(v *StartChangeSetInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Catalog != nil { ok := object.Key("Catalog") ok.String(*v.Catalog) } if v.ChangeSet != nil { ok := object.Key("ChangeSet") if err := awsRestjson1_serializeDocumentRequestedChangeList(v.ChangeSet, ok); err != nil { return err } } if v.ChangeSetName != nil { ok := object.Key("ChangeSetName") ok.String(*v.ChangeSetName) } if v.ChangeSetTags != nil { ok := object.Key("ChangeSetTags") if err := awsRestjson1_serializeDocumentTagList(v.ChangeSetTags, ok); err != nil { return err } } if v.ClientRequestToken != nil { ok := object.Key("ClientRequestToken") ok.String(*v.ClientRequestToken) } return nil } type awsRestjson1_serializeOpTagResource struct { } func (*awsRestjson1_serializeOpTagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*TagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/TagResource") 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_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ResourceArn != nil { ok := object.Key("ResourceArn") ok.String(*v.ResourceArn) } if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUntagResource struct { } func (*awsRestjson1_serializeOpUntagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UntagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/UntagResource") 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_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ResourceArn != nil { ok := object.Key("ResourceArn") ok.String(*v.ResourceArn) } if v.TagKeys != nil { ok := object.Key("TagKeys") if err := awsRestjson1_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentChange(v *types.Change, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ChangeName != nil { ok := object.Key("ChangeName") ok.String(*v.ChangeName) } if v.ChangeType != nil { ok := object.Key("ChangeType") ok.String(*v.ChangeType) } if v.Details != nil { ok := object.Key("Details") ok.String(*v.Details) } if v.Entity != nil { ok := object.Key("Entity") if err := awsRestjson1_serializeDocumentEntity(v.Entity, ok); err != nil { return err } } if v.EntityTags != nil { ok := object.Key("EntityTags") if err := awsRestjson1_serializeDocumentTagList(v.EntityTags, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentEntity(v *types.Entity, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Identifier != nil { ok := object.Key("Identifier") ok.String(*v.Identifier) } if v.Type != nil { ok := object.Key("Type") ok.String(*v.Type) } return nil } func awsRestjson1_serializeDocumentFilter(v *types.Filter, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.ValueList != nil { ok := object.Key("ValueList") if err := awsRestjson1_serializeDocumentValueList(v.ValueList, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentFilterList(v []types.Filter, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentFilter(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentRequestedChangeList(v []types.Change, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentChange(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSort(v *types.Sort, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SortBy != nil { ok := object.Key("SortBy") ok.String(*v.SortBy) } if len(v.SortOrder) > 0 { ok := object.Key("SortOrder") ok.String(string(v.SortOrder)) } return nil } func awsRestjson1_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Key != nil { ok := object.Key("Key") ok.String(*v.Key) } if v.Value != nil { ok := object.Key("Value") ok.String(*v.Value) } return nil } func awsRestjson1_serializeDocumentTagKeyList(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_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentTag(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentValueList(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 }
1,037
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecatalog import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/marketplacecatalog/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpCancelChangeSet struct { } func (*validateOpCancelChangeSet) ID() string { return "OperationInputValidation" } func (m *validateOpCancelChangeSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CancelChangeSetInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCancelChangeSetInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteResourcePolicy struct { } func (*validateOpDeleteResourcePolicy) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteResourcePolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteResourcePolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeChangeSet struct { } func (*validateOpDescribeChangeSet) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeChangeSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeChangeSetInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeChangeSetInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeEntity struct { } func (*validateOpDescribeEntity) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeEntity) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeEntityInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeEntityInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetResourcePolicy struct { } func (*validateOpGetResourcePolicy) ID() string { return "OperationInputValidation" } func (m *validateOpGetResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetResourcePolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetResourcePolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListChangeSets struct { } func (*validateOpListChangeSets) ID() string { return "OperationInputValidation" } func (m *validateOpListChangeSets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListChangeSetsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListChangeSetsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListEntities struct { } func (*validateOpListEntities) ID() string { return "OperationInputValidation" } func (m *validateOpListEntities) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListEntitiesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListEntitiesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListTagsForResource struct { } func (*validateOpListTagsForResource) ID() string { return "OperationInputValidation" } func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListTagsForResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListTagsForResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpPutResourcePolicy struct { } func (*validateOpPutResourcePolicy) ID() string { return "OperationInputValidation" } func (m *validateOpPutResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PutResourcePolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPutResourcePolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartChangeSet struct { } func (*validateOpStartChangeSet) ID() string { return "OperationInputValidation" } func (m *validateOpStartChangeSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartChangeSetInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartChangeSetInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpTagResource struct { } func (*validateOpTagResource) ID() string { return "OperationInputValidation" } func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUntagResource struct { } func (*validateOpUntagResource) ID() string { return "OperationInputValidation" } func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UntagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUntagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpCancelChangeSetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCancelChangeSet{}, middleware.After) } func addOpDeleteResourcePolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteResourcePolicy{}, middleware.After) } func addOpDescribeChangeSetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeChangeSet{}, middleware.After) } func addOpDescribeEntityValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeEntity{}, middleware.After) } func addOpGetResourcePolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetResourcePolicy{}, middleware.After) } func addOpListChangeSetsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListChangeSets{}, middleware.After) } func addOpListEntitiesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListEntities{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } func addOpPutResourcePolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutResourcePolicy{}, middleware.After) } func addOpStartChangeSetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartChangeSet{}, middleware.After) } func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } func validateChange(v *types.Change) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Change"} if v.ChangeType == nil { invalidParams.Add(smithy.NewErrParamRequired("ChangeType")) } if v.Entity == nil { invalidParams.Add(smithy.NewErrParamRequired("Entity")) } else if v.Entity != nil { if err := validateEntity(v.Entity); err != nil { invalidParams.AddNested("Entity", err.(smithy.InvalidParamsError)) } } if v.EntityTags != nil { if err := validateTagList(v.EntityTags); err != nil { invalidParams.AddNested("EntityTags", err.(smithy.InvalidParamsError)) } } if v.Details == nil { invalidParams.Add(smithy.NewErrParamRequired("Details")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateEntity(v *types.Entity) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Entity"} if v.Type == nil { invalidParams.Add(smithy.NewErrParamRequired("Type")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateRequestedChangeList(v []types.Change) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RequestedChangeList"} for i := range v { if err := validateChange(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTag(v *types.Tag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Tag"} if v.Key == nil { invalidParams.Add(smithy.NewErrParamRequired("Key")) } if v.Value == nil { invalidParams.Add(smithy.NewErrParamRequired("Value")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTagList(v []types.Tag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagList"} for i := range v { if err := validateTag(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCancelChangeSetInput(v *CancelChangeSetInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CancelChangeSetInput"} if v.Catalog == nil { invalidParams.Add(smithy.NewErrParamRequired("Catalog")) } if v.ChangeSetId == nil { invalidParams.Add(smithy.NewErrParamRequired("ChangeSetId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteResourcePolicyInput(v *DeleteResourcePolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteResourcePolicyInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeChangeSetInput(v *DescribeChangeSetInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeChangeSetInput"} if v.Catalog == nil { invalidParams.Add(smithy.NewErrParamRequired("Catalog")) } if v.ChangeSetId == nil { invalidParams.Add(smithy.NewErrParamRequired("ChangeSetId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeEntityInput(v *DescribeEntityInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeEntityInput"} if v.Catalog == nil { invalidParams.Add(smithy.NewErrParamRequired("Catalog")) } if v.EntityId == nil { invalidParams.Add(smithy.NewErrParamRequired("EntityId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetResourcePolicyInput(v *GetResourcePolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetResourcePolicyInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListChangeSetsInput(v *ListChangeSetsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListChangeSetsInput"} if v.Catalog == nil { invalidParams.Add(smithy.NewErrParamRequired("Catalog")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListEntitiesInput(v *ListEntitiesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListEntitiesInput"} if v.Catalog == nil { invalidParams.Add(smithy.NewErrParamRequired("Catalog")) } if v.EntityType == nil { invalidParams.Add(smithy.NewErrParamRequired("EntityType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpPutResourcePolicyInput(v *PutResourcePolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PutResourcePolicyInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.Policy == nil { invalidParams.Add(smithy.NewErrParamRequired("Policy")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartChangeSetInput(v *StartChangeSetInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartChangeSetInput"} if v.Catalog == nil { invalidParams.Add(smithy.NewErrParamRequired("Catalog")) } if v.ChangeSet == nil { invalidParams.Add(smithy.NewErrParamRequired("ChangeSet")) } else if v.ChangeSet != nil { if err := validateRequestedChangeList(v.ChangeSet); err != nil { invalidParams.AddNested("ChangeSet", err.(smithy.InvalidParamsError)) } } if v.ChangeSetTags != nil { if err := validateTagList(v.ChangeSetTags); err != nil { invalidParams.AddNested("ChangeSetTags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.Tags == nil { invalidParams.Add(smithy.NewErrParamRequired("Tags")) } else if v.Tags != nil { if err := validateTagList(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUntagResourceInput(v *UntagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.TagKeys == nil { invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
614
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 Marketplace Catalog 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: "catalog.marketplace.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "catalog.marketplace-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "catalog.marketplace-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "catalog.marketplace.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "catalog.marketplace.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "catalog.marketplace-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "catalog.marketplace-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "catalog.marketplace.{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: "catalog.marketplace-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "catalog.marketplace.{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: "catalog.marketplace-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "catalog.marketplace.{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: "catalog.marketplace-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "catalog.marketplace.{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: "catalog.marketplace-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "catalog.marketplace.{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: "catalog.marketplace.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "catalog.marketplace-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "catalog.marketplace-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "catalog.marketplace.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, }, }
302
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 ChangeStatus string // Enum values for ChangeStatus const ( ChangeStatusPreparing ChangeStatus = "PREPARING" ChangeStatusApplying ChangeStatus = "APPLYING" ChangeStatusSucceeded ChangeStatus = "SUCCEEDED" ChangeStatusCancelled ChangeStatus = "CANCELLED" ChangeStatusFailed ChangeStatus = "FAILED" ) // Values returns all known values for ChangeStatus. 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 (ChangeStatus) Values() []ChangeStatus { return []ChangeStatus{ "PREPARING", "APPLYING", "SUCCEEDED", "CANCELLED", "FAILED", } } type FailureCode string // Enum values for FailureCode const ( FailureCodeClientError FailureCode = "CLIENT_ERROR" FailureCodeServerFault FailureCode = "SERVER_FAULT" ) // Values returns all known values for FailureCode. 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 (FailureCode) Values() []FailureCode { return []FailureCode{ "CLIENT_ERROR", "SERVER_FAULT", } } type OwnershipType string // Enum values for OwnershipType const ( OwnershipTypeSelf OwnershipType = "SELF" OwnershipTypeShared OwnershipType = "SHARED" ) // Values returns all known values for OwnershipType. 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 (OwnershipType) Values() []OwnershipType { return []OwnershipType{ "SELF", "SHARED", } } type SortOrder string // Enum values for SortOrder const ( SortOrderAscending SortOrder = "ASCENDING" SortOrderDescending SortOrder = "DESCENDING" ) // 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{ "ASCENDING", "DESCENDING", } }
82
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( "fmt" smithy "github.com/aws/smithy-go" ) // Access is denied. HTTP status code: 403 type AccessDeniedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AccessDeniedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccessDeniedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccessDeniedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccessDeniedException" } return *e.ErrorCodeOverride } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // There was an internal service exception. HTTP status code: 500 type InternalServiceException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InternalServiceException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalServiceException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalServiceException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalServiceException" } return *e.ErrorCodeOverride } func (e *InternalServiceException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // The resource is currently in use. type ResourceInUseException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ResourceInUseException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceInUseException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceInUseException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceInUseException" } return *e.ErrorCodeOverride } func (e *ResourceInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified resource wasn't found. HTTP status code: 404 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 } // Currently, the specified resource is not supported. type ResourceNotSupportedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ResourceNotSupportedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceNotSupportedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceNotSupportedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceNotSupportedException" } return *e.ErrorCodeOverride } func (e *ResourceNotSupportedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The maximum number of open requests per account has been exceeded. 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 } // Too many requests. HTTP status code: 429 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 } // An error occurred during validation. HTTP status code: 422 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 }
217
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" ) // An object that contains the ChangeType , Details , and Entity . type Change struct { // Change types are single string values that describe your intention for the // change. Each change type is unique for each EntityType provided in the change's // scope. For more information on change types available for single-AMI products, // see Working with single-AMI products (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/ami-products.html#working-with-single-AMI-products) // . Also, for more information on change types available for container-based // products, see Working with container products (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/container-products.html#working-with-container-products) // . // // This member is required. ChangeType *string // This object contains details specific to the change type of the requested // change. For more information on change types available for single-AMI products, // see Working with single-AMI products (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/ami-products.html#working-with-single-AMI-products) // . Also, for more information on change types available for container-based // products, see Working with container products (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/container-products.html#working-with-container-products) // . // // This member is required. Details *string // The entity to be changed. // // This member is required. Entity *Entity // Optional name for the change. ChangeName *string // The tags associated with the change. EntityTags []Tag noSmithyDocumentSerde } // A summary of a change set returned in a list of change sets when the // ListChangeSets action is called. type ChangeSetSummaryListItem struct { // The ARN associated with the unique identifier for the change set referenced in // this request. ChangeSetArn *string // The unique identifier for a change set. ChangeSetId *string // The non-unique name for the change set. ChangeSetName *string // The time, in ISO 8601 format (2018-02-27T13:45:22Z), when the change set was // finished. EndTime *string // This object is a list of entity IDs (string) that are a part of a change set. // The entity ID list is a maximum of 20 entities. It must contain at least one // entity. EntityIdList []string // Returned if the change set is in FAILED status. Can be either CLIENT_ERROR , // which means that there are issues with the request (see the ErrorDetailList of // DescribeChangeSet ), or SERVER_FAULT , which means that there is a problem in // the system, and you should retry your request. FailureCode FailureCode // The time, in ISO 8601 format (2018-02-27T13:45:22Z), when the change set was // started. StartTime *string // The current status of the change set. Status ChangeStatus noSmithyDocumentSerde } // This object is a container for common summary information about the change. The // summary doesn't contain the whole change structure. type ChangeSummary struct { // Optional name for the change. ChangeName *string // The type of the change. ChangeType *string // This object contains details specific to the change type of the requested // change. Details *string // The entity to be changed. Entity *Entity // An array of ErrorDetail objects associated with the change. ErrorDetailList []ErrorDetail noSmithyDocumentSerde } // An entity contains data that describes your product, its supported features, // and how it can be used or launched by your customer. type Entity struct { // The type of entity. // // This member is required. Type *string // The identifier for the entity. Identifier *string noSmithyDocumentSerde } // This object is a container for common summary information about the entity. The // summary doesn't contain the whole entity structure, but it does contain // information common across all entities. type EntitySummary struct { // The ARN associated with the unique identifier for the entity. EntityArn *string // The unique identifier for the entity. EntityId *string // The type of the entity. EntityType *string // The last time the entity was published, using ISO 8601 format // (2018-02-27T13:45:22Z). LastModifiedDate *string // The name for the entity. This value is not unique. It is defined by the seller. Name *string // The visibility status of the entity to buyers. This value can be Public // (everyone can view the entity), Limited (the entity is visible to limited // accounts only), or Restricted (the entity was published and then unpublished // and only existing buyers can view it). Visibility *string noSmithyDocumentSerde } // Details about the error. type ErrorDetail struct { // The error code that identifies the type of error. ErrorCode *string // The message for the error. ErrorMessage *string noSmithyDocumentSerde } // A filter object, used to optionally filter results from calls to the // ListEntities and ListChangeSets actions. type Filter struct { // For ListEntities , the supported value for this is an EntityId . For // ListChangeSets , the supported values are as follows: Name *string // ListEntities - This is a list of unique EntityId s. ListChangeSets - The // supported filter names and associated ValueList s is as follows: // - ChangeSetName - The supported ValueList is a list of non-unique // ChangeSetName s. These are defined when you call the StartChangeSet action. // - Status - The supported ValueList is a list of statuses for all change set // requests. // - EntityId - The supported ValueList is a list of unique EntityId s. // - BeforeStartTime - The supported ValueList is a list of all change sets that // started before the filter value. // - AfterStartTime - The supported ValueList is a list of all change sets that // started after the filter value. // - BeforeEndTime - The supported ValueList is a list of all change sets that // ended before the filter value. // - AfterEndTime - The supported ValueList is a list of all change sets that // ended after the filter value. ValueList []string noSmithyDocumentSerde } // An object that contains two attributes, SortBy and SortOrder . type Sort struct { // For ListEntities , supported attributes include LastModifiedDate (default), // Visibility , EntityId , and Name . For ListChangeSets , supported attributes // include StartTime and EndTime . SortBy *string // The sorting order. Can be ASCENDING or DESCENDING . The default value is // DESCENDING . SortOrder SortOrder noSmithyDocumentSerde } // A list of objects specifying each key name and value. type Tag struct { // The key associated with the tag. // // This member is required. Key *string // The value associated with the tag. // // This member is required. Value *string noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
226
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecommerceanalytics 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 = "Marketplace Commerce Analytics" const ServiceAPIVersion = "2015-07-01" // Client provides the API client to make operations call for AWS Marketplace // Commerce Analytics. 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, "marketplacecommerceanalytics", 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 marketplacecommerceanalytics 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 marketplacecommerceanalytics 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/marketplacecommerceanalytics/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Given a data set type and data set publication date, asynchronously publishes // the requested data set to the specified S3 bucket and notifies the specified SNS // topic once the data is available. Returns a unique request identifier that can // be used to correlate requests with notifications from the SNS topic. Data sets // will be published in comma-separated values (CSV) format with the file name // {data_set_type}_YYYY-MM-DD.csv. If a file with the same name already exists // (e.g. if the same data set is requested twice), the original file will be // overwritten by the new file. Requires a Role with an attached permissions policy // providing Allow permissions for the following actions: s3:PutObject, // s3:GetBucketLocation, sns:GetTopicAttributes, sns:Publish, iam:GetRolePolicy. func (c *Client) GenerateDataSet(ctx context.Context, params *GenerateDataSetInput, optFns ...func(*Options)) (*GenerateDataSetOutput, error) { if params == nil { params = &GenerateDataSetInput{} } result, metadata, err := c.invokeOperation(ctx, "GenerateDataSet", params, optFns, c.addOperationGenerateDataSetMiddlewares) if err != nil { return nil, err } out := result.(*GenerateDataSetOutput) out.ResultMetadata = metadata return out, nil } // Container for the parameters to the GenerateDataSet operation. type GenerateDataSetInput struct { // The date a data set was published. For daily data sets, provide a date with // day-level granularity for the desired day. For monthly data sets except those // with prefix disbursed_amount, provide a date with month-level granularity for // the desired month (the day value will be ignored). For data sets with prefix // disbursed_amount, provide a date with day-level granularity for the desired day. // For these data sets we will look backwards in time over the range of 31 days // until the first data set is found (the latest one). // // This member is required. DataSetPublicationDate *time.Time // The desired data set type. // - customer_subscriber_hourly_monthly_subscriptions From 2017-09-15 to // present: Available daily by 24:00 UTC. // - customer_subscriber_annual_subscriptions From 2017-09-15 to present: // Available daily by 24:00 UTC. // - daily_business_usage_by_instance_type From 2017-09-15 to present: Available // daily by 24:00 UTC. // - daily_business_fees From 2017-09-15 to present: Available daily by 24:00 // UTC. // - daily_business_free_trial_conversions From 2017-09-15 to present: Available // daily by 24:00 UTC. // - daily_business_new_instances From 2017-09-15 to present: Available daily by // 24:00 UTC. // - daily_business_new_product_subscribers From 2017-09-15 to present: // Available daily by 24:00 UTC. // - daily_business_canceled_product_subscribers From 2017-09-15 to present: // Available daily by 24:00 UTC. // - monthly_revenue_billing_and_revenue_data From 2017-09-15 to present: // Available monthly on the 15th day of the month by 24:00 UTC. Data includes // metered transactions (e.g. hourly) from one month prior. // - monthly_revenue_annual_subscriptions From 2017-09-15 to present: Available // monthly on the 15th day of the month by 24:00 UTC. Data includes up-front // software charges (e.g. annual) from one month prior. // - monthly_revenue_field_demonstration_usage From 2018-03-15 to present: // Available monthly on the 15th day of the month by 24:00 UTC. // - monthly_revenue_flexible_payment_schedule From 2018-11-15 to present: // Available monthly on the 15th day of the month by 24:00 UTC. // - disbursed_amount_by_product From 2017-09-15 to present: Available every 30 // days by 24:00 UTC. // - disbursed_amount_by_instance_hours From 2017-09-15 to present: Available // every 30 days by 24:00 UTC. // - disbursed_amount_by_customer_geo From 2017-09-15 to present: Available // every 30 days by 24:00 UTC. // - disbursed_amount_by_age_of_uncollected_funds From 2017-09-15 to present: // Available every 30 days by 24:00 UTC. // - disbursed_amount_by_age_of_disbursed_funds From 2017-09-15 to present: // Available every 30 days by 24:00 UTC. // - disbursed_amount_by_age_of_past_due_funds From 2018-04-07 to present: // Available every 30 days by 24:00 UTC. // - disbursed_amount_by_uncollected_funds_breakdown From 2019-10-04 to present: // Available every 30 days by 24:00 UTC. // - sales_compensation_billed_revenue From 2017-09-15 to present: Available // monthly on the 15th day of the month by 24:00 UTC. Data includes metered // transactions (e.g. hourly) from one month prior, and up-front software charges // (e.g. annual) from one month prior. // - us_sales_and_use_tax_records From 2017-09-15 to present: Available monthly // on the 15th day of the month by 24:00 UTC. // - disbursed_amount_by_product_with_uncollected_funds This data set is // deprecated. Download related reports from AMMP instead! // - customer_profile_by_industry This data set is deprecated. Download related // reports from AMMP instead! // - customer_profile_by_revenue This data set is deprecated. Download related // reports from AMMP instead! // - customer_profile_by_geography This data set is deprecated. Download related // reports from AMMP instead! // // This member is required. DataSetType types.DataSetType // The name (friendly name, not ARN) of the destination S3 bucket. // // This member is required. DestinationS3BucketName *string // The Amazon Resource Name (ARN) of the Role with an attached permissions policy // to interact with the provided AWS services. // // This member is required. RoleNameArn *string // Amazon Resource Name (ARN) for the SNS Topic that will be notified when the // data set has been published or if an error has occurred. // // This member is required. SnsTopicArn *string // (Optional) Key-value pairs which will be returned, unmodified, in the Amazon // SNS notification message and the data set metadata file. These key-value pairs // can be used to correlated responses with tracking information from other // systems. CustomerDefinedValues map[string]string // (Optional) The desired S3 prefix for the published data set, similar to a // directory path in standard file systems. For example, if given the bucket name // "mybucket" and the prefix "myprefix/mydatasets", the output file "outputfile" // would be published to "s3://mybucket/myprefix/mydatasets/outputfile". If the // prefix directory structure does not exist, it will be created. If no prefix is // provided, the data set will be published to the S3 bucket root. DestinationS3Prefix *string noSmithyDocumentSerde } // Container for the result of the GenerateDataSet operation. type GenerateDataSetOutput struct { // A unique identifier representing a specific request to the GenerateDataSet // operation. This identifier can be used to correlate a request with notifications // from the SNS topic. DataSetRequestId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGenerateDataSetMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGenerateDataSet{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGenerateDataSet{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGenerateDataSetValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGenerateDataSet(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGenerateDataSet(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "marketplacecommerceanalytics", OperationName: "GenerateDataSet", } }
235
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecommerceanalytics 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/marketplacecommerceanalytics/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Given a data set type and a from date, asynchronously publishes the requested // customer support data to the specified S3 bucket and notifies the specified SNS // topic once the data is available. Returns a unique request identifier that can // be used to correlate requests with notifications from the SNS topic. Data sets // will be published in comma-separated values (CSV) format with the file name // {data_set_type}_YYYY-MM-DD'T'HH-mm-ss'Z'.csv. If a file with the same name // already exists (e.g. if the same data set is requested twice), the original file // will be overwritten by the new file. Requires a Role with an attached // permissions policy providing Allow permissions for the following actions: // s3:PutObject, s3:GetBucketLocation, sns:GetTopicAttributes, sns:Publish, // iam:GetRolePolicy. func (c *Client) StartSupportDataExport(ctx context.Context, params *StartSupportDataExportInput, optFns ...func(*Options)) (*StartSupportDataExportOutput, error) { if params == nil { params = &StartSupportDataExportInput{} } result, metadata, err := c.invokeOperation(ctx, "StartSupportDataExport", params, optFns, c.addOperationStartSupportDataExportMiddlewares) if err != nil { return nil, err } out := result.(*StartSupportDataExportOutput) out.ResultMetadata = metadata return out, nil } // Container for the parameters to the StartSupportDataExport operation. type StartSupportDataExportInput struct { // Specifies the data set type to be written to the output csv file. The data set // types customer_support_contacts_data and test_customer_support_contacts_data // both result in a csv file containing the following fields: Product Id, Product // Code, Customer Guid, Subscription Guid, Subscription Start Date, Organization, // AWS Account Id, Given Name, Surname, Telephone Number, Email, Title, Country // Code, ZIP Code, Operation Type, and Operation Time. // - customer_support_contacts_data Customer support contact data. The data set // will contain all changes (Creates, Updates, and Deletes) to customer support // contact data from the date specified in the from_date parameter. // - test_customer_support_contacts_data An example data set containing static // test data in the same format as customer_support_contacts_data // // This member is required. DataSetType types.SupportDataSetType // The name (friendly name, not ARN) of the destination S3 bucket. // // This member is required. DestinationS3BucketName *string // The start date from which to retrieve the data set in UTC. This parameter only // affects the customer_support_contacts_data data set type. // // This member is required. FromDate *time.Time // The Amazon Resource Name (ARN) of the Role with an attached permissions policy // to interact with the provided AWS services. // // This member is required. RoleNameArn *string // Amazon Resource Name (ARN) for the SNS Topic that will be notified when the // data set has been published or if an error has occurred. // // This member is required. SnsTopicArn *string // (Optional) Key-value pairs which will be returned, unmodified, in the Amazon // SNS notification message and the data set metadata file. CustomerDefinedValues map[string]string // (Optional) The desired S3 prefix for the published data set, similar to a // directory path in standard file systems. For example, if given the bucket name // "mybucket" and the prefix "myprefix/mydatasets", the output file "outputfile" // would be published to "s3://mybucket/myprefix/mydatasets/outputfile". If the // prefix directory structure does not exist, it will be created. If no prefix is // provided, the data set will be published to the S3 bucket root. DestinationS3Prefix *string noSmithyDocumentSerde } // Container for the result of the StartSupportDataExport operation. type StartSupportDataExportOutput struct { // A unique identifier representing a specific request to the // StartSupportDataExport operation. This identifier can be used to correlate a // request with notifications from the SNS topic. DataSetRequestId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartSupportDataExportMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartSupportDataExport{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartSupportDataExport{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStartSupportDataExportValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartSupportDataExport(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStartSupportDataExport(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "marketplacecommerceanalytics", OperationName: "StartSupportDataExport", } }
185
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecommerceanalytics import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/marketplacecommerceanalytics/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "strings" ) type awsAwsjson11_deserializeOpGenerateDataSet struct { } func (*awsAwsjson11_deserializeOpGenerateDataSet) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGenerateDataSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorGenerateDataSet(response, &metadata) } output := &GenerateDataSetOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentGenerateDataSetOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorGenerateDataSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != 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("MarketplaceCommerceAnalyticsException", errorCode): return awsAwsjson11_deserializeErrorMarketplaceCommerceAnalyticsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpStartSupportDataExport struct { } func (*awsAwsjson11_deserializeOpStartSupportDataExport) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpStartSupportDataExport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorStartSupportDataExport(response, &metadata) } output := &StartSupportDataExportOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentStartSupportDataExportOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorStartSupportDataExport(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != 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("MarketplaceCommerceAnalyticsException", errorCode): return awsAwsjson11_deserializeErrorMarketplaceCommerceAnalyticsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsAwsjson11_deserializeErrorMarketplaceCommerceAnalyticsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.MarketplaceCommerceAnalyticsException{} err := awsAwsjson11_deserializeDocumentMarketplaceCommerceAnalyticsException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeDocumentMarketplaceCommerceAnalyticsException(v **types.MarketplaceCommerceAnalyticsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MarketplaceCommerceAnalyticsException if *v == nil { sv = &types.MarketplaceCommerceAnalyticsException{} } 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 ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGenerateDataSetOutput(v **GenerateDataSetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GenerateDataSetOutput if *v == nil { sv = &GenerateDataSetOutput{} } else { sv = *v } for key, value := range shape { switch key { case "dataSetRequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSetRequestId to be of type string, got %T instead", value) } sv.DataSetRequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentStartSupportDataExportOutput(v **StartSupportDataExportOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartSupportDataExportOutput if *v == nil { sv = &StartSupportDataExportOutput{} } else { sv = *v } for key, value := range shape { switch key { case "dataSetRequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSetRequestId to be of type string, got %T instead", value) } sv.DataSetRequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil }
397
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package marketplacecommerceanalytics provides the API client, operations, and // parameter types for AWS Marketplace Commerce Analytics. // // Provides AWS Marketplace business intelligence data on-demand. package marketplacecommerceanalytics
8
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecommerceanalytics 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/marketplacecommerceanalytics/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 = "marketplacecommerceanalytics" } 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 marketplacecommerceanalytics // 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 marketplacecommerceanalytics
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecommerceanalytics import ( "bytes" "context" "fmt" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "path" ) type awsAwsjson11_serializeOpGenerateDataSet struct { } func (*awsAwsjson11_serializeOpGenerateDataSet) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGenerateDataSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GenerateDataSetInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MarketplaceCommerceAnalytics20150701.GenerateDataSet") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGenerateDataSetInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpStartSupportDataExport struct { } func (*awsAwsjson11_serializeOpStartSupportDataExport) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpStartSupportDataExport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartSupportDataExportInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MarketplaceCommerceAnalytics20150701.StartSupportDataExport") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentStartSupportDataExportInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsAwsjson11_serializeDocumentCustomerDefinedValues(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 awsAwsjson11_serializeOpDocumentGenerateDataSetInput(v *GenerateDataSetInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CustomerDefinedValues != nil { ok := object.Key("customerDefinedValues") if err := awsAwsjson11_serializeDocumentCustomerDefinedValues(v.CustomerDefinedValues, ok); err != nil { return err } } if v.DataSetPublicationDate != nil { ok := object.Key("dataSetPublicationDate") ok.Double(smithytime.FormatEpochSeconds(*v.DataSetPublicationDate)) } if len(v.DataSetType) > 0 { ok := object.Key("dataSetType") ok.String(string(v.DataSetType)) } if v.DestinationS3BucketName != nil { ok := object.Key("destinationS3BucketName") ok.String(*v.DestinationS3BucketName) } if v.DestinationS3Prefix != nil { ok := object.Key("destinationS3Prefix") ok.String(*v.DestinationS3Prefix) } if v.RoleNameArn != nil { ok := object.Key("roleNameArn") ok.String(*v.RoleNameArn) } if v.SnsTopicArn != nil { ok := object.Key("snsTopicArn") ok.String(*v.SnsTopicArn) } return nil } func awsAwsjson11_serializeOpDocumentStartSupportDataExportInput(v *StartSupportDataExportInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CustomerDefinedValues != nil { ok := object.Key("customerDefinedValues") if err := awsAwsjson11_serializeDocumentCustomerDefinedValues(v.CustomerDefinedValues, ok); err != nil { return err } } if len(v.DataSetType) > 0 { ok := object.Key("dataSetType") ok.String(string(v.DataSetType)) } if v.DestinationS3BucketName != nil { ok := object.Key("destinationS3BucketName") ok.String(*v.DestinationS3BucketName) } if v.DestinationS3Prefix != nil { ok := object.Key("destinationS3Prefix") ok.String(*v.DestinationS3Prefix) } if v.FromDate != nil { ok := object.Key("fromDate") ok.Double(smithytime.FormatEpochSeconds(*v.FromDate)) } if v.RoleNameArn != nil { ok := object.Key("roleNameArn") ok.String(*v.RoleNameArn) } if v.SnsTopicArn != nil { ok := object.Key("snsTopicArn") ok.String(*v.SnsTopicArn) } return nil }
225
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplacecommerceanalytics import ( "context" "fmt" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpGenerateDataSet struct { } func (*validateOpGenerateDataSet) ID() string { return "OperationInputValidation" } func (m *validateOpGenerateDataSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GenerateDataSetInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGenerateDataSetInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartSupportDataExport struct { } func (*validateOpStartSupportDataExport) ID() string { return "OperationInputValidation" } func (m *validateOpStartSupportDataExport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartSupportDataExportInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartSupportDataExportInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpGenerateDataSetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGenerateDataSet{}, middleware.After) } func addOpStartSupportDataExportValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartSupportDataExport{}, middleware.After) } func validateOpGenerateDataSetInput(v *GenerateDataSetInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GenerateDataSetInput"} if len(v.DataSetType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("DataSetType")) } if v.DataSetPublicationDate == nil { invalidParams.Add(smithy.NewErrParamRequired("DataSetPublicationDate")) } if v.RoleNameArn == nil { invalidParams.Add(smithy.NewErrParamRequired("RoleNameArn")) } if v.DestinationS3BucketName == nil { invalidParams.Add(smithy.NewErrParamRequired("DestinationS3BucketName")) } if v.SnsTopicArn == nil { invalidParams.Add(smithy.NewErrParamRequired("SnsTopicArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartSupportDataExportInput(v *StartSupportDataExportInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartSupportDataExportInput"} if len(v.DataSetType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("DataSetType")) } if v.FromDate == nil { invalidParams.Add(smithy.NewErrParamRequired("FromDate")) } if v.RoleNameArn == nil { invalidParams.Add(smithy.NewErrParamRequired("RoleNameArn")) } if v.DestinationS3BucketName == nil { invalidParams.Add(smithy.NewErrParamRequired("DestinationS3BucketName")) } if v.SnsTopicArn == nil { invalidParams.Add(smithy.NewErrParamRequired("SnsTopicArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
113
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 Marketplace Commerce Analytics 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: "marketplacecommerceanalytics.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "marketplacecommerceanalytics-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "marketplacecommerceanalytics-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "marketplacecommerceanalytics.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "marketplacecommerceanalytics.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "marketplacecommerceanalytics-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "marketplacecommerceanalytics-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "marketplacecommerceanalytics.{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: "marketplacecommerceanalytics-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "marketplacecommerceanalytics.{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: "marketplacecommerceanalytics-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "marketplacecommerceanalytics.{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: "marketplacecommerceanalytics-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "marketplacecommerceanalytics.{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: "marketplacecommerceanalytics-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "marketplacecommerceanalytics.{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: "marketplacecommerceanalytics.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "marketplacecommerceanalytics-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "marketplacecommerceanalytics-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "marketplacecommerceanalytics.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, }, }
302
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 DataSetType string // Enum values for DataSetType const ( DataSetTypeCustomerSubscriberHourlyMonthlySubscriptions DataSetType = "customer_subscriber_hourly_monthly_subscriptions" DataSetTypeCustomerSubscriberAnnualSubscriptions DataSetType = "customer_subscriber_annual_subscriptions" DataSetTypeDailyBusinessUsageByInstanceType DataSetType = "daily_business_usage_by_instance_type" DataSetTypeDailyBusinessFees DataSetType = "daily_business_fees" DataSetTypeDailyBusinessFreeTrialConversions DataSetType = "daily_business_free_trial_conversions" DataSetTypeDailyBusinessNewInstances DataSetType = "daily_business_new_instances" DataSetTypeDailyBusinessNewProductSubscribers DataSetType = "daily_business_new_product_subscribers" DataSetTypeDailyBusinessCanceledProductSubscribers DataSetType = "daily_business_canceled_product_subscribers" DataSetTypeMonthlyRevenueBillingAndRevenueData DataSetType = "monthly_revenue_billing_and_revenue_data" DataSetTypeMonthlyRevenueAnnualSubscriptions DataSetType = "monthly_revenue_annual_subscriptions" DataSetTypeMonthlyRevenueFieldDemonstrationUsage DataSetType = "monthly_revenue_field_demonstration_usage" DataSetTypeMonthlyRevenueFlexiblePaymentSchedule DataSetType = "monthly_revenue_flexible_payment_schedule" DataSetTypeDisbursedAmountByProduct DataSetType = "disbursed_amount_by_product" DataSetTypeDisbursedAmountByProductWithUncollectedFunds DataSetType = "disbursed_amount_by_product_with_uncollected_funds" DataSetTypeDisbursedAmountByInstanceHours DataSetType = "disbursed_amount_by_instance_hours" DataSetTypeDisbursedAmountByCustomerGeo DataSetType = "disbursed_amount_by_customer_geo" DataSetTypeDisbursedAmountByAgeOfUncollectedFunds DataSetType = "disbursed_amount_by_age_of_uncollected_funds" DataSetTypeDisbursedAmountByAgeOfDisbursedFunds DataSetType = "disbursed_amount_by_age_of_disbursed_funds" DataSetTypeDisbursedAmountByAgeOfPastDueFunds DataSetType = "disbursed_amount_by_age_of_past_due_funds" DataSetTypeDisbursedAmountByUncollectedFundsBreakdown DataSetType = "disbursed_amount_by_uncollected_funds_breakdown" DataSetTypeCustomerProfileByIndustry DataSetType = "customer_profile_by_industry" DataSetTypeCustomerProfileByRevenue DataSetType = "customer_profile_by_revenue" DataSetTypeCustomerProfileByGeography DataSetType = "customer_profile_by_geography" DataSetTypeSalesCompensationBilledRevenue DataSetType = "sales_compensation_billed_revenue" DataSetTypeUsSalesAndUseTaxRecords DataSetType = "us_sales_and_use_tax_records" ) // Values returns all known values for DataSetType. 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 (DataSetType) Values() []DataSetType { return []DataSetType{ "customer_subscriber_hourly_monthly_subscriptions", "customer_subscriber_annual_subscriptions", "daily_business_usage_by_instance_type", "daily_business_fees", "daily_business_free_trial_conversions", "daily_business_new_instances", "daily_business_new_product_subscribers", "daily_business_canceled_product_subscribers", "monthly_revenue_billing_and_revenue_data", "monthly_revenue_annual_subscriptions", "monthly_revenue_field_demonstration_usage", "monthly_revenue_flexible_payment_schedule", "disbursed_amount_by_product", "disbursed_amount_by_product_with_uncollected_funds", "disbursed_amount_by_instance_hours", "disbursed_amount_by_customer_geo", "disbursed_amount_by_age_of_uncollected_funds", "disbursed_amount_by_age_of_disbursed_funds", "disbursed_amount_by_age_of_past_due_funds", "disbursed_amount_by_uncollected_funds_breakdown", "customer_profile_by_industry", "customer_profile_by_revenue", "customer_profile_by_geography", "sales_compensation_billed_revenue", "us_sales_and_use_tax_records", } } type SupportDataSetType string // Enum values for SupportDataSetType const ( SupportDataSetTypeCustomerSupportContactsData SupportDataSetType = "customer_support_contacts_data" SupportDataSetTypeTestCustomerSupportContactsData SupportDataSetType = "test_customer_support_contacts_data" ) // Values returns all known values for SupportDataSetType. 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 (SupportDataSetType) Values() []SupportDataSetType { return []SupportDataSetType{ "customer_support_contacts_data", "test_customer_support_contacts_data", } }
86
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" ) // This exception is thrown when an internal service error occurs. type MarketplaceCommerceAnalyticsException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *MarketplaceCommerceAnalyticsException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *MarketplaceCommerceAnalyticsException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *MarketplaceCommerceAnalyticsException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "MarketplaceCommerceAnalyticsException" } return *e.ErrorCodeOverride } func (e *MarketplaceCommerceAnalyticsException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
37
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( smithydocument "github.com/aws/smithy-go/document" ) type noSmithyDocumentSerde = smithydocument.NoSerde
10
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package marketplaceentitlementservice 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 = "Marketplace Entitlement Service" const ServiceAPIVersion = "2017-01-11" // Client provides the API client to make operations call for AWS Marketplace // Entitlement Service. type Client struct { options Options } // New returns an initialized Client based on the functional options. Provide // additional functional options to further configure the behavior of the client, // such as changing the client's endpoint or adding custom middleware behavior. func New(options Options, optFns ...func(*Options)) *Client { options = options.Copy() resolveDefaultLogger(&options) setResolvedDefaultsMode(&options) resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) resolveDefaultEndpointConfiguration(&options) for _, fn := range optFns { fn(&options) } client := &Client{ options: options, } return client } type Options struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // Configures the events that will be sent to the configured logger. ClientLogMode aws.ClientLogMode // The credentials object to use when signing requests. Credentials aws.CredentialsProvider // The configuration DefaultsMode that the SDK should use when constructing the // clients initial default settings. DefaultsMode aws.DefaultsMode // 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, "marketplaceentitlementservice", 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 marketplaceentitlementservice 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 marketplaceentitlementservice 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/marketplaceentitlementservice/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // GetEntitlements retrieves entitlement values for a given product. The results // can be filtered based on customer identifier or product dimensions. func (c *Client) GetEntitlements(ctx context.Context, params *GetEntitlementsInput, optFns ...func(*Options)) (*GetEntitlementsOutput, error) { if params == nil { params = &GetEntitlementsInput{} } result, metadata, err := c.invokeOperation(ctx, "GetEntitlements", params, optFns, c.addOperationGetEntitlementsMiddlewares) if err != nil { return nil, err } out := result.(*GetEntitlementsOutput) out.ResultMetadata = metadata return out, nil } // The GetEntitlementsRequest contains parameters for the GetEntitlements // operation. type GetEntitlementsInput struct { // Product code is used to uniquely identify a product in AWS Marketplace. The // product code will be provided by AWS Marketplace when the product listing is // created. // // This member is required. ProductCode *string // Filter is used to return entitlements for a specific customer or for a specific // dimension. Filters are described as keys mapped to a lists of values. Filtered // requests are unioned for each value in the value list, and then intersected for // each filter key. Filter map[string][]string // The maximum number of items to retrieve from the GetEntitlements operation. For // pagination, use the NextToken field in subsequent calls to GetEntitlements. MaxResults *int32 // For paginated calls to GetEntitlements, pass the NextToken from the previous // GetEntitlementsResult. NextToken *string noSmithyDocumentSerde } // The GetEntitlementsRequest contains results from the GetEntitlements operation. type GetEntitlementsOutput struct { // The set of entitlements found through the GetEntitlements operation. If the // result contains an empty set of entitlements, NextToken might still be present // and should be used. Entitlements []types.Entitlement // For paginated results, use NextToken in subsequent calls to GetEntitlements. If // the result contains an empty set of entitlements, NextToken might still be // present and should be used. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetEntitlementsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetEntitlements{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetEntitlements{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetEntitlementsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetEntitlements(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetEntitlements(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "aws-marketplace", OperationName: "GetEntitlements", } }
152