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 route53domains 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" ) // For operations that require confirmation that the email address for the // registrant contact is valid, such as registering a new domain, this operation // resends the confirmation email to the current email address for the registrant // contact. func (c *Client) ResendContactReachabilityEmail(ctx context.Context, params *ResendContactReachabilityEmailInput, optFns ...func(*Options)) (*ResendContactReachabilityEmailOutput, error) { if params == nil { params = &ResendContactReachabilityEmailInput{} } result, metadata, err := c.invokeOperation(ctx, "ResendContactReachabilityEmail", params, optFns, c.addOperationResendContactReachabilityEmailMiddlewares) if err != nil { return nil, err } out := result.(*ResendContactReachabilityEmailOutput) out.ResultMetadata = metadata return out, nil } type ResendContactReachabilityEmailInput struct { // The name of the domain for which you want Route 53 to resend a confirmation // email to the registrant contact. DomainName *string noSmithyDocumentSerde } type ResendContactReachabilityEmailOutput struct { // The domain name for which you requested a confirmation email. DomainName *string // The email address for the registrant contact at the time that we sent the // verification email. EmailAddress *string // True if the email address for the registrant contact has already been verified, // and false otherwise. If the email address has already been verified, we don't // send another confirmation email. IsAlreadyVerified *bool // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationResendContactReachabilityEmailMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpResendContactReachabilityEmail{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpResendContactReachabilityEmail{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opResendContactReachabilityEmail(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opResendContactReachabilityEmail(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53domains", OperationName: "ResendContactReachabilityEmail", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53domains 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" ) // Resend the form of authorization email for this operation. func (c *Client) ResendOperationAuthorization(ctx context.Context, params *ResendOperationAuthorizationInput, optFns ...func(*Options)) (*ResendOperationAuthorizationOutput, error) { if params == nil { params = &ResendOperationAuthorizationInput{} } result, metadata, err := c.invokeOperation(ctx, "ResendOperationAuthorization", params, optFns, c.addOperationResendOperationAuthorizationMiddlewares) if err != nil { return nil, err } out := result.(*ResendOperationAuthorizationOutput) out.ResultMetadata = metadata return out, nil } type ResendOperationAuthorizationInput struct { // Operation ID. // // This member is required. OperationId *string noSmithyDocumentSerde } type ResendOperationAuthorizationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationResendOperationAuthorizationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpResendOperationAuthorization{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpResendOperationAuthorization{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpResendOperationAuthorizationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResendOperationAuthorization(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opResendOperationAuthorization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53domains", OperationName: "ResendOperationAuthorization", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53domains 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" ) // This operation returns the authorization code for the domain. To transfer a // domain to another registrar, you provide this value to the new registrar. func (c *Client) RetrieveDomainAuthCode(ctx context.Context, params *RetrieveDomainAuthCodeInput, optFns ...func(*Options)) (*RetrieveDomainAuthCodeOutput, error) { if params == nil { params = &RetrieveDomainAuthCodeInput{} } result, metadata, err := c.invokeOperation(ctx, "RetrieveDomainAuthCode", params, optFns, c.addOperationRetrieveDomainAuthCodeMiddlewares) if err != nil { return nil, err } out := result.(*RetrieveDomainAuthCodeOutput) out.ResultMetadata = metadata return out, nil } // A request for the authorization code for the specified domain. To transfer a // domain to another registrar, you provide this value to the new registrar. type RetrieveDomainAuthCodeInput struct { // The name of the domain that you want to get an authorization code for. // // This member is required. DomainName *string noSmithyDocumentSerde } // The RetrieveDomainAuthCode response includes the following element. type RetrieveDomainAuthCodeOutput struct { // The authorization code for the domain. AuthCode *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRetrieveDomainAuthCodeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpRetrieveDomainAuthCode{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRetrieveDomainAuthCode{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpRetrieveDomainAuthCodeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRetrieveDomainAuthCode(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opRetrieveDomainAuthCode(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53domains", OperationName: "RetrieveDomainAuthCode", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53domains 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/route53domains/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Transfers a domain from another registrar to Amazon Route 53. For more // information about transferring domains, see the following topics: // - For transfer requirements, a detailed procedure, and information about // viewing the status of a domain that you're transferring to Route 53, see // Transferring Registration for a Domain to Amazon Route 53 (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-transfer-to-route-53.html) // in the Amazon Route 53 Developer Guide. // - For information about how to transfer a domain from one Amazon Web Services // account to another, see TransferDomainToAnotherAwsAccount (https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_TransferDomainToAnotherAwsAccount.html) // . // - For information about how to transfer a domain to another domain registrar, // see Transferring a Domain from Amazon Route 53 to Another Registrar (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-transfer-from-route-53.html) // in the Amazon Route 53 Developer Guide. // // If the registrar for your domain is also the DNS service provider for the // domain, we highly recommend that you transfer your DNS service to Route 53 or to // another DNS service provider before you transfer your registration. Some // registrars provide free DNS service when you purchase a domain registration. // When you transfer the registration, the previous registrar will not renew your // domain registration and could end your DNS service at any time. If the registrar // for your domain is also the DNS service provider for the domain and you don't // transfer DNS service to another provider, your website, email, and the web // applications associated with the domain might become unavailable. If the // transfer is successful, this method returns an operation ID that you can use to // track the progress and completion of the action. If the transfer doesn't // complete successfully, the domain registrant will be notified by email. func (c *Client) TransferDomain(ctx context.Context, params *TransferDomainInput, optFns ...func(*Options)) (*TransferDomainOutput, error) { if params == nil { params = &TransferDomainInput{} } result, metadata, err := c.invokeOperation(ctx, "TransferDomain", params, optFns, c.addOperationTransferDomainMiddlewares) if err != nil { return nil, err } out := result.(*TransferDomainOutput) out.ResultMetadata = metadata return out, nil } // The TransferDomain request includes the following elements. type TransferDomainInput struct { // Provides detailed contact information. // // This member is required. AdminContact *types.ContactDetail // The name of the domain that you want to transfer to Route 53. The top-level // domain (TLD), such as .com, must be a TLD that Route 53 supports. For a list of // supported TLDs, see Domains that You Can Register with Amazon Route 53 (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/registrar-tld-list.html) // in the Amazon Route 53 Developer Guide. The domain name can contain only the // following characters: // - Letters a through z. Domain names are not case sensitive. // - Numbers 0 through 9. // - Hyphen (-). You can't specify a hyphen at the beginning or end of a label. // - Period (.) to separate the labels in the name, such as the . in example.com // . // // This member is required. DomainName *string // The number of years that you want to register the domain for. Domains are // registered for a minimum of one year. The maximum period depends on the // top-level domain. Default: 1 // // This member is required. DurationInYears *int32 // Provides detailed contact information. // // This member is required. RegistrantContact *types.ContactDetail // Provides detailed contact information. // // This member is required. TechContact *types.ContactDetail // The authorization code for the domain. You get this value from the current // registrar. AuthCode *string // Indicates whether the domain will be automatically renewed (true) or not // (false). Auto renewal only takes effect after the account is charged. Default: // true AutoRenew *bool // Reserved for future use. IdnLangCode *string // Contains details for the host and glue IP addresses. Nameservers []types.Nameserver // Whether you want to conceal contact information from WHOIS queries. If you // specify true , WHOIS ("who is") queries return contact information for the // registrar, the phrase "REDACTED FOR PRIVACY", or "On behalf of owner.". While // some domains may allow different privacy settings per contact, we recommend // specifying the same privacy setting for all contacts. Default: true PrivacyProtectAdminContact *bool // Whether you want to conceal contact information from WHOIS queries. If you // specify true , WHOIS ("who is") queries return contact information either for // Amazon Registrar (for .com, .net, and .org domains) or for our registrar // associate, Gandi (for all other TLDs). If you specify false , WHOIS queries // return the information that you entered for the registrant contact (domain // owner). You must specify the same privacy setting for the administrative, // registrant, and technical contacts. Default: true PrivacyProtectRegistrantContact *bool // Whether you want to conceal contact information from WHOIS queries. If you // specify true , WHOIS ("who is") queries return contact information either for // Amazon Registrar (for .com, .net, and .org domains) or for our registrar // associate, Gandi (for all other TLDs). If you specify false , WHOIS queries // return the information that you entered for the technical contact. You must // specify the same privacy setting for the administrative, registrant, and // technical contacts. Default: true PrivacyProtectTechContact *bool noSmithyDocumentSerde } // The TransferDomain response includes the following element. type TransferDomainOutput struct { // Identifier for tracking the progress of the request. To query the operation // status, use GetOperationDetail (https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_GetOperationDetail.html) // . OperationId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationTransferDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpTransferDomain{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTransferDomain{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpTransferDomainValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTransferDomain(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opTransferDomain(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53domains", OperationName: "TransferDomain", } }
224
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53domains 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" ) // Transfers a domain from the current Amazon Web Services account to another // Amazon Web Services account. Note the following: // - The Amazon Web Services account that you're transferring the domain to must // accept the transfer. If the other account doesn't accept the transfer within 3 // days, we cancel the transfer. See AcceptDomainTransferFromAnotherAwsAccount (https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_AcceptDomainTransferFromAnotherAwsAccount.html) // . // - You can cancel the transfer before the other account accepts it. See // CancelDomainTransferToAnotherAwsAccount (https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_CancelDomainTransferToAnotherAwsAccount.html) // . // - The other account can reject the transfer. See // RejectDomainTransferFromAnotherAwsAccount (https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_RejectDomainTransferFromAnotherAwsAccount.html) // . // // When you transfer a domain from one Amazon Web Services account to another, // Route 53 doesn't transfer the hosted zone that is associated with the domain. // DNS resolution isn't affected if the domain and the hosted zone are owned by // separate accounts, so transferring the hosted zone is optional. For information // about transferring the hosted zone to another Amazon Web Services account, see // Migrating a Hosted Zone to a Different Amazon Web Services Account (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/hosted-zones-migrating.html) // in the Amazon Route 53 Developer Guide. Use either ListOperations (https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_ListOperations.html) // or GetOperationDetail (https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_GetOperationDetail.html) // to determine whether the operation succeeded. GetOperationDetail (https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_GetOperationDetail.html) // provides additional information, for example, Domain Transfer from Aws Account // 111122223333 has been cancelled . func (c *Client) TransferDomainToAnotherAwsAccount(ctx context.Context, params *TransferDomainToAnotherAwsAccountInput, optFns ...func(*Options)) (*TransferDomainToAnotherAwsAccountOutput, error) { if params == nil { params = &TransferDomainToAnotherAwsAccountInput{} } result, metadata, err := c.invokeOperation(ctx, "TransferDomainToAnotherAwsAccount", params, optFns, c.addOperationTransferDomainToAnotherAwsAccountMiddlewares) if err != nil { return nil, err } out := result.(*TransferDomainToAnotherAwsAccountOutput) out.ResultMetadata = metadata return out, nil } // The TransferDomainToAnotherAwsAccount request includes the following elements. type TransferDomainToAnotherAwsAccountInput struct { // The account ID of the Amazon Web Services account that you want to transfer the // domain to, for example, 111122223333 . // // This member is required. AccountId *string // The name of the domain that you want to transfer from the current Amazon Web // Services account to another account. // // This member is required. DomainName *string noSmithyDocumentSerde } // The TransferDomainToAnotherAwsAccount response includes the following elements. type TransferDomainToAnotherAwsAccountOutput struct { // Identifier for tracking the progress of the request. To query the operation // status, use GetOperationDetail (https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_GetOperationDetail.html) // . OperationId *string // To finish transferring a domain to another Amazon Web Services account, the // account that the domain is being transferred to must submit an // AcceptDomainTransferFromAnotherAwsAccount (https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_AcceptDomainTransferFromAnotherAwsAccount.html) // request. The request must include the value of the Password element that was // returned in the TransferDomainToAnotherAwsAccount response. Password *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationTransferDomainToAnotherAwsAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpTransferDomainToAnotherAwsAccount{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTransferDomainToAnotherAwsAccount{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpTransferDomainToAnotherAwsAccountValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTransferDomainToAnotherAwsAccount(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opTransferDomainToAnotherAwsAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53domains", OperationName: "TransferDomainToAnotherAwsAccount", } }
165
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53domains 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/route53domains/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // This operation updates the contact information for a particular domain. You // must specify information for at least one contact: registrant, administrator, or // technical. If the update is successful, this method returns an operation ID that // you can use to track the progress and completion of the operation. If the // request is not completed successfully, the domain registrant will be notified by // email. func (c *Client) UpdateDomainContact(ctx context.Context, params *UpdateDomainContactInput, optFns ...func(*Options)) (*UpdateDomainContactOutput, error) { if params == nil { params = &UpdateDomainContactInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateDomainContact", params, optFns, c.addOperationUpdateDomainContactMiddlewares) if err != nil { return nil, err } out := result.(*UpdateDomainContactOutput) out.ResultMetadata = metadata return out, nil } // The UpdateDomainContact request includes the following elements. type UpdateDomainContactInput struct { // The name of the domain that you want to update contact information for. // // This member is required. DomainName *string // Provides detailed contact information. AdminContact *types.ContactDetail // Customer's consent for the owner change request. Required if the domain is not // free (consent price is more than $0.00). Consent *types.Consent // Provides detailed contact information. RegistrantContact *types.ContactDetail // Provides detailed contact information. TechContact *types.ContactDetail noSmithyDocumentSerde } // The UpdateDomainContact response includes the following element. type UpdateDomainContactOutput struct { // Identifier for tracking the progress of the request. To query the operation // status, use GetOperationDetail (https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_GetOperationDetail.html) // . OperationId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateDomainContactMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateDomainContact{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateDomainContact{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateDomainContactValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDomainContact(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateDomainContact(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53domains", OperationName: "UpdateDomainContact", } }
147
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53domains 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" ) // This operation updates the specified domain contact's privacy setting. When // privacy protection is enabled, your contact information is replaced with contact // information for the registrar or with the phrase "REDACTED FOR PRIVACY", or "On // behalf of owner." While some domains may allow different privacy settings per // contact, we recommend specifying the same privacy setting for all contacts. This // operation affects only the contact information for the specified contact type // (administrative, registrant, or technical). If the request succeeds, Amazon // Route 53 returns an operation ID that you can use with GetOperationDetail (https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_GetOperationDetail.html) // to track the progress and completion of the action. If the request doesn't // complete successfully, the domain registrant will be notified by email. By // disabling the privacy service via API, you consent to the publication of the // contact information provided for this domain via the public WHOIS database. You // certify that you are the registrant of this domain name and have the authority // to make this decision. You may withdraw your consent at any time by enabling // privacy protection using either UpdateDomainContactPrivacy or the Route 53 // console. Enabling privacy protection removes the contact information provided // for this domain from the WHOIS database. For more information on our privacy // practices, see https://aws.amazon.com/privacy/ (https://aws.amazon.com/privacy/) // . func (c *Client) UpdateDomainContactPrivacy(ctx context.Context, params *UpdateDomainContactPrivacyInput, optFns ...func(*Options)) (*UpdateDomainContactPrivacyOutput, error) { if params == nil { params = &UpdateDomainContactPrivacyInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateDomainContactPrivacy", params, optFns, c.addOperationUpdateDomainContactPrivacyMiddlewares) if err != nil { return nil, err } out := result.(*UpdateDomainContactPrivacyOutput) out.ResultMetadata = metadata return out, nil } // The UpdateDomainContactPrivacy request includes the following elements. type UpdateDomainContactPrivacyInput struct { // The name of the domain that you want to update the privacy setting for. // // This member is required. DomainName *string // Whether you want to conceal contact information from WHOIS queries. If you // specify true , WHOIS ("who is") queries return contact information either for // Amazon Registrar (for .com, .net, and .org domains) or for our registrar // associate, Gandi (for all other TLDs). If you specify false , WHOIS queries // return the information that you entered for the admin contact. You must specify // the same privacy setting for the administrative, registrant, and technical // contacts. AdminPrivacy *bool // Whether you want to conceal contact information from WHOIS queries. If you // specify true , WHOIS ("who is") queries return contact information either for // Amazon Registrar (for .com, .net, and .org domains) or for our registrar // associate, Gandi (for all other TLDs). If you specify false , WHOIS queries // return the information that you entered for the registrant contact (domain // owner). You must specify the same privacy setting for the administrative, // registrant, and technical contacts. RegistrantPrivacy *bool // Whether you want to conceal contact information from WHOIS queries. If you // specify true , WHOIS ("who is") queries return contact information either for // Amazon Registrar (for .com, .net, and .org domains) or for our registrar // associate, Gandi (for all other TLDs). If you specify false , WHOIS queries // return the information that you entered for the technical contact. You must // specify the same privacy setting for the administrative, registrant, and // technical contacts. TechPrivacy *bool noSmithyDocumentSerde } // The UpdateDomainContactPrivacy response includes the following element. type UpdateDomainContactPrivacyOutput struct { // Identifier for tracking the progress of the request. To use this ID to query // the operation status, use GetOperationDetail. OperationId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateDomainContactPrivacyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateDomainContactPrivacy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateDomainContactPrivacy{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateDomainContactPrivacyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDomainContactPrivacy(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateDomainContactPrivacy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53domains", OperationName: "UpdateDomainContactPrivacy", } }
172
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53domains 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/route53domains/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // This operation replaces the current set of name servers for the domain with the // specified set of name servers. If you use Amazon Route 53 as your DNS service, // specify the four name servers in the delegation set for the hosted zone for the // domain. If successful, this operation returns an operation ID that you can use // to track the progress and completion of the action. If the request is not // completed successfully, the domain registrant will be notified by email. func (c *Client) UpdateDomainNameservers(ctx context.Context, params *UpdateDomainNameserversInput, optFns ...func(*Options)) (*UpdateDomainNameserversOutput, error) { if params == nil { params = &UpdateDomainNameserversInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateDomainNameservers", params, optFns, c.addOperationUpdateDomainNameserversMiddlewares) if err != nil { return nil, err } out := result.(*UpdateDomainNameserversOutput) out.ResultMetadata = metadata return out, nil } // Replaces the current set of name servers for the domain with the specified set // of name servers. If you use Amazon Route 53 as your DNS service, specify the // four name servers in the delegation set for the hosted zone for the domain. If // successful, this operation returns an operation ID that you can use to track the // progress and completion of the action. If the request is not completed // successfully, the domain registrant will be notified by email. type UpdateDomainNameserversInput struct { // The name of the domain that you want to change name servers for. // // This member is required. DomainName *string // A list of new name servers for the domain. // // This member is required. Nameservers []types.Nameserver // The authorization key for .fi domains // // Deprecated: This member has been deprecated. FIAuthKey *string noSmithyDocumentSerde } // The UpdateDomainNameservers response includes the following element. type UpdateDomainNameserversOutput struct { // Identifier for tracking the progress of the request. To query the operation // status, use GetOperationDetail (https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_GetOperationDetail.html) // . OperationId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateDomainNameserversMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateDomainNameservers{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateDomainNameservers{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateDomainNameserversValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDomainNameservers(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateDomainNameservers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53domains", OperationName: "UpdateDomainNameservers", } }
149
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53domains 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/route53domains/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // This operation adds or updates tags for a specified domain. All tag operations // are eventually consistent; subsequent operations might not immediately represent // all issued operations. func (c *Client) UpdateTagsForDomain(ctx context.Context, params *UpdateTagsForDomainInput, optFns ...func(*Options)) (*UpdateTagsForDomainOutput, error) { if params == nil { params = &UpdateTagsForDomainInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateTagsForDomain", params, optFns, c.addOperationUpdateTagsForDomainMiddlewares) if err != nil { return nil, err } out := result.(*UpdateTagsForDomainOutput) out.ResultMetadata = metadata return out, nil } // The UpdateTagsForDomainRequest includes the following elements. type UpdateTagsForDomainInput struct { // The domain for which you want to add or update tags. // // This member is required. DomainName *string // A list of the tag keys and values that you want to add or update. If you // specify a key that already exists, the corresponding value will be replaced. TagsToUpdate []types.Tag noSmithyDocumentSerde } type UpdateTagsForDomainOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateTagsForDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateTagsForDomain{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateTagsForDomain{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateTagsForDomainValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateTagsForDomain(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateTagsForDomain(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53domains", OperationName: "UpdateTagsForDomain", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53domains 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/route53domains/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Returns all the domain-related billing records for the current Amazon Web // Services account for a specified period func (c *Client) ViewBilling(ctx context.Context, params *ViewBillingInput, optFns ...func(*Options)) (*ViewBillingOutput, error) { if params == nil { params = &ViewBillingInput{} } result, metadata, err := c.invokeOperation(ctx, "ViewBilling", params, optFns, c.addOperationViewBillingMiddlewares) if err != nil { return nil, err } out := result.(*ViewBillingOutput) out.ResultMetadata = metadata return out, nil } // The ViewBilling request includes the following elements. type ViewBillingInput struct { // The end date and time for the time period for which you want a list of billing // records. Specify the date and time in Unix time format and Coordinated Universal // time (UTC). End *time.Time // For an initial request for a list of billing records, omit this element. If the // number of billing records that are associated with the current Amazon Web // Services account during the specified period is greater than the value that you // specified for MaxItems , you can use Marker to return additional billing // records. Get the value of NextPageMarker from the previous response, and submit // another request that includes the value of NextPageMarker in the Marker // element. Constraints: The marker must match the value of NextPageMarker that // was returned in the previous response. Marker *string // The number of billing records to be returned. Default: 20 MaxItems *int32 // The beginning date and time for the time period for which you want a list of // billing records. Specify the date and time in Unix time format and Coordinated // Universal time (UTC). Start *time.Time noSmithyDocumentSerde } // The ViewBilling response includes the following elements. type ViewBillingOutput struct { // A summary of billing records. BillingRecords []types.BillingRecord // If there are more billing records than you specified for MaxItems in the // request, submit another request and include the value of NextPageMarker in the // value of Marker . NextPageMarker *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationViewBillingMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpViewBilling{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpViewBilling{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opViewBilling(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ViewBillingAPIClient is a client that implements the ViewBilling operation. type ViewBillingAPIClient interface { ViewBilling(context.Context, *ViewBillingInput, ...func(*Options)) (*ViewBillingOutput, error) } var _ ViewBillingAPIClient = (*Client)(nil) // ViewBillingPaginatorOptions is the paginator options for ViewBilling type ViewBillingPaginatorOptions struct { // The number of billing records to be returned. Default: 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 } // ViewBillingPaginator is a paginator for ViewBilling type ViewBillingPaginator struct { options ViewBillingPaginatorOptions client ViewBillingAPIClient params *ViewBillingInput nextToken *string firstPage bool } // NewViewBillingPaginator returns a new ViewBillingPaginator func NewViewBillingPaginator(client ViewBillingAPIClient, params *ViewBillingInput, optFns ...func(*ViewBillingPaginatorOptions)) *ViewBillingPaginator { if params == nil { params = &ViewBillingInput{} } options := ViewBillingPaginatorOptions{} if params.MaxItems != nil { options.Limit = *params.MaxItems } for _, fn := range optFns { fn(&options) } return &ViewBillingPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.Marker, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ViewBillingPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ViewBilling page. func (p *ViewBillingPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ViewBillingOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.Marker = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxItems = limit result, err := p.client.ViewBilling(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextPageMarker if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opViewBilling(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53domains", OperationName: "ViewBilling", } }
239
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53domains import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/route53domains/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "io/ioutil" "math" "strings" ) type awsAwsjson11_deserializeOpAcceptDomainTransferFromAnotherAwsAccount struct { } func (*awsAwsjson11_deserializeOpAcceptDomainTransferFromAnotherAwsAccount) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpAcceptDomainTransferFromAnotherAwsAccount) 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_deserializeOpErrorAcceptDomainTransferFromAnotherAwsAccount(response, &metadata) } output := &AcceptDomainTransferFromAnotherAwsAccountOutput{} 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_deserializeOpDocumentAcceptDomainTransferFromAnotherAwsAccountOutput(&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_deserializeOpErrorAcceptDomainTransferFromAnotherAwsAccount(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("DomainLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorDomainLimitExceeded(response, errorBody) case strings.EqualFold("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("OperationLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorOperationLimitExceeded(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpAssociateDelegationSignerToDomain struct { } func (*awsAwsjson11_deserializeOpAssociateDelegationSignerToDomain) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpAssociateDelegationSignerToDomain) 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_deserializeOpErrorAssociateDelegationSignerToDomain(response, &metadata) } output := &AssociateDelegationSignerToDomainOutput{} 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_deserializeOpDocumentAssociateDelegationSignerToDomainOutput(&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_deserializeOpErrorAssociateDelegationSignerToDomain(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("DnssecLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorDnssecLimitExceeded(response, errorBody) case strings.EqualFold("DuplicateRequest", errorCode): return awsAwsjson11_deserializeErrorDuplicateRequest(response, errorBody) case strings.EqualFold("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("OperationLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorOperationLimitExceeded(response, errorBody) case strings.EqualFold("TLDRulesViolation", errorCode): return awsAwsjson11_deserializeErrorTLDRulesViolation(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCancelDomainTransferToAnotherAwsAccount struct { } func (*awsAwsjson11_deserializeOpCancelDomainTransferToAnotherAwsAccount) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCancelDomainTransferToAnotherAwsAccount) 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_deserializeOpErrorCancelDomainTransferToAnotherAwsAccount(response, &metadata) } output := &CancelDomainTransferToAnotherAwsAccountOutput{} 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_deserializeOpDocumentCancelDomainTransferToAnotherAwsAccountOutput(&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_deserializeOpErrorCancelDomainTransferToAnotherAwsAccount(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("OperationLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorOperationLimitExceeded(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCheckDomainAvailability struct { } func (*awsAwsjson11_deserializeOpCheckDomainAvailability) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCheckDomainAvailability) 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_deserializeOpErrorCheckDomainAvailability(response, &metadata) } output := &CheckDomainAvailabilityOutput{} 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_deserializeOpDocumentCheckDomainAvailabilityOutput(&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_deserializeOpErrorCheckDomainAvailability(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCheckDomainTransferability struct { } func (*awsAwsjson11_deserializeOpCheckDomainTransferability) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCheckDomainTransferability) 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_deserializeOpErrorCheckDomainTransferability(response, &metadata) } output := &CheckDomainTransferabilityOutput{} 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_deserializeOpDocumentCheckDomainTransferabilityOutput(&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_deserializeOpErrorCheckDomainTransferability(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteDomain struct { } func (*awsAwsjson11_deserializeOpDeleteDomain) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorDeleteDomain(response, &metadata) } output := &DeleteDomainOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentDeleteDomainOutput(&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_deserializeOpErrorDeleteDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("DuplicateRequest", errorCode): return awsAwsjson11_deserializeErrorDuplicateRequest(response, errorBody) case strings.EqualFold("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("TLDRulesViolation", errorCode): return awsAwsjson11_deserializeErrorTLDRulesViolation(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteTagsForDomain struct { } func (*awsAwsjson11_deserializeOpDeleteTagsForDomain) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteTagsForDomain) 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_deserializeOpErrorDeleteTagsForDomain(response, &metadata) } output := &DeleteTagsForDomainOutput{} 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_deserializeOpDocumentDeleteTagsForDomainOutput(&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_deserializeOpErrorDeleteTagsForDomain(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("OperationLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorOperationLimitExceeded(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDisableDomainAutoRenew struct { } func (*awsAwsjson11_deserializeOpDisableDomainAutoRenew) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDisableDomainAutoRenew) 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_deserializeOpErrorDisableDomainAutoRenew(response, &metadata) } output := &DisableDomainAutoRenewOutput{} 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_deserializeOpDocumentDisableDomainAutoRenewOutput(&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_deserializeOpErrorDisableDomainAutoRenew(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDisableDomainTransferLock struct { } func (*awsAwsjson11_deserializeOpDisableDomainTransferLock) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDisableDomainTransferLock) 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_deserializeOpErrorDisableDomainTransferLock(response, &metadata) } output := &DisableDomainTransferLockOutput{} 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_deserializeOpDocumentDisableDomainTransferLockOutput(&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_deserializeOpErrorDisableDomainTransferLock(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("DuplicateRequest", errorCode): return awsAwsjson11_deserializeErrorDuplicateRequest(response, errorBody) case strings.EqualFold("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("OperationLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorOperationLimitExceeded(response, errorBody) case strings.EqualFold("TLDRulesViolation", errorCode): return awsAwsjson11_deserializeErrorTLDRulesViolation(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDisassociateDelegationSignerFromDomain struct { } func (*awsAwsjson11_deserializeOpDisassociateDelegationSignerFromDomain) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDisassociateDelegationSignerFromDomain) 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_deserializeOpErrorDisassociateDelegationSignerFromDomain(response, &metadata) } output := &DisassociateDelegationSignerFromDomainOutput{} 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_deserializeOpDocumentDisassociateDelegationSignerFromDomainOutput(&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_deserializeOpErrorDisassociateDelegationSignerFromDomain(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("DuplicateRequest", errorCode): return awsAwsjson11_deserializeErrorDuplicateRequest(response, errorBody) case strings.EqualFold("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("OperationLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorOperationLimitExceeded(response, errorBody) case strings.EqualFold("TLDRulesViolation", errorCode): return awsAwsjson11_deserializeErrorTLDRulesViolation(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpEnableDomainAutoRenew struct { } func (*awsAwsjson11_deserializeOpEnableDomainAutoRenew) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpEnableDomainAutoRenew) 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_deserializeOpErrorEnableDomainAutoRenew(response, &metadata) } output := &EnableDomainAutoRenewOutput{} 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_deserializeOpDocumentEnableDomainAutoRenewOutput(&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_deserializeOpErrorEnableDomainAutoRenew(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("TLDRulesViolation", errorCode): return awsAwsjson11_deserializeErrorTLDRulesViolation(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpEnableDomainTransferLock struct { } func (*awsAwsjson11_deserializeOpEnableDomainTransferLock) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpEnableDomainTransferLock) 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_deserializeOpErrorEnableDomainTransferLock(response, &metadata) } output := &EnableDomainTransferLockOutput{} 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_deserializeOpDocumentEnableDomainTransferLockOutput(&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_deserializeOpErrorEnableDomainTransferLock(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("DuplicateRequest", errorCode): return awsAwsjson11_deserializeErrorDuplicateRequest(response, errorBody) case strings.EqualFold("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("OperationLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorOperationLimitExceeded(response, errorBody) case strings.EqualFold("TLDRulesViolation", errorCode): return awsAwsjson11_deserializeErrorTLDRulesViolation(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetContactReachabilityStatus struct { } func (*awsAwsjson11_deserializeOpGetContactReachabilityStatus) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetContactReachabilityStatus) 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_deserializeOpErrorGetContactReachabilityStatus(response, &metadata) } output := &GetContactReachabilityStatusOutput{} 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_deserializeOpDocumentGetContactReachabilityStatusOutput(&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_deserializeOpErrorGetContactReachabilityStatus(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("OperationLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorOperationLimitExceeded(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetDomainDetail struct { } func (*awsAwsjson11_deserializeOpGetDomainDetail) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetDomainDetail) 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_deserializeOpErrorGetDomainDetail(response, &metadata) } output := &GetDomainDetailOutput{} 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_deserializeOpDocumentGetDomainDetailOutput(&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_deserializeOpErrorGetDomainDetail(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetDomainSuggestions struct { } func (*awsAwsjson11_deserializeOpGetDomainSuggestions) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetDomainSuggestions) 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_deserializeOpErrorGetDomainSuggestions(response, &metadata) } output := &GetDomainSuggestionsOutput{} 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_deserializeOpDocumentGetDomainSuggestionsOutput(&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_deserializeOpErrorGetDomainSuggestions(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetOperationDetail struct { } func (*awsAwsjson11_deserializeOpGetOperationDetail) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetOperationDetail) 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_deserializeOpErrorGetOperationDetail(response, &metadata) } output := &GetOperationDetailOutput{} 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_deserializeOpDocumentGetOperationDetailOutput(&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_deserializeOpErrorGetOperationDetail(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListDomains struct { } func (*awsAwsjson11_deserializeOpListDomains) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListDomains) 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_deserializeOpErrorListDomains(response, &metadata) } output := &ListDomainsOutput{} 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_deserializeOpDocumentListDomainsOutput(&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_deserializeOpErrorListDomains(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListOperations struct { } func (*awsAwsjson11_deserializeOpListOperations) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListOperations) 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_deserializeOpErrorListOperations(response, &metadata) } output := &ListOperationsOutput{} 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_deserializeOpDocumentListOperationsOutput(&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_deserializeOpErrorListOperations(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListPrices struct { } func (*awsAwsjson11_deserializeOpListPrices) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListPrices) 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_deserializeOpErrorListPrices(response, &metadata) } output := &ListPricesOutput{} 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_deserializeOpDocumentListPricesOutput(&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_deserializeOpErrorListPrices(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListTagsForDomain struct { } func (*awsAwsjson11_deserializeOpListTagsForDomain) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListTagsForDomain) 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_deserializeOpErrorListTagsForDomain(response, &metadata) } output := &ListTagsForDomainOutput{} 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_deserializeOpDocumentListTagsForDomainOutput(&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_deserializeOpErrorListTagsForDomain(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("OperationLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorOperationLimitExceeded(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpPushDomain struct { } func (*awsAwsjson11_deserializeOpPushDomain) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpPushDomain) 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_deserializeOpErrorPushDomain(response, &metadata) } output := &PushDomainOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } func awsAwsjson11_deserializeOpErrorPushDomain(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("OperationLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorOperationLimitExceeded(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpRegisterDomain struct { } func (*awsAwsjson11_deserializeOpRegisterDomain) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpRegisterDomain) 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_deserializeOpErrorRegisterDomain(response, &metadata) } output := &RegisterDomainOutput{} 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_deserializeOpDocumentRegisterDomainOutput(&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_deserializeOpErrorRegisterDomain(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("DomainLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorDomainLimitExceeded(response, errorBody) case strings.EqualFold("DuplicateRequest", errorCode): return awsAwsjson11_deserializeErrorDuplicateRequest(response, errorBody) case strings.EqualFold("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("OperationLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorOperationLimitExceeded(response, errorBody) case strings.EqualFold("TLDRulesViolation", errorCode): return awsAwsjson11_deserializeErrorTLDRulesViolation(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpRejectDomainTransferFromAnotherAwsAccount struct { } func (*awsAwsjson11_deserializeOpRejectDomainTransferFromAnotherAwsAccount) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpRejectDomainTransferFromAnotherAwsAccount) 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_deserializeOpErrorRejectDomainTransferFromAnotherAwsAccount(response, &metadata) } output := &RejectDomainTransferFromAnotherAwsAccountOutput{} 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_deserializeOpDocumentRejectDomainTransferFromAnotherAwsAccountOutput(&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_deserializeOpErrorRejectDomainTransferFromAnotherAwsAccount(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("OperationLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorOperationLimitExceeded(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpRenewDomain struct { } func (*awsAwsjson11_deserializeOpRenewDomain) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpRenewDomain) 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_deserializeOpErrorRenewDomain(response, &metadata) } output := &RenewDomainOutput{} 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_deserializeOpDocumentRenewDomainOutput(&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_deserializeOpErrorRenewDomain(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("DuplicateRequest", errorCode): return awsAwsjson11_deserializeErrorDuplicateRequest(response, errorBody) case strings.EqualFold("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("OperationLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorOperationLimitExceeded(response, errorBody) case strings.EqualFold("TLDRulesViolation", errorCode): return awsAwsjson11_deserializeErrorTLDRulesViolation(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpResendContactReachabilityEmail struct { } func (*awsAwsjson11_deserializeOpResendContactReachabilityEmail) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpResendContactReachabilityEmail) 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_deserializeOpErrorResendContactReachabilityEmail(response, &metadata) } output := &ResendContactReachabilityEmailOutput{} 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_deserializeOpDocumentResendContactReachabilityEmailOutput(&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_deserializeOpErrorResendContactReachabilityEmail(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("OperationLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorOperationLimitExceeded(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpResendOperationAuthorization struct { } func (*awsAwsjson11_deserializeOpResendOperationAuthorization) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpResendOperationAuthorization) 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_deserializeOpErrorResendOperationAuthorization(response, &metadata) } output := &ResendOperationAuthorizationOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } func awsAwsjson11_deserializeOpErrorResendOperationAuthorization(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpRetrieveDomainAuthCode struct { } func (*awsAwsjson11_deserializeOpRetrieveDomainAuthCode) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpRetrieveDomainAuthCode) 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_deserializeOpErrorRetrieveDomainAuthCode(response, &metadata) } output := &RetrieveDomainAuthCodeOutput{} 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_deserializeOpDocumentRetrieveDomainAuthCodeOutput(&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_deserializeOpErrorRetrieveDomainAuthCode(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpTransferDomain struct { } func (*awsAwsjson11_deserializeOpTransferDomain) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpTransferDomain) 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_deserializeOpErrorTransferDomain(response, &metadata) } output := &TransferDomainOutput{} 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_deserializeOpDocumentTransferDomainOutput(&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_deserializeOpErrorTransferDomain(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("DomainLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorDomainLimitExceeded(response, errorBody) case strings.EqualFold("DuplicateRequest", errorCode): return awsAwsjson11_deserializeErrorDuplicateRequest(response, errorBody) case strings.EqualFold("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("OperationLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorOperationLimitExceeded(response, errorBody) case strings.EqualFold("TLDRulesViolation", errorCode): return awsAwsjson11_deserializeErrorTLDRulesViolation(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpTransferDomainToAnotherAwsAccount struct { } func (*awsAwsjson11_deserializeOpTransferDomainToAnotherAwsAccount) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpTransferDomainToAnotherAwsAccount) 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_deserializeOpErrorTransferDomainToAnotherAwsAccount(response, &metadata) } output := &TransferDomainToAnotherAwsAccountOutput{} 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_deserializeOpDocumentTransferDomainToAnotherAwsAccountOutput(&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_deserializeOpErrorTransferDomainToAnotherAwsAccount(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("DuplicateRequest", errorCode): return awsAwsjson11_deserializeErrorDuplicateRequest(response, errorBody) case strings.EqualFold("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("OperationLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorOperationLimitExceeded(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateDomainContact struct { } func (*awsAwsjson11_deserializeOpUpdateDomainContact) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateDomainContact) 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_deserializeOpErrorUpdateDomainContact(response, &metadata) } output := &UpdateDomainContactOutput{} 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_deserializeOpDocumentUpdateDomainContactOutput(&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_deserializeOpErrorUpdateDomainContact(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("DuplicateRequest", errorCode): return awsAwsjson11_deserializeErrorDuplicateRequest(response, errorBody) case strings.EqualFold("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("OperationLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorOperationLimitExceeded(response, errorBody) case strings.EqualFold("TLDRulesViolation", errorCode): return awsAwsjson11_deserializeErrorTLDRulesViolation(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateDomainContactPrivacy struct { } func (*awsAwsjson11_deserializeOpUpdateDomainContactPrivacy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateDomainContactPrivacy) 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_deserializeOpErrorUpdateDomainContactPrivacy(response, &metadata) } output := &UpdateDomainContactPrivacyOutput{} 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_deserializeOpDocumentUpdateDomainContactPrivacyOutput(&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_deserializeOpErrorUpdateDomainContactPrivacy(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("DuplicateRequest", errorCode): return awsAwsjson11_deserializeErrorDuplicateRequest(response, errorBody) case strings.EqualFold("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("OperationLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorOperationLimitExceeded(response, errorBody) case strings.EqualFold("TLDRulesViolation", errorCode): return awsAwsjson11_deserializeErrorTLDRulesViolation(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateDomainNameservers struct { } func (*awsAwsjson11_deserializeOpUpdateDomainNameservers) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateDomainNameservers) 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_deserializeOpErrorUpdateDomainNameservers(response, &metadata) } output := &UpdateDomainNameserversOutput{} 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_deserializeOpDocumentUpdateDomainNameserversOutput(&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_deserializeOpErrorUpdateDomainNameservers(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("DuplicateRequest", errorCode): return awsAwsjson11_deserializeErrorDuplicateRequest(response, errorBody) case strings.EqualFold("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("OperationLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorOperationLimitExceeded(response, errorBody) case strings.EqualFold("TLDRulesViolation", errorCode): return awsAwsjson11_deserializeErrorTLDRulesViolation(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateTagsForDomain struct { } func (*awsAwsjson11_deserializeOpUpdateTagsForDomain) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateTagsForDomain) 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_deserializeOpErrorUpdateTagsForDomain(response, &metadata) } output := &UpdateTagsForDomainOutput{} 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_deserializeOpDocumentUpdateTagsForDomainOutput(&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_deserializeOpErrorUpdateTagsForDomain(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) case strings.EqualFold("OperationLimitExceeded", errorCode): return awsAwsjson11_deserializeErrorOperationLimitExceeded(response, errorBody) case strings.EqualFold("UnsupportedTLD", errorCode): return awsAwsjson11_deserializeErrorUnsupportedTLD(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpViewBilling struct { } func (*awsAwsjson11_deserializeOpViewBilling) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpViewBilling) 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_deserializeOpErrorViewBilling(response, &metadata) } output := &ViewBillingOutput{} 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_deserializeOpDocumentViewBillingOutput(&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_deserializeOpErrorViewBilling(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("InvalidInput", errorCode): return awsAwsjson11_deserializeErrorInvalidInput(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsAwsjson11_deserializeErrorDnssecLimitExceeded(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.DnssecLimitExceeded{} err := awsAwsjson11_deserializeDocumentDnssecLimitExceeded(&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_deserializeErrorDomainLimitExceeded(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.DomainLimitExceeded{} err := awsAwsjson11_deserializeDocumentDomainLimitExceeded(&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_deserializeErrorDuplicateRequest(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.DuplicateRequest{} err := awsAwsjson11_deserializeDocumentDuplicateRequest(&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_deserializeErrorInvalidInput(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.InvalidInput{} err := awsAwsjson11_deserializeDocumentInvalidInput(&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_deserializeErrorOperationLimitExceeded(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.OperationLimitExceeded{} err := awsAwsjson11_deserializeDocumentOperationLimitExceeded(&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_deserializeErrorTLDRulesViolation(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.TLDRulesViolation{} err := awsAwsjson11_deserializeDocumentTLDRulesViolation(&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_deserializeErrorUnsupportedTLD(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.UnsupportedTLD{} err := awsAwsjson11_deserializeDocumentUnsupportedTLD(&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_deserializeDocumentBillingRecord(v **types.BillingRecord, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.BillingRecord if *v == nil { sv = &types.BillingRecord{} } else { sv = *v } for key, value := range shape { switch key { case "BillDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.BillDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "DomainName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) } sv.DomainName = ptr.String(jtv) } case "InvoiceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected InvoiceId to be of type string, got %T instead", value) } sv.InvoiceId = ptr.String(jtv) } case "Operation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationType to be of type string, got %T instead", value) } sv.Operation = types.OperationType(jtv) } case "Price": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Price = f64 case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Price = f64 default: return fmt.Errorf("expected Price to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentBillingRecords(v *[]types.BillingRecord, 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.BillingRecord if *v == nil { cv = []types.BillingRecord{} } else { cv = *v } for _, value := range shape { var col types.BillingRecord destAddr := &col if err := awsAwsjson11_deserializeDocumentBillingRecord(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentContactDetail(v **types.ContactDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ContactDetail if *v == nil { sv = &types.ContactDetail{} } else { sv = *v } for key, value := range shape { switch key { case "AddressLine1": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AddressLine to be of type string, got %T instead", value) } sv.AddressLine1 = ptr.String(jtv) } case "AddressLine2": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AddressLine to be of type string, got %T instead", value) } sv.AddressLine2 = ptr.String(jtv) } case "City": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected City to be of type string, got %T instead", value) } sv.City = ptr.String(jtv) } case "ContactType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContactType to be of type string, got %T instead", value) } sv.ContactType = types.ContactType(jtv) } case "CountryCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CountryCode to be of type string, got %T instead", value) } sv.CountryCode = types.CountryCode(jtv) } case "Email": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Email to be of type string, got %T instead", value) } sv.Email = ptr.String(jtv) } case "ExtraParams": if err := awsAwsjson11_deserializeDocumentExtraParamList(&sv.ExtraParams, value); err != nil { return err } case "Fax": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContactNumber to be of type string, got %T instead", value) } sv.Fax = ptr.String(jtv) } case "FirstName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContactName to be of type string, got %T instead", value) } sv.FirstName = ptr.String(jtv) } case "LastName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContactName to be of type string, got %T instead", value) } sv.LastName = ptr.String(jtv) } case "OrganizationName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContactName to be of type string, got %T instead", value) } sv.OrganizationName = ptr.String(jtv) } case "PhoneNumber": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContactNumber to be of type string, got %T instead", value) } sv.PhoneNumber = ptr.String(jtv) } case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected State to be of type string, got %T instead", value) } sv.State = ptr.String(jtv) } case "ZipCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ZipCode to be of type string, got %T instead", value) } sv.ZipCode = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDnssecKey(v **types.DnssecKey, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DnssecKey if *v == nil { sv = &types.DnssecKey{} } else { sv = *v } for key, value := range shape { switch key { case "Algorithm": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected NullableInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Algorithm = ptr.Int32(int32(i64)) } case "Digest": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Digest = ptr.String(jtv) } case "DigestType": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected NullableInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DigestType = ptr.Int32(int32(i64)) } case "Flags": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected NullableInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Flags = ptr.Int32(int32(i64)) } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "KeyTag": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected NullableInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.KeyTag = ptr.Int32(int32(i64)) } case "PublicKey": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DnssecPublicKey to be of type string, got %T instead", value) } sv.PublicKey = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDnssecKeyList(v *[]types.DnssecKey, 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.DnssecKey if *v == nil { cv = []types.DnssecKey{} } else { cv = *v } for _, value := range shape { var col types.DnssecKey destAddr := &col if err := awsAwsjson11_deserializeDocumentDnssecKey(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentDnssecLimitExceeded(v **types.DnssecLimitExceeded, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DnssecLimitExceeded if *v == nil { sv = &types.DnssecLimitExceeded{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDomainLimitExceeded(v **types.DomainLimitExceeded, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DomainLimitExceeded if *v == nil { sv = &types.DomainLimitExceeded{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDomainPrice(v **types.DomainPrice, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DomainPrice if *v == nil { sv = &types.DomainPrice{} } else { sv = *v } for key, value := range shape { switch key { case "ChangeOwnershipPrice": if err := awsAwsjson11_deserializeDocumentPriceWithCurrency(&sv.ChangeOwnershipPrice, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainPriceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RegistrationPrice": if err := awsAwsjson11_deserializeDocumentPriceWithCurrency(&sv.RegistrationPrice, value); err != nil { return err } case "RenewalPrice": if err := awsAwsjson11_deserializeDocumentPriceWithCurrency(&sv.RenewalPrice, value); err != nil { return err } case "RestorationPrice": if err := awsAwsjson11_deserializeDocumentPriceWithCurrency(&sv.RestorationPrice, value); err != nil { return err } case "TransferPrice": if err := awsAwsjson11_deserializeDocumentPriceWithCurrency(&sv.TransferPrice, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDomainPriceList(v *[]types.DomainPrice, 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.DomainPrice if *v == nil { cv = []types.DomainPrice{} } else { cv = *v } for _, value := range shape { var col types.DomainPrice destAddr := &col if err := awsAwsjson11_deserializeDocumentDomainPrice(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentDomainStatusList(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 DomainStatus to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentDomainSuggestion(v **types.DomainSuggestion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DomainSuggestion if *v == nil { sv = &types.DomainSuggestion{} } else { sv = *v } for key, value := range shape { switch key { case "Availability": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Availability = ptr.String(jtv) } case "DomainName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) } sv.DomainName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDomainSuggestionsList(v *[]types.DomainSuggestion, 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.DomainSuggestion if *v == nil { cv = []types.DomainSuggestion{} } else { cv = *v } for _, value := range shape { var col types.DomainSuggestion destAddr := &col if err := awsAwsjson11_deserializeDocumentDomainSuggestion(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentDomainSummary(v **types.DomainSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DomainSummary if *v == nil { sv = &types.DomainSummary{} } else { sv = *v } for key, value := range shape { switch key { case "AutoRenew": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AutoRenew = ptr.Bool(jtv) } case "DomainName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) } sv.DomainName = ptr.String(jtv) } case "Expiry": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Expiry = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "TransferLock": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.TransferLock = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDomainSummaryList(v *[]types.DomainSummary, 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.DomainSummary if *v == nil { cv = []types.DomainSummary{} } else { cv = *v } for _, value := range shape { var col types.DomainSummary destAddr := &col if err := awsAwsjson11_deserializeDocumentDomainSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentDomainTransferability(v **types.DomainTransferability, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DomainTransferability if *v == nil { sv = &types.DomainTransferability{} } else { sv = *v } for key, value := range shape { switch key { case "Transferable": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Transferable to be of type string, got %T instead", value) } sv.Transferable = types.Transferable(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDuplicateRequest(v **types.DuplicateRequest, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DuplicateRequest if *v == nil { sv = &types.DuplicateRequest{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentExtraParam(v **types.ExtraParam, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ExtraParam if *v == nil { sv = &types.ExtraParam{} } else { sv = *v } for key, value := range shape { switch key { case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExtraParamName to be of type string, got %T instead", value) } sv.Name = types.ExtraParamName(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExtraParamValue to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentExtraParamList(v *[]types.ExtraParam, 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.ExtraParam if *v == nil { cv = []types.ExtraParam{} } else { cv = *v } for _, value := range shape { var col types.ExtraParam destAddr := &col if err := awsAwsjson11_deserializeDocumentExtraParam(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentGlueIpList(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 GlueIp to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentInvalidInput(v **types.InvalidInput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.InvalidInput if *v == nil { sv = &types.InvalidInput{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentNameserver(v **types.Nameserver, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Nameserver if *v == nil { sv = &types.Nameserver{} } else { sv = *v } for key, value := range shape { switch key { case "GlueIps": if err := awsAwsjson11_deserializeDocumentGlueIpList(&sv.GlueIps, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HostName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentNameserverList(v *[]types.Nameserver, 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.Nameserver if *v == nil { cv = []types.Nameserver{} } else { cv = *v } for _, value := range shape { var col types.Nameserver destAddr := &col if err := awsAwsjson11_deserializeDocumentNameserver(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentOperationLimitExceeded(v **types.OperationLimitExceeded, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.OperationLimitExceeded if *v == nil { sv = &types.OperationLimitExceeded{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentOperationSummary(v **types.OperationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.OperationSummary if *v == nil { sv = &types.OperationSummary{} } else { sv = *v } for key, value := range shape { switch key { case "DomainName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) } sv.DomainName = ptr.String(jtv) } case "LastUpdatedDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "OperationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationId to be of type string, got %T instead", value) } sv.OperationId = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationStatus to be of type string, got %T instead", value) } sv.Status = types.OperationStatus(jtv) } case "StatusFlag": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StatusFlag to be of type string, got %T instead", value) } sv.StatusFlag = types.StatusFlag(jtv) } case "SubmittedDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.SubmittedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationType to be of type string, got %T instead", value) } sv.Type = types.OperationType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentOperationSummaryList(v *[]types.OperationSummary, 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.OperationSummary if *v == nil { cv = []types.OperationSummary{} } else { cv = *v } for _, value := range shape { var col types.OperationSummary destAddr := &col if err := awsAwsjson11_deserializeDocumentOperationSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentPriceWithCurrency(v **types.PriceWithCurrency, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PriceWithCurrency if *v == nil { sv = &types.PriceWithCurrency{} } else { sv = *v } for key, value := range shape { switch key { case "Currency": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Currency to be of type string, got %T instead", value) } sv.Currency = ptr.String(jtv) } case "Price": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Price = f64 case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Price = f64 default: return fmt.Errorf("expected Price to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_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 awsAwsjson11_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 := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentTLDRulesViolation(v **types.TLDRulesViolation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TLDRulesViolation if *v == nil { sv = &types.TLDRulesViolation{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentUnsupportedTLD(v **types.UnsupportedTLD, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.UnsupportedTLD if *v == nil { sv = &types.UnsupportedTLD{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentAcceptDomainTransferFromAnotherAwsAccountOutput(v **AcceptDomainTransferFromAnotherAwsAccountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *AcceptDomainTransferFromAnotherAwsAccountOutput if *v == nil { sv = &AcceptDomainTransferFromAnotherAwsAccountOutput{} } else { sv = *v } for key, value := range shape { switch key { case "OperationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationId to be of type string, got %T instead", value) } sv.OperationId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentAssociateDelegationSignerToDomainOutput(v **AssociateDelegationSignerToDomainOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *AssociateDelegationSignerToDomainOutput if *v == nil { sv = &AssociateDelegationSignerToDomainOutput{} } else { sv = *v } for key, value := range shape { switch key { case "OperationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationId to be of type string, got %T instead", value) } sv.OperationId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCancelDomainTransferToAnotherAwsAccountOutput(v **CancelDomainTransferToAnotherAwsAccountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CancelDomainTransferToAnotherAwsAccountOutput if *v == nil { sv = &CancelDomainTransferToAnotherAwsAccountOutput{} } else { sv = *v } for key, value := range shape { switch key { case "OperationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationId to be of type string, got %T instead", value) } sv.OperationId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCheckDomainAvailabilityOutput(v **CheckDomainAvailabilityOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CheckDomainAvailabilityOutput if *v == nil { sv = &CheckDomainAvailabilityOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Availability": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainAvailability to be of type string, got %T instead", value) } sv.Availability = types.DomainAvailability(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCheckDomainTransferabilityOutput(v **CheckDomainTransferabilityOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CheckDomainTransferabilityOutput if *v == nil { sv = &CheckDomainTransferabilityOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Transferability": if err := awsAwsjson11_deserializeDocumentDomainTransferability(&sv.Transferability, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeleteDomainOutput(v **DeleteDomainOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteDomainOutput if *v == nil { sv = &DeleteDomainOutput{} } else { sv = *v } for key, value := range shape { switch key { case "OperationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationId to be of type string, got %T instead", value) } sv.OperationId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeleteTagsForDomainOutput(v **DeleteTagsForDomainOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteTagsForDomainOutput if *v == nil { sv = &DeleteTagsForDomainOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDisableDomainAutoRenewOutput(v **DisableDomainAutoRenewOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DisableDomainAutoRenewOutput if *v == nil { sv = &DisableDomainAutoRenewOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDisableDomainTransferLockOutput(v **DisableDomainTransferLockOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DisableDomainTransferLockOutput if *v == nil { sv = &DisableDomainTransferLockOutput{} } else { sv = *v } for key, value := range shape { switch key { case "OperationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationId to be of type string, got %T instead", value) } sv.OperationId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDisassociateDelegationSignerFromDomainOutput(v **DisassociateDelegationSignerFromDomainOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DisassociateDelegationSignerFromDomainOutput if *v == nil { sv = &DisassociateDelegationSignerFromDomainOutput{} } else { sv = *v } for key, value := range shape { switch key { case "OperationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationId to be of type string, got %T instead", value) } sv.OperationId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentEnableDomainAutoRenewOutput(v **EnableDomainAutoRenewOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *EnableDomainAutoRenewOutput if *v == nil { sv = &EnableDomainAutoRenewOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentEnableDomainTransferLockOutput(v **EnableDomainTransferLockOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *EnableDomainTransferLockOutput if *v == nil { sv = &EnableDomainTransferLockOutput{} } else { sv = *v } for key, value := range shape { switch key { case "OperationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationId to be of type string, got %T instead", value) } sv.OperationId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetContactReachabilityStatusOutput(v **GetContactReachabilityStatusOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetContactReachabilityStatusOutput if *v == nil { sv = &GetContactReachabilityStatusOutput{} } else { sv = *v } for key, value := range shape { switch key { case "domainName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) } sv.DomainName = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReachabilityStatus to be of type string, got %T instead", value) } sv.Status = types.ReachabilityStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetDomainDetailOutput(v **GetDomainDetailOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetDomainDetailOutput if *v == nil { sv = &GetDomainDetailOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AbuseContactEmail": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Email to be of type string, got %T instead", value) } sv.AbuseContactEmail = ptr.String(jtv) } case "AbuseContactPhone": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContactNumber to be of type string, got %T instead", value) } sv.AbuseContactPhone = ptr.String(jtv) } case "AdminContact": if err := awsAwsjson11_deserializeDocumentContactDetail(&sv.AdminContact, value); err != nil { return err } case "AdminPrivacy": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AdminPrivacy = ptr.Bool(jtv) } case "AutoRenew": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AutoRenew = ptr.Bool(jtv) } case "CreationDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "DnsSec": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DNSSec to be of type string, got %T instead", value) } sv.DnsSec = ptr.String(jtv) } case "DnssecKeys": if err := awsAwsjson11_deserializeDocumentDnssecKeyList(&sv.DnssecKeys, value); err != nil { return err } case "DomainName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) } sv.DomainName = ptr.String(jtv) } case "ExpirationDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.ExpirationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Nameservers": if err := awsAwsjson11_deserializeDocumentNameserverList(&sv.Nameservers, value); err != nil { return err } case "RegistrantContact": if err := awsAwsjson11_deserializeDocumentContactDetail(&sv.RegistrantContact, value); err != nil { return err } case "RegistrantPrivacy": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.RegistrantPrivacy = ptr.Bool(jtv) } case "RegistrarName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RegistrarName to be of type string, got %T instead", value) } sv.RegistrarName = ptr.String(jtv) } case "RegistrarUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RegistrarUrl to be of type string, got %T instead", value) } sv.RegistrarUrl = ptr.String(jtv) } case "RegistryDomainId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RegistryDomainId to be of type string, got %T instead", value) } sv.RegistryDomainId = ptr.String(jtv) } case "Reseller": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Reseller to be of type string, got %T instead", value) } sv.Reseller = ptr.String(jtv) } case "StatusList": if err := awsAwsjson11_deserializeDocumentDomainStatusList(&sv.StatusList, value); err != nil { return err } case "TechContact": if err := awsAwsjson11_deserializeDocumentContactDetail(&sv.TechContact, value); err != nil { return err } case "TechPrivacy": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.TechPrivacy = ptr.Bool(jtv) } case "UpdatedDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.UpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "WhoIsServer": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RegistrarWhoIsServer to be of type string, got %T instead", value) } sv.WhoIsServer = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetDomainSuggestionsOutput(v **GetDomainSuggestionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetDomainSuggestionsOutput if *v == nil { sv = &GetDomainSuggestionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "SuggestionsList": if err := awsAwsjson11_deserializeDocumentDomainSuggestionsList(&sv.SuggestionsList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetOperationDetailOutput(v **GetOperationDetailOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetOperationDetailOutput if *v == nil { sv = &GetOperationDetailOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DomainName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) } sv.DomainName = ptr.String(jtv) } case "LastUpdatedDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "OperationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationId to be of type string, got %T instead", value) } sv.OperationId = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationStatus to be of type string, got %T instead", value) } sv.Status = types.OperationStatus(jtv) } case "StatusFlag": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StatusFlag to be of type string, got %T instead", value) } sv.StatusFlag = types.StatusFlag(jtv) } case "SubmittedDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.SubmittedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationType to be of type string, got %T instead", value) } sv.Type = types.OperationType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListDomainsOutput(v **ListDomainsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListDomainsOutput if *v == nil { sv = &ListDomainsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Domains": if err := awsAwsjson11_deserializeDocumentDomainSummaryList(&sv.Domains, value); err != nil { return err } case "NextPageMarker": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PageMarker to be of type string, got %T instead", value) } sv.NextPageMarker = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListOperationsOutput(v **ListOperationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListOperationsOutput if *v == nil { sv = &ListOperationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NextPageMarker": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PageMarker to be of type string, got %T instead", value) } sv.NextPageMarker = ptr.String(jtv) } case "Operations": if err := awsAwsjson11_deserializeDocumentOperationSummaryList(&sv.Operations, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListPricesOutput(v **ListPricesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListPricesOutput if *v == nil { sv = &ListPricesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NextPageMarker": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PageMarker to be of type string, got %T instead", value) } sv.NextPageMarker = ptr.String(jtv) } case "Prices": if err := awsAwsjson11_deserializeDocumentDomainPriceList(&sv.Prices, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListTagsForDomainOutput(v **ListTagsForDomainOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTagsForDomainOutput if *v == nil { sv = &ListTagsForDomainOutput{} } else { sv = *v } for key, value := range shape { switch key { case "TagList": if err := awsAwsjson11_deserializeDocumentTagList(&sv.TagList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentRegisterDomainOutput(v **RegisterDomainOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *RegisterDomainOutput if *v == nil { sv = &RegisterDomainOutput{} } else { sv = *v } for key, value := range shape { switch key { case "OperationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationId to be of type string, got %T instead", value) } sv.OperationId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentRejectDomainTransferFromAnotherAwsAccountOutput(v **RejectDomainTransferFromAnotherAwsAccountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *RejectDomainTransferFromAnotherAwsAccountOutput if *v == nil { sv = &RejectDomainTransferFromAnotherAwsAccountOutput{} } else { sv = *v } for key, value := range shape { switch key { case "OperationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationId to be of type string, got %T instead", value) } sv.OperationId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentRenewDomainOutput(v **RenewDomainOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *RenewDomainOutput if *v == nil { sv = &RenewDomainOutput{} } else { sv = *v } for key, value := range shape { switch key { case "OperationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationId to be of type string, got %T instead", value) } sv.OperationId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentResendContactReachabilityEmailOutput(v **ResendContactReachabilityEmailOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ResendContactReachabilityEmailOutput if *v == nil { sv = &ResendContactReachabilityEmailOutput{} } else { sv = *v } for key, value := range shape { switch key { case "domainName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) } sv.DomainName = ptr.String(jtv) } case "emailAddress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Email to be of type string, got %T instead", value) } sv.EmailAddress = ptr.String(jtv) } case "isAlreadyVerified": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsAlreadyVerified = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentRetrieveDomainAuthCodeOutput(v **RetrieveDomainAuthCodeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *RetrieveDomainAuthCodeOutput if *v == nil { sv = &RetrieveDomainAuthCodeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AuthCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DomainAuthCode to be of type string, got %T instead", value) } sv.AuthCode = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentTransferDomainOutput(v **TransferDomainOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *TransferDomainOutput if *v == nil { sv = &TransferDomainOutput{} } else { sv = *v } for key, value := range shape { switch key { case "OperationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationId to be of type string, got %T instead", value) } sv.OperationId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentTransferDomainToAnotherAwsAccountOutput(v **TransferDomainToAnotherAwsAccountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *TransferDomainToAnotherAwsAccountOutput if *v == nil { sv = &TransferDomainToAnotherAwsAccountOutput{} } else { sv = *v } for key, value := range shape { switch key { case "OperationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationId to be of type string, got %T instead", value) } sv.OperationId = ptr.String(jtv) } case "Password": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Password = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateDomainContactOutput(v **UpdateDomainContactOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateDomainContactOutput if *v == nil { sv = &UpdateDomainContactOutput{} } else { sv = *v } for key, value := range shape { switch key { case "OperationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationId to be of type string, got %T instead", value) } sv.OperationId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateDomainContactPrivacyOutput(v **UpdateDomainContactPrivacyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateDomainContactPrivacyOutput if *v == nil { sv = &UpdateDomainContactPrivacyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "OperationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationId to be of type string, got %T instead", value) } sv.OperationId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateDomainNameserversOutput(v **UpdateDomainNameserversOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateDomainNameserversOutput if *v == nil { sv = &UpdateDomainNameserversOutput{} } else { sv = *v } for key, value := range shape { switch key { case "OperationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperationId to be of type string, got %T instead", value) } sv.OperationId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateTagsForDomainOutput(v **UpdateTagsForDomainOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateTagsForDomainOutput if *v == nil { sv = &UpdateTagsForDomainOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentViewBillingOutput(v **ViewBillingOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ViewBillingOutput if *v == nil { sv = &ViewBillingOutput{} } else { sv = *v } for key, value := range shape { switch key { case "BillingRecords": if err := awsAwsjson11_deserializeDocumentBillingRecords(&sv.BillingRecords, value); err != nil { return err } case "NextPageMarker": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PageMarker to be of type string, got %T instead", value) } sv.NextPageMarker = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil }
7,371
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package route53domains provides the API client, operations, and parameter types // for Amazon Route 53 Domains. // // Amazon Route 53 API actions let you register domain names and perform related // operations. package route53domains
9
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53domains 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/route53domains/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 = "route53domains" } 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 route53domains // goModuleVersion is the tagged release for this module const goModuleVersion = "1.15.0"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53domains
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53domains import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/route53domains/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "math" "path" ) type awsAwsjson11_serializeOpAcceptDomainTransferFromAnotherAwsAccount struct { } func (*awsAwsjson11_serializeOpAcceptDomainTransferFromAnotherAwsAccount) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpAcceptDomainTransferFromAnotherAwsAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*AcceptDomainTransferFromAnotherAwsAccountInput) _ = 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("Route53Domains_v20140515.AcceptDomainTransferFromAnotherAwsAccount") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentAcceptDomainTransferFromAnotherAwsAccountInput(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_serializeOpAssociateDelegationSignerToDomain struct { } func (*awsAwsjson11_serializeOpAssociateDelegationSignerToDomain) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpAssociateDelegationSignerToDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*AssociateDelegationSignerToDomainInput) _ = 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("Route53Domains_v20140515.AssociateDelegationSignerToDomain") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentAssociateDelegationSignerToDomainInput(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_serializeOpCancelDomainTransferToAnotherAwsAccount struct { } func (*awsAwsjson11_serializeOpCancelDomainTransferToAnotherAwsAccount) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCancelDomainTransferToAnotherAwsAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CancelDomainTransferToAnotherAwsAccountInput) _ = 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("Route53Domains_v20140515.CancelDomainTransferToAnotherAwsAccount") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCancelDomainTransferToAnotherAwsAccountInput(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_serializeOpCheckDomainAvailability struct { } func (*awsAwsjson11_serializeOpCheckDomainAvailability) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCheckDomainAvailability) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CheckDomainAvailabilityInput) _ = 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("Route53Domains_v20140515.CheckDomainAvailability") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCheckDomainAvailabilityInput(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_serializeOpCheckDomainTransferability struct { } func (*awsAwsjson11_serializeOpCheckDomainTransferability) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCheckDomainTransferability) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CheckDomainTransferabilityInput) _ = 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("Route53Domains_v20140515.CheckDomainTransferability") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCheckDomainTransferabilityInput(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_serializeOpDeleteDomain struct { } func (*awsAwsjson11_serializeOpDeleteDomain) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteDomainInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } 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("Route53Domains_v20140515.DeleteDomain") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteDomainInput(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_serializeOpDeleteTagsForDomain struct { } func (*awsAwsjson11_serializeOpDeleteTagsForDomain) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteTagsForDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteTagsForDomainInput) _ = 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("Route53Domains_v20140515.DeleteTagsForDomain") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteTagsForDomainInput(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_serializeOpDisableDomainAutoRenew struct { } func (*awsAwsjson11_serializeOpDisableDomainAutoRenew) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDisableDomainAutoRenew) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisableDomainAutoRenewInput) _ = 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("Route53Domains_v20140515.DisableDomainAutoRenew") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDisableDomainAutoRenewInput(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_serializeOpDisableDomainTransferLock struct { } func (*awsAwsjson11_serializeOpDisableDomainTransferLock) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDisableDomainTransferLock) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisableDomainTransferLockInput) _ = 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("Route53Domains_v20140515.DisableDomainTransferLock") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDisableDomainTransferLockInput(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_serializeOpDisassociateDelegationSignerFromDomain struct { } func (*awsAwsjson11_serializeOpDisassociateDelegationSignerFromDomain) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDisassociateDelegationSignerFromDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisassociateDelegationSignerFromDomainInput) _ = 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("Route53Domains_v20140515.DisassociateDelegationSignerFromDomain") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDisassociateDelegationSignerFromDomainInput(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_serializeOpEnableDomainAutoRenew struct { } func (*awsAwsjson11_serializeOpEnableDomainAutoRenew) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpEnableDomainAutoRenew) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*EnableDomainAutoRenewInput) _ = 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("Route53Domains_v20140515.EnableDomainAutoRenew") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentEnableDomainAutoRenewInput(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_serializeOpEnableDomainTransferLock struct { } func (*awsAwsjson11_serializeOpEnableDomainTransferLock) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpEnableDomainTransferLock) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*EnableDomainTransferLockInput) _ = 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("Route53Domains_v20140515.EnableDomainTransferLock") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentEnableDomainTransferLockInput(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_serializeOpGetContactReachabilityStatus struct { } func (*awsAwsjson11_serializeOpGetContactReachabilityStatus) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetContactReachabilityStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetContactReachabilityStatusInput) _ = 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("Route53Domains_v20140515.GetContactReachabilityStatus") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetContactReachabilityStatusInput(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_serializeOpGetDomainDetail struct { } func (*awsAwsjson11_serializeOpGetDomainDetail) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetDomainDetail) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetDomainDetailInput) _ = 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("Route53Domains_v20140515.GetDomainDetail") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetDomainDetailInput(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_serializeOpGetDomainSuggestions struct { } func (*awsAwsjson11_serializeOpGetDomainSuggestions) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetDomainSuggestions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetDomainSuggestionsInput) _ = 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("Route53Domains_v20140515.GetDomainSuggestions") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetDomainSuggestionsInput(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_serializeOpGetOperationDetail struct { } func (*awsAwsjson11_serializeOpGetOperationDetail) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetOperationDetail) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetOperationDetailInput) _ = 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("Route53Domains_v20140515.GetOperationDetail") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetOperationDetailInput(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_serializeOpListDomains struct { } func (*awsAwsjson11_serializeOpListDomains) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListDomains) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListDomainsInput) _ = 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("Route53Domains_v20140515.ListDomains") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListDomainsInput(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_serializeOpListOperations struct { } func (*awsAwsjson11_serializeOpListOperations) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListOperations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListOperationsInput) _ = 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("Route53Domains_v20140515.ListOperations") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListOperationsInput(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_serializeOpListPrices struct { } func (*awsAwsjson11_serializeOpListPrices) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListPrices) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListPricesInput) _ = 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("Route53Domains_v20140515.ListPrices") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListPricesInput(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_serializeOpListTagsForDomain struct { } func (*awsAwsjson11_serializeOpListTagsForDomain) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListTagsForDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListTagsForDomainInput) _ = 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("Route53Domains_v20140515.ListTagsForDomain") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListTagsForDomainInput(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_serializeOpPushDomain struct { } func (*awsAwsjson11_serializeOpPushDomain) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpPushDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*PushDomainInput) _ = 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("Route53Domains_v20140515.PushDomain") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentPushDomainInput(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_serializeOpRegisterDomain struct { } func (*awsAwsjson11_serializeOpRegisterDomain) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpRegisterDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RegisterDomainInput) _ = 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("Route53Domains_v20140515.RegisterDomain") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentRegisterDomainInput(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_serializeOpRejectDomainTransferFromAnotherAwsAccount struct { } func (*awsAwsjson11_serializeOpRejectDomainTransferFromAnotherAwsAccount) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpRejectDomainTransferFromAnotherAwsAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RejectDomainTransferFromAnotherAwsAccountInput) _ = 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("Route53Domains_v20140515.RejectDomainTransferFromAnotherAwsAccount") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentRejectDomainTransferFromAnotherAwsAccountInput(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_serializeOpRenewDomain struct { } func (*awsAwsjson11_serializeOpRenewDomain) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpRenewDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RenewDomainInput) _ = 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("Route53Domains_v20140515.RenewDomain") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentRenewDomainInput(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_serializeOpResendContactReachabilityEmail struct { } func (*awsAwsjson11_serializeOpResendContactReachabilityEmail) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpResendContactReachabilityEmail) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ResendContactReachabilityEmailInput) _ = 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("Route53Domains_v20140515.ResendContactReachabilityEmail") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentResendContactReachabilityEmailInput(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_serializeOpResendOperationAuthorization struct { } func (*awsAwsjson11_serializeOpResendOperationAuthorization) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpResendOperationAuthorization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ResendOperationAuthorizationInput) _ = 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("Route53Domains_v20140515.ResendOperationAuthorization") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentResendOperationAuthorizationInput(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_serializeOpRetrieveDomainAuthCode struct { } func (*awsAwsjson11_serializeOpRetrieveDomainAuthCode) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpRetrieveDomainAuthCode) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RetrieveDomainAuthCodeInput) _ = 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("Route53Domains_v20140515.RetrieveDomainAuthCode") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentRetrieveDomainAuthCodeInput(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_serializeOpTransferDomain struct { } func (*awsAwsjson11_serializeOpTransferDomain) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpTransferDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*TransferDomainInput) _ = 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("Route53Domains_v20140515.TransferDomain") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentTransferDomainInput(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_serializeOpTransferDomainToAnotherAwsAccount struct { } func (*awsAwsjson11_serializeOpTransferDomainToAnotherAwsAccount) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpTransferDomainToAnotherAwsAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*TransferDomainToAnotherAwsAccountInput) _ = 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("Route53Domains_v20140515.TransferDomainToAnotherAwsAccount") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentTransferDomainToAnotherAwsAccountInput(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_serializeOpUpdateDomainContact struct { } func (*awsAwsjson11_serializeOpUpdateDomainContact) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateDomainContact) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateDomainContactInput) _ = 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("Route53Domains_v20140515.UpdateDomainContact") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateDomainContactInput(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_serializeOpUpdateDomainContactPrivacy struct { } func (*awsAwsjson11_serializeOpUpdateDomainContactPrivacy) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateDomainContactPrivacy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateDomainContactPrivacyInput) _ = 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("Route53Domains_v20140515.UpdateDomainContactPrivacy") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateDomainContactPrivacyInput(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_serializeOpUpdateDomainNameservers struct { } func (*awsAwsjson11_serializeOpUpdateDomainNameservers) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateDomainNameservers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateDomainNameserversInput) _ = 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("Route53Domains_v20140515.UpdateDomainNameservers") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateDomainNameserversInput(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_serializeOpUpdateTagsForDomain struct { } func (*awsAwsjson11_serializeOpUpdateTagsForDomain) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateTagsForDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateTagsForDomainInput) _ = 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("Route53Domains_v20140515.UpdateTagsForDomain") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateTagsForDomainInput(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_serializeOpViewBilling struct { } func (*awsAwsjson11_serializeOpViewBilling) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpViewBilling) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ViewBillingInput) _ = 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("Route53Domains_v20140515.ViewBilling") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentViewBillingInput(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_serializeDocumentConsent(v *types.Consent, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Currency != nil { ok := object.Key("Currency") ok.String(*v.Currency) } { ok := object.Key("MaxPrice") switch { case math.IsNaN(v.MaxPrice): ok.String("NaN") case math.IsInf(v.MaxPrice, 1): ok.String("Infinity") case math.IsInf(v.MaxPrice, -1): ok.String("-Infinity") default: ok.Double(v.MaxPrice) } } return nil } func awsAwsjson11_serializeDocumentContactDetail(v *types.ContactDetail, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AddressLine1 != nil { ok := object.Key("AddressLine1") ok.String(*v.AddressLine1) } if v.AddressLine2 != nil { ok := object.Key("AddressLine2") ok.String(*v.AddressLine2) } if v.City != nil { ok := object.Key("City") ok.String(*v.City) } if len(v.ContactType) > 0 { ok := object.Key("ContactType") ok.String(string(v.ContactType)) } if len(v.CountryCode) > 0 { ok := object.Key("CountryCode") ok.String(string(v.CountryCode)) } if v.Email != nil { ok := object.Key("Email") ok.String(*v.Email) } if v.ExtraParams != nil { ok := object.Key("ExtraParams") if err := awsAwsjson11_serializeDocumentExtraParamList(v.ExtraParams, ok); err != nil { return err } } if v.Fax != nil { ok := object.Key("Fax") ok.String(*v.Fax) } if v.FirstName != nil { ok := object.Key("FirstName") ok.String(*v.FirstName) } if v.LastName != nil { ok := object.Key("LastName") ok.String(*v.LastName) } if v.OrganizationName != nil { ok := object.Key("OrganizationName") ok.String(*v.OrganizationName) } if v.PhoneNumber != nil { ok := object.Key("PhoneNumber") ok.String(*v.PhoneNumber) } if v.State != nil { ok := object.Key("State") ok.String(*v.State) } if v.ZipCode != nil { ok := object.Key("ZipCode") ok.String(*v.ZipCode) } return nil } func awsAwsjson11_serializeDocumentDnssecSigningAttributes(v *types.DnssecSigningAttributes, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Algorithm != nil { ok := object.Key("Algorithm") ok.Integer(*v.Algorithm) } if v.Flags != nil { ok := object.Key("Flags") ok.Integer(*v.Flags) } if v.PublicKey != nil { ok := object.Key("PublicKey") ok.String(*v.PublicKey) } return nil } func awsAwsjson11_serializeDocumentExtraParam(v *types.ExtraParam, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Name) > 0 { ok := object.Key("Name") ok.String(string(v.Name)) } if v.Value != nil { ok := object.Key("Value") ok.String(*v.Value) } return nil } func awsAwsjson11_serializeDocumentExtraParamList(v []types.ExtraParam, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentExtraParam(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentFilterCondition(v *types.FilterCondition, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Name) > 0 { ok := object.Key("Name") ok.String(string(v.Name)) } if len(v.Operator) > 0 { ok := object.Key("Operator") ok.String(string(v.Operator)) } if v.Values != nil { ok := object.Key("Values") if err := awsAwsjson11_serializeDocumentValues(v.Values, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentFilterConditions(v []types.FilterCondition, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentFilterCondition(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentGlueIpList(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 awsAwsjson11_serializeDocumentNameserver(v *types.Nameserver, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.GlueIps != nil { ok := object.Key("GlueIps") if err := awsAwsjson11_serializeDocumentGlueIpList(v.GlueIps, ok); err != nil { return err } } if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } return nil } func awsAwsjson11_serializeDocumentNameserverList(v []types.Nameserver, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentNameserver(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentOperationStatusList(v []types.OperationStatus, 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 awsAwsjson11_serializeDocumentOperationTypeList(v []types.OperationType, 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 awsAwsjson11_serializeDocumentSortCondition(v *types.SortCondition, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Name) > 0 { ok := object.Key("Name") ok.String(string(v.Name)) } if len(v.SortOrder) > 0 { ok := object.Key("SortOrder") ok.String(string(v.SortOrder)) } return nil } func awsAwsjson11_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 awsAwsjson11_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 awsAwsjson11_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentValues(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 awsAwsjson11_serializeOpDocumentAcceptDomainTransferFromAnotherAwsAccountInput(v *AcceptDomainTransferFromAnotherAwsAccountInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } if v.Password != nil { ok := object.Key("Password") ok.String(*v.Password) } return nil } func awsAwsjson11_serializeOpDocumentAssociateDelegationSignerToDomainInput(v *AssociateDelegationSignerToDomainInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } if v.SigningAttributes != nil { ok := object.Key("SigningAttributes") if err := awsAwsjson11_serializeDocumentDnssecSigningAttributes(v.SigningAttributes, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentCancelDomainTransferToAnotherAwsAccountInput(v *CancelDomainTransferToAnotherAwsAccountInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } return nil } func awsAwsjson11_serializeOpDocumentCheckDomainAvailabilityInput(v *CheckDomainAvailabilityInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } if v.IdnLangCode != nil { ok := object.Key("IdnLangCode") ok.String(*v.IdnLangCode) } return nil } func awsAwsjson11_serializeOpDocumentCheckDomainTransferabilityInput(v *CheckDomainTransferabilityInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AuthCode != nil { ok := object.Key("AuthCode") ok.String(*v.AuthCode) } if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } return nil } func awsAwsjson11_serializeOpDocumentDeleteDomainInput(v *DeleteDomainInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } return nil } func awsAwsjson11_serializeOpDocumentDeleteTagsForDomainInput(v *DeleteTagsForDomainInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } if v.TagsToDelete != nil { ok := object.Key("TagsToDelete") if err := awsAwsjson11_serializeDocumentTagKeyList(v.TagsToDelete, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentDisableDomainAutoRenewInput(v *DisableDomainAutoRenewInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } return nil } func awsAwsjson11_serializeOpDocumentDisableDomainTransferLockInput(v *DisableDomainTransferLockInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } return nil } func awsAwsjson11_serializeOpDocumentDisassociateDelegationSignerFromDomainInput(v *DisassociateDelegationSignerFromDomainInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } if v.Id != nil { ok := object.Key("Id") ok.String(*v.Id) } return nil } func awsAwsjson11_serializeOpDocumentEnableDomainAutoRenewInput(v *EnableDomainAutoRenewInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } return nil } func awsAwsjson11_serializeOpDocumentEnableDomainTransferLockInput(v *EnableDomainTransferLockInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } return nil } func awsAwsjson11_serializeOpDocumentGetContactReachabilityStatusInput(v *GetContactReachabilityStatusInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("domainName") ok.String(*v.DomainName) } return nil } func awsAwsjson11_serializeOpDocumentGetDomainDetailInput(v *GetDomainDetailInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } return nil } func awsAwsjson11_serializeOpDocumentGetDomainSuggestionsInput(v *GetDomainSuggestionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } if v.OnlyAvailable != nil { ok := object.Key("OnlyAvailable") ok.Boolean(*v.OnlyAvailable) } { ok := object.Key("SuggestionCount") ok.Integer(v.SuggestionCount) } return nil } func awsAwsjson11_serializeOpDocumentGetOperationDetailInput(v *GetOperationDetailInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.OperationId != nil { ok := object.Key("OperationId") ok.String(*v.OperationId) } return nil } func awsAwsjson11_serializeOpDocumentListDomainsInput(v *ListDomainsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.FilterConditions != nil { ok := object.Key("FilterConditions") if err := awsAwsjson11_serializeDocumentFilterConditions(v.FilterConditions, ok); err != nil { return err } } if v.Marker != nil { ok := object.Key("Marker") ok.String(*v.Marker) } if v.MaxItems != nil { ok := object.Key("MaxItems") ok.Integer(*v.MaxItems) } if v.SortCondition != nil { ok := object.Key("SortCondition") if err := awsAwsjson11_serializeDocumentSortCondition(v.SortCondition, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentListOperationsInput(v *ListOperationsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Marker != nil { ok := object.Key("Marker") ok.String(*v.Marker) } if v.MaxItems != nil { ok := object.Key("MaxItems") ok.Integer(*v.MaxItems) } if len(v.SortBy) > 0 { ok := object.Key("SortBy") ok.String(string(v.SortBy)) } if len(v.SortOrder) > 0 { ok := object.Key("SortOrder") ok.String(string(v.SortOrder)) } if v.Status != nil { ok := object.Key("Status") if err := awsAwsjson11_serializeDocumentOperationStatusList(v.Status, ok); err != nil { return err } } if v.SubmittedSince != nil { ok := object.Key("SubmittedSince") ok.Double(smithytime.FormatEpochSeconds(*v.SubmittedSince)) } if v.Type != nil { ok := object.Key("Type") if err := awsAwsjson11_serializeDocumentOperationTypeList(v.Type, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentListPricesInput(v *ListPricesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Marker != nil { ok := object.Key("Marker") ok.String(*v.Marker) } if v.MaxItems != nil { ok := object.Key("MaxItems") ok.Integer(*v.MaxItems) } if v.Tld != nil { ok := object.Key("Tld") ok.String(*v.Tld) } return nil } func awsAwsjson11_serializeOpDocumentListTagsForDomainInput(v *ListTagsForDomainInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } return nil } func awsAwsjson11_serializeOpDocumentPushDomainInput(v *PushDomainInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } if v.Target != nil { ok := object.Key("Target") ok.String(*v.Target) } return nil } func awsAwsjson11_serializeOpDocumentRegisterDomainInput(v *RegisterDomainInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AdminContact != nil { ok := object.Key("AdminContact") if err := awsAwsjson11_serializeDocumentContactDetail(v.AdminContact, ok); err != nil { return err } } if v.AutoRenew != nil { ok := object.Key("AutoRenew") ok.Boolean(*v.AutoRenew) } if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } if v.DurationInYears != nil { ok := object.Key("DurationInYears") ok.Integer(*v.DurationInYears) } if v.IdnLangCode != nil { ok := object.Key("IdnLangCode") ok.String(*v.IdnLangCode) } if v.PrivacyProtectAdminContact != nil { ok := object.Key("PrivacyProtectAdminContact") ok.Boolean(*v.PrivacyProtectAdminContact) } if v.PrivacyProtectRegistrantContact != nil { ok := object.Key("PrivacyProtectRegistrantContact") ok.Boolean(*v.PrivacyProtectRegistrantContact) } if v.PrivacyProtectTechContact != nil { ok := object.Key("PrivacyProtectTechContact") ok.Boolean(*v.PrivacyProtectTechContact) } if v.RegistrantContact != nil { ok := object.Key("RegistrantContact") if err := awsAwsjson11_serializeDocumentContactDetail(v.RegistrantContact, ok); err != nil { return err } } if v.TechContact != nil { ok := object.Key("TechContact") if err := awsAwsjson11_serializeDocumentContactDetail(v.TechContact, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentRejectDomainTransferFromAnotherAwsAccountInput(v *RejectDomainTransferFromAnotherAwsAccountInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } return nil } func awsAwsjson11_serializeOpDocumentRenewDomainInput(v *RenewDomainInput, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("CurrentExpiryYear") ok.Integer(v.CurrentExpiryYear) } if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } if v.DurationInYears != nil { ok := object.Key("DurationInYears") ok.Integer(*v.DurationInYears) } return nil } func awsAwsjson11_serializeOpDocumentResendContactReachabilityEmailInput(v *ResendContactReachabilityEmailInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("domainName") ok.String(*v.DomainName) } return nil } func awsAwsjson11_serializeOpDocumentResendOperationAuthorizationInput(v *ResendOperationAuthorizationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.OperationId != nil { ok := object.Key("OperationId") ok.String(*v.OperationId) } return nil } func awsAwsjson11_serializeOpDocumentRetrieveDomainAuthCodeInput(v *RetrieveDomainAuthCodeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } return nil } func awsAwsjson11_serializeOpDocumentTransferDomainInput(v *TransferDomainInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AdminContact != nil { ok := object.Key("AdminContact") if err := awsAwsjson11_serializeDocumentContactDetail(v.AdminContact, ok); err != nil { return err } } if v.AuthCode != nil { ok := object.Key("AuthCode") ok.String(*v.AuthCode) } if v.AutoRenew != nil { ok := object.Key("AutoRenew") ok.Boolean(*v.AutoRenew) } if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } if v.DurationInYears != nil { ok := object.Key("DurationInYears") ok.Integer(*v.DurationInYears) } if v.IdnLangCode != nil { ok := object.Key("IdnLangCode") ok.String(*v.IdnLangCode) } if v.Nameservers != nil { ok := object.Key("Nameservers") if err := awsAwsjson11_serializeDocumentNameserverList(v.Nameservers, ok); err != nil { return err } } if v.PrivacyProtectAdminContact != nil { ok := object.Key("PrivacyProtectAdminContact") ok.Boolean(*v.PrivacyProtectAdminContact) } if v.PrivacyProtectRegistrantContact != nil { ok := object.Key("PrivacyProtectRegistrantContact") ok.Boolean(*v.PrivacyProtectRegistrantContact) } if v.PrivacyProtectTechContact != nil { ok := object.Key("PrivacyProtectTechContact") ok.Boolean(*v.PrivacyProtectTechContact) } if v.RegistrantContact != nil { ok := object.Key("RegistrantContact") if err := awsAwsjson11_serializeDocumentContactDetail(v.RegistrantContact, ok); err != nil { return err } } if v.TechContact != nil { ok := object.Key("TechContact") if err := awsAwsjson11_serializeDocumentContactDetail(v.TechContact, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentTransferDomainToAnotherAwsAccountInput(v *TransferDomainToAnotherAwsAccountInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccountId != nil { ok := object.Key("AccountId") ok.String(*v.AccountId) } if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } return nil } func awsAwsjson11_serializeOpDocumentUpdateDomainContactInput(v *UpdateDomainContactInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AdminContact != nil { ok := object.Key("AdminContact") if err := awsAwsjson11_serializeDocumentContactDetail(v.AdminContact, ok); err != nil { return err } } if v.Consent != nil { ok := object.Key("Consent") if err := awsAwsjson11_serializeDocumentConsent(v.Consent, ok); err != nil { return err } } if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } if v.RegistrantContact != nil { ok := object.Key("RegistrantContact") if err := awsAwsjson11_serializeDocumentContactDetail(v.RegistrantContact, ok); err != nil { return err } } if v.TechContact != nil { ok := object.Key("TechContact") if err := awsAwsjson11_serializeDocumentContactDetail(v.TechContact, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentUpdateDomainContactPrivacyInput(v *UpdateDomainContactPrivacyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AdminPrivacy != nil { ok := object.Key("AdminPrivacy") ok.Boolean(*v.AdminPrivacy) } if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } if v.RegistrantPrivacy != nil { ok := object.Key("RegistrantPrivacy") ok.Boolean(*v.RegistrantPrivacy) } if v.TechPrivacy != nil { ok := object.Key("TechPrivacy") ok.Boolean(*v.TechPrivacy) } return nil } func awsAwsjson11_serializeOpDocumentUpdateDomainNameserversInput(v *UpdateDomainNameserversInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } if v.FIAuthKey != nil { ok := object.Key("FIAuthKey") ok.String(*v.FIAuthKey) } if v.Nameservers != nil { ok := object.Key("Nameservers") if err := awsAwsjson11_serializeDocumentNameserverList(v.Nameservers, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentUpdateTagsForDomainInput(v *UpdateTagsForDomainInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) } if v.TagsToUpdate != nil { ok := object.Key("TagsToUpdate") if err := awsAwsjson11_serializeDocumentTagList(v.TagsToUpdate, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentViewBillingInput(v *ViewBillingInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.End != nil { ok := object.Key("End") ok.Double(smithytime.FormatEpochSeconds(*v.End)) } if v.Marker != nil { ok := object.Key("Marker") ok.String(*v.Marker) } if v.MaxItems != nil { ok := object.Key("MaxItems") ok.Integer(*v.MaxItems) } if v.Start != nil { ok := object.Key("Start") ok.Double(smithytime.FormatEpochSeconds(*v.Start)) } return nil }
2,946
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53domains import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/route53domains/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpAcceptDomainTransferFromAnotherAwsAccount struct { } func (*validateOpAcceptDomainTransferFromAnotherAwsAccount) ID() string { return "OperationInputValidation" } func (m *validateOpAcceptDomainTransferFromAnotherAwsAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AcceptDomainTransferFromAnotherAwsAccountInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAcceptDomainTransferFromAnotherAwsAccountInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpAssociateDelegationSignerToDomain struct { } func (*validateOpAssociateDelegationSignerToDomain) ID() string { return "OperationInputValidation" } func (m *validateOpAssociateDelegationSignerToDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AssociateDelegationSignerToDomainInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAssociateDelegationSignerToDomainInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCancelDomainTransferToAnotherAwsAccount struct { } func (*validateOpCancelDomainTransferToAnotherAwsAccount) ID() string { return "OperationInputValidation" } func (m *validateOpCancelDomainTransferToAnotherAwsAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CancelDomainTransferToAnotherAwsAccountInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCancelDomainTransferToAnotherAwsAccountInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCheckDomainAvailability struct { } func (*validateOpCheckDomainAvailability) ID() string { return "OperationInputValidation" } func (m *validateOpCheckDomainAvailability) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CheckDomainAvailabilityInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCheckDomainAvailabilityInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCheckDomainTransferability struct { } func (*validateOpCheckDomainTransferability) ID() string { return "OperationInputValidation" } func (m *validateOpCheckDomainTransferability) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CheckDomainTransferabilityInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCheckDomainTransferabilityInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteDomain struct { } func (*validateOpDeleteDomain) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteDomainInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteDomainInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteTagsForDomain struct { } func (*validateOpDeleteTagsForDomain) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteTagsForDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteTagsForDomainInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteTagsForDomainInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDisableDomainAutoRenew struct { } func (*validateOpDisableDomainAutoRenew) ID() string { return "OperationInputValidation" } func (m *validateOpDisableDomainAutoRenew) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DisableDomainAutoRenewInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDisableDomainAutoRenewInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDisableDomainTransferLock struct { } func (*validateOpDisableDomainTransferLock) ID() string { return "OperationInputValidation" } func (m *validateOpDisableDomainTransferLock) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DisableDomainTransferLockInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDisableDomainTransferLockInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDisassociateDelegationSignerFromDomain struct { } func (*validateOpDisassociateDelegationSignerFromDomain) ID() string { return "OperationInputValidation" } func (m *validateOpDisassociateDelegationSignerFromDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DisassociateDelegationSignerFromDomainInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDisassociateDelegationSignerFromDomainInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpEnableDomainAutoRenew struct { } func (*validateOpEnableDomainAutoRenew) ID() string { return "OperationInputValidation" } func (m *validateOpEnableDomainAutoRenew) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*EnableDomainAutoRenewInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpEnableDomainAutoRenewInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpEnableDomainTransferLock struct { } func (*validateOpEnableDomainTransferLock) ID() string { return "OperationInputValidation" } func (m *validateOpEnableDomainTransferLock) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*EnableDomainTransferLockInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpEnableDomainTransferLockInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetDomainDetail struct { } func (*validateOpGetDomainDetail) ID() string { return "OperationInputValidation" } func (m *validateOpGetDomainDetail) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetDomainDetailInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetDomainDetailInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetDomainSuggestions struct { } func (*validateOpGetDomainSuggestions) ID() string { return "OperationInputValidation" } func (m *validateOpGetDomainSuggestions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetDomainSuggestionsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetDomainSuggestionsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetOperationDetail struct { } func (*validateOpGetOperationDetail) ID() string { return "OperationInputValidation" } func (m *validateOpGetOperationDetail) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetOperationDetailInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetOperationDetailInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListDomains struct { } func (*validateOpListDomains) ID() string { return "OperationInputValidation" } func (m *validateOpListDomains) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListDomainsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListDomainsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListTagsForDomain struct { } func (*validateOpListTagsForDomain) ID() string { return "OperationInputValidation" } func (m *validateOpListTagsForDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListTagsForDomainInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListTagsForDomainInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpPushDomain struct { } func (*validateOpPushDomain) ID() string { return "OperationInputValidation" } func (m *validateOpPushDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PushDomainInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPushDomainInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRegisterDomain struct { } func (*validateOpRegisterDomain) ID() string { return "OperationInputValidation" } func (m *validateOpRegisterDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RegisterDomainInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRegisterDomainInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRejectDomainTransferFromAnotherAwsAccount struct { } func (*validateOpRejectDomainTransferFromAnotherAwsAccount) ID() string { return "OperationInputValidation" } func (m *validateOpRejectDomainTransferFromAnotherAwsAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RejectDomainTransferFromAnotherAwsAccountInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRejectDomainTransferFromAnotherAwsAccountInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRenewDomain struct { } func (*validateOpRenewDomain) ID() string { return "OperationInputValidation" } func (m *validateOpRenewDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RenewDomainInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRenewDomainInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpResendOperationAuthorization struct { } func (*validateOpResendOperationAuthorization) ID() string { return "OperationInputValidation" } func (m *validateOpResendOperationAuthorization) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ResendOperationAuthorizationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpResendOperationAuthorizationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRetrieveDomainAuthCode struct { } func (*validateOpRetrieveDomainAuthCode) ID() string { return "OperationInputValidation" } func (m *validateOpRetrieveDomainAuthCode) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RetrieveDomainAuthCodeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRetrieveDomainAuthCodeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpTransferDomain struct { } func (*validateOpTransferDomain) ID() string { return "OperationInputValidation" } func (m *validateOpTransferDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TransferDomainInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTransferDomainInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpTransferDomainToAnotherAwsAccount struct { } func (*validateOpTransferDomainToAnotherAwsAccount) ID() string { return "OperationInputValidation" } func (m *validateOpTransferDomainToAnotherAwsAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TransferDomainToAnotherAwsAccountInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTransferDomainToAnotherAwsAccountInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateDomainContact struct { } func (*validateOpUpdateDomainContact) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateDomainContact) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateDomainContactInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateDomainContactInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateDomainContactPrivacy struct { } func (*validateOpUpdateDomainContactPrivacy) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateDomainContactPrivacy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateDomainContactPrivacyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateDomainContactPrivacyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateDomainNameservers struct { } func (*validateOpUpdateDomainNameservers) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateDomainNameservers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateDomainNameserversInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateDomainNameserversInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateTagsForDomain struct { } func (*validateOpUpdateTagsForDomain) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateTagsForDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateTagsForDomainInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateTagsForDomainInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpAcceptDomainTransferFromAnotherAwsAccountValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAcceptDomainTransferFromAnotherAwsAccount{}, middleware.After) } func addOpAssociateDelegationSignerToDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociateDelegationSignerToDomain{}, middleware.After) } func addOpCancelDomainTransferToAnotherAwsAccountValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCancelDomainTransferToAnotherAwsAccount{}, middleware.After) } func addOpCheckDomainAvailabilityValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCheckDomainAvailability{}, middleware.After) } func addOpCheckDomainTransferabilityValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCheckDomainTransferability{}, middleware.After) } func addOpDeleteDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteDomain{}, middleware.After) } func addOpDeleteTagsForDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteTagsForDomain{}, middleware.After) } func addOpDisableDomainAutoRenewValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisableDomainAutoRenew{}, middleware.After) } func addOpDisableDomainTransferLockValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisableDomainTransferLock{}, middleware.After) } func addOpDisassociateDelegationSignerFromDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisassociateDelegationSignerFromDomain{}, middleware.After) } func addOpEnableDomainAutoRenewValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpEnableDomainAutoRenew{}, middleware.After) } func addOpEnableDomainTransferLockValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpEnableDomainTransferLock{}, middleware.After) } func addOpGetDomainDetailValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDomainDetail{}, middleware.After) } func addOpGetDomainSuggestionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDomainSuggestions{}, middleware.After) } func addOpGetOperationDetailValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetOperationDetail{}, middleware.After) } func addOpListDomainsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListDomains{}, middleware.After) } func addOpListTagsForDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForDomain{}, middleware.After) } func addOpPushDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPushDomain{}, middleware.After) } func addOpRegisterDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRegisterDomain{}, middleware.After) } func addOpRejectDomainTransferFromAnotherAwsAccountValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRejectDomainTransferFromAnotherAwsAccount{}, middleware.After) } func addOpRenewDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRenewDomain{}, middleware.After) } func addOpResendOperationAuthorizationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpResendOperationAuthorization{}, middleware.After) } func addOpRetrieveDomainAuthCodeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRetrieveDomainAuthCode{}, middleware.After) } func addOpTransferDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTransferDomain{}, middleware.After) } func addOpTransferDomainToAnotherAwsAccountValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTransferDomainToAnotherAwsAccount{}, middleware.After) } func addOpUpdateDomainContactValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateDomainContact{}, middleware.After) } func addOpUpdateDomainContactPrivacyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateDomainContactPrivacy{}, middleware.After) } func addOpUpdateDomainNameserversValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateDomainNameservers{}, middleware.After) } func addOpUpdateTagsForDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateTagsForDomain{}, middleware.After) } func validateConsent(v *types.Consent) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Consent"} if v.Currency == nil { invalidParams.Add(smithy.NewErrParamRequired("Currency")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateContactDetail(v *types.ContactDetail) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ContactDetail"} if v.ExtraParams != nil { if err := validateExtraParamList(v.ExtraParams); err != nil { invalidParams.AddNested("ExtraParams", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateExtraParam(v *types.ExtraParam) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ExtraParam"} if len(v.Name) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Value == nil { invalidParams.Add(smithy.NewErrParamRequired("Value")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateExtraParamList(v []types.ExtraParam) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ExtraParamList"} for i := range v { if err := validateExtraParam(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateFilterCondition(v *types.FilterCondition) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "FilterCondition"} if len(v.Name) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if len(v.Operator) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Operator")) } if v.Values == nil { invalidParams.Add(smithy.NewErrParamRequired("Values")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateFilterConditions(v []types.FilterCondition) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "FilterConditions"} for i := range v { if err := validateFilterCondition(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateNameserver(v *types.Nameserver) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Nameserver"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateNameserverList(v []types.Nameserver) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "NameserverList"} for i := range v { if err := validateNameserver(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateSortCondition(v *types.SortCondition) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SortCondition"} if len(v.Name) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if len(v.SortOrder) == 0 { invalidParams.Add(smithy.NewErrParamRequired("SortOrder")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAcceptDomainTransferFromAnotherAwsAccountInput(v *AcceptDomainTransferFromAnotherAwsAccountInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AcceptDomainTransferFromAnotherAwsAccountInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if v.Password == nil { invalidParams.Add(smithy.NewErrParamRequired("Password")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAssociateDelegationSignerToDomainInput(v *AssociateDelegationSignerToDomainInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AssociateDelegationSignerToDomainInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if v.SigningAttributes == nil { invalidParams.Add(smithy.NewErrParamRequired("SigningAttributes")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCancelDomainTransferToAnotherAwsAccountInput(v *CancelDomainTransferToAnotherAwsAccountInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CancelDomainTransferToAnotherAwsAccountInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCheckDomainAvailabilityInput(v *CheckDomainAvailabilityInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CheckDomainAvailabilityInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCheckDomainTransferabilityInput(v *CheckDomainTransferabilityInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CheckDomainTransferabilityInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteDomainInput(v *DeleteDomainInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteDomainInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteTagsForDomainInput(v *DeleteTagsForDomainInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteTagsForDomainInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if v.TagsToDelete == nil { invalidParams.Add(smithy.NewErrParamRequired("TagsToDelete")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDisableDomainAutoRenewInput(v *DisableDomainAutoRenewInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DisableDomainAutoRenewInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDisableDomainTransferLockInput(v *DisableDomainTransferLockInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DisableDomainTransferLockInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDisassociateDelegationSignerFromDomainInput(v *DisassociateDelegationSignerFromDomainInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DisassociateDelegationSignerFromDomainInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpEnableDomainAutoRenewInput(v *EnableDomainAutoRenewInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "EnableDomainAutoRenewInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpEnableDomainTransferLockInput(v *EnableDomainTransferLockInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "EnableDomainTransferLockInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetDomainDetailInput(v *GetDomainDetailInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetDomainDetailInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetDomainSuggestionsInput(v *GetDomainSuggestionsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetDomainSuggestionsInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if v.OnlyAvailable == nil { invalidParams.Add(smithy.NewErrParamRequired("OnlyAvailable")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetOperationDetailInput(v *GetOperationDetailInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetOperationDetailInput"} if v.OperationId == nil { invalidParams.Add(smithy.NewErrParamRequired("OperationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListDomainsInput(v *ListDomainsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListDomainsInput"} if v.FilterConditions != nil { if err := validateFilterConditions(v.FilterConditions); err != nil { invalidParams.AddNested("FilterConditions", err.(smithy.InvalidParamsError)) } } if v.SortCondition != nil { if err := validateSortCondition(v.SortCondition); err != nil { invalidParams.AddNested("SortCondition", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListTagsForDomainInput(v *ListTagsForDomainInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListTagsForDomainInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpPushDomainInput(v *PushDomainInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PushDomainInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if v.Target == nil { invalidParams.Add(smithy.NewErrParamRequired("Target")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRegisterDomainInput(v *RegisterDomainInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RegisterDomainInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if v.DurationInYears == nil { invalidParams.Add(smithy.NewErrParamRequired("DurationInYears")) } if v.AdminContact == nil { invalidParams.Add(smithy.NewErrParamRequired("AdminContact")) } else if v.AdminContact != nil { if err := validateContactDetail(v.AdminContact); err != nil { invalidParams.AddNested("AdminContact", err.(smithy.InvalidParamsError)) } } if v.RegistrantContact == nil { invalidParams.Add(smithy.NewErrParamRequired("RegistrantContact")) } else if v.RegistrantContact != nil { if err := validateContactDetail(v.RegistrantContact); err != nil { invalidParams.AddNested("RegistrantContact", err.(smithy.InvalidParamsError)) } } if v.TechContact == nil { invalidParams.Add(smithy.NewErrParamRequired("TechContact")) } else if v.TechContact != nil { if err := validateContactDetail(v.TechContact); err != nil { invalidParams.AddNested("TechContact", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRejectDomainTransferFromAnotherAwsAccountInput(v *RejectDomainTransferFromAnotherAwsAccountInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RejectDomainTransferFromAnotherAwsAccountInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRenewDomainInput(v *RenewDomainInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RenewDomainInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpResendOperationAuthorizationInput(v *ResendOperationAuthorizationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ResendOperationAuthorizationInput"} if v.OperationId == nil { invalidParams.Add(smithy.NewErrParamRequired("OperationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRetrieveDomainAuthCodeInput(v *RetrieveDomainAuthCodeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RetrieveDomainAuthCodeInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTransferDomainInput(v *TransferDomainInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TransferDomainInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if v.DurationInYears == nil { invalidParams.Add(smithy.NewErrParamRequired("DurationInYears")) } if v.Nameservers != nil { if err := validateNameserverList(v.Nameservers); err != nil { invalidParams.AddNested("Nameservers", err.(smithy.InvalidParamsError)) } } if v.AdminContact == nil { invalidParams.Add(smithy.NewErrParamRequired("AdminContact")) } else if v.AdminContact != nil { if err := validateContactDetail(v.AdminContact); err != nil { invalidParams.AddNested("AdminContact", err.(smithy.InvalidParamsError)) } } if v.RegistrantContact == nil { invalidParams.Add(smithy.NewErrParamRequired("RegistrantContact")) } else if v.RegistrantContact != nil { if err := validateContactDetail(v.RegistrantContact); err != nil { invalidParams.AddNested("RegistrantContact", err.(smithy.InvalidParamsError)) } } if v.TechContact == nil { invalidParams.Add(smithy.NewErrParamRequired("TechContact")) } else if v.TechContact != nil { if err := validateContactDetail(v.TechContact); err != nil { invalidParams.AddNested("TechContact", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTransferDomainToAnotherAwsAccountInput(v *TransferDomainToAnotherAwsAccountInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TransferDomainToAnotherAwsAccountInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if v.AccountId == nil { invalidParams.Add(smithy.NewErrParamRequired("AccountId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateDomainContactInput(v *UpdateDomainContactInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateDomainContactInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if v.AdminContact != nil { if err := validateContactDetail(v.AdminContact); err != nil { invalidParams.AddNested("AdminContact", err.(smithy.InvalidParamsError)) } } if v.RegistrantContact != nil { if err := validateContactDetail(v.RegistrantContact); err != nil { invalidParams.AddNested("RegistrantContact", err.(smithy.InvalidParamsError)) } } if v.TechContact != nil { if err := validateContactDetail(v.TechContact); err != nil { invalidParams.AddNested("TechContact", err.(smithy.InvalidParamsError)) } } if v.Consent != nil { if err := validateConsent(v.Consent); err != nil { invalidParams.AddNested("Consent", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateDomainContactPrivacyInput(v *UpdateDomainContactPrivacyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateDomainContactPrivacyInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateDomainNameserversInput(v *UpdateDomainNameserversInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateDomainNameserversInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if v.Nameservers == nil { invalidParams.Add(smithy.NewErrParamRequired("Nameservers")) } else if v.Nameservers != nil { if err := validateNameserverList(v.Nameservers); err != nil { invalidParams.AddNested("Nameservers", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateTagsForDomainInput(v *UpdateTagsForDomainInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateTagsForDomainInput"} if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
1,406
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 Route 53 Domains 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: "route53domains.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "route53domains-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "route53domains-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53domains.{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: "route53domains.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "route53domains-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "route53domains-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53domains.{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: "route53domains-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53domains.{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: "route53domains-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53domains.{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: "route53domains-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53domains.{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: "route53domains-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53domains.{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: "route53domains.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "route53domains-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "route53domains-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53domains.{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 ContactType string // Enum values for ContactType const ( ContactTypePerson ContactType = "PERSON" ContactTypeCompany ContactType = "COMPANY" ContactTypeAssociation ContactType = "ASSOCIATION" ContactTypePublicBody ContactType = "PUBLIC_BODY" ContactTypeReseller ContactType = "RESELLER" ) // Values returns all known values for ContactType. 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 (ContactType) Values() []ContactType { return []ContactType{ "PERSON", "COMPANY", "ASSOCIATION", "PUBLIC_BODY", "RESELLER", } } type CountryCode string // Enum values for CountryCode const ( CountryCodeAc CountryCode = "AC" CountryCodeAd CountryCode = "AD" CountryCodeAe CountryCode = "AE" CountryCodeAf CountryCode = "AF" CountryCodeAg CountryCode = "AG" CountryCodeAi CountryCode = "AI" CountryCodeAl CountryCode = "AL" CountryCodeAm CountryCode = "AM" CountryCodeAn CountryCode = "AN" CountryCodeAo CountryCode = "AO" CountryCodeAq CountryCode = "AQ" CountryCodeAr CountryCode = "AR" CountryCodeAs CountryCode = "AS" CountryCodeAt CountryCode = "AT" CountryCodeAu CountryCode = "AU" CountryCodeAw CountryCode = "AW" CountryCodeAx CountryCode = "AX" CountryCodeAz CountryCode = "AZ" CountryCodeBa CountryCode = "BA" CountryCodeBb CountryCode = "BB" CountryCodeBd CountryCode = "BD" CountryCodeBe CountryCode = "BE" CountryCodeBf CountryCode = "BF" CountryCodeBg CountryCode = "BG" CountryCodeBh CountryCode = "BH" CountryCodeBi CountryCode = "BI" CountryCodeBj CountryCode = "BJ" CountryCodeBl CountryCode = "BL" CountryCodeBm CountryCode = "BM" CountryCodeBn CountryCode = "BN" CountryCodeBo CountryCode = "BO" CountryCodeBq CountryCode = "BQ" CountryCodeBr CountryCode = "BR" CountryCodeBs CountryCode = "BS" CountryCodeBt CountryCode = "BT" CountryCodeBv CountryCode = "BV" CountryCodeBw CountryCode = "BW" CountryCodeBy CountryCode = "BY" CountryCodeBz CountryCode = "BZ" CountryCodeCa CountryCode = "CA" CountryCodeCc CountryCode = "CC" CountryCodeCd CountryCode = "CD" CountryCodeCf CountryCode = "CF" CountryCodeCg CountryCode = "CG" CountryCodeCh CountryCode = "CH" CountryCodeCi CountryCode = "CI" CountryCodeCk CountryCode = "CK" CountryCodeCl CountryCode = "CL" CountryCodeCm CountryCode = "CM" CountryCodeCn CountryCode = "CN" CountryCodeCo CountryCode = "CO" CountryCodeCr CountryCode = "CR" CountryCodeCu CountryCode = "CU" CountryCodeCv CountryCode = "CV" CountryCodeCw CountryCode = "CW" CountryCodeCx CountryCode = "CX" CountryCodeCy CountryCode = "CY" CountryCodeCz CountryCode = "CZ" CountryCodeDe CountryCode = "DE" CountryCodeDj CountryCode = "DJ" CountryCodeDk CountryCode = "DK" CountryCodeDm CountryCode = "DM" CountryCodeDo CountryCode = "DO" CountryCodeDz CountryCode = "DZ" CountryCodeEc CountryCode = "EC" CountryCodeEe CountryCode = "EE" CountryCodeEg CountryCode = "EG" CountryCodeEh CountryCode = "EH" CountryCodeEr CountryCode = "ER" CountryCodeEs CountryCode = "ES" CountryCodeEt CountryCode = "ET" CountryCodeFi CountryCode = "FI" CountryCodeFj CountryCode = "FJ" CountryCodeFk CountryCode = "FK" CountryCodeFm CountryCode = "FM" CountryCodeFo CountryCode = "FO" CountryCodeFr CountryCode = "FR" CountryCodeGa CountryCode = "GA" CountryCodeGb CountryCode = "GB" CountryCodeGd CountryCode = "GD" CountryCodeGe CountryCode = "GE" CountryCodeGf CountryCode = "GF" CountryCodeGg CountryCode = "GG" CountryCodeGh CountryCode = "GH" CountryCodeGi CountryCode = "GI" CountryCodeGl CountryCode = "GL" CountryCodeGm CountryCode = "GM" CountryCodeGn CountryCode = "GN" CountryCodeGp CountryCode = "GP" CountryCodeGq CountryCode = "GQ" CountryCodeGr CountryCode = "GR" CountryCodeGs CountryCode = "GS" CountryCodeGt CountryCode = "GT" CountryCodeGu CountryCode = "GU" CountryCodeGw CountryCode = "GW" CountryCodeGy CountryCode = "GY" CountryCodeHk CountryCode = "HK" CountryCodeHm CountryCode = "HM" CountryCodeHn CountryCode = "HN" CountryCodeHr CountryCode = "HR" CountryCodeHt CountryCode = "HT" CountryCodeHu CountryCode = "HU" CountryCodeId CountryCode = "ID" CountryCodeIe CountryCode = "IE" CountryCodeIl CountryCode = "IL" CountryCodeIm CountryCode = "IM" CountryCodeIn CountryCode = "IN" CountryCodeIo CountryCode = "IO" CountryCodeIq CountryCode = "IQ" CountryCodeIr CountryCode = "IR" CountryCodeIs CountryCode = "IS" CountryCodeIt CountryCode = "IT" CountryCodeJe CountryCode = "JE" CountryCodeJm CountryCode = "JM" CountryCodeJo CountryCode = "JO" CountryCodeJp CountryCode = "JP" CountryCodeKe CountryCode = "KE" CountryCodeKg CountryCode = "KG" CountryCodeKh CountryCode = "KH" CountryCodeKi CountryCode = "KI" CountryCodeKm CountryCode = "KM" CountryCodeKn CountryCode = "KN" CountryCodeKp CountryCode = "KP" CountryCodeKr CountryCode = "KR" CountryCodeKw CountryCode = "KW" CountryCodeKy CountryCode = "KY" CountryCodeKz CountryCode = "KZ" CountryCodeLa CountryCode = "LA" CountryCodeLb CountryCode = "LB" CountryCodeLc CountryCode = "LC" CountryCodeLi CountryCode = "LI" CountryCodeLk CountryCode = "LK" CountryCodeLr CountryCode = "LR" CountryCodeLs CountryCode = "LS" CountryCodeLt CountryCode = "LT" CountryCodeLu CountryCode = "LU" CountryCodeLv CountryCode = "LV" CountryCodeLy CountryCode = "LY" CountryCodeMa CountryCode = "MA" CountryCodeMc CountryCode = "MC" CountryCodeMd CountryCode = "MD" CountryCodeMe CountryCode = "ME" CountryCodeMf CountryCode = "MF" CountryCodeMg CountryCode = "MG" CountryCodeMh CountryCode = "MH" CountryCodeMk CountryCode = "MK" CountryCodeMl CountryCode = "ML" CountryCodeMm CountryCode = "MM" CountryCodeMn CountryCode = "MN" CountryCodeMo CountryCode = "MO" CountryCodeMp CountryCode = "MP" CountryCodeMq CountryCode = "MQ" CountryCodeMr CountryCode = "MR" CountryCodeMs CountryCode = "MS" CountryCodeMt CountryCode = "MT" CountryCodeMu CountryCode = "MU" CountryCodeMv CountryCode = "MV" CountryCodeMw CountryCode = "MW" CountryCodeMx CountryCode = "MX" CountryCodeMy CountryCode = "MY" CountryCodeMz CountryCode = "MZ" CountryCodeNa CountryCode = "NA" CountryCodeNc CountryCode = "NC" CountryCodeNe CountryCode = "NE" CountryCodeNf CountryCode = "NF" CountryCodeNg CountryCode = "NG" CountryCodeNi CountryCode = "NI" CountryCodeNl CountryCode = "NL" CountryCodeNo CountryCode = "NO" CountryCodeNp CountryCode = "NP" CountryCodeNr CountryCode = "NR" CountryCodeNu CountryCode = "NU" CountryCodeNz CountryCode = "NZ" CountryCodeOm CountryCode = "OM" CountryCodePa CountryCode = "PA" CountryCodePe CountryCode = "PE" CountryCodePf CountryCode = "PF" CountryCodePg CountryCode = "PG" CountryCodePh CountryCode = "PH" CountryCodePk CountryCode = "PK" CountryCodePl CountryCode = "PL" CountryCodePm CountryCode = "PM" CountryCodePn CountryCode = "PN" CountryCodePr CountryCode = "PR" CountryCodePs CountryCode = "PS" CountryCodePt CountryCode = "PT" CountryCodePw CountryCode = "PW" CountryCodePy CountryCode = "PY" CountryCodeQa CountryCode = "QA" CountryCodeRe CountryCode = "RE" CountryCodeRo CountryCode = "RO" CountryCodeRs CountryCode = "RS" CountryCodeRu CountryCode = "RU" CountryCodeRw CountryCode = "RW" CountryCodeSa CountryCode = "SA" CountryCodeSb CountryCode = "SB" CountryCodeSc CountryCode = "SC" CountryCodeSd CountryCode = "SD" CountryCodeSe CountryCode = "SE" CountryCodeSg CountryCode = "SG" CountryCodeSh CountryCode = "SH" CountryCodeSi CountryCode = "SI" CountryCodeSj CountryCode = "SJ" CountryCodeSk CountryCode = "SK" CountryCodeSl CountryCode = "SL" CountryCodeSm CountryCode = "SM" CountryCodeSn CountryCode = "SN" CountryCodeSo CountryCode = "SO" CountryCodeSr CountryCode = "SR" CountryCodeSs CountryCode = "SS" CountryCodeSt CountryCode = "ST" CountryCodeSv CountryCode = "SV" CountryCodeSx CountryCode = "SX" CountryCodeSy CountryCode = "SY" CountryCodeSz CountryCode = "SZ" CountryCodeTc CountryCode = "TC" CountryCodeTd CountryCode = "TD" CountryCodeTf CountryCode = "TF" CountryCodeTg CountryCode = "TG" CountryCodeTh CountryCode = "TH" CountryCodeTj CountryCode = "TJ" CountryCodeTk CountryCode = "TK" CountryCodeTl CountryCode = "TL" CountryCodeTm CountryCode = "TM" CountryCodeTn CountryCode = "TN" CountryCodeTo CountryCode = "TO" CountryCodeTp CountryCode = "TP" CountryCodeTr CountryCode = "TR" CountryCodeTt CountryCode = "TT" CountryCodeTv CountryCode = "TV" CountryCodeTw CountryCode = "TW" CountryCodeTz CountryCode = "TZ" CountryCodeUa CountryCode = "UA" CountryCodeUg CountryCode = "UG" CountryCodeUs CountryCode = "US" CountryCodeUy CountryCode = "UY" CountryCodeUz CountryCode = "UZ" CountryCodeVa CountryCode = "VA" CountryCodeVc CountryCode = "VC" CountryCodeVe CountryCode = "VE" CountryCodeVg CountryCode = "VG" CountryCodeVi CountryCode = "VI" CountryCodeVn CountryCode = "VN" CountryCodeVu CountryCode = "VU" CountryCodeWf CountryCode = "WF" CountryCodeWs CountryCode = "WS" CountryCodeYe CountryCode = "YE" CountryCodeYt CountryCode = "YT" CountryCodeZa CountryCode = "ZA" CountryCodeZm CountryCode = "ZM" CountryCodeZw CountryCode = "ZW" ) // Values returns all known values for CountryCode. 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 (CountryCode) Values() []CountryCode { return []CountryCode{ "AC", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TP", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW", } } type DomainAvailability string // Enum values for DomainAvailability const ( DomainAvailabilityAvailable DomainAvailability = "AVAILABLE" DomainAvailabilityAvailableReserved DomainAvailability = "AVAILABLE_RESERVED" DomainAvailabilityAvailablePreorder DomainAvailability = "AVAILABLE_PREORDER" DomainAvailabilityUnavailable DomainAvailability = "UNAVAILABLE" DomainAvailabilityUnavailablePremium DomainAvailability = "UNAVAILABLE_PREMIUM" DomainAvailabilityUnavailableRestricted DomainAvailability = "UNAVAILABLE_RESTRICTED" DomainAvailabilityReserved DomainAvailability = "RESERVED" DomainAvailabilityDontKnow DomainAvailability = "DONT_KNOW" ) // Values returns all known values for DomainAvailability. 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 (DomainAvailability) Values() []DomainAvailability { return []DomainAvailability{ "AVAILABLE", "AVAILABLE_RESERVED", "AVAILABLE_PREORDER", "UNAVAILABLE", "UNAVAILABLE_PREMIUM", "UNAVAILABLE_RESTRICTED", "RESERVED", "DONT_KNOW", } } type ExtraParamName string // Enum values for ExtraParamName const ( ExtraParamNameDunsNumber ExtraParamName = "DUNS_NUMBER" ExtraParamNameBrandNumber ExtraParamName = "BRAND_NUMBER" ExtraParamNameBirthDepartment ExtraParamName = "BIRTH_DEPARTMENT" ExtraParamNameBirthDateInYyyyMmDd ExtraParamName = "BIRTH_DATE_IN_YYYY_MM_DD" ExtraParamNameBirthCountry ExtraParamName = "BIRTH_COUNTRY" ExtraParamNameBirthCity ExtraParamName = "BIRTH_CITY" ExtraParamNameDocumentNumber ExtraParamName = "DOCUMENT_NUMBER" ExtraParamNameAuIdNumber ExtraParamName = "AU_ID_NUMBER" ExtraParamNameAuIdType ExtraParamName = "AU_ID_TYPE" ExtraParamNameCaLegalType ExtraParamName = "CA_LEGAL_TYPE" ExtraParamNameCaBusinessEntityType ExtraParamName = "CA_BUSINESS_ENTITY_TYPE" ExtraParamNameCaLegalRepresentative ExtraParamName = "CA_LEGAL_REPRESENTATIVE" ExtraParamNameCaLegalRepresentativeCapacity ExtraParamName = "CA_LEGAL_REPRESENTATIVE_CAPACITY" ExtraParamNameEsIdentification ExtraParamName = "ES_IDENTIFICATION" ExtraParamNameEsIdentificationType ExtraParamName = "ES_IDENTIFICATION_TYPE" ExtraParamNameEsLegalForm ExtraParamName = "ES_LEGAL_FORM" ExtraParamNameFiBusinessNumber ExtraParamName = "FI_BUSINESS_NUMBER" ExtraParamNameOnwerFiIdNumber ExtraParamName = "FI_ID_NUMBER" ExtraParamNameFiNationality ExtraParamName = "FI_NATIONALITY" ExtraParamNameFiOrganizationType ExtraParamName = "FI_ORGANIZATION_TYPE" ExtraParamNameItNationality ExtraParamName = "IT_NATIONALITY" ExtraParamNameItPin ExtraParamName = "IT_PIN" ExtraParamNameItRegistrantEntityType ExtraParamName = "IT_REGISTRANT_ENTITY_TYPE" ExtraParamNameRuPassportData ExtraParamName = "RU_PASSPORT_DATA" ExtraParamNameSeIdNumber ExtraParamName = "SE_ID_NUMBER" ExtraParamNameSgIdNumber ExtraParamName = "SG_ID_NUMBER" ExtraParamNameVatNumber ExtraParamName = "VAT_NUMBER" ExtraParamNameUkContactType ExtraParamName = "UK_CONTACT_TYPE" ExtraParamNameUkCompanyNumber ExtraParamName = "UK_COMPANY_NUMBER" ExtraParamNameEuCountryOfCitizenship ExtraParamName = "EU_COUNTRY_OF_CITIZENSHIP" ExtraParamNameAuPriorityToken ExtraParamName = "AU_PRIORITY_TOKEN" ) // Values returns all known values for ExtraParamName. 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 (ExtraParamName) Values() []ExtraParamName { return []ExtraParamName{ "DUNS_NUMBER", "BRAND_NUMBER", "BIRTH_DEPARTMENT", "BIRTH_DATE_IN_YYYY_MM_DD", "BIRTH_COUNTRY", "BIRTH_CITY", "DOCUMENT_NUMBER", "AU_ID_NUMBER", "AU_ID_TYPE", "CA_LEGAL_TYPE", "CA_BUSINESS_ENTITY_TYPE", "CA_LEGAL_REPRESENTATIVE", "CA_LEGAL_REPRESENTATIVE_CAPACITY", "ES_IDENTIFICATION", "ES_IDENTIFICATION_TYPE", "ES_LEGAL_FORM", "FI_BUSINESS_NUMBER", "FI_ID_NUMBER", "FI_NATIONALITY", "FI_ORGANIZATION_TYPE", "IT_NATIONALITY", "IT_PIN", "IT_REGISTRANT_ENTITY_TYPE", "RU_PASSPORT_DATA", "SE_ID_NUMBER", "SG_ID_NUMBER", "VAT_NUMBER", "UK_CONTACT_TYPE", "UK_COMPANY_NUMBER", "EU_COUNTRY_OF_CITIZENSHIP", "AU_PRIORITY_TOKEN", } } type ListDomainsAttributeName string // Enum values for ListDomainsAttributeName const ( ListDomainsAttributeNameDomainName ListDomainsAttributeName = "DomainName" ListDomainsAttributeNameExpiry ListDomainsAttributeName = "Expiry" ) // Values returns all known values for ListDomainsAttributeName. 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 (ListDomainsAttributeName) Values() []ListDomainsAttributeName { return []ListDomainsAttributeName{ "DomainName", "Expiry", } } type ListOperationsSortAttributeName string // Enum values for ListOperationsSortAttributeName const ( ListOperationsSortAttributeNameSubmittedDate ListOperationsSortAttributeName = "SubmittedDate" ) // Values returns all known values for ListOperationsSortAttributeName. 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 (ListOperationsSortAttributeName) Values() []ListOperationsSortAttributeName { return []ListOperationsSortAttributeName{ "SubmittedDate", } } type OperationStatus string // Enum values for OperationStatus const ( OperationStatusSubmitted OperationStatus = "SUBMITTED" OperationStatusInProgress OperationStatus = "IN_PROGRESS" OperationStatusError OperationStatus = "ERROR" OperationStatusSuccessful OperationStatus = "SUCCESSFUL" OperationStatusFailed OperationStatus = "FAILED" ) // Values returns all known values for OperationStatus. 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 (OperationStatus) Values() []OperationStatus { return []OperationStatus{ "SUBMITTED", "IN_PROGRESS", "ERROR", "SUCCESSFUL", "FAILED", } } type OperationType string // Enum values for OperationType const ( OperationTypeRegisterDomain OperationType = "REGISTER_DOMAIN" OperationTypeDeleteDomain OperationType = "DELETE_DOMAIN" OperationTypeTransferInDomain OperationType = "TRANSFER_IN_DOMAIN" OperationTypeUpdateDomainContact OperationType = "UPDATE_DOMAIN_CONTACT" OperationTypeUpdateNameserver OperationType = "UPDATE_NAMESERVER" OperationTypeChangePrivacyProtection OperationType = "CHANGE_PRIVACY_PROTECTION" OperationTypeDomainLock OperationType = "DOMAIN_LOCK" OperationTypeEnableAutorenew OperationType = "ENABLE_AUTORENEW" OperationTypeDisableAutorenew OperationType = "DISABLE_AUTORENEW" OperationTypeAddDnssec OperationType = "ADD_DNSSEC" OperationTypeRemoveDnssec OperationType = "REMOVE_DNSSEC" OperationTypeExpireDomain OperationType = "EXPIRE_DOMAIN" OperationTypeTransferOutDomain OperationType = "TRANSFER_OUT_DOMAIN" OperationTypeChangeDomainOwner OperationType = "CHANGE_DOMAIN_OWNER" OperationTypeRenewDomain OperationType = "RENEW_DOMAIN" OperationTypePushDomain OperationType = "PUSH_DOMAIN" OperationTypeInternalTransferOutDomain OperationType = "INTERNAL_TRANSFER_OUT_DOMAIN" OperationTypeInternalTransferInDomain OperationType = "INTERNAL_TRANSFER_IN_DOMAIN" ) // Values returns all known values for OperationType. 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 (OperationType) Values() []OperationType { return []OperationType{ "REGISTER_DOMAIN", "DELETE_DOMAIN", "TRANSFER_IN_DOMAIN", "UPDATE_DOMAIN_CONTACT", "UPDATE_NAMESERVER", "CHANGE_PRIVACY_PROTECTION", "DOMAIN_LOCK", "ENABLE_AUTORENEW", "DISABLE_AUTORENEW", "ADD_DNSSEC", "REMOVE_DNSSEC", "EXPIRE_DOMAIN", "TRANSFER_OUT_DOMAIN", "CHANGE_DOMAIN_OWNER", "RENEW_DOMAIN", "PUSH_DOMAIN", "INTERNAL_TRANSFER_OUT_DOMAIN", "INTERNAL_TRANSFER_IN_DOMAIN", } } type Operator string // Enum values for Operator const ( OperatorLe Operator = "LE" OperatorGe Operator = "GE" OperatorBeginsWith Operator = "BEGINS_WITH" ) // Values returns all known values for Operator. 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 (Operator) Values() []Operator { return []Operator{ "LE", "GE", "BEGINS_WITH", } } type ReachabilityStatus string // Enum values for ReachabilityStatus const ( ReachabilityStatusPending ReachabilityStatus = "PENDING" ReachabilityStatusDone ReachabilityStatus = "DONE" ReachabilityStatusExpired ReachabilityStatus = "EXPIRED" ) // Values returns all known values for ReachabilityStatus. 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 (ReachabilityStatus) Values() []ReachabilityStatus { return []ReachabilityStatus{ "PENDING", "DONE", "EXPIRED", } } type SortOrder string // Enum values for SortOrder const ( SortOrderAsc SortOrder = "ASC" SortOrderDesc SortOrder = "DESC" ) // Values returns all known values for SortOrder. Note that this can be expanded // in the future, and so it is only as up to date as the client. The ordering of // this slice is not guaranteed to be stable across updates. func (SortOrder) Values() []SortOrder { return []SortOrder{ "ASC", "DESC", } } type StatusFlag string // Enum values for StatusFlag const ( StatusFlagPendingAcceptance StatusFlag = "PENDING_ACCEPTANCE" StatusFlagPendingCustomerAction StatusFlag = "PENDING_CUSTOMER_ACTION" StatusFlagPendingAuthorization StatusFlag = "PENDING_AUTHORIZATION" StatusFlagPendingPaymentVerification StatusFlag = "PENDING_PAYMENT_VERIFICATION" StatusFlagPendingSupportCase StatusFlag = "PENDING_SUPPORT_CASE" ) // Values returns all known values for StatusFlag. 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 (StatusFlag) Values() []StatusFlag { return []StatusFlag{ "PENDING_ACCEPTANCE", "PENDING_CUSTOMER_ACTION", "PENDING_AUTHORIZATION", "PENDING_PAYMENT_VERIFICATION", "PENDING_SUPPORT_CASE", } } type Transferable string // Enum values for Transferable const ( TransferableTransferable Transferable = "TRANSFERABLE" TransferableUntransferable Transferable = "UNTRANSFERABLE" TransferableDontKnow Transferable = "DONT_KNOW" TransferableDomainInOwnAccount Transferable = "DOMAIN_IN_OWN_ACCOUNT" TransferableDomainInAnotherAccount Transferable = "DOMAIN_IN_ANOTHER_ACCOUNT" TransferablePremiumDomain Transferable = "PREMIUM_DOMAIN" ) // Values returns all known values for Transferable. 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 (Transferable) Values() []Transferable { return []Transferable{ "TRANSFERABLE", "UNTRANSFERABLE", "DONT_KNOW", "DOMAIN_IN_OWN_ACCOUNT", "DOMAIN_IN_ANOTHER_ACCOUNT", "PREMIUM_DOMAIN", } }
867
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 error is returned if you call AssociateDelegationSignerToDomain when the // specified domain has reached the maximum number of DS records. You can't add any // additional DS records unless you delete an existing one first. type DnssecLimitExceeded struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *DnssecLimitExceeded) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *DnssecLimitExceeded) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *DnssecLimitExceeded) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "DnssecLimitExceeded" } return *e.ErrorCodeOverride } func (e *DnssecLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The number of domains has exceeded the allowed threshold for the account. type DomainLimitExceeded struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *DomainLimitExceeded) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *DomainLimitExceeded) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *DomainLimitExceeded) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "DomainLimitExceeded" } return *e.ErrorCodeOverride } func (e *DomainLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request is already in progress for the domain. type DuplicateRequest struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *DuplicateRequest) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *DuplicateRequest) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *DuplicateRequest) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "DuplicateRequest" } return *e.ErrorCodeOverride } func (e *DuplicateRequest) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The requested item is not acceptable. For example, for APIs that accept a // domain name, the request might specify a domain name that doesn't belong to the // account that submitted the request. For // AcceptDomainTransferFromAnotherAwsAccount , the password might be invalid. type InvalidInput struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidInput) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidInput) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidInput) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidInput" } return *e.ErrorCodeOverride } func (e *InvalidInput) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The number of operations or jobs running exceeded the allowed threshold for the // account. type OperationLimitExceeded struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *OperationLimitExceeded) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *OperationLimitExceeded) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *OperationLimitExceeded) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "OperationLimitExceeded" } return *e.ErrorCodeOverride } func (e *OperationLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The top-level domain does not support this operation. type TLDRulesViolation struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *TLDRulesViolation) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TLDRulesViolation) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TLDRulesViolation) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "TLDRulesViolation" } return *e.ErrorCodeOverride } func (e *TLDRulesViolation) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Amazon Route 53 does not support this top-level domain (TLD). type UnsupportedTLD struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *UnsupportedTLD) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *UnsupportedTLD) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *UnsupportedTLD) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "UnsupportedTLD" } return *e.ErrorCodeOverride } func (e *UnsupportedTLD) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
197
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" ) // Information for one billing record. type BillingRecord struct { // The date that the operation was billed, in Unix format. BillDate *time.Time // The name of the domain that the billing record applies to. If the domain name // contains characters other than a-z, 0-9, and - (hyphen), such as an // internationalized domain name, then this value is in Punycode. For more // information, see DNS Domain Name Format (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html) // in the Amazon Route 53 Developer Guide. DomainName *string // The ID of the invoice that is associated with the billing record. InvoiceId *string // The operation that you were charged for. Operation OperationType // The price that you were charged for the operation, in US dollars. Example // value: 12.0 Price float64 noSmithyDocumentSerde } // Customer's consent for the owner change request. type Consent struct { // Currency for the MaxPrice . // // This member is required. Currency *string // Maximum amount the customer agreed to accept. // // This member is required. MaxPrice float64 noSmithyDocumentSerde } // ContactDetail includes the following elements. type ContactDetail struct { // First line of the contact's address. AddressLine1 *string // Second line of contact's address, if any. AddressLine2 *string // The city of the contact's address. City *string // Indicates whether the contact is a person, company, association, or public // organization. Note the following: // - If you specify a value other than PERSON , you must also specify a value for // OrganizationName . // - For some TLDs, the privacy protection available depends on the value that // you specify for Contact Type . For the privacy protection settings for your // TLD, see Domains that You Can Register with Amazon Route 53 (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/registrar-tld-list.html) // in the Amazon Route 53 Developer Guide // - For .es domains, the value of ContactType must be PERSON for all three // contacts. ContactType ContactType // Code for the country of the contact's address. CountryCode CountryCode // Email address of the contact. Email *string // A list of name-value pairs for parameters required by certain top-level domains. ExtraParams []ExtraParam // Fax number of the contact. Constraints: Phone number must be specified in the // format "+[country dialing code].[number including any area code]". For example, // a US phone number might appear as "+1.1234567890" . Fax *string // First name of contact. FirstName *string // Last name of contact. LastName *string // Name of the organization for contact types other than PERSON . OrganizationName *string // The phone number of the contact. Constraints: Phone number must be specified in // the format "+[country dialing code].[number including any area code>]". For // example, a US phone number might appear as "+1.1234567890" . PhoneNumber *string // The state or province of the contact's city. State *string // The zip or postal code of the contact's address. ZipCode *string noSmithyDocumentSerde } // Information about the DNSSEC key. You get this from your DNS provider and then // give it to Route 53 (by using AssociateDelegationSignerToDomain (https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_AssociateDelegationSignerToDomain.html) // ) to pass it to the registry to establish the chain of trust. type DnssecKey struct { // The number of the public key’s cryptographic algorithm according to an IANA (https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xml) // assignment. If Route 53 is your DNS service, set this to 13. For more // information about enabling DNSSEC signing, see Enabling DNSSEC signing and // establishing a chain of trust (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-configuring-dnssec-enable-signing.html) // . Algorithm *int32 // The delegation signer digest. Digest is calculated from the public key provided // using specified digest algorithm and this digest is the actual value returned // from the registry nameservers as the value of DS records. Digest *string // The number of the DS digest algorithm according to an IANA assignment. For more // information, see IANA (https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml) // for DNSSEC Delegation Signer (DS) Resource Record (RR) Type Digest Algorithms. DigestType *int32 // Defines the type of key. It can be either a KSK (key-signing-key, value 257) or // ZSK (zone-signing-key, value 256). Using KSK is always encouraged. Only use ZSK // if your DNS provider isn't Route 53 and you don’t have KSK available. If you // have KSK and ZSK keys, always use KSK to create a delegations signer (DS) // record. If you have ZSK keys only – use ZSK to create a DS record. Flags *int32 // An ID assigned to each DS record created by AssociateDelegationSignerToDomain (https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_AssociateDelegationSignerToDomain.html) // . Id *string // A numeric identification of the DNSKEY record referred to by this DS record. KeyTag *int32 // The base64-encoded public key part of the key pair that is passed to the // registry . PublicKey *string noSmithyDocumentSerde } // Information about a delegation signer (DS) record that was created in the // registry by AssociateDelegationSignerToDomain (https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_AssociateDelegationSignerToDomain.html) // . type DnssecSigningAttributes struct { // Algorithm which was used to generate the digest from the public key. Algorithm *int32 // Defines the type of key. It can be either a KSK (key-signing-key, value 257) or // ZSK (zone-signing-key, value 256). Using KSK is always encouraged. Only use ZSK // if your DNS provider isn't Route 53 and you don’t have KSK available. If you // have KSK and ZSK keys, always use KSK to create a delegations signer (DS) // record. If you have ZSK keys only – use ZSK to create a DS record. Flags *int32 // The base64-encoded public key part of the key pair that is passed to the // registry. PublicKey *string noSmithyDocumentSerde } // Information about the domain price associated with a TLD. type DomainPrice struct { // The price for changing domain ownership. ChangeOwnershipPrice *PriceWithCurrency // The name of the TLD for which the prices apply. Name *string // The price for domain registration with Route 53. RegistrationPrice *PriceWithCurrency // The price for renewing domain registration with Route 53. RenewalPrice *PriceWithCurrency // The price for restoring the domain with Route 53. RestorationPrice *PriceWithCurrency // The price for transferring the domain registration to Route 53. TransferPrice *PriceWithCurrency noSmithyDocumentSerde } // Information about one suggested domain name. type DomainSuggestion struct { // Whether the domain name is available for registering. You can register only the // domains that are designated as AVAILABLE . Valid values: AVAILABLE The domain // name is available. AVAILABLE_RESERVED The domain name is reserved under specific // conditions. AVAILABLE_PREORDER The domain name is available and can be // preordered. DONT_KNOW The TLD registry didn't reply with a definitive answer // about whether the domain name is available. Route 53 can return this response // for a variety of reasons, for example, the registry is performing maintenance. // Try again later. PENDING The TLD registry didn't return a response in the // expected amount of time. When the response is delayed, it usually takes just a // few extra seconds. You can resubmit the request immediately. RESERVED The domain // name has been reserved for another person or organization. UNAVAILABLE The // domain name is not available. UNAVAILABLE_PREMIUM The domain name is not // available. UNAVAILABLE_RESTRICTED The domain name is forbidden. Availability *string // A suggested domain name. DomainName *string noSmithyDocumentSerde } // Summary information about one domain. type DomainSummary struct { // Indicates whether the domain is automatically renewed upon expiration. AutoRenew *bool // The name of the domain that the summary information applies to. DomainName *string // Expiration date of the domain in Unix time format and Coordinated Universal // Time (UTC). Expiry *time.Time // Indicates whether a domain is locked from unauthorized transfer to another // party. TransferLock *bool noSmithyDocumentSerde } // A complex type that contains information about whether the specified domain can // be transferred to Route 53. type DomainTransferability struct { // Whether the domain name can be transferred to Route 53. You can transfer only // domains that have a value of TRANSFERABLE or Transferable . Valid values: // TRANSFERABLE The domain name can be transferred to Route 53. UNTRANSFERRABLE The // domain name can't be transferred to Route 53. DONT_KNOW Reserved for future use. // DOMAIN_IN_OWN_ACCOUNT The domain already exists in the current Amazon Web // Services account. DOMAIN_IN_ANOTHER_ACCOUNT the domain exists in another Amazon // Web Services account. PREMIUM_DOMAIN Premium domain transfer is not supported. Transferable Transferable noSmithyDocumentSerde } // ExtraParam includes the following elements. type ExtraParam struct { // The name of an additional parameter that is required by a top-level domain. // Here are the top-level domains that require additional parameters and the names // of the parameters that they require: .com.au and .net.au // - AU_ID_NUMBER // - AU_ID_TYPE Valid values include the following: // - ABN (Australian business number) // - ACN (Australian company number) // - TM (Trademark number) // .ca // - BRAND_NUMBER // - CA_BUSINESS_ENTITY_TYPE Valid values include the following: // - BANK (Bank) // - COMMERCIAL_COMPANY (Commercial company) // - COMPANY (Company) // - COOPERATION (Cooperation) // - COOPERATIVE (Cooperative) // - COOPRIX (Cooprix) // - CORP (Corporation) // - CREDIT_UNION (Credit union) // - FOMIA (Federation of mutual insurance associations) // - INC (Incorporated) // - LTD (Limited) // - LTEE (Limitée) // - LLC (Limited liability corporation) // - LLP (Limited liability partnership) // - LTE (Lte.) // - MBA (Mutual benefit association) // - MIC (Mutual insurance company) // - NFP (Not-for-profit corporation) // - SA (S.A.) // - SAVINGS_COMPANY (Savings company) // - SAVINGS_UNION (Savings union) // - SARL (Société à responsabilité limitée) // - TRUST (Trust) // - ULC (Unlimited liability corporation) // - CA_LEGAL_TYPE When ContactType is PERSON , valid values include the // following: // - ABO (Aboriginal Peoples indigenous to Canada) // - CCT (Canadian citizen) // - LGR (Legal Representative of a Canadian Citizen or Permanent Resident) // - RES (Permanent resident of Canada) When ContactType is a value other than // PERSON , valid values include the following: // - ASS (Canadian unincorporated association) // - CCO (Canadian corporation) // - EDU (Canadian educational institution) // - GOV (Government or government entity in Canada) // - HOP (Canadian Hospital) // - INB (Indian Band recognized by the Indian Act of Canada) // - LAM (Canadian Library, Archive, or Museum) // - MAJ (Her/His Majesty the Queen/King) // - OMK (Official mark registered in Canada) // - PLT (Canadian Political Party) // - PRT (Partnership Registered in Canada) // - TDM (Trademark registered in Canada) // - TRD (Canadian Trade Union) // - TRS (Trust established in Canada) // .es // - ES_IDENTIFICATION The value of ES_IDENTIFICATION depends on the following // values: // - The value of ES_LEGAL_FORM // - The value of ES_IDENTIFICATION_TYPE If ES_LEGAL_FORM is any value other than // INDIVIDUAL : // - Specify 1 letter + 8 numbers (CIF [Certificado de Identificación Fiscal]) // - Example: B12345678 If ES_LEGAL_FORM is INDIVIDUAL , the value that you // specify for ES_IDENTIFICATION depends on the value of ES_IDENTIFICATION_TYPE : // - If ES_IDENTIFICATION_TYPE is DNI_AND_NIF (for Spanish contacts): // - Specify 8 numbers + 1 letter (DNI [Documento Nacional de Identidad], NIF // [Número de Identificación Fiscal]) // - Example: 12345678M // - If ES_IDENTIFICATION_TYPE is NIE (for foreigners with legal residence): // - Specify 1 letter + 7 numbers + 1 letter ( NIE [Número de Identidad de // Extranjero]) // - Example: Y1234567X // - If ES_IDENTIFICATION_TYPE is OTHER (for contacts outside of Spain): // - Specify a passport number, drivers license number, or national identity // card number // - ES_IDENTIFICATION_TYPE Valid values include the following: // - DNI_AND_NIF (For Spanish contacts) // - NIE (For foreigners with legal residence) // - OTHER (For contacts outside of Spain) // - ES_LEGAL_FORM Valid values include the following: // - ASSOCIATION // - CENTRAL_GOVERNMENT_BODY // - CIVIL_SOCIETY // - COMMUNITY_OF_OWNERS // - COMMUNITY_PROPERTY // - CONSULATE // - COOPERATIVE // - DESIGNATION_OF_ORIGIN_SUPERVISORY_COUNCIL // - ECONOMIC_INTEREST_GROUP // - EMBASSY // - ENTITY_MANAGING_NATURAL_AREAS // - FARM_PARTNERSHIP // - FOUNDATION // - GENERAL_AND_LIMITED_PARTNERSHIP // - GENERAL_PARTNERSHIP // - INDIVIDUAL // - LIMITED_COMPANY // - LOCAL_AUTHORITY // - LOCAL_PUBLIC_ENTITY // - MUTUAL_INSURANCE_COMPANY // - NATIONAL_PUBLIC_ENTITY // - ORDER_OR_RELIGIOUS_INSTITUTION // - OTHERS (Only for contacts outside of Spain) // - POLITICAL_PARTY // - PROFESSIONAL_ASSOCIATION // - PUBLIC_LAW_ASSOCIATION // - PUBLIC_LIMITED_COMPANY // - REGIONAL_GOVERNMENT_BODY // - REGIONAL_PUBLIC_ENTITY // - SAVINGS_BANK // - SPANISH_OFFICE // - SPORTS_ASSOCIATION // - SPORTS_FEDERATION // - SPORTS_LIMITED_COMPANY // - TEMPORARY_ALLIANCE_OF_ENTERPRISES // - TRADE_UNION // - WORKER_OWNED_COMPANY // - WORKER_OWNED_LIMITED_COMPANY // .eu // - EU_COUNTRY_OF_CITIZENSHIP // .fi // - BIRTH_DATE_IN_YYYY_MM_DD // - FI_BUSINESS_NUMBER // - FI_ID_NUMBER // - FI_NATIONALITY Valid values include the following: // - FINNISH // - NOT_FINNISH // - FI_ORGANIZATION_TYPE Valid values include the following: // - COMPANY // - CORPORATION // - GOVERNMENT // - INSTITUTION // - POLITICAL_PARTY // - PUBLIC_COMMUNITY // - TOWNSHIP // .it // - IT_NATIONALITY // - IT_PIN // - IT_REGISTRANT_ENTITY_TYPE Valid values include the following: // - FOREIGNERS // - FREELANCE_WORKERS (Freelance workers and professionals) // - ITALIAN_COMPANIES (Italian companies and one-person companies) // - NON_PROFIT_ORGANIZATIONS // - OTHER_SUBJECTS // - PUBLIC_ORGANIZATIONS // .ru // - BIRTH_DATE_IN_YYYY_MM_DD // - RU_PASSPORT_DATA // .se // - BIRTH_COUNTRY // - SE_ID_NUMBER // .sg // - SG_ID_NUMBER // .uk, .co.uk, .me.uk, and .org.uk // - UK_CONTACT_TYPE Valid values include the following: // - CRC (UK Corporation by Royal Charter) // - FCORP (Non-UK Corporation) // - FIND (Non-UK Individual, representing self) // - FOTHER (Non-UK Entity that does not fit into any other category) // - GOV (UK Government Body) // - IND (UK Individual (representing self)) // - IP (UK Industrial/Provident Registered Company) // - LLP (UK Limited Liability Partnership) // - LTD (UK Limited Company) // - OTHER (UK Entity that does not fit into any other category) // - PLC (UK Public Limited Company) // - PTNR (UK Partnership) // - RCHAR (UK Registered Charity) // - SCH (UK School) // - STAT (UK Statutory Body) // - STRA (UK Sole Trader) // - UK_COMPANY_NUMBER // In addition, many TLDs require a VAT_NUMBER . // // This member is required. Name ExtraParamName // The value that corresponds with the name of an extra parameter. // // This member is required. Value *string noSmithyDocumentSerde } // Information for the filtering of a list of domains returned by ListDomains (https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains__ListDomains.html) // . type FilterCondition struct { // Name of the field which should be used for filtering the list of domains. // // This member is required. Name ListDomainsAttributeName // The operator values for filtering domain names. The values can be: // - LE : Less than, or equal to // - GE : Greater than, or equal to // - BEGINS_WITH : Begins with // // This member is required. Operator Operator // An array of strings presenting values to compare. Only 1 item in the list is // currently supported. // // This member is required. Values []string noSmithyDocumentSerde } // Name server includes the following elements. type Nameserver struct { // The fully qualified host name of the name server. Constraint: Maximum 255 // characters // // This member is required. Name *string // Glue IP address of a name server entry. Glue IP addresses are required only // when the name of the name server is a subdomain of the domain. For example, if // your domain is example.com and the name server for the domain is ns.example.com, // you need to specify the IP address for ns.example.com. Constraints: The list can // contain only one IPv4 and one IPv6 address. GlueIps []string noSmithyDocumentSerde } // OperationSummary includes the following elements. type OperationSummary struct { // Name of the domain. DomainName *string // The date when the last change was made in Unix time format and Coordinated // Universal Time (UTC). LastUpdatedDate *time.Time // Message about the operation. Message *string // Identifier returned to track the requested action. OperationId *string // The current status of the requested operation in the system. Status OperationStatus // Automatically checks whether there are no outstanding operations on domains // that need customer attention. Valid values are: // - PENDING_ACCEPTANCE : The operation is waiting for acceptance from the // account that is receiving the domain. // - PENDING_CUSTOMER_ACTION : The operation is waiting for customer action, for // example, returning an email. // - PENDING_AUTHORIZATION : The operation is waiting for the form of // authorization. For more information, see ResendOperationAuthorization (https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_ResendOperationAuthorization.html) // . // - PENDING_PAYMENT_VERIFICATION : The operation is waiting for the payment // method to validate. // - PENDING_SUPPORT_CASE : The operation includes a support case and is waiting // for its resolution. StatusFlag StatusFlag // The date when the request was submitted. SubmittedDate *time.Time // Type of the action requested. Type OperationType noSmithyDocumentSerde } // Currency-specific price information. type PriceWithCurrency struct { // The currency specifier. // // This member is required. Currency *string // The price of a domain, in a specific currency. // // This member is required. Price float64 noSmithyDocumentSerde } // Information for sorting a list of domains. type SortCondition struct { // Field to be used for sorting the list of domains. It can be either the name or // the expiration for a domain. Note that if filterCondition is used in the same // ListDomains (https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains__ListDomains.html) // call, the field used for sorting has to be the same as the field used for // filtering. // // This member is required. Name ListDomainsAttributeName // The sort order for a list of domains. Either ascending (ASC) or descending // (DES). // // This member is required. SortOrder SortOrder noSmithyDocumentSerde } // Each tag includes the following elements. type Tag struct { // The key (name) of a tag. Valid values: A-Z, a-z, 0-9, space, ".:/=+\-@" // Constraints: Each key can be 1-128 characters long. Key *string // The value of a tag. Valid values: A-Z, a-z, 0-9, space, ".:/=+\-@" Constraints: // Each value can be 0-256 characters long. Value *string noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
591
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycluster 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 = "Route53 Recovery Cluster" const ServiceAPIVersion = "2019-12-02" // Client provides the API client to make operations call for Route53 Recovery // Cluster. 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, "route53recoverycluster", 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 route53recoverycluster 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 route53recoverycluster 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/route53recoverycluster/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Get the state for a routing control. A routing control is a simple on/off // switch that you can use to route traffic to cells. When a routing control state // is On, traffic flows to a cell. When the state is Off, traffic does not flow. // Before you can create a routing control, you must first create a cluster, and // then host the control in a control panel on the cluster. For more information, // see Create routing control structures (https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.create.html) // in the Amazon Route 53 Application Recovery Controller Developer Guide. You // access one of the endpoints for the cluster to get or update the routing control // state to redirect traffic for your application. You must specify Regional // endpoints when you work with API cluster operations to get or update routing // control states in Route 53 ARC. To see a code example for getting a routing // control state, including accessing Regional cluster endpoints in sequence, see // API examples (https://docs.aws.amazon.com/r53recovery/latest/dg/service_code_examples_actions.html) // in the Amazon Route 53 Application Recovery Controller Developer Guide. Learn // more about working with routing controls in the following topics in the Amazon // Route 53 Application Recovery Controller Developer Guide: // - Viewing and updating routing control states (https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.update.html) // - Working with routing controls in Route 53 ARC (https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.html) func (c *Client) GetRoutingControlState(ctx context.Context, params *GetRoutingControlStateInput, optFns ...func(*Options)) (*GetRoutingControlStateOutput, error) { if params == nil { params = &GetRoutingControlStateInput{} } result, metadata, err := c.invokeOperation(ctx, "GetRoutingControlState", params, optFns, c.addOperationGetRoutingControlStateMiddlewares) if err != nil { return nil, err } out := result.(*GetRoutingControlStateOutput) out.ResultMetadata = metadata return out, nil } type GetRoutingControlStateInput struct { // The Amazon Resource Name (ARN) for the routing control that you want to get the // state for. // // This member is required. RoutingControlArn *string noSmithyDocumentSerde } type GetRoutingControlStateOutput struct { // The Amazon Resource Name (ARN) of the response. // // This member is required. RoutingControlArn *string // The state of the routing control. // // This member is required. RoutingControlState types.RoutingControlState // The routing control name. RoutingControlName *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetRoutingControlStateMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetRoutingControlState{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetRoutingControlState{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetRoutingControlStateValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRoutingControlState(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetRoutingControlState(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-cluster", OperationName: "GetRoutingControlState", } }
153
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycluster 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/route53recoverycluster/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // List routing control names and Amazon Resource Names (ARNs), as well as the // routing control state for each routing control, along with the control panel // name and control panel ARN for the routing controls. If you specify a control // panel ARN, this call lists the routing controls in the control panel. Otherwise, // it lists all the routing controls in the cluster. A routing control is a simple // on/off switch in Route 53 ARC that you can use to route traffic to cells. When a // routing control state is On, traffic flows to a cell. When the state is Off, // traffic does not flow. Before you can create a routing control, you must first // create a cluster, and then host the control in a control panel on the cluster. // For more information, see Create routing control structures (https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.create.html) // in the Amazon Route 53 Application Recovery Controller Developer Guide. You // access one of the endpoints for the cluster to get or update the routing control // state to redirect traffic for your application. You must specify Regional // endpoints when you work with API cluster operations to use this API operation to // list routing controls in Route 53 ARC. Learn more about working with routing // controls in the following topics in the Amazon Route 53 Application Recovery // Controller Developer Guide: // - Viewing and updating routing control states (https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.update.html) // - Working with routing controls in Route 53 ARC (https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.html) func (c *Client) ListRoutingControls(ctx context.Context, params *ListRoutingControlsInput, optFns ...func(*Options)) (*ListRoutingControlsOutput, error) { if params == nil { params = &ListRoutingControlsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListRoutingControls", params, optFns, c.addOperationListRoutingControlsMiddlewares) if err != nil { return nil, err } out := result.(*ListRoutingControlsOutput) out.ResultMetadata = metadata return out, nil } type ListRoutingControlsInput struct { // The Amazon Resource Name (ARN) of the control panel of the routing controls to // list. ControlPanelArn *string // The number of routing controls objects that you want to return with this call. // The default value is 500. MaxResults *int32 // The token for the next set of results. You receive this token from a previous // call. NextToken *string noSmithyDocumentSerde } type ListRoutingControlsOutput struct { // The list of routing controls. // // This member is required. RoutingControls []types.RoutingControl // The token for the next set of results. You receive this token from a previous // call. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListRoutingControlsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpListRoutingControls{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListRoutingControls{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListRoutingControls(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListRoutingControlsAPIClient is a client that implements the // ListRoutingControls operation. type ListRoutingControlsAPIClient interface { ListRoutingControls(context.Context, *ListRoutingControlsInput, ...func(*Options)) (*ListRoutingControlsOutput, error) } var _ ListRoutingControlsAPIClient = (*Client)(nil) // ListRoutingControlsPaginatorOptions is the paginator options for // ListRoutingControls type ListRoutingControlsPaginatorOptions struct { // The number of routing controls objects that you want to return with this call. // The default value is 500. 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 } // ListRoutingControlsPaginator is a paginator for ListRoutingControls type ListRoutingControlsPaginator struct { options ListRoutingControlsPaginatorOptions client ListRoutingControlsAPIClient params *ListRoutingControlsInput nextToken *string firstPage bool } // NewListRoutingControlsPaginator returns a new ListRoutingControlsPaginator func NewListRoutingControlsPaginator(client ListRoutingControlsAPIClient, params *ListRoutingControlsInput, optFns ...func(*ListRoutingControlsPaginatorOptions)) *ListRoutingControlsPaginator { if params == nil { params = &ListRoutingControlsInput{} } options := ListRoutingControlsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListRoutingControlsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListRoutingControlsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListRoutingControls page. func (p *ListRoutingControlsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRoutingControlsOutput, 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.ListRoutingControls(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_opListRoutingControls(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-cluster", OperationName: "ListRoutingControls", } }
246
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycluster 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/route53recoverycluster/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Set the state of the routing control to reroute traffic. You can set the value // to be On or Off. When the state is On, traffic flows to a cell. When the state // is Off, traffic does not flow. With Route 53 ARC, you can add safety rules for // routing controls, which are safeguards for routing control state updates that // help prevent unexpected outcomes, like fail open traffic routing. However, there // are scenarios when you might want to bypass the routing control safeguards that // are enforced with safety rules that you've configured. For example, you might // want to fail over quickly for disaster recovery, and one or more safety rules // might be unexpectedly preventing you from updating a routing control state to // reroute traffic. In a "break glass" scenario like this, you can override one or // more safety rules to change a routing control state and fail over your // application. The SafetyRulesToOverride property enables you override one or // more safety rules and update routing control states. For more information, see // Override safety rules to reroute traffic (https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.override-safety-rule.html) // in the Amazon Route 53 Application Recovery Controller Developer Guide. You must // specify Regional endpoints when you work with API cluster operations to get or // update routing control states in Route 53 ARC. To see a code example for getting // a routing control state, including accessing Regional cluster endpoints in // sequence, see API examples (https://docs.aws.amazon.com/r53recovery/latest/dg/service_code_examples_actions.html) // in the Amazon Route 53 Application Recovery Controller Developer Guide. // - Viewing and updating routing control states (https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.update.html) // - Working with routing controls overall (https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.html) func (c *Client) UpdateRoutingControlState(ctx context.Context, params *UpdateRoutingControlStateInput, optFns ...func(*Options)) (*UpdateRoutingControlStateOutput, error) { if params == nil { params = &UpdateRoutingControlStateInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateRoutingControlState", params, optFns, c.addOperationUpdateRoutingControlStateMiddlewares) if err != nil { return nil, err } out := result.(*UpdateRoutingControlStateOutput) out.ResultMetadata = metadata return out, nil } type UpdateRoutingControlStateInput struct { // The Amazon Resource Name (ARN) for the routing control that you want to update // the state for. // // This member is required. RoutingControlArn *string // The state of the routing control. You can set the value to be On or Off. // // This member is required. RoutingControlState types.RoutingControlState // The Amazon Resource Names (ARNs) for the safety rules that you want to override // when you're updating the state of a routing control. You can override one safety // rule or multiple safety rules by including one or more ARNs, separated by // commas. For more information, see Override safety rules to reroute traffic (https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.override-safety-rule.html) // in the Amazon Route 53 Application Recovery Controller Developer Guide. SafetyRulesToOverride []string noSmithyDocumentSerde } type UpdateRoutingControlStateOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateRoutingControlStateMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateRoutingControlState{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateRoutingControlState{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateRoutingControlStateValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRoutingControlState(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateRoutingControlState(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-cluster", OperationName: "UpdateRoutingControlState", } }
155
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycluster 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/route53recoverycluster/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Set multiple routing control states. You can set the value for each state to be // On or Off. When the state is On, traffic flows to a cell. When it's Off, traffic // does not flow. With Route 53 ARC, you can add safety rules for routing controls, // which are safeguards for routing control state updates that help prevent // unexpected outcomes, like fail open traffic routing. However, there are // scenarios when you might want to bypass the routing control safeguards that are // enforced with safety rules that you've configured. For example, you might want // to fail over quickly for disaster recovery, and one or more safety rules might // be unexpectedly preventing you from updating a routing control state to reroute // traffic. In a "break glass" scenario like this, you can override one or more // safety rules to change a routing control state and fail over your application. // The SafetyRulesToOverride property enables you override one or more safety // rules and update routing control states. For more information, see Override // safety rules to reroute traffic (https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.override-safety-rule.html) // in the Amazon Route 53 Application Recovery Controller Developer Guide. You must // specify Regional endpoints when you work with API cluster operations to get or // update routing control states in Route 53 ARC. To see a code example for getting // a routing control state, including accessing Regional cluster endpoints in // sequence, see API examples (https://docs.aws.amazon.com/r53recovery/latest/dg/service_code_examples_actions.html) // in the Amazon Route 53 Application Recovery Controller Developer Guide. // - Viewing and updating routing control states (https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.update.html) // - Working with routing controls overall (https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.html) func (c *Client) UpdateRoutingControlStates(ctx context.Context, params *UpdateRoutingControlStatesInput, optFns ...func(*Options)) (*UpdateRoutingControlStatesOutput, error) { if params == nil { params = &UpdateRoutingControlStatesInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateRoutingControlStates", params, optFns, c.addOperationUpdateRoutingControlStatesMiddlewares) if err != nil { return nil, err } out := result.(*UpdateRoutingControlStatesOutput) out.ResultMetadata = metadata return out, nil } type UpdateRoutingControlStatesInput struct { // A set of routing control entries that you want to update. // // This member is required. UpdateRoutingControlStateEntries []types.UpdateRoutingControlStateEntry // The Amazon Resource Names (ARNs) for the safety rules that you want to override // when you're updating routing control states. You can override one safety rule or // multiple safety rules by including one or more ARNs, separated by commas. For // more information, see Override safety rules to reroute traffic (https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.override-safety-rule.html) // in the Amazon Route 53 Application Recovery Controller Developer Guide. SafetyRulesToOverride []string noSmithyDocumentSerde } type UpdateRoutingControlStatesOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateRoutingControlStatesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateRoutingControlStates{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateRoutingControlStates{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateRoutingControlStatesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRoutingControlStates(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateRoutingControlStates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-cluster", OperationName: "UpdateRoutingControlStates", } }
149
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycluster import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/route53recoverycluster/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "strings" ) type awsAwsjson10_deserializeOpGetRoutingControlState struct { } func (*awsAwsjson10_deserializeOpGetRoutingControlState) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpGetRoutingControlState) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorGetRoutingControlState(response, &metadata) } output := &GetRoutingControlStateOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentGetRoutingControlStateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorGetRoutingControlState(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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("EndpointTemporarilyUnavailableException", errorCode): return awsAwsjson10_deserializeErrorEndpointTemporarilyUnavailableException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpListRoutingControls struct { } func (*awsAwsjson10_deserializeOpListRoutingControls) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpListRoutingControls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorListRoutingControls(response, &metadata) } output := &ListRoutingControlsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentListRoutingControlsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorListRoutingControls(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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("EndpointTemporarilyUnavailableException", errorCode): return awsAwsjson10_deserializeErrorEndpointTemporarilyUnavailableException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpUpdateRoutingControlState struct { } func (*awsAwsjson10_deserializeOpUpdateRoutingControlState) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpUpdateRoutingControlState) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorUpdateRoutingControlState(response, &metadata) } output := &UpdateRoutingControlStateOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentUpdateRoutingControlStateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorUpdateRoutingControlState(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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsAwsjson10_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("EndpointTemporarilyUnavailableException", errorCode): return awsAwsjson10_deserializeErrorEndpointTemporarilyUnavailableException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson10_deserializeOpUpdateRoutingControlStates struct { } func (*awsAwsjson10_deserializeOpUpdateRoutingControlStates) ID() string { return "OperationDeserializer" } func (m *awsAwsjson10_deserializeOpUpdateRoutingControlStates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson10_deserializeOpErrorUpdateRoutingControlStates(response, &metadata) } output := &UpdateRoutingControlStatesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson10_deserializeOpDocumentUpdateRoutingControlStatesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson10_deserializeOpErrorUpdateRoutingControlStates(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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsAwsjson10_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("EndpointTemporarilyUnavailableException", errorCode): return awsAwsjson10_deserializeErrorEndpointTemporarilyUnavailableException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceLimitExceededException", errorCode): return awsAwsjson10_deserializeErrorServiceLimitExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsAwsjson10_deserializeErrorAccessDeniedException(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.AccessDeniedException{} err := awsAwsjson10_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 awsAwsjson10_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.ConflictException{} err := awsAwsjson10_deserializeDocumentConflictException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson10_deserializeErrorEndpointTemporarilyUnavailableException(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.EndpointTemporarilyUnavailableException{} err := awsAwsjson10_deserializeDocumentEndpointTemporarilyUnavailableException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson10_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.InternalServerException{} err := awsAwsjson10_deserializeDocumentInternalServerException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson10_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.ResourceNotFoundException{} err := awsAwsjson10_deserializeDocumentResourceNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson10_deserializeErrorServiceLimitExceededException(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.ServiceLimitExceededException{} err := awsAwsjson10_deserializeDocumentServiceLimitExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson10_deserializeErrorThrottlingException(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.ThrottlingException{} err := awsAwsjson10_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 awsAwsjson10_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.ValidationException{} err := awsAwsjson10_deserializeDocumentValidationException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson10_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 awsAwsjson10_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ConflictException if *v == nil { sv = &types.ConflictException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "resourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentEndpointTemporarilyUnavailableException(v **types.EndpointTemporarilyUnavailableException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.EndpointTemporarilyUnavailableException if *v == nil { sv = &types.EndpointTemporarilyUnavailableException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InternalServerException if *v == nil { sv = &types.InternalServerException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "retryAfterSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected RetryAfterSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RetryAfterSeconds = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceNotFoundException if *v == nil { sv = &types.ResourceNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "resourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentRoutingControl(v **types.RoutingControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RoutingControl if *v == nil { sv = &types.RoutingControl{} } else { sv = *v } for key, value := range shape { switch key { case "ControlPanelArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.ControlPanelArn = ptr.String(jtv) } case "ControlPanelName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ControlPanelName to be of type string, got %T instead", value) } sv.ControlPanelName = ptr.String(jtv) } case "RoutingControlArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.RoutingControlArn = ptr.String(jtv) } case "RoutingControlName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoutingControlName to be of type string, got %T instead", value) } sv.RoutingControlName = ptr.String(jtv) } case "RoutingControlState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoutingControlState to be of type string, got %T instead", value) } sv.RoutingControlState = types.RoutingControlState(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentRoutingControls(v *[]types.RoutingControl, 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.RoutingControl if *v == nil { cv = []types.RoutingControl{} } else { cv = *v } for _, value := range shape { var col types.RoutingControl destAddr := &col if err := awsAwsjson10_deserializeDocumentRoutingControl(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson10_deserializeDocumentServiceLimitExceededException(v **types.ServiceLimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ServiceLimitExceededException if *v == nil { sv = &types.ServiceLimitExceededException{} } else { sv = *v } for key, value := range shape { switch key { case "limitCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.LimitCode = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "resourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } case "serviceCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ServiceCode = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_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 String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "retryAfterSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected RetryAfterSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RetryAfterSeconds = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ValidationException if *v == nil { sv = &types.ValidationException{} } else { sv = *v } for key, value := range shape { switch key { case "fields": if err := awsAwsjson10_deserializeDocumentValidationExceptionFieldList(&sv.Fields, value); err != nil { return err } 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 "reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value) } sv.Reason = types.ValidationExceptionReason(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ValidationExceptionField if *v == nil { sv = &types.ValidationExceptionField{} } 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 "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, 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.ValidationExceptionField if *v == nil { cv = []types.ValidationExceptionField{} } else { cv = *v } for _, value := range shape { var col types.ValidationExceptionField destAddr := &col if err := awsAwsjson10_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson10_deserializeOpDocumentGetRoutingControlStateOutput(v **GetRoutingControlStateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetRoutingControlStateOutput if *v == nil { sv = &GetRoutingControlStateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RoutingControlArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.RoutingControlArn = ptr.String(jtv) } case "RoutingControlName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoutingControlName to be of type string, got %T instead", value) } sv.RoutingControlName = ptr.String(jtv) } case "RoutingControlState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoutingControlState to be of type string, got %T instead", value) } sv.RoutingControlState = types.RoutingControlState(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentListRoutingControlsOutput(v **ListRoutingControlsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListRoutingControlsOutput if *v == nil { sv = &ListRoutingControlsOutput{} } 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 PageToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "RoutingControls": if err := awsAwsjson10_deserializeDocumentRoutingControls(&sv.RoutingControls, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentUpdateRoutingControlStateOutput(v **UpdateRoutingControlStateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateRoutingControlStateOutput if *v == nil { sv = &UpdateRoutingControlStateOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson10_deserializeOpDocumentUpdateRoutingControlStatesOutput(v **UpdateRoutingControlStatesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateRoutingControlStatesOutput if *v == nil { sv = &UpdateRoutingControlStatesOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil }
1,603
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package route53recoverycluster provides the API client, operations, and // parameter types for Route53 Recovery Cluster. // // Welcome to the Routing Control (Recovery Cluster) API Reference Guide for // Amazon Route 53 Application Recovery Controller. With Route 53 ARC, you can use // routing control with extreme reliability to recover applications by rerouting // traffic across Availability Zones or Amazon Web Services Regions. Routing // controls are simple on/off switches hosted on a highly available cluster in // Route 53 ARC. A cluster provides a set of five redundant Regional endpoints // against which you can run API calls to get or update the state of routing // controls. To implement failover, you set one routing control On and another one // Off, to reroute traffic from one Availability Zone or Amazon Web Services Region // to another. Be aware that you must specify a Regional endpoint for a cluster // when you work with API cluster operations to get or update routing control // states in Route 53 ARC. In addition, you must specify the US West (Oregon) // Region for Route 53 ARC API calls. For example, use the parameter --region // us-west-2 with AWS CLI commands. For more information, see Get and update // routing control states using the API (https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.update.api.html) // in the Amazon Route 53 Application Recovery Controller Developer Guide. This API // guide includes information about the API operations for how to get and update // routing control states in Route 53 ARC. To work with routing control in Route 53 // ARC, you must first create the required components (clusters, control panels, // and routing controls) using the recovery cluster configuration API. For more // information about working with routing control in Route 53 ARC, see the // following: // - Create clusters, control panels, and routing controls by using API // operations. For more information, see the Recovery Control Configuration API // Reference Guide for Amazon Route 53 Application Recovery Controller (https://docs.aws.amazon.com/recovery-cluster/latest/api/) // . // - Learn about the components in recovery control, including clusters, routing // controls, and control panels, and how to work with Route 53 ARC in the Amazon // Web Services console. For more information, see Recovery control components (https://docs.aws.amazon.com/r53recovery/latest/dg/introduction-components.html#introduction-components-routing) // in the Amazon Route 53 Application Recovery Controller Developer Guide. // - Route 53 ARC also provides readiness checks that continually audit // resources to help make sure that your applications are scaled and ready to // handle failover traffic. For more information about the related API operations, // see the Recovery Readiness API Reference Guide for Amazon Route 53 // Application Recovery Controller (https://docs.aws.amazon.com/recovery-readiness/latest/api/) // . // - For more information about creating resilient applications and preparing // for recovery readiness with Route 53 ARC, see the Amazon Route 53 Application // Recovery Controller Developer Guide (https://docs.aws.amazon.com/r53recovery/latest/dg/) // . package route53recoverycluster
47
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycluster 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/route53recoverycluster/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 = "route53-recovery-cluster" } 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 route53recoverycluster // goModuleVersion is the tagged release for this module const goModuleVersion = "1.11.12"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycluster
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycluster import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/route53recoverycluster/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "path" ) type awsAwsjson10_serializeOpGetRoutingControlState struct { } func (*awsAwsjson10_serializeOpGetRoutingControlState) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpGetRoutingControlState) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetRoutingControlStateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("ToggleCustomerAPI.GetRoutingControlState") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentGetRoutingControlStateInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpListRoutingControls struct { } func (*awsAwsjson10_serializeOpListRoutingControls) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpListRoutingControls) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListRoutingControlsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("ToggleCustomerAPI.ListRoutingControls") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentListRoutingControlsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpUpdateRoutingControlState struct { } func (*awsAwsjson10_serializeOpUpdateRoutingControlState) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpUpdateRoutingControlState) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateRoutingControlStateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("ToggleCustomerAPI.UpdateRoutingControlState") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentUpdateRoutingControlStateInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson10_serializeOpUpdateRoutingControlStates struct { } func (*awsAwsjson10_serializeOpUpdateRoutingControlStates) ID() string { return "OperationSerializer" } func (m *awsAwsjson10_serializeOpUpdateRoutingControlStates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateRoutingControlStatesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") httpBindingEncoder.SetHeader("X-Amz-Target").String("ToggleCustomerAPI.UpdateRoutingControlStates") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson10_serializeOpDocumentUpdateRoutingControlStatesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsAwsjson10_serializeDocumentArns(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsAwsjson10_serializeDocumentUpdateRoutingControlStateEntries(v []types.UpdateRoutingControlStateEntry, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson10_serializeDocumentUpdateRoutingControlStateEntry(&v[i], av); err != nil { return err } } return nil } func awsAwsjson10_serializeDocumentUpdateRoutingControlStateEntry(v *types.UpdateRoutingControlStateEntry, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.RoutingControlArn != nil { ok := object.Key("RoutingControlArn") ok.String(*v.RoutingControlArn) } if len(v.RoutingControlState) > 0 { ok := object.Key("RoutingControlState") ok.String(string(v.RoutingControlState)) } return nil } func awsAwsjson10_serializeOpDocumentGetRoutingControlStateInput(v *GetRoutingControlStateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.RoutingControlArn != nil { ok := object.Key("RoutingControlArn") ok.String(*v.RoutingControlArn) } return nil } func awsAwsjson10_serializeOpDocumentListRoutingControlsInput(v *ListRoutingControlsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ControlPanelArn != nil { ok := object.Key("ControlPanelArn") ok.String(*v.ControlPanelArn) } if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } return nil } func awsAwsjson10_serializeOpDocumentUpdateRoutingControlStateInput(v *UpdateRoutingControlStateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.RoutingControlArn != nil { ok := object.Key("RoutingControlArn") ok.String(*v.RoutingControlArn) } if len(v.RoutingControlState) > 0 { ok := object.Key("RoutingControlState") ok.String(string(v.RoutingControlState)) } if v.SafetyRulesToOverride != nil { ok := object.Key("SafetyRulesToOverride") if err := awsAwsjson10_serializeDocumentArns(v.SafetyRulesToOverride, ok); err != nil { return err } } return nil } func awsAwsjson10_serializeOpDocumentUpdateRoutingControlStatesInput(v *UpdateRoutingControlStatesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SafetyRulesToOverride != nil { ok := object.Key("SafetyRulesToOverride") if err := awsAwsjson10_serializeDocumentArns(v.SafetyRulesToOverride, ok); err != nil { return err } } if v.UpdateRoutingControlStateEntries != nil { ok := object.Key("UpdateRoutingControlStateEntries") if err := awsAwsjson10_serializeDocumentUpdateRoutingControlStateEntries(v.UpdateRoutingControlStateEntries, ok); err != nil { return err } } return nil }
356
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycluster import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/route53recoverycluster/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpGetRoutingControlState struct { } func (*validateOpGetRoutingControlState) ID() string { return "OperationInputValidation" } func (m *validateOpGetRoutingControlState) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetRoutingControlStateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetRoutingControlStateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateRoutingControlState struct { } func (*validateOpUpdateRoutingControlState) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateRoutingControlState) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateRoutingControlStateInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateRoutingControlStateInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateRoutingControlStates struct { } func (*validateOpUpdateRoutingControlStates) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateRoutingControlStates) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateRoutingControlStatesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateRoutingControlStatesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpGetRoutingControlStateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetRoutingControlState{}, middleware.After) } func addOpUpdateRoutingControlStateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateRoutingControlState{}, middleware.After) } func addOpUpdateRoutingControlStatesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateRoutingControlStates{}, middleware.After) } func validateUpdateRoutingControlStateEntries(v []types.UpdateRoutingControlStateEntry) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateRoutingControlStateEntries"} for i := range v { if err := validateUpdateRoutingControlStateEntry(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateUpdateRoutingControlStateEntry(v *types.UpdateRoutingControlStateEntry) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateRoutingControlStateEntry"} if v.RoutingControlArn == nil { invalidParams.Add(smithy.NewErrParamRequired("RoutingControlArn")) } if len(v.RoutingControlState) == 0 { invalidParams.Add(smithy.NewErrParamRequired("RoutingControlState")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetRoutingControlStateInput(v *GetRoutingControlStateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetRoutingControlStateInput"} if v.RoutingControlArn == nil { invalidParams.Add(smithy.NewErrParamRequired("RoutingControlArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateRoutingControlStateInput(v *UpdateRoutingControlStateInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateRoutingControlStateInput"} if v.RoutingControlArn == nil { invalidParams.Add(smithy.NewErrParamRequired("RoutingControlArn")) } if len(v.RoutingControlState) == 0 { invalidParams.Add(smithy.NewErrParamRequired("RoutingControlState")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateRoutingControlStatesInput(v *UpdateRoutingControlStatesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateRoutingControlStatesInput"} if v.UpdateRoutingControlStateEntries == nil { invalidParams.Add(smithy.NewErrParamRequired("UpdateRoutingControlStateEntries")) } else if v.UpdateRoutingControlStateEntries != nil { if err := validateUpdateRoutingControlStateEntries(v.UpdateRoutingControlStateEntries); err != nil { invalidParams.AddNested("UpdateRoutingControlStateEntries", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
171
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 Route53 Recovery Cluster 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: "route53-recovery-cluster.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "route53-recovery-cluster-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "route53-recovery-cluster-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53-recovery-cluster.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "route53-recovery-cluster.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "route53-recovery-cluster-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "route53-recovery-cluster-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53-recovery-cluster.{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: "route53-recovery-cluster-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53-recovery-cluster.{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: "route53-recovery-cluster-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53-recovery-cluster.{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: "route53-recovery-cluster-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53-recovery-cluster.{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: "route53-recovery-cluster-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53-recovery-cluster.{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: "route53-recovery-cluster.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "route53-recovery-cluster-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "route53-recovery-cluster-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53-recovery-cluster.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, }, }
297
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package endpoints import ( "testing" ) func TestRegexCompile(t *testing.T) { _ = defaultPartitions }
12
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types type RoutingControlState string // Enum values for RoutingControlState const ( RoutingControlStateOn RoutingControlState = "On" RoutingControlStateOff RoutingControlState = "Off" ) // Values returns all known values for RoutingControlState. 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 (RoutingControlState) Values() []RoutingControlState { return []RoutingControlState{ "On", "Off", } } type ValidationExceptionReason string // Enum values for ValidationExceptionReason const ( ValidationExceptionReasonUnknownOperation ValidationExceptionReason = "unknownOperation" ValidationExceptionReasonCannotParse ValidationExceptionReason = "cannotParse" ValidationExceptionReasonFieldValidationFailed ValidationExceptionReason = "fieldValidationFailed" ValidationExceptionReasonOther ValidationExceptionReason = "other" ) // Values returns all known values for ValidationExceptionReason. 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 (ValidationExceptionReason) Values() []ValidationExceptionReason { return []ValidationExceptionReason{ "unknownOperation", "cannotParse", "fieldValidationFailed", "other", } }
44
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 permissions 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 } // There was a conflict with this request. Try again. type ConflictException struct { Message *string ErrorCodeOverride *string ResourceId *string ResourceType *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 } // The cluster endpoint isn't available. Try another cluster endpoint. type EndpointTemporarilyUnavailableException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *EndpointTemporarilyUnavailableException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *EndpointTemporarilyUnavailableException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *EndpointTemporarilyUnavailableException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "EndpointTemporarilyUnavailableException" } return *e.ErrorCodeOverride } func (e *EndpointTemporarilyUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // There was an unexpected error during processing of the request. type InternalServerException struct { Message *string ErrorCodeOverride *string RetryAfterSeconds int32 noSmithyDocumentSerde } func (e *InternalServerException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalServerException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalServerException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalServerException" } return *e.ErrorCodeOverride } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // The request references a routing control or control panel that was not found. type ResourceNotFoundException struct { Message *string ErrorCodeOverride *string ResourceId *string ResourceType *string noSmithyDocumentSerde } func (e *ResourceNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceNotFoundException" } return *e.ErrorCodeOverride } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request can't update that many routing control states at the same time. Try // again with fewer routing control states. type ServiceLimitExceededException struct { Message *string ErrorCodeOverride *string ResourceId *string ResourceType *string LimitCode *string ServiceCode *string noSmithyDocumentSerde } func (e *ServiceLimitExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ServiceLimitExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ServiceLimitExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ServiceLimitExceededException" } return *e.ErrorCodeOverride } func (e *ServiceLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request was denied because of request throttling. type ThrottlingException struct { Message *string ErrorCodeOverride *string RetryAfterSeconds int32 noSmithyDocumentSerde } func (e *ThrottlingException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ThrottlingException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ThrottlingException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ThrottlingException" } return *e.ErrorCodeOverride } func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // There was a validation error on the request. type ValidationException struct { Message *string ErrorCodeOverride *string Reason ValidationExceptionReason Fields []ValidationExceptionField 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 }
238
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" ) // A routing control, which is a simple on/off switch that you can use to route // traffic to cells. When a routing control state is On, traffic flows to a cell. // When the state is Off, traffic does not flow. type RoutingControl struct { // The Amazon Resource Name (ARN) of the control panel where the routing control // is located. ControlPanelArn *string // The name of the control panel where the routing control is located. ControlPanelName *string // The Amazon Resource Name (ARN) of the routing control. RoutingControlArn *string // The name of the routing control. RoutingControlName *string // The current state of the routing control. When a routing control state is On, // traffic flows to a cell. When the state is Off, traffic does not flow. RoutingControlState RoutingControlState noSmithyDocumentSerde } // A routing control state entry. type UpdateRoutingControlStateEntry struct { // The Amazon Resource Name (ARN) for a routing control state entry. // // This member is required. RoutingControlArn *string // The routing control state in a set of routing control state entries. // // This member is required. RoutingControlState RoutingControlState noSmithyDocumentSerde } // There was a validation error on the request. type ValidationExceptionField struct { // Information about the validation exception. // // This member is required. Message *string // The field that had the validation exception. // // This member is required. Name *string noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
67
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig 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 = "Route53 Recovery Control Config" const ServiceAPIVersion = "2020-11-02" // Client provides the API client to make operations call for AWS Route53 Recovery // Control Config. 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, "route53recoverycontrolconfig", 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 route53recoverycontrolconfig 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 route53recoverycontrolconfig 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/route53recoverycontrolconfig/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Create a new cluster. A cluster is a set of redundant Regional endpoints // against which you can run API calls to update or get the state of one or more // routing controls. Each cluster has a name, status, Amazon Resource Name (ARN), // and an array of the five cluster endpoints (one for each supported Amazon Web // Services Region) that you can use with API calls to the cluster data plane. func (c *Client) CreateCluster(ctx context.Context, params *CreateClusterInput, optFns ...func(*Options)) (*CreateClusterOutput, error) { if params == nil { params = &CreateClusterInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateCluster", params, optFns, c.addOperationCreateClusterMiddlewares) if err != nil { return nil, err } out := result.(*CreateClusterOutput) out.ResultMetadata = metadata return out, nil } // Creates a cluster. type CreateClusterInput struct { // The name of the cluster. // // This member is required. ClusterName *string // A unique, case-sensitive string of up to 64 ASCII characters. To make an // idempotent API request with an action, specify a client token in the request. ClientToken *string // The tags associated with the cluster. Tags map[string]string noSmithyDocumentSerde } type CreateClusterOutput struct { // The cluster that was created. Cluster *types.Cluster // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateCluster{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateCluster{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opCreateClusterMiddleware(stack, options); err != nil { return err } if err = addOpCreateClusterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCluster(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateCluster struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateCluster) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateCluster) 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.(*CreateClusterInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateClusterInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateClusterMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateCluster{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateCluster(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-control-config", OperationName: "CreateCluster", } }
174
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig 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/route53recoverycontrolconfig/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new control panel. A control panel represents a group of routing // controls that can be changed together in a single transaction. You can use a // control panel to centrally view the operational status of applications across // your organization, and trigger multi-app failovers in a single transaction, for // example, to fail over an Availability Zone or Amazon Web Services Region. func (c *Client) CreateControlPanel(ctx context.Context, params *CreateControlPanelInput, optFns ...func(*Options)) (*CreateControlPanelOutput, error) { if params == nil { params = &CreateControlPanelInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateControlPanel", params, optFns, c.addOperationCreateControlPanelMiddlewares) if err != nil { return nil, err } out := result.(*CreateControlPanelOutput) out.ResultMetadata = metadata return out, nil } // The details of the control panel that you're creating. type CreateControlPanelInput struct { // The Amazon Resource Name (ARN) of the cluster for the control panel. // // This member is required. ClusterArn *string // The name of the control panel. // // This member is required. ControlPanelName *string // A unique, case-sensitive string of up to 64 ASCII characters. To make an // idempotent API request with an action, specify a client token in the request. ClientToken *string // The tags associated with the control panel. Tags map[string]string noSmithyDocumentSerde } type CreateControlPanelOutput struct { // Information about a control panel. ControlPanel *types.ControlPanel // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateControlPanelMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateControlPanel{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateControlPanel{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opCreateControlPanelMiddleware(stack, options); err != nil { return err } if err = addOpCreateControlPanelValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateControlPanel(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateControlPanel struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateControlPanel) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateControlPanel) 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.(*CreateControlPanelInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateControlPanelInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateControlPanelMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateControlPanel{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateControlPanel(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-control-config", OperationName: "CreateControlPanel", } }
179
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig 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/route53recoverycontrolconfig/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new routing control. A routing control has one of two states: ON and // OFF. You can map the routing control state to the state of an Amazon Route 53 // health check, which can be used to control traffic routing. To get or update the // routing control state, see the Recovery Cluster (data plane) API actions for // Amazon Route 53 Application Recovery Controller. func (c *Client) CreateRoutingControl(ctx context.Context, params *CreateRoutingControlInput, optFns ...func(*Options)) (*CreateRoutingControlOutput, error) { if params == nil { params = &CreateRoutingControlInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateRoutingControl", params, optFns, c.addOperationCreateRoutingControlMiddlewares) if err != nil { return nil, err } out := result.(*CreateRoutingControlOutput) out.ResultMetadata = metadata return out, nil } // The details of the routing control that you're creating. type CreateRoutingControlInput struct { // The Amazon Resource Name (ARN) of the cluster that includes the routing control. // // This member is required. ClusterArn *string // The name of the routing control. // // This member is required. RoutingControlName *string // A unique, case-sensitive string of up to 64 ASCII characters. To make an // idempotent API request with an action, specify a client token in the request. ClientToken *string // The Amazon Resource Name (ARN) of the control panel that includes the routing // control. ControlPanelArn *string noSmithyDocumentSerde } type CreateRoutingControlOutput struct { // The routing control that is created. RoutingControl *types.RoutingControl // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateRoutingControlMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateRoutingControl{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateRoutingControl{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opCreateRoutingControlMiddleware(stack, options); err != nil { return err } if err = addOpCreateRoutingControlValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRoutingControl(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateRoutingControl struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateRoutingControl) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateRoutingControl) 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.(*CreateRoutingControlInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateRoutingControlInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateRoutingControlMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateRoutingControl{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateRoutingControl(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-control-config", OperationName: "CreateRoutingControl", } }
180
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig 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/route53recoverycontrolconfig/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a safety rule in a control panel. Safety rules let you add safeguards // around changing routing control states, and for enabling and disabling routing // controls, to help prevent unexpected outcomes. There are two types of safety // rules: assertion rules and gating rules. Assertion rule: An assertion rule // enforces that, when you change a routing control state, that a certain criteria // is met. For example, the criteria might be that at least one routing control // state is On after the transaction so that traffic continues to flow to at least // one cell for the application. This ensures that you avoid a fail-open scenario. // Gating rule: A gating rule lets you configure a gating routing control as an // overall "on/off" switch for a group of routing controls. Or, you can configure // more complex gating scenarios, for example by configuring multiple gating // routing controls. For more information, see Safety rules (https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.safety-rules.html) // in the Amazon Route 53 Application Recovery Controller Developer Guide. func (c *Client) CreateSafetyRule(ctx context.Context, params *CreateSafetyRuleInput, optFns ...func(*Options)) (*CreateSafetyRuleOutput, error) { if params == nil { params = &CreateSafetyRuleInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateSafetyRule", params, optFns, c.addOperationCreateSafetyRuleMiddlewares) if err != nil { return nil, err } out := result.(*CreateSafetyRuleOutput) out.ResultMetadata = metadata return out, nil } // The request body that you include when you create a safety rule. type CreateSafetyRuleInput struct { // The assertion rule requested. AssertionRule *types.NewAssertionRule // A unique, case-sensitive string of up to 64 ASCII characters. To make an // idempotent API request with an action, specify a client token in the request. ClientToken *string // The gating rule requested. GatingRule *types.NewGatingRule // The tags associated with the safety rule. Tags map[string]string noSmithyDocumentSerde } type CreateSafetyRuleOutput struct { // The assertion rule created. AssertionRule *types.AssertionRule // The gating rule created. GatingRule *types.GatingRule // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateSafetyRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSafetyRule{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSafetyRule{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opCreateSafetyRuleMiddleware(stack, options); err != nil { return err } if err = addOpCreateSafetyRuleValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSafetyRule(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateSafetyRule struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateSafetyRule) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateSafetyRule) 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.(*CreateSafetyRuleInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateSafetyRuleInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateSafetyRuleMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateSafetyRule{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateSafetyRule(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-control-config", OperationName: "CreateSafetyRule", } }
186
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Delete a cluster. func (c *Client) DeleteCluster(ctx context.Context, params *DeleteClusterInput, optFns ...func(*Options)) (*DeleteClusterOutput, error) { if params == nil { params = &DeleteClusterInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteCluster", params, optFns, c.addOperationDeleteClusterMiddlewares) if err != nil { return nil, err } out := result.(*DeleteClusterOutput) out.ResultMetadata = metadata return out, nil } type DeleteClusterInput struct { // The Amazon Resource Name (ARN) of the cluster that you're deleting. // // This member is required. ClusterArn *string noSmithyDocumentSerde } type DeleteClusterOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteCluster{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteCluster{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteClusterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCluster(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteCluster(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-control-config", OperationName: "DeleteCluster", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig 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 control panel. func (c *Client) DeleteControlPanel(ctx context.Context, params *DeleteControlPanelInput, optFns ...func(*Options)) (*DeleteControlPanelOutput, error) { if params == nil { params = &DeleteControlPanelInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteControlPanel", params, optFns, c.addOperationDeleteControlPanelMiddlewares) if err != nil { return nil, err } out := result.(*DeleteControlPanelOutput) out.ResultMetadata = metadata return out, nil } type DeleteControlPanelInput struct { // The Amazon Resource Name (ARN) of the control panel. // // This member is required. ControlPanelArn *string noSmithyDocumentSerde } type DeleteControlPanelOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteControlPanelMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteControlPanel{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteControlPanel{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteControlPanelValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteControlPanel(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteControlPanel(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-control-config", OperationName: "DeleteControlPanel", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig 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 routing control. func (c *Client) DeleteRoutingControl(ctx context.Context, params *DeleteRoutingControlInput, optFns ...func(*Options)) (*DeleteRoutingControlOutput, error) { if params == nil { params = &DeleteRoutingControlInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteRoutingControl", params, optFns, c.addOperationDeleteRoutingControlMiddlewares) if err != nil { return nil, err } out := result.(*DeleteRoutingControlOutput) out.ResultMetadata = metadata return out, nil } type DeleteRoutingControlInput struct { // The Amazon Resource Name (ARN) of the routing control that you're deleting. // // This member is required. RoutingControlArn *string noSmithyDocumentSerde } type DeleteRoutingControlOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteRoutingControlMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteRoutingControl{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteRoutingControl{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteRoutingControlValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRoutingControl(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteRoutingControl(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-control-config", OperationName: "DeleteRoutingControl", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig 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 safety rule./> func (c *Client) DeleteSafetyRule(ctx context.Context, params *DeleteSafetyRuleInput, optFns ...func(*Options)) (*DeleteSafetyRuleOutput, error) { if params == nil { params = &DeleteSafetyRuleInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteSafetyRule", params, optFns, c.addOperationDeleteSafetyRuleMiddlewares) if err != nil { return nil, err } out := result.(*DeleteSafetyRuleOutput) out.ResultMetadata = metadata return out, nil } type DeleteSafetyRuleInput struct { // The ARN of the safety rule. // // This member is required. SafetyRuleArn *string noSmithyDocumentSerde } type DeleteSafetyRuleOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteSafetyRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSafetyRule{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSafetyRule{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteSafetyRuleValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSafetyRule(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteSafetyRule(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-control-config", OperationName: "DeleteSafetyRule", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig import ( "context" "errors" "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/route53recoverycontrolconfig/types" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" smithywaiter "github.com/aws/smithy-go/waiter" "github.com/jmespath/go-jmespath" "time" ) // Display the details about a cluster. The response includes the cluster name, // endpoints, status, and Amazon Resource Name (ARN). func (c *Client) DescribeCluster(ctx context.Context, params *DescribeClusterInput, optFns ...func(*Options)) (*DescribeClusterOutput, error) { if params == nil { params = &DescribeClusterInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeCluster", params, optFns, c.addOperationDescribeClusterMiddlewares) if err != nil { return nil, err } out := result.(*DescribeClusterOutput) out.ResultMetadata = metadata return out, nil } type DescribeClusterInput struct { // The Amazon Resource Name (ARN) of the cluster. // // This member is required. ClusterArn *string noSmithyDocumentSerde } type DescribeClusterOutput struct { // The cluster for the DescribeCluster request. Cluster *types.Cluster // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeCluster{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeCluster{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeClusterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCluster(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // DescribeClusterAPIClient is a client that implements the DescribeCluster // operation. type DescribeClusterAPIClient interface { DescribeCluster(context.Context, *DescribeClusterInput, ...func(*Options)) (*DescribeClusterOutput, error) } var _ DescribeClusterAPIClient = (*Client)(nil) // ClusterCreatedWaiterOptions are waiter options for ClusterCreatedWaiter type ClusterCreatedWaiterOptions 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 // MinDelay is the minimum amount of time to delay between retries. If unset, // ClusterCreatedWaiter will use default minimum delay of 5 seconds. Note that // MinDelay must resolve to a value lesser than or equal to the MaxDelay. MinDelay time.Duration // MaxDelay is the maximum amount of time to delay between retries. If unset or // set to zero, ClusterCreatedWaiter will use default max delay of 120 seconds. // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. MaxDelay time.Duration // LogWaitAttempts is used to enable logging for waiter retry attempts LogWaitAttempts bool // Retryable is function that can be used to override the service defined // waiter-behavior based on operation output, or returned error. This function is // used by the waiter to decide if a state is retryable or a terminal state. By // default service-modeled logic will populate this option. This option can thus be // used to define a custom waiter state with fall-back to service-modeled waiter // state mutators.The function returns an error in case of a failure state. In case // of retry state, this function returns a bool value of true and nil error, while // in case of success it returns a bool value of false and nil error. Retryable func(context.Context, *DescribeClusterInput, *DescribeClusterOutput, error) (bool, error) } // ClusterCreatedWaiter defines the waiters for ClusterCreated type ClusterCreatedWaiter struct { client DescribeClusterAPIClient options ClusterCreatedWaiterOptions } // NewClusterCreatedWaiter constructs a ClusterCreatedWaiter. func NewClusterCreatedWaiter(client DescribeClusterAPIClient, optFns ...func(*ClusterCreatedWaiterOptions)) *ClusterCreatedWaiter { options := ClusterCreatedWaiterOptions{} options.MinDelay = 5 * time.Second options.MaxDelay = 120 * time.Second options.Retryable = clusterCreatedStateRetryable for _, fn := range optFns { fn(&options) } return &ClusterCreatedWaiter{ client: client, options: options, } } // Wait calls the waiter function for ClusterCreated waiter. The maxWaitDur is the // maximum wait duration the waiter will wait. The maxWaitDur is required and must // be greater than zero. func (w *ClusterCreatedWaiter) Wait(ctx context.Context, params *DescribeClusterInput, maxWaitDur time.Duration, optFns ...func(*ClusterCreatedWaiterOptions)) error { _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) return err } // WaitForOutput calls the waiter function for ClusterCreated waiter and returns // the output of the successful operation. The maxWaitDur is the maximum wait // duration the waiter will wait. The maxWaitDur is required and must be greater // than zero. func (w *ClusterCreatedWaiter) WaitForOutput(ctx context.Context, params *DescribeClusterInput, maxWaitDur time.Duration, optFns ...func(*ClusterCreatedWaiterOptions)) (*DescribeClusterOutput, error) { if maxWaitDur <= 0 { return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") } options := w.options for _, fn := range optFns { fn(&options) } if options.MaxDelay <= 0 { options.MaxDelay = 120 * time.Second } if options.MinDelay > options.MaxDelay { return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) } ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) defer cancelFn() logger := smithywaiter.Logger{} remainingTime := maxWaitDur var attempt int64 for { attempt++ apiOptions := options.APIOptions start := time.Now() if options.LogWaitAttempts { logger.Attempt = attempt apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) apiOptions = append(apiOptions, logger.AddLogger) } out, err := w.client.DescribeCluster(ctx, params, func(o *Options) { o.APIOptions = append(o.APIOptions, apiOptions...) }) retryable, err := options.Retryable(ctx, params, out, err) if err != nil { return nil, err } if !retryable { return out, nil } remainingTime -= time.Since(start) if remainingTime < options.MinDelay || remainingTime <= 0 { break } // compute exponential backoff between waiter retries delay, err := smithywaiter.ComputeDelay( attempt, options.MinDelay, options.MaxDelay, remainingTime, ) if err != nil { return nil, fmt.Errorf("error computing waiter delay, %w", err) } remainingTime -= delay // sleep for the delay amount before invoking a request if err := smithytime.SleepWithContext(ctx, delay); err != nil { return nil, fmt.Errorf("request cancelled while waiting, %w", err) } } return nil, fmt.Errorf("exceeded max wait time for ClusterCreated waiter") } func clusterCreatedStateRetryable(ctx context.Context, input *DescribeClusterInput, output *DescribeClusterOutput, err error) (bool, error) { if err == nil { pathValue, err := jmespath.Search("Cluster.Status", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "DEPLOYED" value, ok := pathValue.(types.Status) if !ok { return false, fmt.Errorf("waiter comparator expected types.Status value, got %T", pathValue) } if string(value) == expectedValue { return false, nil } } if err == nil { pathValue, err := jmespath.Search("Cluster.Status", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "PENDING" value, ok := pathValue.(types.Status) if !ok { return false, fmt.Errorf("waiter comparator expected types.Status value, got %T", pathValue) } if string(value) == expectedValue { return true, nil } } if err != nil { var errorType *types.InternalServerException if errors.As(err, &errorType) { return true, nil } } return true, nil } // ClusterDeletedWaiterOptions are waiter options for ClusterDeletedWaiter type ClusterDeletedWaiterOptions 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 // MinDelay is the minimum amount of time to delay between retries. If unset, // ClusterDeletedWaiter will use default minimum delay of 5 seconds. Note that // MinDelay must resolve to a value lesser than or equal to the MaxDelay. MinDelay time.Duration // MaxDelay is the maximum amount of time to delay between retries. If unset or // set to zero, ClusterDeletedWaiter will use default max delay of 120 seconds. // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. MaxDelay time.Duration // LogWaitAttempts is used to enable logging for waiter retry attempts LogWaitAttempts bool // Retryable is function that can be used to override the service defined // waiter-behavior based on operation output, or returned error. This function is // used by the waiter to decide if a state is retryable or a terminal state. By // default service-modeled logic will populate this option. This option can thus be // used to define a custom waiter state with fall-back to service-modeled waiter // state mutators.The function returns an error in case of a failure state. In case // of retry state, this function returns a bool value of true and nil error, while // in case of success it returns a bool value of false and nil error. Retryable func(context.Context, *DescribeClusterInput, *DescribeClusterOutput, error) (bool, error) } // ClusterDeletedWaiter defines the waiters for ClusterDeleted type ClusterDeletedWaiter struct { client DescribeClusterAPIClient options ClusterDeletedWaiterOptions } // NewClusterDeletedWaiter constructs a ClusterDeletedWaiter. func NewClusterDeletedWaiter(client DescribeClusterAPIClient, optFns ...func(*ClusterDeletedWaiterOptions)) *ClusterDeletedWaiter { options := ClusterDeletedWaiterOptions{} options.MinDelay = 5 * time.Second options.MaxDelay = 120 * time.Second options.Retryable = clusterDeletedStateRetryable for _, fn := range optFns { fn(&options) } return &ClusterDeletedWaiter{ client: client, options: options, } } // Wait calls the waiter function for ClusterDeleted waiter. The maxWaitDur is the // maximum wait duration the waiter will wait. The maxWaitDur is required and must // be greater than zero. func (w *ClusterDeletedWaiter) Wait(ctx context.Context, params *DescribeClusterInput, maxWaitDur time.Duration, optFns ...func(*ClusterDeletedWaiterOptions)) error { _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) return err } // WaitForOutput calls the waiter function for ClusterDeleted waiter and returns // the output of the successful operation. The maxWaitDur is the maximum wait // duration the waiter will wait. The maxWaitDur is required and must be greater // than zero. func (w *ClusterDeletedWaiter) WaitForOutput(ctx context.Context, params *DescribeClusterInput, maxWaitDur time.Duration, optFns ...func(*ClusterDeletedWaiterOptions)) (*DescribeClusterOutput, error) { if maxWaitDur <= 0 { return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") } options := w.options for _, fn := range optFns { fn(&options) } if options.MaxDelay <= 0 { options.MaxDelay = 120 * time.Second } if options.MinDelay > options.MaxDelay { return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) } ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) defer cancelFn() logger := smithywaiter.Logger{} remainingTime := maxWaitDur var attempt int64 for { attempt++ apiOptions := options.APIOptions start := time.Now() if options.LogWaitAttempts { logger.Attempt = attempt apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) apiOptions = append(apiOptions, logger.AddLogger) } out, err := w.client.DescribeCluster(ctx, params, func(o *Options) { o.APIOptions = append(o.APIOptions, apiOptions...) }) retryable, err := options.Retryable(ctx, params, out, err) if err != nil { return nil, err } if !retryable { return out, nil } remainingTime -= time.Since(start) if remainingTime < options.MinDelay || remainingTime <= 0 { break } // compute exponential backoff between waiter retries delay, err := smithywaiter.ComputeDelay( attempt, options.MinDelay, options.MaxDelay, remainingTime, ) if err != nil { return nil, fmt.Errorf("error computing waiter delay, %w", err) } remainingTime -= delay // sleep for the delay amount before invoking a request if err := smithytime.SleepWithContext(ctx, delay); err != nil { return nil, fmt.Errorf("request cancelled while waiting, %w", err) } } return nil, fmt.Errorf("exceeded max wait time for ClusterDeleted waiter") } func clusterDeletedStateRetryable(ctx context.Context, input *DescribeClusterInput, output *DescribeClusterOutput, err error) (bool, error) { if err != nil { var errorType *types.ResourceNotFoundException if errors.As(err, &errorType) { return false, nil } } if err == nil { pathValue, err := jmespath.Search("Cluster.Status", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "PENDING_DELETION" value, ok := pathValue.(types.Status) if !ok { return false, fmt.Errorf("waiter comparator expected types.Status value, got %T", pathValue) } if string(value) == expectedValue { return true, nil } } if err != nil { var errorType *types.InternalServerException if errors.As(err, &errorType) { return true, nil } } return true, nil } func newServiceMetadataMiddleware_opDescribeCluster(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-control-config", OperationName: "DescribeCluster", } }
498
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig import ( "context" "errors" "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/route53recoverycontrolconfig/types" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" smithywaiter "github.com/aws/smithy-go/waiter" "github.com/jmespath/go-jmespath" "time" ) // Displays details about a control panel. func (c *Client) DescribeControlPanel(ctx context.Context, params *DescribeControlPanelInput, optFns ...func(*Options)) (*DescribeControlPanelOutput, error) { if params == nil { params = &DescribeControlPanelInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeControlPanel", params, optFns, c.addOperationDescribeControlPanelMiddlewares) if err != nil { return nil, err } out := result.(*DescribeControlPanelOutput) out.ResultMetadata = metadata return out, nil } type DescribeControlPanelInput struct { // The Amazon Resource Name (ARN) of the control panel. // // This member is required. ControlPanelArn *string noSmithyDocumentSerde } type DescribeControlPanelOutput struct { // Information about the control panel. ControlPanel *types.ControlPanel // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeControlPanelMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeControlPanel{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeControlPanel{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeControlPanelValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeControlPanel(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // DescribeControlPanelAPIClient is a client that implements the // DescribeControlPanel operation. type DescribeControlPanelAPIClient interface { DescribeControlPanel(context.Context, *DescribeControlPanelInput, ...func(*Options)) (*DescribeControlPanelOutput, error) } var _ DescribeControlPanelAPIClient = (*Client)(nil) // ControlPanelCreatedWaiterOptions are waiter options for // ControlPanelCreatedWaiter type ControlPanelCreatedWaiterOptions 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 // MinDelay is the minimum amount of time to delay between retries. If unset, // ControlPanelCreatedWaiter will use default minimum delay of 5 seconds. Note that // MinDelay must resolve to a value lesser than or equal to the MaxDelay. MinDelay time.Duration // MaxDelay is the maximum amount of time to delay between retries. If unset or // set to zero, ControlPanelCreatedWaiter will use default max delay of 120 // seconds. Note that MaxDelay must resolve to value greater than or equal to the // MinDelay. MaxDelay time.Duration // LogWaitAttempts is used to enable logging for waiter retry attempts LogWaitAttempts bool // Retryable is function that can be used to override the service defined // waiter-behavior based on operation output, or returned error. This function is // used by the waiter to decide if a state is retryable or a terminal state. By // default service-modeled logic will populate this option. This option can thus be // used to define a custom waiter state with fall-back to service-modeled waiter // state mutators.The function returns an error in case of a failure state. In case // of retry state, this function returns a bool value of true and nil error, while // in case of success it returns a bool value of false and nil error. Retryable func(context.Context, *DescribeControlPanelInput, *DescribeControlPanelOutput, error) (bool, error) } // ControlPanelCreatedWaiter defines the waiters for ControlPanelCreated type ControlPanelCreatedWaiter struct { client DescribeControlPanelAPIClient options ControlPanelCreatedWaiterOptions } // NewControlPanelCreatedWaiter constructs a ControlPanelCreatedWaiter. func NewControlPanelCreatedWaiter(client DescribeControlPanelAPIClient, optFns ...func(*ControlPanelCreatedWaiterOptions)) *ControlPanelCreatedWaiter { options := ControlPanelCreatedWaiterOptions{} options.MinDelay = 5 * time.Second options.MaxDelay = 120 * time.Second options.Retryable = controlPanelCreatedStateRetryable for _, fn := range optFns { fn(&options) } return &ControlPanelCreatedWaiter{ client: client, options: options, } } // Wait calls the waiter function for ControlPanelCreated waiter. The maxWaitDur // is the maximum wait duration the waiter will wait. The maxWaitDur is required // and must be greater than zero. func (w *ControlPanelCreatedWaiter) Wait(ctx context.Context, params *DescribeControlPanelInput, maxWaitDur time.Duration, optFns ...func(*ControlPanelCreatedWaiterOptions)) error { _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) return err } // WaitForOutput calls the waiter function for ControlPanelCreated waiter and // returns the output of the successful operation. The maxWaitDur is the maximum // wait duration the waiter will wait. The maxWaitDur is required and must be // greater than zero. func (w *ControlPanelCreatedWaiter) WaitForOutput(ctx context.Context, params *DescribeControlPanelInput, maxWaitDur time.Duration, optFns ...func(*ControlPanelCreatedWaiterOptions)) (*DescribeControlPanelOutput, error) { if maxWaitDur <= 0 { return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") } options := w.options for _, fn := range optFns { fn(&options) } if options.MaxDelay <= 0 { options.MaxDelay = 120 * time.Second } if options.MinDelay > options.MaxDelay { return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) } ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) defer cancelFn() logger := smithywaiter.Logger{} remainingTime := maxWaitDur var attempt int64 for { attempt++ apiOptions := options.APIOptions start := time.Now() if options.LogWaitAttempts { logger.Attempt = attempt apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) apiOptions = append(apiOptions, logger.AddLogger) } out, err := w.client.DescribeControlPanel(ctx, params, func(o *Options) { o.APIOptions = append(o.APIOptions, apiOptions...) }) retryable, err := options.Retryable(ctx, params, out, err) if err != nil { return nil, err } if !retryable { return out, nil } remainingTime -= time.Since(start) if remainingTime < options.MinDelay || remainingTime <= 0 { break } // compute exponential backoff between waiter retries delay, err := smithywaiter.ComputeDelay( attempt, options.MinDelay, options.MaxDelay, remainingTime, ) if err != nil { return nil, fmt.Errorf("error computing waiter delay, %w", err) } remainingTime -= delay // sleep for the delay amount before invoking a request if err := smithytime.SleepWithContext(ctx, delay); err != nil { return nil, fmt.Errorf("request cancelled while waiting, %w", err) } } return nil, fmt.Errorf("exceeded max wait time for ControlPanelCreated waiter") } func controlPanelCreatedStateRetryable(ctx context.Context, input *DescribeControlPanelInput, output *DescribeControlPanelOutput, err error) (bool, error) { if err == nil { pathValue, err := jmespath.Search("ControlPanel.Status", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "DEPLOYED" value, ok := pathValue.(types.Status) if !ok { return false, fmt.Errorf("waiter comparator expected types.Status value, got %T", pathValue) } if string(value) == expectedValue { return false, nil } } if err == nil { pathValue, err := jmespath.Search("ControlPanel.Status", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "PENDING" value, ok := pathValue.(types.Status) if !ok { return false, fmt.Errorf("waiter comparator expected types.Status value, got %T", pathValue) } if string(value) == expectedValue { return true, nil } } if err != nil { var errorType *types.InternalServerException if errors.As(err, &errorType) { return true, nil } } return true, nil } // ControlPanelDeletedWaiterOptions are waiter options for // ControlPanelDeletedWaiter type ControlPanelDeletedWaiterOptions 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 // MinDelay is the minimum amount of time to delay between retries. If unset, // ControlPanelDeletedWaiter will use default minimum delay of 5 seconds. Note that // MinDelay must resolve to a value lesser than or equal to the MaxDelay. MinDelay time.Duration // MaxDelay is the maximum amount of time to delay between retries. If unset or // set to zero, ControlPanelDeletedWaiter will use default max delay of 120 // seconds. Note that MaxDelay must resolve to value greater than or equal to the // MinDelay. MaxDelay time.Duration // LogWaitAttempts is used to enable logging for waiter retry attempts LogWaitAttempts bool // Retryable is function that can be used to override the service defined // waiter-behavior based on operation output, or returned error. This function is // used by the waiter to decide if a state is retryable or a terminal state. By // default service-modeled logic will populate this option. This option can thus be // used to define a custom waiter state with fall-back to service-modeled waiter // state mutators.The function returns an error in case of a failure state. In case // of retry state, this function returns a bool value of true and nil error, while // in case of success it returns a bool value of false and nil error. Retryable func(context.Context, *DescribeControlPanelInput, *DescribeControlPanelOutput, error) (bool, error) } // ControlPanelDeletedWaiter defines the waiters for ControlPanelDeleted type ControlPanelDeletedWaiter struct { client DescribeControlPanelAPIClient options ControlPanelDeletedWaiterOptions } // NewControlPanelDeletedWaiter constructs a ControlPanelDeletedWaiter. func NewControlPanelDeletedWaiter(client DescribeControlPanelAPIClient, optFns ...func(*ControlPanelDeletedWaiterOptions)) *ControlPanelDeletedWaiter { options := ControlPanelDeletedWaiterOptions{} options.MinDelay = 5 * time.Second options.MaxDelay = 120 * time.Second options.Retryable = controlPanelDeletedStateRetryable for _, fn := range optFns { fn(&options) } return &ControlPanelDeletedWaiter{ client: client, options: options, } } // Wait calls the waiter function for ControlPanelDeleted waiter. The maxWaitDur // is the maximum wait duration the waiter will wait. The maxWaitDur is required // and must be greater than zero. func (w *ControlPanelDeletedWaiter) Wait(ctx context.Context, params *DescribeControlPanelInput, maxWaitDur time.Duration, optFns ...func(*ControlPanelDeletedWaiterOptions)) error { _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) return err } // WaitForOutput calls the waiter function for ControlPanelDeleted waiter and // returns the output of the successful operation. The maxWaitDur is the maximum // wait duration the waiter will wait. The maxWaitDur is required and must be // greater than zero. func (w *ControlPanelDeletedWaiter) WaitForOutput(ctx context.Context, params *DescribeControlPanelInput, maxWaitDur time.Duration, optFns ...func(*ControlPanelDeletedWaiterOptions)) (*DescribeControlPanelOutput, error) { if maxWaitDur <= 0 { return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") } options := w.options for _, fn := range optFns { fn(&options) } if options.MaxDelay <= 0 { options.MaxDelay = 120 * time.Second } if options.MinDelay > options.MaxDelay { return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) } ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) defer cancelFn() logger := smithywaiter.Logger{} remainingTime := maxWaitDur var attempt int64 for { attempt++ apiOptions := options.APIOptions start := time.Now() if options.LogWaitAttempts { logger.Attempt = attempt apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) apiOptions = append(apiOptions, logger.AddLogger) } out, err := w.client.DescribeControlPanel(ctx, params, func(o *Options) { o.APIOptions = append(o.APIOptions, apiOptions...) }) retryable, err := options.Retryable(ctx, params, out, err) if err != nil { return nil, err } if !retryable { return out, nil } remainingTime -= time.Since(start) if remainingTime < options.MinDelay || remainingTime <= 0 { break } // compute exponential backoff between waiter retries delay, err := smithywaiter.ComputeDelay( attempt, options.MinDelay, options.MaxDelay, remainingTime, ) if err != nil { return nil, fmt.Errorf("error computing waiter delay, %w", err) } remainingTime -= delay // sleep for the delay amount before invoking a request if err := smithytime.SleepWithContext(ctx, delay); err != nil { return nil, fmt.Errorf("request cancelled while waiting, %w", err) } } return nil, fmt.Errorf("exceeded max wait time for ControlPanelDeleted waiter") } func controlPanelDeletedStateRetryable(ctx context.Context, input *DescribeControlPanelInput, output *DescribeControlPanelOutput, err error) (bool, error) { if err != nil { var errorType *types.ResourceNotFoundException if errors.As(err, &errorType) { return false, nil } } if err == nil { pathValue, err := jmespath.Search("ControlPanel.Status", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "PENDING_DELETION" value, ok := pathValue.(types.Status) if !ok { return false, fmt.Errorf("waiter comparator expected types.Status value, got %T", pathValue) } if string(value) == expectedValue { return true, nil } } if err != nil { var errorType *types.InternalServerException if errors.As(err, &errorType) { return true, nil } } return true, nil } func newServiceMetadataMiddleware_opDescribeControlPanel(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-control-config", OperationName: "DescribeControlPanel", } }
501
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig import ( "context" "errors" "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/route53recoverycontrolconfig/types" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" smithywaiter "github.com/aws/smithy-go/waiter" "github.com/jmespath/go-jmespath" "time" ) // Displays details about a routing control. A routing control has one of two // states: ON and OFF. You can map the routing control state to the state of an // Amazon Route 53 health check, which can be used to control routing. To get or // update the routing control state, see the Recovery Cluster (data plane) API // actions for Amazon Route 53 Application Recovery Controller. func (c *Client) DescribeRoutingControl(ctx context.Context, params *DescribeRoutingControlInput, optFns ...func(*Options)) (*DescribeRoutingControlOutput, error) { if params == nil { params = &DescribeRoutingControlInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeRoutingControl", params, optFns, c.addOperationDescribeRoutingControlMiddlewares) if err != nil { return nil, err } out := result.(*DescribeRoutingControlOutput) out.ResultMetadata = metadata return out, nil } type DescribeRoutingControlInput struct { // The Amazon Resource Name (ARN) of the routing control. // // This member is required. RoutingControlArn *string noSmithyDocumentSerde } type DescribeRoutingControlOutput struct { // Information about the routing control. RoutingControl *types.RoutingControl // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeRoutingControlMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeRoutingControl{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeRoutingControl{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeRoutingControlValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRoutingControl(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // DescribeRoutingControlAPIClient is a client that implements the // DescribeRoutingControl operation. type DescribeRoutingControlAPIClient interface { DescribeRoutingControl(context.Context, *DescribeRoutingControlInput, ...func(*Options)) (*DescribeRoutingControlOutput, error) } var _ DescribeRoutingControlAPIClient = (*Client)(nil) // RoutingControlCreatedWaiterOptions are waiter options for // RoutingControlCreatedWaiter type RoutingControlCreatedWaiterOptions 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 // MinDelay is the minimum amount of time to delay between retries. If unset, // RoutingControlCreatedWaiter will use default minimum delay of 5 seconds. Note // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. MinDelay time.Duration // MaxDelay is the maximum amount of time to delay between retries. If unset or // set to zero, RoutingControlCreatedWaiter will use default max delay of 120 // seconds. Note that MaxDelay must resolve to value greater than or equal to the // MinDelay. MaxDelay time.Duration // LogWaitAttempts is used to enable logging for waiter retry attempts LogWaitAttempts bool // Retryable is function that can be used to override the service defined // waiter-behavior based on operation output, or returned error. This function is // used by the waiter to decide if a state is retryable or a terminal state. By // default service-modeled logic will populate this option. This option can thus be // used to define a custom waiter state with fall-back to service-modeled waiter // state mutators.The function returns an error in case of a failure state. In case // of retry state, this function returns a bool value of true and nil error, while // in case of success it returns a bool value of false and nil error. Retryable func(context.Context, *DescribeRoutingControlInput, *DescribeRoutingControlOutput, error) (bool, error) } // RoutingControlCreatedWaiter defines the waiters for RoutingControlCreated type RoutingControlCreatedWaiter struct { client DescribeRoutingControlAPIClient options RoutingControlCreatedWaiterOptions } // NewRoutingControlCreatedWaiter constructs a RoutingControlCreatedWaiter. func NewRoutingControlCreatedWaiter(client DescribeRoutingControlAPIClient, optFns ...func(*RoutingControlCreatedWaiterOptions)) *RoutingControlCreatedWaiter { options := RoutingControlCreatedWaiterOptions{} options.MinDelay = 5 * time.Second options.MaxDelay = 120 * time.Second options.Retryable = routingControlCreatedStateRetryable for _, fn := range optFns { fn(&options) } return &RoutingControlCreatedWaiter{ client: client, options: options, } } // Wait calls the waiter function for RoutingControlCreated waiter. The maxWaitDur // is the maximum wait duration the waiter will wait. The maxWaitDur is required // and must be greater than zero. func (w *RoutingControlCreatedWaiter) Wait(ctx context.Context, params *DescribeRoutingControlInput, maxWaitDur time.Duration, optFns ...func(*RoutingControlCreatedWaiterOptions)) error { _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) return err } // WaitForOutput calls the waiter function for RoutingControlCreated waiter and // returns the output of the successful operation. The maxWaitDur is the maximum // wait duration the waiter will wait. The maxWaitDur is required and must be // greater than zero. func (w *RoutingControlCreatedWaiter) WaitForOutput(ctx context.Context, params *DescribeRoutingControlInput, maxWaitDur time.Duration, optFns ...func(*RoutingControlCreatedWaiterOptions)) (*DescribeRoutingControlOutput, error) { if maxWaitDur <= 0 { return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") } options := w.options for _, fn := range optFns { fn(&options) } if options.MaxDelay <= 0 { options.MaxDelay = 120 * time.Second } if options.MinDelay > options.MaxDelay { return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) } ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) defer cancelFn() logger := smithywaiter.Logger{} remainingTime := maxWaitDur var attempt int64 for { attempt++ apiOptions := options.APIOptions start := time.Now() if options.LogWaitAttempts { logger.Attempt = attempt apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) apiOptions = append(apiOptions, logger.AddLogger) } out, err := w.client.DescribeRoutingControl(ctx, params, func(o *Options) { o.APIOptions = append(o.APIOptions, apiOptions...) }) retryable, err := options.Retryable(ctx, params, out, err) if err != nil { return nil, err } if !retryable { return out, nil } remainingTime -= time.Since(start) if remainingTime < options.MinDelay || remainingTime <= 0 { break } // compute exponential backoff between waiter retries delay, err := smithywaiter.ComputeDelay( attempt, options.MinDelay, options.MaxDelay, remainingTime, ) if err != nil { return nil, fmt.Errorf("error computing waiter delay, %w", err) } remainingTime -= delay // sleep for the delay amount before invoking a request if err := smithytime.SleepWithContext(ctx, delay); err != nil { return nil, fmt.Errorf("request cancelled while waiting, %w", err) } } return nil, fmt.Errorf("exceeded max wait time for RoutingControlCreated waiter") } func routingControlCreatedStateRetryable(ctx context.Context, input *DescribeRoutingControlInput, output *DescribeRoutingControlOutput, err error) (bool, error) { if err == nil { pathValue, err := jmespath.Search("RoutingControl.Status", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "DEPLOYED" value, ok := pathValue.(types.Status) if !ok { return false, fmt.Errorf("waiter comparator expected types.Status value, got %T", pathValue) } if string(value) == expectedValue { return false, nil } } if err == nil { pathValue, err := jmespath.Search("RoutingControl.Status", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "PENDING" value, ok := pathValue.(types.Status) if !ok { return false, fmt.Errorf("waiter comparator expected types.Status value, got %T", pathValue) } if string(value) == expectedValue { return true, nil } } if err != nil { var errorType *types.InternalServerException if errors.As(err, &errorType) { return true, nil } } return true, nil } // RoutingControlDeletedWaiterOptions are waiter options for // RoutingControlDeletedWaiter type RoutingControlDeletedWaiterOptions 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 // MinDelay is the minimum amount of time to delay between retries. If unset, // RoutingControlDeletedWaiter will use default minimum delay of 5 seconds. Note // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. MinDelay time.Duration // MaxDelay is the maximum amount of time to delay between retries. If unset or // set to zero, RoutingControlDeletedWaiter will use default max delay of 120 // seconds. Note that MaxDelay must resolve to value greater than or equal to the // MinDelay. MaxDelay time.Duration // LogWaitAttempts is used to enable logging for waiter retry attempts LogWaitAttempts bool // Retryable is function that can be used to override the service defined // waiter-behavior based on operation output, or returned error. This function is // used by the waiter to decide if a state is retryable or a terminal state. By // default service-modeled logic will populate this option. This option can thus be // used to define a custom waiter state with fall-back to service-modeled waiter // state mutators.The function returns an error in case of a failure state. In case // of retry state, this function returns a bool value of true and nil error, while // in case of success it returns a bool value of false and nil error. Retryable func(context.Context, *DescribeRoutingControlInput, *DescribeRoutingControlOutput, error) (bool, error) } // RoutingControlDeletedWaiter defines the waiters for RoutingControlDeleted type RoutingControlDeletedWaiter struct { client DescribeRoutingControlAPIClient options RoutingControlDeletedWaiterOptions } // NewRoutingControlDeletedWaiter constructs a RoutingControlDeletedWaiter. func NewRoutingControlDeletedWaiter(client DescribeRoutingControlAPIClient, optFns ...func(*RoutingControlDeletedWaiterOptions)) *RoutingControlDeletedWaiter { options := RoutingControlDeletedWaiterOptions{} options.MinDelay = 5 * time.Second options.MaxDelay = 120 * time.Second options.Retryable = routingControlDeletedStateRetryable for _, fn := range optFns { fn(&options) } return &RoutingControlDeletedWaiter{ client: client, options: options, } } // Wait calls the waiter function for RoutingControlDeleted waiter. The maxWaitDur // is the maximum wait duration the waiter will wait. The maxWaitDur is required // and must be greater than zero. func (w *RoutingControlDeletedWaiter) Wait(ctx context.Context, params *DescribeRoutingControlInput, maxWaitDur time.Duration, optFns ...func(*RoutingControlDeletedWaiterOptions)) error { _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) return err } // WaitForOutput calls the waiter function for RoutingControlDeleted waiter and // returns the output of the successful operation. The maxWaitDur is the maximum // wait duration the waiter will wait. The maxWaitDur is required and must be // greater than zero. func (w *RoutingControlDeletedWaiter) WaitForOutput(ctx context.Context, params *DescribeRoutingControlInput, maxWaitDur time.Duration, optFns ...func(*RoutingControlDeletedWaiterOptions)) (*DescribeRoutingControlOutput, error) { if maxWaitDur <= 0 { return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") } options := w.options for _, fn := range optFns { fn(&options) } if options.MaxDelay <= 0 { options.MaxDelay = 120 * time.Second } if options.MinDelay > options.MaxDelay { return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) } ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) defer cancelFn() logger := smithywaiter.Logger{} remainingTime := maxWaitDur var attempt int64 for { attempt++ apiOptions := options.APIOptions start := time.Now() if options.LogWaitAttempts { logger.Attempt = attempt apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) apiOptions = append(apiOptions, logger.AddLogger) } out, err := w.client.DescribeRoutingControl(ctx, params, func(o *Options) { o.APIOptions = append(o.APIOptions, apiOptions...) }) retryable, err := options.Retryable(ctx, params, out, err) if err != nil { return nil, err } if !retryable { return out, nil } remainingTime -= time.Since(start) if remainingTime < options.MinDelay || remainingTime <= 0 { break } // compute exponential backoff between waiter retries delay, err := smithywaiter.ComputeDelay( attempt, options.MinDelay, options.MaxDelay, remainingTime, ) if err != nil { return nil, fmt.Errorf("error computing waiter delay, %w", err) } remainingTime -= delay // sleep for the delay amount before invoking a request if err := smithytime.SleepWithContext(ctx, delay); err != nil { return nil, fmt.Errorf("request cancelled while waiting, %w", err) } } return nil, fmt.Errorf("exceeded max wait time for RoutingControlDeleted waiter") } func routingControlDeletedStateRetryable(ctx context.Context, input *DescribeRoutingControlInput, output *DescribeRoutingControlOutput, err error) (bool, error) { if err != nil { var errorType *types.ResourceNotFoundException if errors.As(err, &errorType) { return false, nil } } if err == nil { pathValue, err := jmespath.Search("RoutingControl.Status", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "PENDING_DELETION" value, ok := pathValue.(types.Status) if !ok { return false, fmt.Errorf("waiter comparator expected types.Status value, got %T", pathValue) } if string(value) == expectedValue { return true, nil } } if err != nil { var errorType *types.InternalServerException if errors.As(err, &errorType) { return true, nil } } return true, nil } func newServiceMetadataMiddleware_opDescribeRoutingControl(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-control-config", OperationName: "DescribeRoutingControl", } }
505
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig 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/route53recoverycontrolconfig/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns information about a safety rule. func (c *Client) DescribeSafetyRule(ctx context.Context, params *DescribeSafetyRuleInput, optFns ...func(*Options)) (*DescribeSafetyRuleOutput, error) { if params == nil { params = &DescribeSafetyRuleInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeSafetyRule", params, optFns, c.addOperationDescribeSafetyRuleMiddlewares) if err != nil { return nil, err } out := result.(*DescribeSafetyRuleOutput) out.ResultMetadata = metadata return out, nil } type DescribeSafetyRuleInput struct { // The ARN of the safety rule. // // This member is required. SafetyRuleArn *string noSmithyDocumentSerde } type DescribeSafetyRuleOutput struct { // The assertion rule in the response. AssertionRule *types.AssertionRule // The gating rule in the response. GatingRule *types.GatingRule // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeSafetyRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeSafetyRule{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeSafetyRule{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeSafetyRuleValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSafetyRule(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeSafetyRule(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-control-config", OperationName: "DescribeSafetyRule", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns an array of all Amazon Route 53 health checks associated with a // specific routing control. func (c *Client) ListAssociatedRoute53HealthChecks(ctx context.Context, params *ListAssociatedRoute53HealthChecksInput, optFns ...func(*Options)) (*ListAssociatedRoute53HealthChecksOutput, error) { if params == nil { params = &ListAssociatedRoute53HealthChecksInput{} } result, metadata, err := c.invokeOperation(ctx, "ListAssociatedRoute53HealthChecks", params, optFns, c.addOperationListAssociatedRoute53HealthChecksMiddlewares) if err != nil { return nil, err } out := result.(*ListAssociatedRoute53HealthChecksOutput) out.ResultMetadata = metadata return out, nil } type ListAssociatedRoute53HealthChecksInput struct { // The Amazon Resource Name (ARN) of the routing control. // // This member is required. RoutingControlArn *string // The number of objects that you want to return with this call. MaxResults int32 // The token that identifies which batch of results you want to see. NextToken *string noSmithyDocumentSerde } type ListAssociatedRoute53HealthChecksOutput struct { // Identifiers for the health checks. HealthCheckIds []string // Next token for listing health checks. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListAssociatedRoute53HealthChecksMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListAssociatedRoute53HealthChecks{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAssociatedRoute53HealthChecks{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListAssociatedRoute53HealthChecksValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssociatedRoute53HealthChecks(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListAssociatedRoute53HealthChecksAPIClient is a client that implements the // ListAssociatedRoute53HealthChecks operation. type ListAssociatedRoute53HealthChecksAPIClient interface { ListAssociatedRoute53HealthChecks(context.Context, *ListAssociatedRoute53HealthChecksInput, ...func(*Options)) (*ListAssociatedRoute53HealthChecksOutput, error) } var _ ListAssociatedRoute53HealthChecksAPIClient = (*Client)(nil) // ListAssociatedRoute53HealthChecksPaginatorOptions is the paginator options for // ListAssociatedRoute53HealthChecks type ListAssociatedRoute53HealthChecksPaginatorOptions struct { // The number of objects that you want to return with this call. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListAssociatedRoute53HealthChecksPaginator is a paginator for // ListAssociatedRoute53HealthChecks type ListAssociatedRoute53HealthChecksPaginator struct { options ListAssociatedRoute53HealthChecksPaginatorOptions client ListAssociatedRoute53HealthChecksAPIClient params *ListAssociatedRoute53HealthChecksInput nextToken *string firstPage bool } // NewListAssociatedRoute53HealthChecksPaginator returns a new // ListAssociatedRoute53HealthChecksPaginator func NewListAssociatedRoute53HealthChecksPaginator(client ListAssociatedRoute53HealthChecksAPIClient, params *ListAssociatedRoute53HealthChecksInput, optFns ...func(*ListAssociatedRoute53HealthChecksPaginatorOptions)) *ListAssociatedRoute53HealthChecksPaginator { if params == nil { params = &ListAssociatedRoute53HealthChecksInput{} } options := ListAssociatedRoute53HealthChecksPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListAssociatedRoute53HealthChecksPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListAssociatedRoute53HealthChecksPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListAssociatedRoute53HealthChecks page. func (p *ListAssociatedRoute53HealthChecksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssociatedRoute53HealthChecksOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListAssociatedRoute53HealthChecks(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_opListAssociatedRoute53HealthChecks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-control-config", OperationName: "ListAssociatedRoute53HealthChecks", } }
224
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig 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/route53recoverycontrolconfig/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns an array of all the clusters in an account. func (c *Client) ListClusters(ctx context.Context, params *ListClustersInput, optFns ...func(*Options)) (*ListClustersOutput, error) { if params == nil { params = &ListClustersInput{} } result, metadata, err := c.invokeOperation(ctx, "ListClusters", params, optFns, c.addOperationListClustersMiddlewares) if err != nil { return nil, err } out := result.(*ListClustersOutput) out.ResultMetadata = metadata return out, nil } type ListClustersInput struct { // The number of objects that you want to return with this call. MaxResults int32 // The token that identifies which batch of results you want to see. NextToken *string noSmithyDocumentSerde } type ListClustersOutput struct { // An array of the clusters in an account. Clusters []types.Cluster // The token that identifies which batch of results you want to see. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListClustersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListClusters{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListClusters{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListClusters(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListClustersAPIClient is a client that implements the ListClusters operation. type ListClustersAPIClient interface { ListClusters(context.Context, *ListClustersInput, ...func(*Options)) (*ListClustersOutput, error) } var _ ListClustersAPIClient = (*Client)(nil) // ListClustersPaginatorOptions is the paginator options for ListClusters type ListClustersPaginatorOptions struct { // The number of objects that you want to return with this call. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListClustersPaginator is a paginator for ListClusters type ListClustersPaginator struct { options ListClustersPaginatorOptions client ListClustersAPIClient params *ListClustersInput nextToken *string firstPage bool } // NewListClustersPaginator returns a new ListClustersPaginator func NewListClustersPaginator(client ListClustersAPIClient, params *ListClustersInput, optFns ...func(*ListClustersPaginatorOptions)) *ListClustersPaginator { if params == nil { params = &ListClustersInput{} } options := ListClustersPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListClustersPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListClustersPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListClusters page. func (p *ListClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClustersOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListClusters(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_opListClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-control-config", OperationName: "ListClusters", } }
212
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig 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/route53recoverycontrolconfig/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns an array of control panels in an account or in a cluster. func (c *Client) ListControlPanels(ctx context.Context, params *ListControlPanelsInput, optFns ...func(*Options)) (*ListControlPanelsOutput, error) { if params == nil { params = &ListControlPanelsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListControlPanels", params, optFns, c.addOperationListControlPanelsMiddlewares) if err != nil { return nil, err } out := result.(*ListControlPanelsOutput) out.ResultMetadata = metadata return out, nil } type ListControlPanelsInput struct { // The Amazon Resource Name (ARN) of a cluster. ClusterArn *string // The number of objects that you want to return with this call. MaxResults int32 // The token that identifies which batch of results you want to see. NextToken *string noSmithyDocumentSerde } type ListControlPanelsOutput struct { // The result of a successful ListControlPanel request. ControlPanels []types.ControlPanel // The token that identifies which batch of results you want to see. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListControlPanelsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListControlPanels{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListControlPanels{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListControlPanels(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListControlPanelsAPIClient is a client that implements the ListControlPanels // operation. type ListControlPanelsAPIClient interface { ListControlPanels(context.Context, *ListControlPanelsInput, ...func(*Options)) (*ListControlPanelsOutput, error) } var _ ListControlPanelsAPIClient = (*Client)(nil) // ListControlPanelsPaginatorOptions is the paginator options for ListControlPanels type ListControlPanelsPaginatorOptions struct { // The number of objects that you want to return with this call. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListControlPanelsPaginator is a paginator for ListControlPanels type ListControlPanelsPaginator struct { options ListControlPanelsPaginatorOptions client ListControlPanelsAPIClient params *ListControlPanelsInput nextToken *string firstPage bool } // NewListControlPanelsPaginator returns a new ListControlPanelsPaginator func NewListControlPanelsPaginator(client ListControlPanelsAPIClient, params *ListControlPanelsInput, optFns ...func(*ListControlPanelsPaginatorOptions)) *ListControlPanelsPaginator { if params == nil { params = &ListControlPanelsInput{} } options := ListControlPanelsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListControlPanelsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListControlPanelsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListControlPanels page. func (p *ListControlPanelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListControlPanelsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListControlPanels(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_opListControlPanels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-control-config", OperationName: "ListControlPanels", } }
216
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig 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/route53recoverycontrolconfig/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns an array of routing controls for a control panel. A routing control is // an Amazon Route 53 Application Recovery Controller construct that has one of two // states: ON and OFF. You can map the routing control state to the state of an // Amazon Route 53 health check, which can be used to control routing. func (c *Client) ListRoutingControls(ctx context.Context, params *ListRoutingControlsInput, optFns ...func(*Options)) (*ListRoutingControlsOutput, error) { if params == nil { params = &ListRoutingControlsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListRoutingControls", params, optFns, c.addOperationListRoutingControlsMiddlewares) if err != nil { return nil, err } out := result.(*ListRoutingControlsOutput) out.ResultMetadata = metadata return out, nil } type ListRoutingControlsInput struct { // The Amazon Resource Name (ARN) of the control panel. // // This member is required. ControlPanelArn *string // The number of objects that you want to return with this call. MaxResults int32 // The token that identifies which batch of results you want to see. NextToken *string noSmithyDocumentSerde } type ListRoutingControlsOutput struct { // The token that identifies which batch of results you want to see. NextToken *string // An array of routing controls. RoutingControls []types.RoutingControl // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListRoutingControlsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListRoutingControls{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListRoutingControls{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListRoutingControlsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRoutingControls(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListRoutingControlsAPIClient is a client that implements the // ListRoutingControls operation. type ListRoutingControlsAPIClient interface { ListRoutingControls(context.Context, *ListRoutingControlsInput, ...func(*Options)) (*ListRoutingControlsOutput, error) } var _ ListRoutingControlsAPIClient = (*Client)(nil) // ListRoutingControlsPaginatorOptions is the paginator options for // ListRoutingControls type ListRoutingControlsPaginatorOptions struct { // The number of objects that you want to return with this call. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListRoutingControlsPaginator is a paginator for ListRoutingControls type ListRoutingControlsPaginator struct { options ListRoutingControlsPaginatorOptions client ListRoutingControlsAPIClient params *ListRoutingControlsInput nextToken *string firstPage bool } // NewListRoutingControlsPaginator returns a new ListRoutingControlsPaginator func NewListRoutingControlsPaginator(client ListRoutingControlsAPIClient, params *ListRoutingControlsInput, optFns ...func(*ListRoutingControlsPaginatorOptions)) *ListRoutingControlsPaginator { if params == nil { params = &ListRoutingControlsInput{} } options := ListRoutingControlsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListRoutingControlsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListRoutingControlsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListRoutingControls page. func (p *ListRoutingControlsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRoutingControlsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListRoutingControls(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_opListRoutingControls(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-control-config", OperationName: "ListRoutingControls", } }
225
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig 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/route53recoverycontrolconfig/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // List the safety rules (the assertion rules and gating rules) that you've // defined for the routing controls in a control panel. func (c *Client) ListSafetyRules(ctx context.Context, params *ListSafetyRulesInput, optFns ...func(*Options)) (*ListSafetyRulesOutput, error) { if params == nil { params = &ListSafetyRulesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListSafetyRules", params, optFns, c.addOperationListSafetyRulesMiddlewares) if err != nil { return nil, err } out := result.(*ListSafetyRulesOutput) out.ResultMetadata = metadata return out, nil } type ListSafetyRulesInput struct { // The Amazon Resource Name (ARN) of the control panel. // // This member is required. ControlPanelArn *string // The number of objects that you want to return with this call. MaxResults int32 // The token that identifies which batch of results you want to see. NextToken *string noSmithyDocumentSerde } type ListSafetyRulesOutput struct { // The token that identifies which batch of results you want to see. NextToken *string // The list of safety rules in a control panel. SafetyRules []types.Rule // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListSafetyRulesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListSafetyRules{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSafetyRules{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListSafetyRulesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSafetyRules(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListSafetyRulesAPIClient is a client that implements the ListSafetyRules // operation. type ListSafetyRulesAPIClient interface { ListSafetyRules(context.Context, *ListSafetyRulesInput, ...func(*Options)) (*ListSafetyRulesOutput, error) } var _ ListSafetyRulesAPIClient = (*Client)(nil) // ListSafetyRulesPaginatorOptions is the paginator options for ListSafetyRules type ListSafetyRulesPaginatorOptions struct { // The number of objects that you want to return with this call. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListSafetyRulesPaginator is a paginator for ListSafetyRules type ListSafetyRulesPaginator struct { options ListSafetyRulesPaginatorOptions client ListSafetyRulesAPIClient params *ListSafetyRulesInput nextToken *string firstPage bool } // NewListSafetyRulesPaginator returns a new ListSafetyRulesPaginator func NewListSafetyRulesPaginator(client ListSafetyRulesAPIClient, params *ListSafetyRulesInput, optFns ...func(*ListSafetyRulesPaginatorOptions)) *ListSafetyRulesPaginator { if params == nil { params = &ListSafetyRulesInput{} } options := ListSafetyRulesPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListSafetyRulesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListSafetyRulesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListSafetyRules page. func (p *ListSafetyRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSafetyRulesOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListSafetyRules(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_opListSafetyRules(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-control-config", OperationName: "ListSafetyRules", } }
222
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the tags for a resource. 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) for the resource that's tagged. // // This member is required. ResourceArn *string noSmithyDocumentSerde } type ListTagsForResourceOutput struct { // The tags associated with 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: "route53-recovery-control-config", OperationName: "ListTagsForResource", } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Adds a tag to a resource. 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 } // Request of adding tag to the resource type TagResourceInput struct { // The Amazon Resource Name (ARN) for the resource that's tagged. // // This member is required. ResourceArn *string // The tags associated with the 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: "route53-recovery-control-config", OperationName: "TagResource", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Removes a tag from a resource. func (c *Client) 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) for the resource that's tagged. // // This member is required. ResourceArn *string // Keys for the tags to be removed. // // 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: "route53-recovery-control-config", OperationName: "UntagResource", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig 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/route53recoverycontrolconfig/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates a control panel. The only update you can make to a control panel is to // change the name of the control panel. func (c *Client) UpdateControlPanel(ctx context.Context, params *UpdateControlPanelInput, optFns ...func(*Options)) (*UpdateControlPanelOutput, error) { if params == nil { params = &UpdateControlPanelInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateControlPanel", params, optFns, c.addOperationUpdateControlPanelMiddlewares) if err != nil { return nil, err } out := result.(*UpdateControlPanelOutput) out.ResultMetadata = metadata return out, nil } // The details of the control panel that you're updating. type UpdateControlPanelInput struct { // The Amazon Resource Name (ARN) of the control panel. // // This member is required. ControlPanelArn *string // The name of the control panel. // // This member is required. ControlPanelName *string noSmithyDocumentSerde } type UpdateControlPanelOutput struct { // The control panel to update. ControlPanel *types.ControlPanel // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateControlPanelMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateControlPanel{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateControlPanel{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateControlPanelValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateControlPanel(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateControlPanel(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-control-config", OperationName: "UpdateControlPanel", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig 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/route53recoverycontrolconfig/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates a routing control. You can only update the name of the routing control. // To get or update the routing control state, see the Recovery Cluster (data // plane) API actions for Amazon Route 53 Application Recovery Controller. func (c *Client) UpdateRoutingControl(ctx context.Context, params *UpdateRoutingControlInput, optFns ...func(*Options)) (*UpdateRoutingControlOutput, error) { if params == nil { params = &UpdateRoutingControlInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateRoutingControl", params, optFns, c.addOperationUpdateRoutingControlMiddlewares) if err != nil { return nil, err } out := result.(*UpdateRoutingControlOutput) out.ResultMetadata = metadata return out, nil } // The details of the routing control that you're updating. type UpdateRoutingControlInput struct { // The Amazon Resource Name (ARN) of the routing control. // // This member is required. RoutingControlArn *string // The name of the routing control. // // This member is required. RoutingControlName *string noSmithyDocumentSerde } type UpdateRoutingControlOutput struct { // The routing control that was updated. RoutingControl *types.RoutingControl // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateRoutingControlMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateRoutingControl{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateRoutingControl{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateRoutingControlValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRoutingControl(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateRoutingControl(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-control-config", OperationName: "UpdateRoutingControl", } }
133
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig 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/route53recoverycontrolconfig/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Update a safety rule (an assertion rule or gating rule). You can only update // the name and the waiting period for a safety rule. To make other updates, delete // the safety rule and create a new one. func (c *Client) UpdateSafetyRule(ctx context.Context, params *UpdateSafetyRuleInput, optFns ...func(*Options)) (*UpdateSafetyRuleOutput, error) { if params == nil { params = &UpdateSafetyRuleInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateSafetyRule", params, optFns, c.addOperationUpdateSafetyRuleMiddlewares) if err != nil { return nil, err } out := result.(*UpdateSafetyRuleOutput) out.ResultMetadata = metadata return out, nil } // A rule that you add to Application Recovery Controller to ensure that recovery // actions don't accidentally impair your application's availability. type UpdateSafetyRuleInput struct { // The assertion rule to update. AssertionRuleUpdate *types.AssertionRuleUpdate // The gating rule to update. GatingRuleUpdate *types.GatingRuleUpdate noSmithyDocumentSerde } type UpdateSafetyRuleOutput struct { // The assertion rule updated. AssertionRule *types.AssertionRule // The gating rule updated. GatingRule *types.GatingRule // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateSafetyRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSafetyRule{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSafetyRule{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateSafetyRuleValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSafetyRule(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateSafetyRule(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-control-config", OperationName: "UpdateSafetyRule", } }
133
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/route53recoverycontrolconfig/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_deserializeOpCreateCluster struct { } func (*awsRestjson1_deserializeOpCreateCluster) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateCluster) 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_deserializeOpErrorCreateCluster(response, &metadata) } output := &CreateClusterOutput{} 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_deserializeOpDocumentCreateClusterOutput(&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_deserializeOpErrorCreateCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("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_deserializeOpDocumentCreateClusterOutput(v **CreateClusterOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateClusterOutput if *v == nil { sv = &CreateClusterOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Cluster": if err := awsRestjson1_deserializeDocumentCluster(&sv.Cluster, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateControlPanel struct { } func (*awsRestjson1_deserializeOpCreateControlPanel) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateControlPanel) 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_deserializeOpErrorCreateControlPanel(response, &metadata) } output := &CreateControlPanelOutput{} 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_deserializeOpDocumentCreateControlPanelOutput(&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_deserializeOpErrorCreateControlPanel(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("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_deserializeOpDocumentCreateControlPanelOutput(v **CreateControlPanelOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateControlPanelOutput if *v == nil { sv = &CreateControlPanelOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ControlPanel": if err := awsRestjson1_deserializeDocumentControlPanel(&sv.ControlPanel, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateRoutingControl struct { } func (*awsRestjson1_deserializeOpCreateRoutingControl) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateRoutingControl) 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_deserializeOpErrorCreateRoutingControl(response, &metadata) } output := &CreateRoutingControlOutput{} 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_deserializeOpDocumentCreateRoutingControlOutput(&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_deserializeOpErrorCreateRoutingControl(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("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_deserializeOpDocumentCreateRoutingControlOutput(v **CreateRoutingControlOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateRoutingControlOutput if *v == nil { sv = &CreateRoutingControlOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RoutingControl": if err := awsRestjson1_deserializeDocumentRoutingControl(&sv.RoutingControl, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateSafetyRule struct { } func (*awsRestjson1_deserializeOpCreateSafetyRule) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateSafetyRule) 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_deserializeOpErrorCreateSafetyRule(response, &metadata) } output := &CreateSafetyRuleOutput{} 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_deserializeOpDocumentCreateSafetyRuleOutput(&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_deserializeOpErrorCreateSafetyRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateSafetyRuleOutput(v **CreateSafetyRuleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateSafetyRuleOutput if *v == nil { sv = &CreateSafetyRuleOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AssertionRule": if err := awsRestjson1_deserializeDocumentAssertionRule(&sv.AssertionRule, value); err != nil { return err } case "GatingRule": if err := awsRestjson1_deserializeDocumentGatingRule(&sv.GatingRule, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteCluster struct { } func (*awsRestjson1_deserializeOpDeleteCluster) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteCluster) 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_deserializeOpErrorDeleteCluster(response, &metadata) } output := &DeleteClusterOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("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_deserializeOpDeleteControlPanel struct { } func (*awsRestjson1_deserializeOpDeleteControlPanel) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteControlPanel) 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_deserializeOpErrorDeleteControlPanel(response, &metadata) } output := &DeleteControlPanelOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteControlPanel(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("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_deserializeOpDeleteRoutingControl struct { } func (*awsRestjson1_deserializeOpDeleteRoutingControl) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteRoutingControl) 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_deserializeOpErrorDeleteRoutingControl(response, &metadata) } output := &DeleteRoutingControlOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteRoutingControl(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("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_deserializeOpDeleteSafetyRule struct { } func (*awsRestjson1_deserializeOpDeleteSafetyRule) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteSafetyRule) 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_deserializeOpErrorDeleteSafetyRule(response, &metadata) } output := &DeleteSafetyRuleOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteSafetyRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDescribeCluster struct { } func (*awsRestjson1_deserializeOpDescribeCluster) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeCluster) 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_deserializeOpErrorDescribeCluster(response, &metadata) } output := &DescribeClusterOutput{} 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_deserializeOpDocumentDescribeClusterOutput(&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_deserializeOpErrorDescribeCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("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_deserializeOpDocumentDescribeClusterOutput(v **DescribeClusterOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeClusterOutput if *v == nil { sv = &DescribeClusterOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Cluster": if err := awsRestjson1_deserializeDocumentCluster(&sv.Cluster, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeControlPanel struct { } func (*awsRestjson1_deserializeOpDescribeControlPanel) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeControlPanel) 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_deserializeOpErrorDescribeControlPanel(response, &metadata) } output := &DescribeControlPanelOutput{} 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_deserializeOpDocumentDescribeControlPanelOutput(&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_deserializeOpErrorDescribeControlPanel(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("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_deserializeOpDocumentDescribeControlPanelOutput(v **DescribeControlPanelOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeControlPanelOutput if *v == nil { sv = &DescribeControlPanelOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ControlPanel": if err := awsRestjson1_deserializeDocumentControlPanel(&sv.ControlPanel, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeRoutingControl struct { } func (*awsRestjson1_deserializeOpDescribeRoutingControl) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeRoutingControl) 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_deserializeOpErrorDescribeRoutingControl(response, &metadata) } output := &DescribeRoutingControlOutput{} 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_deserializeOpDocumentDescribeRoutingControlOutput(&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_deserializeOpErrorDescribeRoutingControl(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("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_deserializeOpDocumentDescribeRoutingControlOutput(v **DescribeRoutingControlOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeRoutingControlOutput if *v == nil { sv = &DescribeRoutingControlOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RoutingControl": if err := awsRestjson1_deserializeDocumentRoutingControl(&sv.RoutingControl, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeSafetyRule struct { } func (*awsRestjson1_deserializeOpDescribeSafetyRule) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeSafetyRule) 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_deserializeOpErrorDescribeSafetyRule(response, &metadata) } output := &DescribeSafetyRuleOutput{} 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_deserializeOpDocumentDescribeSafetyRuleOutput(&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_deserializeOpErrorDescribeSafetyRule(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeSafetyRuleOutput(v **DescribeSafetyRuleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeSafetyRuleOutput if *v == nil { sv = &DescribeSafetyRuleOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AssertionRule": if err := awsRestjson1_deserializeDocumentAssertionRule(&sv.AssertionRule, value); err != nil { return err } case "GatingRule": if err := awsRestjson1_deserializeDocumentGatingRule(&sv.GatingRule, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListAssociatedRoute53HealthChecks struct { } func (*awsRestjson1_deserializeOpListAssociatedRoute53HealthChecks) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListAssociatedRoute53HealthChecks) 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_deserializeOpErrorListAssociatedRoute53HealthChecks(response, &metadata) } output := &ListAssociatedRoute53HealthChecksOutput{} 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_deserializeOpDocumentListAssociatedRoute53HealthChecksOutput(&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_deserializeOpErrorListAssociatedRoute53HealthChecks(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListAssociatedRoute53HealthChecksOutput(v **ListAssociatedRoute53HealthChecksOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListAssociatedRoute53HealthChecksOutput if *v == nil { sv = &ListAssociatedRoute53HealthChecksOutput{} } else { sv = *v } for key, value := range shape { switch key { case "HealthCheckIds": if err := awsRestjson1_deserializeDocument__listOf__stringMax36PatternS(&sv.HealthCheckIds, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin1Max8096PatternS to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListClusters struct { } func (*awsRestjson1_deserializeOpListClusters) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListClusters) 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_deserializeOpErrorListClusters(response, &metadata) } output := &ListClustersOutput{} 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_deserializeOpDocumentListClustersOutput(&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_deserializeOpErrorListClusters(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListClustersOutput(v **ListClustersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListClustersOutput if *v == nil { sv = &ListClustersOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Clusters": if err := awsRestjson1_deserializeDocument__listOfCluster(&sv.Clusters, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin1Max8096PatternS to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListControlPanels struct { } func (*awsRestjson1_deserializeOpListControlPanels) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListControlPanels) 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_deserializeOpErrorListControlPanels(response, &metadata) } output := &ListControlPanelsOutput{} 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_deserializeOpDocumentListControlPanelsOutput(&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_deserializeOpErrorListControlPanels(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListControlPanelsOutput(v **ListControlPanelsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListControlPanelsOutput if *v == nil { sv = &ListControlPanelsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ControlPanels": if err := awsRestjson1_deserializeDocument__listOfControlPanel(&sv.ControlPanels, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin1Max8096PatternS to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListRoutingControls struct { } func (*awsRestjson1_deserializeOpListRoutingControls) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListRoutingControls) 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_deserializeOpErrorListRoutingControls(response, &metadata) } output := &ListRoutingControlsOutput{} 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_deserializeOpDocumentListRoutingControlsOutput(&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_deserializeOpErrorListRoutingControls(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListRoutingControlsOutput(v **ListRoutingControlsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListRoutingControlsOutput if *v == nil { sv = &ListRoutingControlsOutput{} } 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 __stringMin1Max8096PatternS to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "RoutingControls": if err := awsRestjson1_deserializeDocument__listOfRoutingControl(&sv.RoutingControls, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListSafetyRules struct { } func (*awsRestjson1_deserializeOpListSafetyRules) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListSafetyRules) 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_deserializeOpErrorListSafetyRules(response, &metadata) } output := &ListSafetyRulesOutput{} 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_deserializeOpDocumentListSafetyRulesOutput(&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_deserializeOpErrorListSafetyRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListSafetyRulesOutput(v **ListSafetyRulesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListSafetyRulesOutput if *v == nil { sv = &ListSafetyRulesOutput{} } 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 __stringMin1Max8096PatternS to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "SafetyRules": if err := awsRestjson1_deserializeDocument__listOfRule(&sv.SafetyRules, 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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_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_deserializeDocument__mapOf__stringMin0Max256PatternS(&sv.Tags, value); err != nil { return err } 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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUpdateControlPanel struct { } func (*awsRestjson1_deserializeOpUpdateControlPanel) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateControlPanel) 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_deserializeOpErrorUpdateControlPanel(response, &metadata) } output := &UpdateControlPanelOutput{} 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_deserializeOpDocumentUpdateControlPanelOutput(&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_deserializeOpErrorUpdateControlPanel(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("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_deserializeOpDocumentUpdateControlPanelOutput(v **UpdateControlPanelOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateControlPanelOutput if *v == nil { sv = &UpdateControlPanelOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ControlPanel": if err := awsRestjson1_deserializeDocumentControlPanel(&sv.ControlPanel, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateRoutingControl struct { } func (*awsRestjson1_deserializeOpUpdateRoutingControl) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateRoutingControl) 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_deserializeOpErrorUpdateRoutingControl(response, &metadata) } output := &UpdateRoutingControlOutput{} 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_deserializeOpDocumentUpdateRoutingControlOutput(&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_deserializeOpErrorUpdateRoutingControl(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("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_deserializeOpDocumentUpdateRoutingControlOutput(v **UpdateRoutingControlOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateRoutingControlOutput if *v == nil { sv = &UpdateRoutingControlOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RoutingControl": if err := awsRestjson1_deserializeDocumentRoutingControl(&sv.RoutingControl, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateSafetyRule struct { } func (*awsRestjson1_deserializeOpUpdateSafetyRule) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateSafetyRule) 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_deserializeOpErrorUpdateSafetyRule(response, &metadata) } output := &UpdateSafetyRuleOutput{} 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_deserializeOpDocumentUpdateSafetyRuleOutput(&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_deserializeOpErrorUpdateSafetyRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateSafetyRuleOutput(v **UpdateSafetyRuleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateSafetyRuleOutput if *v == nil { sv = &UpdateSafetyRuleOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AssertionRule": if err := awsRestjson1_deserializeDocumentAssertionRule(&sv.AssertionRule, value); err != nil { return err } case "GatingRule": if err := awsRestjson1_deserializeDocumentGatingRule(&sv.GatingRule, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.AccessDeniedException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ConflictException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentConflictException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalServerException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_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_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_deserializeDocument__listOf__stringMax36PatternS(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 __stringMax36PatternS to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOf__stringMin1Max256PatternAZaZ09(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 __stringMin1Max256PatternAZaZ09 to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfCluster(v *[]types.Cluster, 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.Cluster if *v == nil { cv = []types.Cluster{} } else { cv = *v } for _, value := range shape { var col types.Cluster destAddr := &col if err := awsRestjson1_deserializeDocumentCluster(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfClusterEndpoint(v *[]types.ClusterEndpoint, 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.ClusterEndpoint if *v == nil { cv = []types.ClusterEndpoint{} } else { cv = *v } for _, value := range shape { var col types.ClusterEndpoint destAddr := &col if err := awsRestjson1_deserializeDocumentClusterEndpoint(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfControlPanel(v *[]types.ControlPanel, 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.ControlPanel if *v == nil { cv = []types.ControlPanel{} } else { cv = *v } for _, value := range shape { var col types.ControlPanel destAddr := &col if err := awsRestjson1_deserializeDocumentControlPanel(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfRoutingControl(v *[]types.RoutingControl, 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.RoutingControl if *v == nil { cv = []types.RoutingControl{} } else { cv = *v } for _, value := range shape { var col types.RoutingControl destAddr := &col if err := awsRestjson1_deserializeDocumentRoutingControl(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfRule(v *[]types.Rule, 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.Rule if *v == nil { cv = []types.Rule{} } else { cv = *v } for _, value := range shape { var col types.Rule destAddr := &col if err := awsRestjson1_deserializeDocumentRule(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__mapOf__stringMin0Max256PatternS(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 __stringMin0Max256PatternS to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } 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_deserializeDocumentAssertionRule(v **types.AssertionRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssertionRule if *v == nil { sv = &types.AssertionRule{} } else { sv = *v } for key, value := range shape { switch key { case "AssertedControls": if err := awsRestjson1_deserializeDocument__listOf__stringMin1Max256PatternAZaZ09(&sv.AssertedControls, value); err != nil { return err } case "ControlPanelArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin1Max256PatternAZaZ09 to be of type string, got %T instead", value) } sv.ControlPanelArn = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin1Max64PatternS to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RuleConfig": if err := awsRestjson1_deserializeDocumentRuleConfig(&sv.RuleConfig, value); err != nil { return err } case "SafetyRuleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin1Max256PatternAZaZ09 to be of type string, got %T instead", value) } sv.SafetyRuleArn = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Status to be of type string, got %T instead", value) } sv.Status = types.Status(jtv) } case "WaitPeriodMs": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.WaitPeriodMs = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCluster(v **types.Cluster, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Cluster if *v == nil { sv = &types.Cluster{} } else { sv = *v } for key, value := range shape { switch key { case "ClusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin1Max256PatternAZaZ09 to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "ClusterEndpoints": if err := awsRestjson1_deserializeDocument__listOfClusterEndpoint(&sv.ClusterEndpoints, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin1Max64PatternS 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 Status to be of type string, got %T instead", value) } sv.Status = types.Status(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentClusterEndpoint(v **types.ClusterEndpoint, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ClusterEndpoint if *v == nil { sv = &types.ClusterEndpoint{} } else { sv = *v } for key, value := range shape { switch key { case "Endpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin1Max128PatternAZaZ09 to be of type string, got %T instead", value) } sv.Endpoint = ptr.String(jtv) } case "Region": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin1Max32PatternS to be of type string, got %T instead", value) } sv.Region = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ConflictException if *v == nil { sv = &types.ConflictException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentControlPanel(v **types.ControlPanel, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ControlPanel if *v == nil { sv = &types.ControlPanel{} } else { sv = *v } for key, value := range shape { switch key { case "ClusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin1Max256PatternAZaZ09 to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "ControlPanelArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin1Max256PatternAZaZ09 to be of type string, got %T instead", value) } sv.ControlPanelArn = ptr.String(jtv) } case "DefaultControlPanel": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.DefaultControlPanel = jtv } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin1Max64PatternS to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RoutingControlCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RoutingControlCount = int32(i64) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Status to be of type string, got %T instead", value) } sv.Status = types.Status(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGatingRule(v **types.GatingRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GatingRule if *v == nil { sv = &types.GatingRule{} } else { sv = *v } for key, value := range shape { switch key { case "ControlPanelArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin1Max256PatternAZaZ09 to be of type string, got %T instead", value) } sv.ControlPanelArn = ptr.String(jtv) } case "GatingControls": if err := awsRestjson1_deserializeDocument__listOf__stringMin1Max256PatternAZaZ09(&sv.GatingControls, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin1Max64PatternS to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RuleConfig": if err := awsRestjson1_deserializeDocumentRuleConfig(&sv.RuleConfig, value); err != nil { return err } case "SafetyRuleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin1Max256PatternAZaZ09 to be of type string, got %T instead", value) } sv.SafetyRuleArn = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Status to be of type string, got %T instead", value) } sv.Status = types.Status(jtv) } case "TargetControls": if err := awsRestjson1_deserializeDocument__listOf__stringMin1Max256PatternAZaZ09(&sv.TargetControls, value); err != nil { return err } case "WaitPeriodMs": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.WaitPeriodMs = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InternalServerException if *v == nil { sv = &types.InternalServerException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRoutingControl(v **types.RoutingControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RoutingControl if *v == nil { sv = &types.RoutingControl{} } else { sv = *v } for key, value := range shape { switch key { case "ControlPanelArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin1Max256PatternAZaZ09 to be of type string, got %T instead", value) } sv.ControlPanelArn = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin1Max64PatternS to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RoutingControlArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin1Max256PatternAZaZ09 to be of type string, got %T instead", value) } sv.RoutingControlArn = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Status to be of type string, got %T instead", value) } sv.Status = types.Status(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRule(v **types.Rule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Rule if *v == nil { sv = &types.Rule{} } else { sv = *v } for key, value := range shape { switch key { case "ASSERTION": if err := awsRestjson1_deserializeDocumentAssertionRule(&sv.ASSERTION, value); err != nil { return err } case "GATING": if err := awsRestjson1_deserializeDocumentGatingRule(&sv.GATING, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuleConfig(v **types.RuleConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RuleConfig if *v == nil { sv = &types.RuleConfig{} } else { sv = *v } for key, value := range shape { switch key { case "Inverted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.Inverted = jtv } case "Threshold": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Threshold = int32(i64) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RuleType to be of type string, got %T instead", value) } sv.Type = types.RuleType(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 __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 { 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_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ValidationException if *v == nil { sv = &types.ValidationException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil }
4,707
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package route53recoverycontrolconfig provides the API client, operations, and // parameter types for AWS Route53 Recovery Control Config. // // Recovery Control Configuration API Reference for Amazon Route 53 Application // Recovery Controller package route53recoverycontrolconfig
9
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig 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/route53recoverycontrolconfig/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 = "route53-recovery-control-config" } 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 route53recoverycontrolconfig // goModuleVersion is the tagged release for this module const goModuleVersion = "1.11.12"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/route53recoverycontrolconfig/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_serializeOpCreateCluster struct { } func (*awsRestjson1_serializeOpCreateCluster) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateClusterInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/cluster") 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_serializeOpDocumentCreateClusterInput(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_serializeOpHttpBindingsCreateClusterInput(v *CreateClusterInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateClusterInput(v *CreateClusterInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("ClientToken") ok.String(*v.ClientToken) } if v.ClusterName != nil { ok := object.Key("ClusterName") ok.String(*v.ClusterName) } if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocument__mapOf__stringMin0Max256PatternS(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateControlPanel struct { } func (*awsRestjson1_serializeOpCreateControlPanel) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateControlPanel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateControlPanelInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/controlpanel") 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_serializeOpDocumentCreateControlPanelInput(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_serializeOpHttpBindingsCreateControlPanelInput(v *CreateControlPanelInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateControlPanelInput(v *CreateControlPanelInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("ClientToken") ok.String(*v.ClientToken) } if v.ClusterArn != nil { ok := object.Key("ClusterArn") ok.String(*v.ClusterArn) } if v.ControlPanelName != nil { ok := object.Key("ControlPanelName") ok.String(*v.ControlPanelName) } if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocument__mapOf__stringMin0Max256PatternS(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateRoutingControl struct { } func (*awsRestjson1_serializeOpCreateRoutingControl) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateRoutingControl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateRoutingControlInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/routingcontrol") 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_serializeOpDocumentCreateRoutingControlInput(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_serializeOpHttpBindingsCreateRoutingControlInput(v *CreateRoutingControlInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateRoutingControlInput(v *CreateRoutingControlInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("ClientToken") ok.String(*v.ClientToken) } if v.ClusterArn != nil { ok := object.Key("ClusterArn") ok.String(*v.ClusterArn) } if v.ControlPanelArn != nil { ok := object.Key("ControlPanelArn") ok.String(*v.ControlPanelArn) } if v.RoutingControlName != nil { ok := object.Key("RoutingControlName") ok.String(*v.RoutingControlName) } return nil } type awsRestjson1_serializeOpCreateSafetyRule struct { } func (*awsRestjson1_serializeOpCreateSafetyRule) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateSafetyRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateSafetyRuleInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/safetyrule") 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_serializeOpDocumentCreateSafetyRuleInput(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_serializeOpHttpBindingsCreateSafetyRuleInput(v *CreateSafetyRuleInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateSafetyRuleInput(v *CreateSafetyRuleInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssertionRule != nil { ok := object.Key("AssertionRule") if err := awsRestjson1_serializeDocumentNewAssertionRule(v.AssertionRule, ok); err != nil { return err } } if v.ClientToken != nil { ok := object.Key("ClientToken") ok.String(*v.ClientToken) } if v.GatingRule != nil { ok := object.Key("GatingRule") if err := awsRestjson1_serializeDocumentNewGatingRule(v.GatingRule, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocument__mapOf__stringMin0Max256PatternS(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteCluster struct { } func (*awsRestjson1_serializeOpDeleteCluster) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteClusterInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/cluster/{ClusterArn}") 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_serializeOpHttpBindingsDeleteClusterInput(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_serializeOpHttpBindingsDeleteClusterInput(v *DeleteClusterInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteControlPanel struct { } func (*awsRestjson1_serializeOpDeleteControlPanel) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteControlPanel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteControlPanelInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/controlpanel/{ControlPanelArn}") 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_serializeOpHttpBindingsDeleteControlPanelInput(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_serializeOpHttpBindingsDeleteControlPanelInput(v *DeleteControlPanelInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ControlPanelArn == nil || len(*v.ControlPanelArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ControlPanelArn must not be empty")} } if v.ControlPanelArn != nil { if err := encoder.SetURI("ControlPanelArn").String(*v.ControlPanelArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteRoutingControl struct { } func (*awsRestjson1_serializeOpDeleteRoutingControl) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteRoutingControl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteRoutingControlInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/routingcontrol/{RoutingControlArn}") 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_serializeOpHttpBindingsDeleteRoutingControlInput(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_serializeOpHttpBindingsDeleteRoutingControlInput(v *DeleteRoutingControlInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.RoutingControlArn == nil || len(*v.RoutingControlArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member RoutingControlArn must not be empty")} } if v.RoutingControlArn != nil { if err := encoder.SetURI("RoutingControlArn").String(*v.RoutingControlArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteSafetyRule struct { } func (*awsRestjson1_serializeOpDeleteSafetyRule) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteSafetyRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteSafetyRuleInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/safetyrule/{SafetyRuleArn}") 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_serializeOpHttpBindingsDeleteSafetyRuleInput(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_serializeOpHttpBindingsDeleteSafetyRuleInput(v *DeleteSafetyRuleInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.SafetyRuleArn == nil || len(*v.SafetyRuleArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member SafetyRuleArn must not be empty")} } if v.SafetyRuleArn != nil { if err := encoder.SetURI("SafetyRuleArn").String(*v.SafetyRuleArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeCluster struct { } func (*awsRestjson1_serializeOpDescribeCluster) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeClusterInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/cluster/{ClusterArn}") 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_serializeOpHttpBindingsDescribeClusterInput(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_serializeOpHttpBindingsDescribeClusterInput(v *DescribeClusterInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeControlPanel struct { } func (*awsRestjson1_serializeOpDescribeControlPanel) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeControlPanel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeControlPanelInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/controlpanel/{ControlPanelArn}") 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_serializeOpHttpBindingsDescribeControlPanelInput(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_serializeOpHttpBindingsDescribeControlPanelInput(v *DescribeControlPanelInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ControlPanelArn == nil || len(*v.ControlPanelArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ControlPanelArn must not be empty")} } if v.ControlPanelArn != nil { if err := encoder.SetURI("ControlPanelArn").String(*v.ControlPanelArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeRoutingControl struct { } func (*awsRestjson1_serializeOpDescribeRoutingControl) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeRoutingControl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeRoutingControlInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/routingcontrol/{RoutingControlArn}") 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_serializeOpHttpBindingsDescribeRoutingControlInput(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_serializeOpHttpBindingsDescribeRoutingControlInput(v *DescribeRoutingControlInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.RoutingControlArn == nil || len(*v.RoutingControlArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member RoutingControlArn must not be empty")} } if v.RoutingControlArn != nil { if err := encoder.SetURI("RoutingControlArn").String(*v.RoutingControlArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeSafetyRule struct { } func (*awsRestjson1_serializeOpDescribeSafetyRule) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeSafetyRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeSafetyRuleInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/safetyrule/{SafetyRuleArn}") 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_serializeOpHttpBindingsDescribeSafetyRuleInput(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_serializeOpHttpBindingsDescribeSafetyRuleInput(v *DescribeSafetyRuleInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.SafetyRuleArn == nil || len(*v.SafetyRuleArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member SafetyRuleArn must not be empty")} } if v.SafetyRuleArn != nil { if err := encoder.SetURI("SafetyRuleArn").String(*v.SafetyRuleArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpListAssociatedRoute53HealthChecks struct { } func (*awsRestjson1_serializeOpListAssociatedRoute53HealthChecks) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListAssociatedRoute53HealthChecks) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListAssociatedRoute53HealthChecksInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/routingcontrol/{RoutingControlArn}/associatedRoute53HealthChecks") 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_serializeOpHttpBindingsListAssociatedRoute53HealthChecksInput(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_serializeOpHttpBindingsListAssociatedRoute53HealthChecksInput(v *ListAssociatedRoute53HealthChecksInput, 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.RoutingControlArn == nil || len(*v.RoutingControlArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member RoutingControlArn must not be empty")} } if v.RoutingControlArn != nil { if err := encoder.SetURI("RoutingControlArn").String(*v.RoutingControlArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpListClusters struct { } func (*awsRestjson1_serializeOpListClusters) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListClusters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListClustersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/cluster") 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_serializeOpHttpBindingsListClustersInput(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_serializeOpHttpBindingsListClustersInput(v *ListClustersInput, 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_serializeOpListControlPanels struct { } func (*awsRestjson1_serializeOpListControlPanels) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListControlPanels) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListControlPanelsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/controlpanels") 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_serializeOpHttpBindingsListControlPanelsInput(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_serializeOpHttpBindingsListControlPanelsInput(v *ListControlPanelsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn != nil { encoder.SetQuery("ClusterArn").String(*v.ClusterArn) } if v.MaxResults != 0 { encoder.SetQuery("MaxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("NextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListRoutingControls struct { } func (*awsRestjson1_serializeOpListRoutingControls) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListRoutingControls) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListRoutingControlsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/controlpanel/{ControlPanelArn}/routingcontrols") 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_serializeOpHttpBindingsListRoutingControlsInput(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_serializeOpHttpBindingsListRoutingControlsInput(v *ListRoutingControlsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ControlPanelArn == nil || len(*v.ControlPanelArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ControlPanelArn must not be empty")} } if v.ControlPanelArn != nil { if err := encoder.SetURI("ControlPanelArn").String(*v.ControlPanelArn); err != nil { return err } } if v.MaxResults != 0 { encoder.SetQuery("MaxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("NextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListSafetyRules struct { } func (*awsRestjson1_serializeOpListSafetyRules) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListSafetyRules) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListSafetyRulesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/controlpanel/{ControlPanelArn}/safetyrules") 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_serializeOpHttpBindingsListSafetyRulesInput(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_serializeOpHttpBindingsListSafetyRulesInput(v *ListSafetyRulesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ControlPanelArn == nil || len(*v.ControlPanelArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ControlPanelArn must not be empty")} } if v.ControlPanelArn != nil { if err := encoder.SetURI("ControlPanelArn").String(*v.ControlPanelArn); err != nil { return err } } if v.MaxResults != 0 { encoder.SetQuery("MaxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("NextToken").String(*v.NextToken) } return nil } type awsRestjson1_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_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_serializeDocument__mapOf__stringMin0Max256PatternS(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_serializeOpUpdateControlPanel struct { } func (*awsRestjson1_serializeOpUpdateControlPanel) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateControlPanel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateControlPanelInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/controlpanel") 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_serializeOpDocumentUpdateControlPanelInput(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_serializeOpHttpBindingsUpdateControlPanelInput(v *UpdateControlPanelInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateControlPanelInput(v *UpdateControlPanelInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ControlPanelArn != nil { ok := object.Key("ControlPanelArn") ok.String(*v.ControlPanelArn) } if v.ControlPanelName != nil { ok := object.Key("ControlPanelName") ok.String(*v.ControlPanelName) } return nil } type awsRestjson1_serializeOpUpdateRoutingControl struct { } func (*awsRestjson1_serializeOpUpdateRoutingControl) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateRoutingControl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateRoutingControlInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/routingcontrol") 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_serializeOpDocumentUpdateRoutingControlInput(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_serializeOpHttpBindingsUpdateRoutingControlInput(v *UpdateRoutingControlInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateRoutingControlInput(v *UpdateRoutingControlInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.RoutingControlArn != nil { ok := object.Key("RoutingControlArn") ok.String(*v.RoutingControlArn) } if v.RoutingControlName != nil { ok := object.Key("RoutingControlName") ok.String(*v.RoutingControlName) } return nil } type awsRestjson1_serializeOpUpdateSafetyRule struct { } func (*awsRestjson1_serializeOpUpdateSafetyRule) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateSafetyRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateSafetyRuleInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/safetyrule") 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_serializeOpDocumentUpdateSafetyRuleInput(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_serializeOpHttpBindingsUpdateSafetyRuleInput(v *UpdateSafetyRuleInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateSafetyRuleInput(v *UpdateSafetyRuleInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssertionRuleUpdate != nil { ok := object.Key("AssertionRuleUpdate") if err := awsRestjson1_serializeDocumentAssertionRuleUpdate(v.AssertionRuleUpdate, ok); err != nil { return err } } if v.GatingRuleUpdate != nil { ok := object.Key("GatingRuleUpdate") if err := awsRestjson1_serializeDocumentGatingRuleUpdate(v.GatingRuleUpdate, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocument__listOf__stringMin1Max256PatternAZaZ09(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__mapOf__stringMin0Max256PatternS(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_serializeDocumentAssertionRuleUpdate(v *types.AssertionRuleUpdate, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.SafetyRuleArn != nil { ok := object.Key("SafetyRuleArn") ok.String(*v.SafetyRuleArn) } { ok := object.Key("WaitPeriodMs") ok.Integer(v.WaitPeriodMs) } return nil } func awsRestjson1_serializeDocumentGatingRuleUpdate(v *types.GatingRuleUpdate, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.SafetyRuleArn != nil { ok := object.Key("SafetyRuleArn") ok.String(*v.SafetyRuleArn) } { ok := object.Key("WaitPeriodMs") ok.Integer(v.WaitPeriodMs) } return nil } func awsRestjson1_serializeDocumentNewAssertionRule(v *types.NewAssertionRule, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssertedControls != nil { ok := object.Key("AssertedControls") if err := awsRestjson1_serializeDocument__listOf__stringMin1Max256PatternAZaZ09(v.AssertedControls, ok); err != nil { return err } } if v.ControlPanelArn != nil { ok := object.Key("ControlPanelArn") ok.String(*v.ControlPanelArn) } if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.RuleConfig != nil { ok := object.Key("RuleConfig") if err := awsRestjson1_serializeDocumentRuleConfig(v.RuleConfig, ok); err != nil { return err } } { ok := object.Key("WaitPeriodMs") ok.Integer(v.WaitPeriodMs) } return nil } func awsRestjson1_serializeDocumentNewGatingRule(v *types.NewGatingRule, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ControlPanelArn != nil { ok := object.Key("ControlPanelArn") ok.String(*v.ControlPanelArn) } if v.GatingControls != nil { ok := object.Key("GatingControls") if err := awsRestjson1_serializeDocument__listOf__stringMin1Max256PatternAZaZ09(v.GatingControls, ok); err != nil { return err } } if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.RuleConfig != nil { ok := object.Key("RuleConfig") if err := awsRestjson1_serializeDocumentRuleConfig(v.RuleConfig, ok); err != nil { return err } } if v.TargetControls != nil { ok := object.Key("TargetControls") if err := awsRestjson1_serializeDocument__listOf__stringMin1Max256PatternAZaZ09(v.TargetControls, ok); err != nil { return err } } { ok := object.Key("WaitPeriodMs") ok.Integer(v.WaitPeriodMs) } return nil } func awsRestjson1_serializeDocumentRuleConfig(v *types.RuleConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("Inverted") ok.Boolean(v.Inverted) } { ok := object.Key("Threshold") ok.Integer(v.Threshold) } if len(v.Type) > 0 { ok := object.Key("Type") ok.String(string(v.Type)) } return nil }
1,728
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoverycontrolconfig import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/route53recoverycontrolconfig/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpCreateCluster struct { } func (*validateOpCreateCluster) ID() string { return "OperationInputValidation" } func (m *validateOpCreateCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateClusterInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateClusterInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateControlPanel struct { } func (*validateOpCreateControlPanel) ID() string { return "OperationInputValidation" } func (m *validateOpCreateControlPanel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateControlPanelInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateControlPanelInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateRoutingControl struct { } func (*validateOpCreateRoutingControl) ID() string { return "OperationInputValidation" } func (m *validateOpCreateRoutingControl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateRoutingControlInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateRoutingControlInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateSafetyRule struct { } func (*validateOpCreateSafetyRule) ID() string { return "OperationInputValidation" } func (m *validateOpCreateSafetyRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateSafetyRuleInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateSafetyRuleInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteCluster struct { } func (*validateOpDeleteCluster) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteClusterInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteClusterInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteControlPanel struct { } func (*validateOpDeleteControlPanel) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteControlPanel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteControlPanelInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteControlPanelInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteRoutingControl struct { } func (*validateOpDeleteRoutingControl) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteRoutingControl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteRoutingControlInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteRoutingControlInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteSafetyRule struct { } func (*validateOpDeleteSafetyRule) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteSafetyRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteSafetyRuleInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteSafetyRuleInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeCluster struct { } func (*validateOpDescribeCluster) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeClusterInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeClusterInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeControlPanel struct { } func (*validateOpDescribeControlPanel) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeControlPanel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeControlPanelInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeControlPanelInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeRoutingControl struct { } func (*validateOpDescribeRoutingControl) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeRoutingControl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeRoutingControlInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeRoutingControlInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeSafetyRule struct { } func (*validateOpDescribeSafetyRule) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeSafetyRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeSafetyRuleInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeSafetyRuleInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListAssociatedRoute53HealthChecks struct { } func (*validateOpListAssociatedRoute53HealthChecks) ID() string { return "OperationInputValidation" } func (m *validateOpListAssociatedRoute53HealthChecks) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListAssociatedRoute53HealthChecksInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListAssociatedRoute53HealthChecksInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListRoutingControls struct { } func (*validateOpListRoutingControls) ID() string { return "OperationInputValidation" } func (m *validateOpListRoutingControls) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListRoutingControlsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListRoutingControlsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListSafetyRules struct { } func (*validateOpListSafetyRules) ID() string { return "OperationInputValidation" } func (m *validateOpListSafetyRules) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListSafetyRulesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListSafetyRulesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListTagsForResource struct { } func (*validateOpListTagsForResource) ID() string { return "OperationInputValidation" } func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListTagsForResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListTagsForResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpTagResource struct { } func (*validateOpTagResource) ID() string { return "OperationInputValidation" } func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUntagResource struct { } func (*validateOpUntagResource) ID() string { return "OperationInputValidation" } func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UntagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUntagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateControlPanel struct { } func (*validateOpUpdateControlPanel) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateControlPanel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateControlPanelInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateControlPanelInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateRoutingControl struct { } func (*validateOpUpdateRoutingControl) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateRoutingControl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateRoutingControlInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateRoutingControlInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateSafetyRule struct { } func (*validateOpUpdateSafetyRule) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateSafetyRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateSafetyRuleInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateSafetyRuleInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpCreateClusterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateCluster{}, middleware.After) } func addOpCreateControlPanelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateControlPanel{}, middleware.After) } func addOpCreateRoutingControlValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateRoutingControl{}, middleware.After) } func addOpCreateSafetyRuleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateSafetyRule{}, middleware.After) } func addOpDeleteClusterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteCluster{}, middleware.After) } func addOpDeleteControlPanelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteControlPanel{}, middleware.After) } func addOpDeleteRoutingControlValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteRoutingControl{}, middleware.After) } func addOpDeleteSafetyRuleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteSafetyRule{}, middleware.After) } func addOpDescribeClusterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeCluster{}, middleware.After) } func addOpDescribeControlPanelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeControlPanel{}, middleware.After) } func addOpDescribeRoutingControlValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeRoutingControl{}, middleware.After) } func addOpDescribeSafetyRuleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeSafetyRule{}, middleware.After) } func addOpListAssociatedRoute53HealthChecksValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListAssociatedRoute53HealthChecks{}, middleware.After) } func addOpListRoutingControlsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListRoutingControls{}, middleware.After) } func addOpListSafetyRulesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListSafetyRules{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } func addOpUpdateControlPanelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateControlPanel{}, middleware.After) } func addOpUpdateRoutingControlValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateRoutingControl{}, middleware.After) } func addOpUpdateSafetyRuleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateSafetyRule{}, middleware.After) } func validateAssertionRuleUpdate(v *types.AssertionRuleUpdate) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AssertionRuleUpdate"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.SafetyRuleArn == nil { invalidParams.Add(smithy.NewErrParamRequired("SafetyRuleArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateGatingRuleUpdate(v *types.GatingRuleUpdate) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GatingRuleUpdate"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.SafetyRuleArn == nil { invalidParams.Add(smithy.NewErrParamRequired("SafetyRuleArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateNewAssertionRule(v *types.NewAssertionRule) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "NewAssertionRule"} if v.AssertedControls == nil { invalidParams.Add(smithy.NewErrParamRequired("AssertedControls")) } if v.ControlPanelArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ControlPanelArn")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.RuleConfig == nil { invalidParams.Add(smithy.NewErrParamRequired("RuleConfig")) } else if v.RuleConfig != nil { if err := validateRuleConfig(v.RuleConfig); err != nil { invalidParams.AddNested("RuleConfig", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateNewGatingRule(v *types.NewGatingRule) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "NewGatingRule"} if v.ControlPanelArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ControlPanelArn")) } if v.GatingControls == nil { invalidParams.Add(smithy.NewErrParamRequired("GatingControls")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.RuleConfig == nil { invalidParams.Add(smithy.NewErrParamRequired("RuleConfig")) } else if v.RuleConfig != nil { if err := validateRuleConfig(v.RuleConfig); err != nil { invalidParams.AddNested("RuleConfig", err.(smithy.InvalidParamsError)) } } if v.TargetControls == nil { invalidParams.Add(smithy.NewErrParamRequired("TargetControls")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateRuleConfig(v *types.RuleConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RuleConfig"} if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateClusterInput(v *CreateClusterInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateClusterInput"} if v.ClusterName == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateControlPanelInput(v *CreateControlPanelInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateControlPanelInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if v.ControlPanelName == nil { invalidParams.Add(smithy.NewErrParamRequired("ControlPanelName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateRoutingControlInput(v *CreateRoutingControlInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateRoutingControlInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if v.RoutingControlName == nil { invalidParams.Add(smithy.NewErrParamRequired("RoutingControlName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateSafetyRuleInput(v *CreateSafetyRuleInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateSafetyRuleInput"} if v.AssertionRule != nil { if err := validateNewAssertionRule(v.AssertionRule); err != nil { invalidParams.AddNested("AssertionRule", err.(smithy.InvalidParamsError)) } } if v.GatingRule != nil { if err := validateNewGatingRule(v.GatingRule); err != nil { invalidParams.AddNested("GatingRule", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteClusterInput(v *DeleteClusterInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteClusterInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteControlPanelInput(v *DeleteControlPanelInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteControlPanelInput"} if v.ControlPanelArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ControlPanelArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteRoutingControlInput(v *DeleteRoutingControlInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteRoutingControlInput"} if v.RoutingControlArn == nil { invalidParams.Add(smithy.NewErrParamRequired("RoutingControlArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteSafetyRuleInput(v *DeleteSafetyRuleInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteSafetyRuleInput"} if v.SafetyRuleArn == nil { invalidParams.Add(smithy.NewErrParamRequired("SafetyRuleArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeClusterInput(v *DescribeClusterInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeClusterInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeControlPanelInput(v *DescribeControlPanelInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeControlPanelInput"} if v.ControlPanelArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ControlPanelArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeRoutingControlInput(v *DescribeRoutingControlInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeRoutingControlInput"} if v.RoutingControlArn == nil { invalidParams.Add(smithy.NewErrParamRequired("RoutingControlArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeSafetyRuleInput(v *DescribeSafetyRuleInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeSafetyRuleInput"} if v.SafetyRuleArn == nil { invalidParams.Add(smithy.NewErrParamRequired("SafetyRuleArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListAssociatedRoute53HealthChecksInput(v *ListAssociatedRoute53HealthChecksInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListAssociatedRoute53HealthChecksInput"} if v.RoutingControlArn == nil { invalidParams.Add(smithy.NewErrParamRequired("RoutingControlArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListRoutingControlsInput(v *ListRoutingControlsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListRoutingControlsInput"} if v.ControlPanelArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ControlPanelArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListSafetyRulesInput(v *ListSafetyRulesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListSafetyRulesInput"} if v.ControlPanelArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ControlPanelArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.Tags == nil { invalidParams.Add(smithy.NewErrParamRequired("Tags")) } 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 validateOpUpdateControlPanelInput(v *UpdateControlPanelInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateControlPanelInput"} if v.ControlPanelArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ControlPanelArn")) } if v.ControlPanelName == nil { invalidParams.Add(smithy.NewErrParamRequired("ControlPanelName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateRoutingControlInput(v *UpdateRoutingControlInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateRoutingControlInput"} if v.RoutingControlArn == nil { invalidParams.Add(smithy.NewErrParamRequired("RoutingControlArn")) } if v.RoutingControlName == nil { invalidParams.Add(smithy.NewErrParamRequired("RoutingControlName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateSafetyRuleInput(v *UpdateSafetyRuleInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateSafetyRuleInput"} if v.AssertionRuleUpdate != nil { if err := validateAssertionRuleUpdate(v.AssertionRuleUpdate); err != nil { invalidParams.AddNested("AssertionRuleUpdate", err.(smithy.InvalidParamsError)) } } if v.GatingRuleUpdate != nil { if err := validateGatingRuleUpdate(v.GatingRuleUpdate); err != nil { invalidParams.AddNested("GatingRuleUpdate", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
973
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 Route53 Recovery Control Config 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: "route53-recovery-control-config.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "route53-recovery-control-config-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "route53-recovery-control-config-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53-recovery-control-config.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "aws-global", }: endpoints.Endpoint{ Hostname: "route53-recovery-control-config.us-west-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-2", }, }, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "route53-recovery-control-config.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "route53-recovery-control-config-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "route53-recovery-control-config-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53-recovery-control-config.{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: "route53-recovery-control-config-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53-recovery-control-config.{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: "route53-recovery-control-config-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53-recovery-control-config.{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: "route53-recovery-control-config-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53-recovery-control-config.{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: "route53-recovery-control-config-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53-recovery-control-config.{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: "route53-recovery-control-config.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "route53-recovery-control-config-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "route53-recovery-control-config-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "route53-recovery-control-config.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, }, }
307
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 RuleType string // Enum values for RuleType const ( RuleTypeAtleast RuleType = "ATLEAST" RuleTypeAnd RuleType = "AND" RuleTypeOr RuleType = "OR" ) // Values returns all known values for RuleType. 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 (RuleType) Values() []RuleType { return []RuleType{ "ATLEAST", "AND", "OR", } } type Status string // Enum values for Status const ( StatusPending Status = "PENDING" StatusDeployed Status = "DEPLOYED" StatusPendingDeletion Status = "PENDING_DELETION" ) // Values returns all known values for Status. 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 (Status) Values() []Status { return []Status{ "PENDING", "DEPLOYED", "PENDING_DELETION", } }
44
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" ) // 403 response - You do not 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 } // 409 response - ConflictException. You might be using a predefined variable. 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 } // 500 response - InternalServiceError. Temporary service error. Retry the request. type InternalServerException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InternalServerException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalServerException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalServerException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalServerException" } return *e.ErrorCodeOverride } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // 404 response - MalformedQueryString. The query string contains a syntax error // or resource not found. type ResourceNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ResourceNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceNotFoundException" } return *e.ErrorCodeOverride } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // 402 response - You attempted to create more resources than the service allows // based on service quotas. 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 } // 429 response - LimitExceededException or TooManyRequestsException. 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 } // 400 response - Multiple causes. For example, you might have a malformed query // string and input parameter might be out of range, or you might have used // parameters together incorrectly. 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 }
195
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 assertion rule enforces that, when you change a routing control state, that // the criteria that you set in the rule configuration is met. Otherwise, the // change to the routing control is not accepted. For example, the criteria might // be that at least one routing control state is On after the transaction so that // traffic continues to flow to at least one cell for the application. This ensures // that you avoid a fail-open scenario. type AssertionRule struct { // The routing controls that are part of transactions that are evaluated to // determine if a request to change a routing control state is allowed. For // example, you might include three routing controls, one for each of three Amazon // Web Services Regions. // // This member is required. AssertedControls []string // The Amazon Resource Name (ARN) of the control panel. // // This member is required. ControlPanelArn *string // Name of the assertion rule. You can use any non-white space character in the // name. // // This member is required. Name *string // The criteria that you set for specific assertion routing controls // (AssertedControls) that designate how many routing control states must be ON as // the result of a transaction. For example, if you have three assertion routing // controls, you might specify ATLEAST 2 for your rule configuration. This means // that at least two assertion routing control states must be ON, so that at least // two Amazon Web Services Regions have traffic flowing to them. // // This member is required. RuleConfig *RuleConfig // The Amazon Resource Name (ARN) of the assertion rule. // // This member is required. SafetyRuleArn *string // The deployment status of an assertion rule. Status can be one of the following: // PENDING, DEPLOYED, PENDING_DELETION. // // This member is required. Status Status // An evaluation period, in milliseconds (ms), during which any request against // the target routing controls will fail. This helps prevent "flapping" of state. // The wait period is 5000 ms by default, but you can choose a custom value. // // This member is required. WaitPeriodMs int32 noSmithyDocumentSerde } // An update to an assertion rule. You can update the name or the evaluation // period (wait period). If you don't specify one of the items to update, the item // is unchanged. type AssertionRuleUpdate struct { // The name of the assertion rule. You can use any non-white space character in // the name. // // This member is required. Name *string // The Amazon Resource Name (ARN) of the assertion rule. // // This member is required. SafetyRuleArn *string // An evaluation period, in milliseconds (ms), during which any request against // the target routing controls will fail. This helps prevent "flapping" of state. // The wait period is 5000 ms by default, but you can choose a custom value. // // This member is required. WaitPeriodMs int32 noSmithyDocumentSerde } // A set of five redundant Regional endpoints against which you can execute API // calls to update or get the state of routing controls. You can host multiple // control panels and routing controls on one cluster. type Cluster struct { // The Amazon Resource Name (ARN) of the cluster. ClusterArn *string // Endpoints for a cluster. Specify one of these endpoints when you want to set or // retrieve a routing control state in the cluster. To get or update the routing // control state, see the Amazon Route 53 Application Recovery Controller Routing // Control Actions. ClusterEndpoints []ClusterEndpoint // The name of the cluster. Name *string // Deployment status of a resource. Status can be one of the following: PENDING, // DEPLOYED, PENDING_DELETION. Status Status noSmithyDocumentSerde } // A cluster endpoint. Specify an endpoint when you want to set or retrieve a // routing control state in the cluster. type ClusterEndpoint struct { // A cluster endpoint. Specify an endpoint and Amazon Web Services Region when you // want to set or retrieve a routing control state in the cluster. To get or update // the routing control state, see the Amazon Route 53 Application Recovery // Controller Routing Control Actions. Endpoint *string // The Amazon Web Services Region for a cluster endpoint. Region *string noSmithyDocumentSerde } // A control panel represents a group of routing controls that can be changed // together in a single transaction. type ControlPanel struct { // The Amazon Resource Name (ARN) of the cluster that includes the control panel. ClusterArn *string // The Amazon Resource Name (ARN) of the control panel. ControlPanelArn *string // A flag that Amazon Route 53 Application Recovery Controller sets to true to // designate the default control panel for a cluster. When you create a cluster, // Amazon Route 53 Application Recovery Controller creates a control panel, and // sets this flag for that control panel. If you create a control panel yourself, // this flag is set to false. DefaultControlPanel bool // The name of the control panel. You can use any non-white space character in the // name. Name *string // The number of routing controls in the control panel. RoutingControlCount int32 // The deployment status of control panel. Status can be one of the following: // PENDING, DEPLOYED, PENDING_DELETION. Status Status noSmithyDocumentSerde } // A gating rule verifies that a gating routing control or set of gating routing // controls, evaluates as true, based on a rule configuration that you specify, // which allows a set of routing control state changes to complete. For example, if // you specify one gating routing control and you set the Type in the rule // configuration to OR, that indicates that you must set the gating routing control // to On for the rule to evaluate as true; that is, for the gating control "switch" // to be "On". When you do that, then you can update the routing control states for // the target routing controls that you specify in the gating rule. type GatingRule struct { // The Amazon Resource Name (ARN) of the control panel. // // This member is required. ControlPanelArn *string // An array of gating routing control Amazon Resource Names (ARNs). For a simple // "on/off" switch, specify the ARN for one routing control. The gating routing // controls are evaluated by the rule configuration that you specify to determine // if the target routing control states can be changed. // // This member is required. GatingControls []string // The name for the gating rule. You can use any non-white space character in the // name. // // This member is required. Name *string // The criteria that you set for gating routing controls that designate how many // of the routing control states must be ON to allow you to update target routing // control states. // // This member is required. RuleConfig *RuleConfig // The Amazon Resource Name (ARN) of the gating rule. // // This member is required. SafetyRuleArn *string // The deployment status of a gating rule. Status can be one of the following: // PENDING, DEPLOYED, PENDING_DELETION. // // This member is required. Status Status // An array of target routing control Amazon Resource Names (ARNs) for which the // states can only be updated if the rule configuration that you specify evaluates // to true for the gating routing control. As a simple example, if you have a // single gating control, it acts as an overall "on/off" switch for a set of target // routing controls. You can use this to manually override automated failover, for // example. // // This member is required. TargetControls []string // An evaluation period, in milliseconds (ms), during which any request against // the target routing controls will fail. This helps prevent "flapping" of state. // The wait period is 5000 ms by default, but you can choose a custom value. // // This member is required. WaitPeriodMs int32 noSmithyDocumentSerde } // Update to a gating rule. You can update the name or the evaluation period (wait // period). If you don't specify one of the items to update, the item is unchanged. type GatingRuleUpdate struct { // The name for the gating rule. You can use any non-white space character in the // name. // // This member is required. Name *string // The Amazon Resource Name (ARN) of the gating rule. // // This member is required. SafetyRuleArn *string // An evaluation period, in milliseconds (ms), during which any request against // the target routing controls will fail. This helps prevent "flapping" of state. // The wait period is 5000 ms by default, but you can choose a custom value. // // This member is required. WaitPeriodMs int32 noSmithyDocumentSerde } // A new assertion rule for a control panel. type NewAssertionRule struct { // The routing controls that are part of transactions that are evaluated to // determine if a request to change a routing control state is allowed. For // example, you might include three routing controls, one for each of three Amazon // Web Services Regions. // // This member is required. AssertedControls []string // The Amazon Resource Name (ARN) for the control panel. // // This member is required. ControlPanelArn *string // The name of the assertion rule. You can use any non-white space character in // the name. // // This member is required. Name *string // The criteria that you set for specific assertion controls (routing controls) // that designate how many control states must be ON as the result of a // transaction. For example, if you have three assertion controls, you might // specify ATLEAST 2 for your rule configuration. This means that at least two // assertion controls must be ON, so that at least two Amazon Web Services Regions // have traffic flowing to them. // // This member is required. RuleConfig *RuleConfig // An evaluation period, in milliseconds (ms), during which any request against // the target routing controls will fail. This helps prevent "flapping" of state. // The wait period is 5000 ms by default, but you can choose a custom value. // // This member is required. WaitPeriodMs int32 noSmithyDocumentSerde } // A new gating rule for a control panel. type NewGatingRule struct { // The Amazon Resource Name (ARN) of the control panel. // // This member is required. ControlPanelArn *string // The gating controls for the new gating rule. That is, routing controls that are // evaluated by the rule configuration that you specify. // // This member is required. GatingControls []string // The name for the new gating rule. // // This member is required. Name *string // The criteria that you set for specific gating controls (routing controls) that // designate how many control states must be ON to allow you to change (set or // unset) the target control states. // // This member is required. RuleConfig *RuleConfig // Routing controls that can only be set or unset if the specified RuleConfig // evaluates to true for the specified GatingControls. For example, say you have // three gating controls, one for each of three Amazon Web Services Regions. Now // you specify ATLEAST 2 as your RuleConfig. With these settings, you can only // change (set or unset) the routing controls that you have specified as // TargetControls if that rule evaluates to true. In other words, your ability to // change the routing controls that you have specified as TargetControls is gated // by the rule that you set for the routing controls in GatingControls. // // This member is required. TargetControls []string // An evaluation period, in milliseconds (ms), during which any request against // the target routing controls will fail. This helps prevent "flapping" of state. // The wait period is 5000 ms by default, but you can choose a custom value. // // This member is required. WaitPeriodMs int32 noSmithyDocumentSerde } // A routing control has one of two states: ON and OFF. You can map the routing // control state to the state of an Amazon Route 53 health check, which can be used // to control traffic routing. type RoutingControl struct { // The Amazon Resource Name (ARN) of the control panel that includes the routing // control. ControlPanelArn *string // The name of the routing control. Name *string // The Amazon Resource Name (ARN) of the routing control. RoutingControlArn *string // The deployment status of a routing control. Status can be one of the following: // PENDING, DEPLOYED, PENDING_DELETION. Status Status noSmithyDocumentSerde } // A safety rule. A safety rule can be an assertion rule or a gating rule. type Rule struct { // An assertion rule enforces that, when a routing control state is changed, the // criteria set by the rule configuration is met. Otherwise, the change to the // routing control state is not accepted. For example, the criteria might be that // at least one routing control state is On after the transaction so that traffic // continues to flow to at least one cell for the application. This ensures that // you avoid a fail-open scenario. ASSERTION *AssertionRule // A gating rule verifies that a gating routing control or set of gating routing // controls, evaluates as true, based on a rule configuration that you specify, // which allows a set of routing control state changes to complete. For example, if // you specify one gating routing control and you set the Type in the rule // configuration to OR, that indicates that you must set the gating routing control // to On for the rule to evaluate as true; that is, for the gating control "switch" // to be "On". When you do that, then you can update the routing control states for // the target routing controls that you specify in the gating rule. GATING *GatingRule noSmithyDocumentSerde } // The rule configuration for an assertion rule. That is, the criteria that you // set for specific assertion controls (routing controls) that specify how many // control states must be ON after a transaction completes. type RuleConfig struct { // Logical negation of the rule. If the rule would usually evaluate true, it's // evaluated as false, and vice versa. // // This member is required. Inverted bool // The value of N, when you specify an ATLEAST rule type. That is, Threshold is // the number of controls that must be set when you specify an ATLEAST type. // // This member is required. Threshold int32 // A rule can be one of the following: ATLEAST, AND, or OR. // // This member is required. Type RuleType noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
418
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness 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 = "Route53 Recovery Readiness" const ServiceAPIVersion = "2019-12-02" // Client provides the API client to make operations call for AWS Route53 Recovery // Readiness. 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, "route53recoveryreadiness", 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 route53recoveryreadiness 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 route53recoveryreadiness import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a cell in an account. func (c *Client) CreateCell(ctx context.Context, params *CreateCellInput, optFns ...func(*Options)) (*CreateCellOutput, error) { if params == nil { params = &CreateCellInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateCell", params, optFns, c.addOperationCreateCellMiddlewares) if err != nil { return nil, err } out := result.(*CreateCellOutput) out.ResultMetadata = metadata return out, nil } type CreateCellInput struct { // The name of the cell to create. // // This member is required. CellName *string // A list of cell Amazon Resource Names (ARNs) contained within this cell, for use // in nested cells. For example, Availability Zones within specific Amazon Web // Services Regions. Cells []string // A collection of tags associated with a resource. Tags map[string]string noSmithyDocumentSerde } type CreateCellOutput struct { // The Amazon Resource Name (ARN) for the cell. CellArn *string // The name of the cell. CellName *string // A list of cell ARNs. Cells []string // The readiness scope for the cell, which can be a cell Amazon Resource Name // (ARN) or a recovery group ARN. This is a list but currently can have only one // element. ParentReadinessScopes []string // Tags on the resources. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateCellMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateCell{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateCell{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateCellValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCell(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateCell(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "CreateCell", } }
146
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a cross-account readiness authorization. This lets you authorize // another account to work with Route 53 Application Recovery Controller, for // example, to check the readiness status of resources in a separate account. func (c *Client) CreateCrossAccountAuthorization(ctx context.Context, params *CreateCrossAccountAuthorizationInput, optFns ...func(*Options)) (*CreateCrossAccountAuthorizationOutput, error) { if params == nil { params = &CreateCrossAccountAuthorizationInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateCrossAccountAuthorization", params, optFns, c.addOperationCreateCrossAccountAuthorizationMiddlewares) if err != nil { return nil, err } out := result.(*CreateCrossAccountAuthorizationOutput) out.ResultMetadata = metadata return out, nil } type CreateCrossAccountAuthorizationInput struct { // The cross-account authorization. // // This member is required. CrossAccountAuthorization *string noSmithyDocumentSerde } type CreateCrossAccountAuthorizationOutput struct { // The cross-account authorization. CrossAccountAuthorization *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateCrossAccountAuthorizationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateCrossAccountAuthorization{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateCrossAccountAuthorization{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateCrossAccountAuthorizationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCrossAccountAuthorization(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateCrossAccountAuthorization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "CreateCrossAccountAuthorization", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a readiness check in an account. A readiness check monitors a resource // set in your application, such as a set of Amazon Aurora instances, that // Application Recovery Controller is auditing recovery readiness for. The audits // run once every minute on every resource that's associated with a readiness // check. func (c *Client) CreateReadinessCheck(ctx context.Context, params *CreateReadinessCheckInput, optFns ...func(*Options)) (*CreateReadinessCheckOutput, error) { if params == nil { params = &CreateReadinessCheckInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateReadinessCheck", params, optFns, c.addOperationCreateReadinessCheckMiddlewares) if err != nil { return nil, err } out := result.(*CreateReadinessCheckOutput) out.ResultMetadata = metadata return out, nil } type CreateReadinessCheckInput struct { // The name of the readiness check to create. // // This member is required. ReadinessCheckName *string // The name of the resource set to check. // // This member is required. ResourceSetName *string // A collection of tags associated with a resource. Tags map[string]string noSmithyDocumentSerde } type CreateReadinessCheckOutput struct { // The Amazon Resource Name (ARN) associated with a readiness check. ReadinessCheckArn *string // Name of a readiness check. ReadinessCheckName *string // Name of the resource set to be checked. ResourceSet *string // A collection of tags associated with a resource. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateReadinessCheckMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateReadinessCheck{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateReadinessCheck{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateReadinessCheckValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateReadinessCheck(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateReadinessCheck(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "CreateReadinessCheck", } }
145
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a recovery group in an account. A recovery group corresponds to an // application and includes a list of the cells that make up the application. func (c *Client) CreateRecoveryGroup(ctx context.Context, params *CreateRecoveryGroupInput, optFns ...func(*Options)) (*CreateRecoveryGroupOutput, error) { if params == nil { params = &CreateRecoveryGroupInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateRecoveryGroup", params, optFns, c.addOperationCreateRecoveryGroupMiddlewares) if err != nil { return nil, err } out := result.(*CreateRecoveryGroupOutput) out.ResultMetadata = metadata return out, nil } type CreateRecoveryGroupInput struct { // The name of the recovery group to create. // // This member is required. RecoveryGroupName *string // A list of the cell Amazon Resource Names (ARNs) in the recovery group. Cells []string // A collection of tags associated with a resource. Tags map[string]string noSmithyDocumentSerde } type CreateRecoveryGroupOutput struct { // A list of a cell's Amazon Resource Names (ARNs). Cells []string // The Amazon Resource Name (ARN) for the recovery group. RecoveryGroupArn *string // The name of the recovery group. RecoveryGroupName *string // The tags associated with the recovery group. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateRecoveryGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateRecoveryGroup{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateRecoveryGroup{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateRecoveryGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRecoveryGroup(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateRecoveryGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "CreateRecoveryGroup", } }
140
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness 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/route53recoveryreadiness/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a resource set. A resource set is a set of resources of one type that // span multiple cells. You can associate a resource set with a readiness check to // monitor the resources for failover readiness. func (c *Client) CreateResourceSet(ctx context.Context, params *CreateResourceSetInput, optFns ...func(*Options)) (*CreateResourceSetOutput, error) { if params == nil { params = &CreateResourceSetInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateResourceSet", params, optFns, c.addOperationCreateResourceSetMiddlewares) if err != nil { return nil, err } out := result.(*CreateResourceSetOutput) out.ResultMetadata = metadata return out, nil } type CreateResourceSetInput struct { // The name of the resource set to create. // // This member is required. ResourceSetName *string // The resource type of the resources in the resource set. Enter one of the // following values for resource type: AWS::ApiGateway::Stage, // AWS::ApiGatewayV2::Stage, AWS::AutoScaling::AutoScalingGroup, // AWS::CloudWatch::Alarm, AWS::EC2::CustomerGateway, AWS::DynamoDB::Table, // AWS::EC2::Volume, AWS::ElasticLoadBalancing::LoadBalancer, // AWS::ElasticLoadBalancingV2::LoadBalancer, AWS::Lambda::Function, // AWS::MSK::Cluster, AWS::RDS::DBCluster, AWS::Route53::HealthCheck, // AWS::SQS::Queue, AWS::SNS::Topic, AWS::SNS::Subscription, AWS::EC2::VPC, // AWS::EC2::VPNConnection, AWS::EC2::VPNGateway, // AWS::Route53RecoveryReadiness::DNSTargetResource // // This member is required. ResourceSetType *string // A list of resource objects in the resource set. // // This member is required. Resources []types.Resource // A tag to associate with the parameters for a resource set. Tags map[string]string noSmithyDocumentSerde } type CreateResourceSetOutput struct { // The Amazon Resource Name (ARN) for the resource set. ResourceSetArn *string // The name of the resource set. ResourceSetName *string // The resource type of the resources in the resource set. Enter one of the // following values for resource type: AWS::ApiGateway::Stage, // AWS::ApiGatewayV2::Stage, AWS::AutoScaling::AutoScalingGroup, // AWS::CloudWatch::Alarm, AWS::EC2::CustomerGateway, AWS::DynamoDB::Table, // AWS::EC2::Volume, AWS::ElasticLoadBalancing::LoadBalancer, // AWS::ElasticLoadBalancingV2::LoadBalancer, AWS::Lambda::Function, // AWS::MSK::Cluster, AWS::RDS::DBCluster, AWS::Route53::HealthCheck, // AWS::SQS::Queue, AWS::SNS::Topic, AWS::SNS::Subscription, AWS::EC2::VPC, // AWS::EC2::VPNConnection, AWS::EC2::VPNGateway, // AWS::Route53RecoveryReadiness::DNSTargetResource ResourceSetType *string // A list of resource objects. Resources []types.Resource // A collection of tags associated with a resource. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateResourceSetMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateResourceSet{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateResourceSet{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateResourceSetValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateResourceSet(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateResourceSet(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "CreateResourceSet", } }
170
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Delete a cell. When successful, the response code is 204, with no response body. func (c *Client) DeleteCell(ctx context.Context, params *DeleteCellInput, optFns ...func(*Options)) (*DeleteCellOutput, error) { if params == nil { params = &DeleteCellInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteCell", params, optFns, c.addOperationDeleteCellMiddlewares) if err != nil { return nil, err } out := result.(*DeleteCellOutput) out.ResultMetadata = metadata return out, nil } type DeleteCellInput struct { // The name of the cell. // // This member is required. CellName *string noSmithyDocumentSerde } type DeleteCellOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteCellMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteCell{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteCell{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteCellValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCell(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteCell(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "DeleteCell", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness 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 cross account readiness authorization. func (c *Client) DeleteCrossAccountAuthorization(ctx context.Context, params *DeleteCrossAccountAuthorizationInput, optFns ...func(*Options)) (*DeleteCrossAccountAuthorizationOutput, error) { if params == nil { params = &DeleteCrossAccountAuthorizationInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteCrossAccountAuthorization", params, optFns, c.addOperationDeleteCrossAccountAuthorizationMiddlewares) if err != nil { return nil, err } out := result.(*DeleteCrossAccountAuthorizationOutput) out.ResultMetadata = metadata return out, nil } type DeleteCrossAccountAuthorizationInput struct { // The cross-account authorization. // // This member is required. CrossAccountAuthorization *string noSmithyDocumentSerde } type DeleteCrossAccountAuthorizationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteCrossAccountAuthorizationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteCrossAccountAuthorization{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteCrossAccountAuthorization{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteCrossAccountAuthorizationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCrossAccountAuthorization(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteCrossAccountAuthorization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "DeleteCrossAccountAuthorization", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness 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 readiness check. func (c *Client) DeleteReadinessCheck(ctx context.Context, params *DeleteReadinessCheckInput, optFns ...func(*Options)) (*DeleteReadinessCheckOutput, error) { if params == nil { params = &DeleteReadinessCheckInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteReadinessCheck", params, optFns, c.addOperationDeleteReadinessCheckMiddlewares) if err != nil { return nil, err } out := result.(*DeleteReadinessCheckOutput) out.ResultMetadata = metadata return out, nil } type DeleteReadinessCheckInput struct { // Name of a readiness check. // // This member is required. ReadinessCheckName *string noSmithyDocumentSerde } type DeleteReadinessCheckOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteReadinessCheckMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteReadinessCheck{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteReadinessCheck{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteReadinessCheckValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteReadinessCheck(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteReadinessCheck(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "DeleteReadinessCheck", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness 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 recovery group. func (c *Client) DeleteRecoveryGroup(ctx context.Context, params *DeleteRecoveryGroupInput, optFns ...func(*Options)) (*DeleteRecoveryGroupOutput, error) { if params == nil { params = &DeleteRecoveryGroupInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteRecoveryGroup", params, optFns, c.addOperationDeleteRecoveryGroupMiddlewares) if err != nil { return nil, err } out := result.(*DeleteRecoveryGroupOutput) out.ResultMetadata = metadata return out, nil } type DeleteRecoveryGroupInput struct { // The name of a recovery group. // // This member is required. RecoveryGroupName *string noSmithyDocumentSerde } type DeleteRecoveryGroupOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteRecoveryGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteRecoveryGroup{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteRecoveryGroup{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteRecoveryGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRecoveryGroup(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteRecoveryGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "DeleteRecoveryGroup", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness 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 set. func (c *Client) DeleteResourceSet(ctx context.Context, params *DeleteResourceSetInput, optFns ...func(*Options)) (*DeleteResourceSetOutput, error) { if params == nil { params = &DeleteResourceSetInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteResourceSet", params, optFns, c.addOperationDeleteResourceSetMiddlewares) if err != nil { return nil, err } out := result.(*DeleteResourceSetOutput) out.ResultMetadata = metadata return out, nil } type DeleteResourceSetInput struct { // Name of a resource set. // // This member is required. ResourceSetName *string noSmithyDocumentSerde } type DeleteResourceSetOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteResourceSetMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteResourceSet{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteResourceSet{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteResourceSetValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResourceSet(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteResourceSet(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "DeleteResourceSet", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness 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/route53recoveryreadiness/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Gets recommendations about architecture designs for improving resiliency for an // application, based on a recovery group. func (c *Client) GetArchitectureRecommendations(ctx context.Context, params *GetArchitectureRecommendationsInput, optFns ...func(*Options)) (*GetArchitectureRecommendationsOutput, error) { if params == nil { params = &GetArchitectureRecommendationsInput{} } result, metadata, err := c.invokeOperation(ctx, "GetArchitectureRecommendations", params, optFns, c.addOperationGetArchitectureRecommendationsMiddlewares) if err != nil { return nil, err } out := result.(*GetArchitectureRecommendationsOutput) out.ResultMetadata = metadata return out, nil } type GetArchitectureRecommendationsInput struct { // The name of a recovery group. // // This member is required. RecoveryGroupName *string // The number of objects that you want to return with this call. MaxResults int32 // The token that identifies which batch of results you want to see. NextToken *string noSmithyDocumentSerde } type GetArchitectureRecommendationsOutput struct { // The time that a recovery group was last assessed for recommendations, in UTC // ISO-8601 format. LastAuditTimestamp *time.Time // The token that identifies which batch of results you want to see. NextToken *string // A list of the recommendations for the customer's application. Recommendations []types.Recommendation // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetArchitectureRecommendationsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetArchitectureRecommendations{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetArchitectureRecommendations{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetArchitectureRecommendationsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetArchitectureRecommendations(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetArchitectureRecommendations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "GetArchitectureRecommendations", } }
140
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness 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 information about a cell including cell name, cell Amazon Resource Name // (ARN), ARNs of nested cells for this cell, and a list of those cell ARNs with // their associated recovery group ARNs. func (c *Client) GetCell(ctx context.Context, params *GetCellInput, optFns ...func(*Options)) (*GetCellOutput, error) { if params == nil { params = &GetCellInput{} } result, metadata, err := c.invokeOperation(ctx, "GetCell", params, optFns, c.addOperationGetCellMiddlewares) if err != nil { return nil, err } out := result.(*GetCellOutput) out.ResultMetadata = metadata return out, nil } type GetCellInput struct { // The name of the cell. // // This member is required. CellName *string noSmithyDocumentSerde } type GetCellOutput struct { // The Amazon Resource Name (ARN) for the cell. CellArn *string // The name of the cell. CellName *string // A list of cell ARNs. Cells []string // The readiness scope for the cell, which can be a cell Amazon Resource Name // (ARN) or a recovery group ARN. This is a list but currently can have only one // element. ParentReadinessScopes []string // Tags on the resources. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetCellMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetCell{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetCell{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetCellValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCell(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetCell(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "GetCell", } }
140
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness 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/route53recoveryreadiness/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets readiness for a cell. Aggregates the readiness of all the resources that // are associated with the cell into a single value. func (c *Client) GetCellReadinessSummary(ctx context.Context, params *GetCellReadinessSummaryInput, optFns ...func(*Options)) (*GetCellReadinessSummaryOutput, error) { if params == nil { params = &GetCellReadinessSummaryInput{} } result, metadata, err := c.invokeOperation(ctx, "GetCellReadinessSummary", params, optFns, c.addOperationGetCellReadinessSummaryMiddlewares) if err != nil { return nil, err } out := result.(*GetCellReadinessSummaryOutput) out.ResultMetadata = metadata return out, nil } type GetCellReadinessSummaryInput struct { // The name of the cell. // // This member is required. CellName *string // The number of objects that you want to return with this call. MaxResults int32 // The token that identifies which batch of results you want to see. NextToken *string noSmithyDocumentSerde } type GetCellReadinessSummaryOutput struct { // The token that identifies which batch of results you want to see. NextToken *string // The readiness at a cell level. Readiness types.Readiness // Summaries for the readiness checks that make up the cell. ReadinessChecks []types.ReadinessCheckSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetCellReadinessSummaryMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetCellReadinessSummary{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetCellReadinessSummary{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetCellReadinessSummaryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCellReadinessSummary(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // GetCellReadinessSummaryAPIClient is a client that implements the // GetCellReadinessSummary operation. type GetCellReadinessSummaryAPIClient interface { GetCellReadinessSummary(context.Context, *GetCellReadinessSummaryInput, ...func(*Options)) (*GetCellReadinessSummaryOutput, error) } var _ GetCellReadinessSummaryAPIClient = (*Client)(nil) // GetCellReadinessSummaryPaginatorOptions is the paginator options for // GetCellReadinessSummary type GetCellReadinessSummaryPaginatorOptions struct { // The number of objects that you want to return with this call. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // GetCellReadinessSummaryPaginator is a paginator for GetCellReadinessSummary type GetCellReadinessSummaryPaginator struct { options GetCellReadinessSummaryPaginatorOptions client GetCellReadinessSummaryAPIClient params *GetCellReadinessSummaryInput nextToken *string firstPage bool } // NewGetCellReadinessSummaryPaginator returns a new // GetCellReadinessSummaryPaginator func NewGetCellReadinessSummaryPaginator(client GetCellReadinessSummaryAPIClient, params *GetCellReadinessSummaryInput, optFns ...func(*GetCellReadinessSummaryPaginatorOptions)) *GetCellReadinessSummaryPaginator { if params == nil { params = &GetCellReadinessSummaryInput{} } options := GetCellReadinessSummaryPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &GetCellReadinessSummaryPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *GetCellReadinessSummaryPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next GetCellReadinessSummary page. func (p *GetCellReadinessSummaryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCellReadinessSummaryOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.GetCellReadinessSummary(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_opGetCellReadinessSummary(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "GetCellReadinessSummary", } }
227
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness 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 details about a readiness check. func (c *Client) GetReadinessCheck(ctx context.Context, params *GetReadinessCheckInput, optFns ...func(*Options)) (*GetReadinessCheckOutput, error) { if params == nil { params = &GetReadinessCheckInput{} } result, metadata, err := c.invokeOperation(ctx, "GetReadinessCheck", params, optFns, c.addOperationGetReadinessCheckMiddlewares) if err != nil { return nil, err } out := result.(*GetReadinessCheckOutput) out.ResultMetadata = metadata return out, nil } type GetReadinessCheckInput struct { // Name of a readiness check. // // This member is required. ReadinessCheckName *string noSmithyDocumentSerde } type GetReadinessCheckOutput struct { // The Amazon Resource Name (ARN) associated with a readiness check. ReadinessCheckArn *string // Name of a readiness check. ReadinessCheckName *string // Name of the resource set to be checked. ResourceSet *string // A collection of tags associated with a resource. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetReadinessCheckMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetReadinessCheck{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetReadinessCheck{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetReadinessCheckValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetReadinessCheck(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetReadinessCheck(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "GetReadinessCheck", } }
133
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness 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/route53recoveryreadiness/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets individual readiness status for a readiness check. To see the overall // readiness status for a recovery group, that considers the readiness status for // all the readiness checks in the recovery group, use // GetRecoveryGroupReadinessSummary. func (c *Client) GetReadinessCheckResourceStatus(ctx context.Context, params *GetReadinessCheckResourceStatusInput, optFns ...func(*Options)) (*GetReadinessCheckResourceStatusOutput, error) { if params == nil { params = &GetReadinessCheckResourceStatusInput{} } result, metadata, err := c.invokeOperation(ctx, "GetReadinessCheckResourceStatus", params, optFns, c.addOperationGetReadinessCheckResourceStatusMiddlewares) if err != nil { return nil, err } out := result.(*GetReadinessCheckResourceStatusOutput) out.ResultMetadata = metadata return out, nil } type GetReadinessCheckResourceStatusInput struct { // Name of a readiness check. // // This member is required. ReadinessCheckName *string // The resource identifier, which is the Amazon Resource Name (ARN) or the // identifier generated for the resource by Application Recovery Controller (for // example, for a DNS target resource). // // This member is required. ResourceIdentifier *string // The number of objects that you want to return with this call. MaxResults int32 // The token that identifies which batch of results you want to see. NextToken *string noSmithyDocumentSerde } type GetReadinessCheckResourceStatusOutput struct { // The token that identifies which batch of results you want to see. NextToken *string // The readiness at a rule level. Readiness types.Readiness // Details of the rule's results. Rules []types.RuleResult // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetReadinessCheckResourceStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetReadinessCheckResourceStatus{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetReadinessCheckResourceStatus{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetReadinessCheckResourceStatusValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetReadinessCheckResourceStatus(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // GetReadinessCheckResourceStatusAPIClient is a client that implements the // GetReadinessCheckResourceStatus operation. type GetReadinessCheckResourceStatusAPIClient interface { GetReadinessCheckResourceStatus(context.Context, *GetReadinessCheckResourceStatusInput, ...func(*Options)) (*GetReadinessCheckResourceStatusOutput, error) } var _ GetReadinessCheckResourceStatusAPIClient = (*Client)(nil) // GetReadinessCheckResourceStatusPaginatorOptions is the paginator options for // GetReadinessCheckResourceStatus type GetReadinessCheckResourceStatusPaginatorOptions struct { // The number of objects that you want to return with this call. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // GetReadinessCheckResourceStatusPaginator is a paginator for // GetReadinessCheckResourceStatus type GetReadinessCheckResourceStatusPaginator struct { options GetReadinessCheckResourceStatusPaginatorOptions client GetReadinessCheckResourceStatusAPIClient params *GetReadinessCheckResourceStatusInput nextToken *string firstPage bool } // NewGetReadinessCheckResourceStatusPaginator returns a new // GetReadinessCheckResourceStatusPaginator func NewGetReadinessCheckResourceStatusPaginator(client GetReadinessCheckResourceStatusAPIClient, params *GetReadinessCheckResourceStatusInput, optFns ...func(*GetReadinessCheckResourceStatusPaginatorOptions)) *GetReadinessCheckResourceStatusPaginator { if params == nil { params = &GetReadinessCheckResourceStatusInput{} } options := GetReadinessCheckResourceStatusPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &GetReadinessCheckResourceStatusPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *GetReadinessCheckResourceStatusPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next GetReadinessCheckResourceStatus page. func (p *GetReadinessCheckResourceStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetReadinessCheckResourceStatusOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.GetReadinessCheckResourceStatus(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_opGetReadinessCheckResourceStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "GetReadinessCheckResourceStatus", } }
237
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness 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/route53recoveryreadiness/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets the readiness status for an individual readiness check. To see the overall // readiness status for a recovery group, that considers the readiness status for // all the readiness checks in a recovery group, use // GetRecoveryGroupReadinessSummary. func (c *Client) GetReadinessCheckStatus(ctx context.Context, params *GetReadinessCheckStatusInput, optFns ...func(*Options)) (*GetReadinessCheckStatusOutput, error) { if params == nil { params = &GetReadinessCheckStatusInput{} } result, metadata, err := c.invokeOperation(ctx, "GetReadinessCheckStatus", params, optFns, c.addOperationGetReadinessCheckStatusMiddlewares) if err != nil { return nil, err } out := result.(*GetReadinessCheckStatusOutput) out.ResultMetadata = metadata return out, nil } type GetReadinessCheckStatusInput struct { // Name of a readiness check. // // This member is required. ReadinessCheckName *string // The number of objects that you want to return with this call. MaxResults int32 // The token that identifies which batch of results you want to see. NextToken *string noSmithyDocumentSerde } type GetReadinessCheckStatusOutput struct { // Top level messages for readiness check status Messages []types.Message // The token that identifies which batch of results you want to see. NextToken *string // The readiness at rule level. Readiness types.Readiness // Summary of the readiness of resources. Resources []types.ResourceResult // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetReadinessCheckStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetReadinessCheckStatus{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetReadinessCheckStatus{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetReadinessCheckStatusValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetReadinessCheckStatus(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // GetReadinessCheckStatusAPIClient is a client that implements the // GetReadinessCheckStatus operation. type GetReadinessCheckStatusAPIClient interface { GetReadinessCheckStatus(context.Context, *GetReadinessCheckStatusInput, ...func(*Options)) (*GetReadinessCheckStatusOutput, error) } var _ GetReadinessCheckStatusAPIClient = (*Client)(nil) // GetReadinessCheckStatusPaginatorOptions is the paginator options for // GetReadinessCheckStatus type GetReadinessCheckStatusPaginatorOptions struct { // The number of objects that you want to return with this call. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // GetReadinessCheckStatusPaginator is a paginator for GetReadinessCheckStatus type GetReadinessCheckStatusPaginator struct { options GetReadinessCheckStatusPaginatorOptions client GetReadinessCheckStatusAPIClient params *GetReadinessCheckStatusInput nextToken *string firstPage bool } // NewGetReadinessCheckStatusPaginator returns a new // GetReadinessCheckStatusPaginator func NewGetReadinessCheckStatusPaginator(client GetReadinessCheckStatusAPIClient, params *GetReadinessCheckStatusInput, optFns ...func(*GetReadinessCheckStatusPaginatorOptions)) *GetReadinessCheckStatusPaginator { if params == nil { params = &GetReadinessCheckStatusInput{} } options := GetReadinessCheckStatusPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &GetReadinessCheckStatusPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *GetReadinessCheckStatusPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next GetReadinessCheckStatus page. func (p *GetReadinessCheckStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetReadinessCheckStatusOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.GetReadinessCheckStatus(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_opGetReadinessCheckStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "GetReadinessCheckStatus", } }
232
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness 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 details about a recovery group, including a list of the cells that are // included in it. func (c *Client) GetRecoveryGroup(ctx context.Context, params *GetRecoveryGroupInput, optFns ...func(*Options)) (*GetRecoveryGroupOutput, error) { if params == nil { params = &GetRecoveryGroupInput{} } result, metadata, err := c.invokeOperation(ctx, "GetRecoveryGroup", params, optFns, c.addOperationGetRecoveryGroupMiddlewares) if err != nil { return nil, err } out := result.(*GetRecoveryGroupOutput) out.ResultMetadata = metadata return out, nil } type GetRecoveryGroupInput struct { // The name of a recovery group. // // This member is required. RecoveryGroupName *string noSmithyDocumentSerde } type GetRecoveryGroupOutput struct { // A list of a cell's Amazon Resource Names (ARNs). Cells []string // The Amazon Resource Name (ARN) for the recovery group. RecoveryGroupArn *string // The name of the recovery group. RecoveryGroupName *string // The tags associated with the recovery group. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetRecoveryGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetRecoveryGroup{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetRecoveryGroup{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetRecoveryGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRecoveryGroup(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetRecoveryGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "GetRecoveryGroup", } }
134
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness 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/route53recoveryreadiness/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Displays a summary of information about a recovery group's readiness status. // Includes the readiness checks for resources in the recovery group and the // readiness status of each one. func (c *Client) GetRecoveryGroupReadinessSummary(ctx context.Context, params *GetRecoveryGroupReadinessSummaryInput, optFns ...func(*Options)) (*GetRecoveryGroupReadinessSummaryOutput, error) { if params == nil { params = &GetRecoveryGroupReadinessSummaryInput{} } result, metadata, err := c.invokeOperation(ctx, "GetRecoveryGroupReadinessSummary", params, optFns, c.addOperationGetRecoveryGroupReadinessSummaryMiddlewares) if err != nil { return nil, err } out := result.(*GetRecoveryGroupReadinessSummaryOutput) out.ResultMetadata = metadata return out, nil } type GetRecoveryGroupReadinessSummaryInput struct { // The name of a recovery group. // // This member is required. RecoveryGroupName *string // The number of objects that you want to return with this call. MaxResults int32 // The token that identifies which batch of results you want to see. NextToken *string noSmithyDocumentSerde } type GetRecoveryGroupReadinessSummaryOutput struct { // The token that identifies which batch of results you want to see. NextToken *string // The readiness status at a recovery group level. Readiness types.Readiness // Summaries of the readiness checks for the recovery group. ReadinessChecks []types.ReadinessCheckSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetRecoveryGroupReadinessSummaryMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetRecoveryGroupReadinessSummary{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetRecoveryGroupReadinessSummary{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetRecoveryGroupReadinessSummaryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRecoveryGroupReadinessSummary(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // GetRecoveryGroupReadinessSummaryAPIClient is a client that implements the // GetRecoveryGroupReadinessSummary operation. type GetRecoveryGroupReadinessSummaryAPIClient interface { GetRecoveryGroupReadinessSummary(context.Context, *GetRecoveryGroupReadinessSummaryInput, ...func(*Options)) (*GetRecoveryGroupReadinessSummaryOutput, error) } var _ GetRecoveryGroupReadinessSummaryAPIClient = (*Client)(nil) // GetRecoveryGroupReadinessSummaryPaginatorOptions is the paginator options for // GetRecoveryGroupReadinessSummary type GetRecoveryGroupReadinessSummaryPaginatorOptions struct { // The number of objects that you want to return with this call. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // GetRecoveryGroupReadinessSummaryPaginator is a paginator for // GetRecoveryGroupReadinessSummary type GetRecoveryGroupReadinessSummaryPaginator struct { options GetRecoveryGroupReadinessSummaryPaginatorOptions client GetRecoveryGroupReadinessSummaryAPIClient params *GetRecoveryGroupReadinessSummaryInput nextToken *string firstPage bool } // NewGetRecoveryGroupReadinessSummaryPaginator returns a new // GetRecoveryGroupReadinessSummaryPaginator func NewGetRecoveryGroupReadinessSummaryPaginator(client GetRecoveryGroupReadinessSummaryAPIClient, params *GetRecoveryGroupReadinessSummaryInput, optFns ...func(*GetRecoveryGroupReadinessSummaryPaginatorOptions)) *GetRecoveryGroupReadinessSummaryPaginator { if params == nil { params = &GetRecoveryGroupReadinessSummaryInput{} } options := GetRecoveryGroupReadinessSummaryPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &GetRecoveryGroupReadinessSummaryPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *GetRecoveryGroupReadinessSummaryPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next GetRecoveryGroupReadinessSummary page. func (p *GetRecoveryGroupReadinessSummaryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetRecoveryGroupReadinessSummaryOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.GetRecoveryGroupReadinessSummary(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_opGetRecoveryGroupReadinessSummary(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "GetRecoveryGroupReadinessSummary", } }
229
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness 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/route53recoveryreadiness/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Displays the details about a resource set, including a list of the resources in // the set. func (c *Client) GetResourceSet(ctx context.Context, params *GetResourceSetInput, optFns ...func(*Options)) (*GetResourceSetOutput, error) { if params == nil { params = &GetResourceSetInput{} } result, metadata, err := c.invokeOperation(ctx, "GetResourceSet", params, optFns, c.addOperationGetResourceSetMiddlewares) if err != nil { return nil, err } out := result.(*GetResourceSetOutput) out.ResultMetadata = metadata return out, nil } type GetResourceSetInput struct { // Name of a resource set. // // This member is required. ResourceSetName *string noSmithyDocumentSerde } type GetResourceSetOutput struct { // The Amazon Resource Name (ARN) for the resource set. ResourceSetArn *string // The name of the resource set. ResourceSetName *string // The resource type of the resources in the resource set. Enter one of the // following values for resource type: AWS::ApiGateway::Stage, // AWS::ApiGatewayV2::Stage, AWS::AutoScaling::AutoScalingGroup, // AWS::CloudWatch::Alarm, AWS::EC2::CustomerGateway, AWS::DynamoDB::Table, // AWS::EC2::Volume, AWS::ElasticLoadBalancing::LoadBalancer, // AWS::ElasticLoadBalancingV2::LoadBalancer, AWS::Lambda::Function, // AWS::MSK::Cluster, AWS::RDS::DBCluster, AWS::Route53::HealthCheck, // AWS::SQS::Queue, AWS::SNS::Topic, AWS::SNS::Subscription, AWS::EC2::VPC, // AWS::EC2::VPNConnection, AWS::EC2::VPNGateway, // AWS::Route53RecoveryReadiness::DNSTargetResource ResourceSetType *string // A list of resource objects. Resources []types.Resource // A collection of tags associated with a resource. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetResourceSetMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetResourceSet{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetResourceSet{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetResourceSetValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetResourceSet(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetResourceSet(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "GetResourceSet", } }
147
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness 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/route53recoveryreadiness/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the cells for an account. func (c *Client) ListCells(ctx context.Context, params *ListCellsInput, optFns ...func(*Options)) (*ListCellsOutput, error) { if params == nil { params = &ListCellsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListCells", params, optFns, c.addOperationListCellsMiddlewares) if err != nil { return nil, err } out := result.(*ListCellsOutput) out.ResultMetadata = metadata return out, nil } type ListCellsInput struct { // The number of objects that you want to return with this call. MaxResults int32 // The token that identifies which batch of results you want to see. NextToken *string noSmithyDocumentSerde } type ListCellsOutput struct { // A list of cells. Cells []types.CellOutput // The token that identifies which batch of results you want to see. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListCellsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListCells{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCells{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListCells(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListCellsAPIClient is a client that implements the ListCells operation. type ListCellsAPIClient interface { ListCells(context.Context, *ListCellsInput, ...func(*Options)) (*ListCellsOutput, error) } var _ ListCellsAPIClient = (*Client)(nil) // ListCellsPaginatorOptions is the paginator options for ListCells type ListCellsPaginatorOptions struct { // The number of objects that you want to return with this call. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListCellsPaginator is a paginator for ListCells type ListCellsPaginator struct { options ListCellsPaginatorOptions client ListCellsAPIClient params *ListCellsInput nextToken *string firstPage bool } // NewListCellsPaginator returns a new ListCellsPaginator func NewListCellsPaginator(client ListCellsAPIClient, params *ListCellsInput, optFns ...func(*ListCellsPaginatorOptions)) *ListCellsPaginator { if params == nil { params = &ListCellsInput{} } options := ListCellsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListCellsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListCellsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListCells page. func (p *ListCellsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCellsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListCells(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_opListCells(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "ListCells", } }
212
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package route53recoveryreadiness import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the cross-account readiness authorizations that are in place for an // account. func (c *Client) ListCrossAccountAuthorizations(ctx context.Context, params *ListCrossAccountAuthorizationsInput, optFns ...func(*Options)) (*ListCrossAccountAuthorizationsOutput, error) { if params == nil { params = &ListCrossAccountAuthorizationsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListCrossAccountAuthorizations", params, optFns, c.addOperationListCrossAccountAuthorizationsMiddlewares) if err != nil { return nil, err } out := result.(*ListCrossAccountAuthorizationsOutput) out.ResultMetadata = metadata return out, nil } type ListCrossAccountAuthorizationsInput struct { // The number of objects that you want to return with this call. MaxResults int32 // The token that identifies which batch of results you want to see. NextToken *string noSmithyDocumentSerde } type ListCrossAccountAuthorizationsOutput struct { // A list of cross-account authorizations. CrossAccountAuthorizations []string // The token that identifies which batch of results you want to see. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListCrossAccountAuthorizationsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListCrossAccountAuthorizations{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCrossAccountAuthorizations{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListCrossAccountAuthorizations(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListCrossAccountAuthorizationsAPIClient is a client that implements the // ListCrossAccountAuthorizations operation. type ListCrossAccountAuthorizationsAPIClient interface { ListCrossAccountAuthorizations(context.Context, *ListCrossAccountAuthorizationsInput, ...func(*Options)) (*ListCrossAccountAuthorizationsOutput, error) } var _ ListCrossAccountAuthorizationsAPIClient = (*Client)(nil) // ListCrossAccountAuthorizationsPaginatorOptions is the paginator options for // ListCrossAccountAuthorizations type ListCrossAccountAuthorizationsPaginatorOptions struct { // The number of objects that you want to return with this call. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListCrossAccountAuthorizationsPaginator is a paginator for // ListCrossAccountAuthorizations type ListCrossAccountAuthorizationsPaginator struct { options ListCrossAccountAuthorizationsPaginatorOptions client ListCrossAccountAuthorizationsAPIClient params *ListCrossAccountAuthorizationsInput nextToken *string firstPage bool } // NewListCrossAccountAuthorizationsPaginator returns a new // ListCrossAccountAuthorizationsPaginator func NewListCrossAccountAuthorizationsPaginator(client ListCrossAccountAuthorizationsAPIClient, params *ListCrossAccountAuthorizationsInput, optFns ...func(*ListCrossAccountAuthorizationsPaginatorOptions)) *ListCrossAccountAuthorizationsPaginator { if params == nil { params = &ListCrossAccountAuthorizationsInput{} } options := ListCrossAccountAuthorizationsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListCrossAccountAuthorizationsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListCrossAccountAuthorizationsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListCrossAccountAuthorizations page. func (p *ListCrossAccountAuthorizationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCrossAccountAuthorizationsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListCrossAccountAuthorizations(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_opListCrossAccountAuthorizations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "route53-recovery-readiness", OperationName: "ListCrossAccountAuthorizations", } }
216