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 organizations 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 organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Sends a response to the originator of a handshake agreeing to the action // proposed by the handshake request. You can only call this operation by the // following principals when they also have the relevant IAM permissions: // - Invitation to join or Approve all features request handshakes: only a // principal from the member account. The user who calls the API for an invitation // to join must have the organizations:AcceptHandshake permission. If you enabled // all features in the organization, the user must also have the // iam:CreateServiceLinkedRole permission so that Organizations can create the // required service-linked role named AWSServiceRoleForOrganizations . For more // information, see Organizations and Service-Linked Roles (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integration_services.html#orgs_integration_service-linked-roles) // in the Organizations User Guide. // - Enable all features final confirmation handshake: only a principal from the // management account. For more information about invitations, see Inviting an // Amazon Web Services account to join your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_invites.html) // in the Organizations User Guide. For more information about requests to enable // all features in the organization, see Enabling all features in your // organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) // in the Organizations User Guide. // // After you accept a handshake, it continues to appear in the results of relevant // APIs for only 30 days. After that, it's deleted. func (c *Client) AcceptHandshake(ctx context.Context, params *AcceptHandshakeInput, optFns ...func(*Options)) (*AcceptHandshakeOutput, error) { if params == nil { params = &AcceptHandshakeInput{} } result, metadata, err := c.invokeOperation(ctx, "AcceptHandshake", params, optFns, c.addOperationAcceptHandshakeMiddlewares) if err != nil { return nil, err } out := result.(*AcceptHandshakeOutput) out.ResultMetadata = metadata return out, nil } type AcceptHandshakeInput struct { // The unique identifier (ID) of the handshake that you want to accept. The regex // pattern (http://wikipedia.org/wiki/regex) for handshake ID string requires "h-" // followed by from 8 to 32 lowercase letters or digits. // // This member is required. HandshakeId *string noSmithyDocumentSerde } type AcceptHandshakeOutput struct { // A structure that contains details about the accepted handshake. Handshake *types.Handshake // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAcceptHandshakeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpAcceptHandshake{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAcceptHandshake{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpAcceptHandshakeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAcceptHandshake(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opAcceptHandshake(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "AcceptHandshake", } }
147
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Attaches a policy to a root, an organizational unit (OU), or an individual // account. How the policy affects accounts depends on the type of policy. Refer to // the Organizations User Guide for information about each policy type: // - AISERVICES_OPT_OUT_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html) // - BACKUP_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html) // - SERVICE_CONTROL_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html) // - TAG_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) // // This operation can be called only from the organization's management account. func (c *Client) AttachPolicy(ctx context.Context, params *AttachPolicyInput, optFns ...func(*Options)) (*AttachPolicyOutput, error) { if params == nil { params = &AttachPolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "AttachPolicy", params, optFns, c.addOperationAttachPolicyMiddlewares) if err != nil { return nil, err } out := result.(*AttachPolicyOutput) out.ResultMetadata = metadata return out, nil } type AttachPolicyInput struct { // The unique identifier (ID) of the policy that you want to attach to the target. // You can get the ID for the policy by calling the ListPolicies operation. The // regex pattern (http://wikipedia.org/wiki/regex) for a policy ID string requires // "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, or the // underscore character (_). // // This member is required. PolicyId *string // The unique identifier (ID) of the root, OU, or account that you want to attach // the policy to. You can get the ID by calling the ListRoots , // ListOrganizationalUnitsForParent , or ListAccounts operations. The regex pattern (http://wikipedia.org/wiki/regex) // for a target ID string requires one of the following: // - Root - A string that begins with "r-" followed by from 4 to 32 lowercase // letters or digits. // - Account - A string that consists of exactly 12 digits. // - Organizational unit (OU) - A string that begins with "ou-" followed by from // 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This // string is followed by a second "-" dash and from 8 to 32 additional lowercase // letters or digits. // // This member is required. TargetId *string noSmithyDocumentSerde } type AttachPolicyOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAttachPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpAttachPolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAttachPolicy{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpAttachPolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAttachPolicy(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opAttachPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "AttachPolicy", } }
147
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Cancels a handshake. Canceling a handshake sets the handshake state to CANCELED // . This operation can be called only from the account that originated the // handshake. The recipient of the handshake can't cancel it, but can use // DeclineHandshake instead. After a handshake is canceled, the recipient can no // longer respond to that handshake. After you cancel a handshake, it continues to // appear in the results of relevant APIs for only 30 days. After that, it's // deleted. func (c *Client) CancelHandshake(ctx context.Context, params *CancelHandshakeInput, optFns ...func(*Options)) (*CancelHandshakeOutput, error) { if params == nil { params = &CancelHandshakeInput{} } result, metadata, err := c.invokeOperation(ctx, "CancelHandshake", params, optFns, c.addOperationCancelHandshakeMiddlewares) if err != nil { return nil, err } out := result.(*CancelHandshakeOutput) out.ResultMetadata = metadata return out, nil } type CancelHandshakeInput struct { // The unique identifier (ID) of the handshake that you want to cancel. You can // get the ID from the ListHandshakesForOrganization operation. The regex pattern (http://wikipedia.org/wiki/regex) // for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters // or digits. // // This member is required. HandshakeId *string noSmithyDocumentSerde } type CancelHandshakeOutput struct { // A structure that contains details about the handshake that you canceled. Handshake *types.Handshake // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCancelHandshakeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCancelHandshake{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCancelHandshake{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCancelHandshakeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelHandshake(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCancelHandshake(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "CancelHandshake", } }
134
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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" ) // Closes an Amazon Web Services member account within an organization. You can // close an account when all features are enabled (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) // . You can't close the management account with this API. This is an asynchronous // request that Amazon Web Services performs in the background. Because // CloseAccount operates asynchronously, it can return a successful completion // message even though account closure might still be in progress. You need to wait // a few minutes before the account is fully closed. To check the status of the // request, do one of the following: // // - Use the AccountId that you sent in the CloseAccount request to provide as a // parameter to the DescribeAccount operation. While the close account request is // in progress, Account status will indicate PENDING_CLOSURE. When the close // account request completes, the status will change to SUSPENDED. // // - Check the CloudTrail log for the CloseAccountResult event that gets // published after the account closes successfully. For information on using // CloudTrail with Organizations, see Logging and monitoring in Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_security_incident-response.html#orgs_cloudtrail-integration) // in the Organizations User Guide. // // - You can close only 10% of member accounts, between 10 and 200, within a // rolling 30 day period. This quota is not bound by a calendar month, but starts // when you close an account. After you reach this limit, you can close additional // accounts in the Billing console. For more information, see Closing an account (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/close-account.html) // in the Amazon Web Services Billing and Cost Management User Guide. // // - To reinstate a closed account, contact Amazon Web Services Support within // the 90-day grace period while the account is in SUSPENDED status. // // - If the Amazon Web Services account you attempt to close is linked to an // Amazon Web Services GovCloud (US) account, the CloseAccount request will close // both accounts. To learn important pre-closure details, see Closing an Amazon // Web Services GovCloud (US) account (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/Closing-govcloud-account.html) // in the Amazon Web Services GovCloud User Guide. // // For more information about closing accounts, see Closing an Amazon Web Services // account (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_close.html) // in the Organizations User Guide. func (c *Client) CloseAccount(ctx context.Context, params *CloseAccountInput, optFns ...func(*Options)) (*CloseAccountOutput, error) { if params == nil { params = &CloseAccountInput{} } result, metadata, err := c.invokeOperation(ctx, "CloseAccount", params, optFns, c.addOperationCloseAccountMiddlewares) if err != nil { return nil, err } out := result.(*CloseAccountOutput) out.ResultMetadata = metadata return out, nil } type CloseAccountInput struct { // Retrieves the Amazon Web Services account Id for the current CloseAccount API // request. // // This member is required. AccountId *string noSmithyDocumentSerde } type CloseAccountOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCloseAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCloseAccount{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCloseAccount{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCloseAccountValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCloseAccount(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCloseAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "CloseAccount", } }
157
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates an Amazon Web Services account that is automatically a member of the // organization whose credentials made the request. This is an asynchronous request // that Amazon Web Services performs in the background. Because CreateAccount // operates asynchronously, it can return a successful completion message even // though account initialization might still be in progress. You might need to wait // a few minutes before you can successfully access the account. To check the // status of the request, do one of the following: // - Use the Id value of the CreateAccountStatus response element from this // operation to provide as a parameter to the DescribeCreateAccountStatus // operation. // - Check the CloudTrail log for the CreateAccountResult event. For information // on using CloudTrail with Organizations, see Logging and monitoring in // Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_security_incident-response.html#orgs_cloudtrail-integration) // in the Organizations User Guide. // // The user who calls the API to create an account must have the // organizations:CreateAccount permission. If you enabled all features in the // organization, Organizations creates the required service-linked role named // AWSServiceRoleForOrganizations . For more information, see Organizations and // Service-Linked Roles (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_integrate_services-using_slrs) // in the Organizations User Guide. If the request includes tags, then the // requester must have the organizations:TagResource permission. Organizations // preconfigures the new member account with a role (named // OrganizationAccountAccessRole by default) that grants users in the management // account administrator permissions in the new member account. Principals in the // management account can assume the role. Organizations clones the company name // and address information for the new account from the organization's management // account. This operation can be called only from the organization's management // account. For more information about creating accounts, see Creating an Amazon // Web Services account in Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_create.html) // in the Organizations User Guide. // - When you create an account in an organization using the Organizations // console, API, or CLI commands, the information required for the account to // operate as a standalone account, such as a payment method and signing the end // user license agreement (EULA) is not automatically collected. If you must remove // an account from your organization later, you can do so only after you provide // the missing information. Follow the steps at To leave an organization as a // member account (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) // in the Organizations User Guide. // - If you get an exception that indicates that you exceeded your account // limits for the organization, contact Amazon Web Services Support (https://console.aws.amazon.com/support/home#/) // . // - If you get an exception that indicates that the operation failed because // your organization is still initializing, wait one hour and then try again. If // the error persists, contact Amazon Web Services Support (https://console.aws.amazon.com/support/home#/) // . // - Using CreateAccount to create multiple temporary accounts isn't recommended. // You can only close an account from the Billing and Cost Management console, and // you must be signed in as the root user. For information on the requirements and // process for closing an account, see Closing an Amazon Web Services account (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_close.html) // in the Organizations User Guide. // // When you create a member account with this operation, you can choose whether to // create the account with the IAM User and Role Access to Billing Information // switch enabled. If you enable it, IAM users and roles that have appropriate // permissions can view billing information for the account. If you disable it, // only the account root user can access billing information. For information about // how to disable this switch for an account, see Granting Access to Your Billing // Information and Tools (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html) // . func (c *Client) CreateAccount(ctx context.Context, params *CreateAccountInput, optFns ...func(*Options)) (*CreateAccountOutput, error) { if params == nil { params = &CreateAccountInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateAccount", params, optFns, c.addOperationCreateAccountMiddlewares) if err != nil { return nil, err } out := result.(*CreateAccountOutput) out.ResultMetadata = metadata return out, nil } type CreateAccountInput struct { // The friendly name of the member account. // // This member is required. AccountName *string // The email address of the owner to assign to the new member account. This email // address must not already be associated with another Amazon Web Services account. // You must use a valid email address to complete account creation. The rules for a // valid email address: // - The address must be a minimum of 6 and a maximum of 64 characters long. // - All characters must be 7-bit ASCII characters. // - There must be one and only one @ symbol, which separates the local name // from the domain name. // - The local name can't contain any of the following characters: whitespace, " // ' ( ) < > [ ] : ; , \ | % & // - The local name can't begin with a dot (.) // - The domain name can consist of only the characters [a-z],[A-Z],[0-9], // hyphen (-), or dot (.) // - The domain name can't begin or end with a hyphen (-) or dot (.) // - The domain name must contain at least one dot // You can't access the root user of the account or remove an account that was // created with an invalid email address. // // This member is required. Email *string // If set to ALLOW , the new account enables IAM users to access account billing // information if they have the required permissions. If set to DENY , only the // root user of the new account can access account billing information. For more // information, see Activating Access to the Billing and Cost Management Console (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate) // in the Amazon Web Services Billing and Cost Management User Guide. If you don't // specify this parameter, the value defaults to ALLOW , and IAM users and roles // with the required permissions can access billing information for the new // account. IamUserAccessToBilling types.IAMUserAccessToBilling // The name of an IAM role that Organizations automatically preconfigures in the // new member account. This role trusts the management account, allowing users in // the management account to assume the role, as permitted by the management // account administrator. The role has administrator permissions in the new member // account. If you don't specify this parameter, the role name defaults to // OrganizationAccountAccessRole . For more information about how to use this role // to access the member account, see the following links: // - Accessing and Administering the Member Accounts in Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html#orgs_manage_accounts_create-cross-account-role) // in the Organizations User Guide // - Steps 2 and 3 in Tutorial: Delegate Access Across Amazon Web Services // accounts Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html) // in the IAM User Guide // The regex pattern (http://wikipedia.org/wiki/regex) that is used to validate // this parameter. The pattern can include uppercase letters, lowercase letters, // digits with no spaces, and any of the following characters: =,.@- RoleName *string // A list of tags that you want to attach to the newly created account. For each // tag in the list, you must specify both a tag key and a value. You can set the // value to an empty string, but you can't set it to null . For more information // about tagging, see Tagging Organizations resources (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html) // in the Organizations User Guide. If any one of the tags is not valid or if you // exceed the maximum allowed number of tags for an account, then the entire // request fails and the account is not created. Tags []types.Tag noSmithyDocumentSerde } type CreateAccountOutput struct { // A structure that contains details about the request to create an account. This // response structure might not be fully populated when you first receive it // because account creation is an asynchronous process. You can pass the returned // CreateAccountStatus ID as a parameter to DescribeCreateAccountStatus to get // status about the progress of the request at later times. You can also check the // CloudTrail log for the CreateAccountResult event. For more information, see // Monitoring the Activity in Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_monitoring.html) // in the Organizations User Guide. CreateAccountStatus *types.CreateAccountStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAccount{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAccount{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateAccountValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAccount(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "CreateAccount", } }
248
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // This action is available if all of the following are true: // - You're authorized to create accounts in the Amazon Web Services GovCloud // (US) Region. For more information on the Amazon Web Services GovCloud (US) // Region, see the Amazon Web Services GovCloud User Guide. (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/welcome.html) // - You already have an account in the Amazon Web Services GovCloud (US) Region // that is paired with a management account of an organization in the commercial // Region. // - You call this action from the management account of your organization in // the commercial Region. // - You have the organizations:CreateGovCloudAccount permission. // // Organizations automatically creates the required service-linked role named // AWSServiceRoleForOrganizations . For more information, see Organizations and // Service-Linked Roles (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_integrate_services-using_slrs) // in the Organizations User Guide. Amazon Web Services automatically enables // CloudTrail for Amazon Web Services GovCloud (US) accounts, but you should also // do the following: // - Verify that CloudTrail is enabled to store logs. // - Create an Amazon S3 bucket for CloudTrail log storage. For more // information, see Verifying CloudTrail Is Enabled (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/verifying-cloudtrail.html) // in the Amazon Web Services GovCloud User Guide. // // If the request includes tags, then the requester must have the // organizations:TagResource permission. The tags are attached to the commercial // account associated with the GovCloud account, rather than the GovCloud account // itself. To add tags to the GovCloud account, call the TagResource operation in // the GovCloud Region after the new GovCloud account exists. You call this action // from the management account of your organization in the commercial Region to // create a standalone Amazon Web Services account in the Amazon Web Services // GovCloud (US) Region. After the account is created, the management account of an // organization in the Amazon Web Services GovCloud (US) Region can invite it to // that organization. For more information on inviting standalone accounts in the // Amazon Web Services GovCloud (US) to join an organization, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) // in the Amazon Web Services GovCloud User Guide. Calling CreateGovCloudAccount // is an asynchronous request that Amazon Web Services performs in the background. // Because CreateGovCloudAccount operates asynchronously, it can return a // successful completion message even though account initialization might still be // in progress. You might need to wait a few minutes before you can successfully // access the account. To check the status of the request, do one of the following: // // - Use the OperationId response element from this operation to provide as a // parameter to the DescribeCreateAccountStatus operation. // - Check the CloudTrail log for the CreateAccountResult event. For information // on using CloudTrail with Organizations, see Monitoring the Activity in Your // Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_monitoring.html) // in the Organizations User Guide. // // When you call the CreateGovCloudAccount action, you create two accounts: a // standalone account in the Amazon Web Services GovCloud (US) Region and an // associated account in the commercial Region for billing and support purposes. // The account in the commercial Region is automatically a member of the // organization whose credentials made the request. Both accounts are associated // with the same email address. A role is created in the new account in the // commercial Region that allows the management account in the organization in the // commercial Region to assume it. An Amazon Web Services GovCloud (US) account is // then created and associated with the commercial account that you just created. A // role is also created in the new Amazon Web Services GovCloud (US) account that // can be assumed by the Amazon Web Services GovCloud (US) account that is // associated with the management account of the commercial organization. For more // information and to view a diagram that explains how account access works, see // Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) // in the Amazon Web Services GovCloud User Guide. For more information about // creating accounts, see Creating an Amazon Web Services account in Your // Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_create.html) // in the Organizations User Guide. // - When you create an account in an organization using the Organizations // console, API, or CLI commands, the information required for the account to // operate as a standalone account is not automatically collected. This includes a // payment method and signing the end user license agreement (EULA). If you must // remove an account from your organization later, you can do so only after you // provide the missing information. Follow the steps at To leave an organization // as a member account (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) // in the Organizations User Guide. // - If you get an exception that indicates that you exceeded your account // limits for the organization, contact Amazon Web Services Support (https://console.aws.amazon.com/support/home#/) // . // - If you get an exception that indicates that the operation failed because // your organization is still initializing, wait one hour and then try again. If // the error persists, contact Amazon Web Services Support (https://console.aws.amazon.com/support/home#/) // . // - Using CreateGovCloudAccount to create multiple temporary accounts isn't // recommended. You can only close an account from the Amazon Web Services Billing // and Cost Management console, and you must be signed in as the root user. For // information on the requirements and process for closing an account, see // Closing an Amazon Web Services account (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_close.html) // in the Organizations User Guide. // // When you create a member account with this operation, you can choose whether to // create the account with the IAM User and Role Access to Billing Information // switch enabled. If you enable it, IAM users and roles that have appropriate // permissions can view billing information for the account. If you disable it, // only the account root user can access billing information. For information about // how to disable this switch for an account, see Granting Access to Your Billing // Information and Tools (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html) // . func (c *Client) CreateGovCloudAccount(ctx context.Context, params *CreateGovCloudAccountInput, optFns ...func(*Options)) (*CreateGovCloudAccountOutput, error) { if params == nil { params = &CreateGovCloudAccountInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateGovCloudAccount", params, optFns, c.addOperationCreateGovCloudAccountMiddlewares) if err != nil { return nil, err } out := result.(*CreateGovCloudAccountOutput) out.ResultMetadata = metadata return out, nil } type CreateGovCloudAccountInput struct { // The friendly name of the member account. The account name can consist of only // the characters [a-z],[A-Z],[0-9], hyphen (-), or dot (.) You can't separate // characters with a dash (–). // // This member is required. AccountName *string // Specifies the email address of the owner to assign to the new member account in // the commercial Region. This email address must not already be associated with // another Amazon Web Services account. You must use a valid email address to // complete account creation. The rules for a valid email address: // - The address must be a minimum of 6 and a maximum of 64 characters long. // - All characters must be 7-bit ASCII characters. // - There must be one and only one @ symbol, which separates the local name // from the domain name. // - The local name can't contain any of the following characters: whitespace, " // ' ( ) < > [ ] : ; , \ | % & // - The local name can't begin with a dot (.) // - The domain name can consist of only the characters [a-z],[A-Z],[0-9], // hyphen (-), or dot (.) // - The domain name can't begin or end with a hyphen (-) or dot (.) // - The domain name must contain at least one dot // You can't access the root user of the account or remove an account that was // created with an invalid email address. Like all request parameters for // CreateGovCloudAccount , the request for the email address for the Amazon Web // Services GovCloud (US) account originates from the commercial Region, not from // the Amazon Web Services GovCloud (US) Region. // // This member is required. Email *string // If set to ALLOW , the new linked account in the commercial Region enables IAM // users to access account billing information if they have the required // permissions. If set to DENY , only the root user of the new account can access // account billing information. For more information, see Activating Access to the // Billing and Cost Management Console (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate) // in the Amazon Web Services Billing and Cost Management User Guide. If you don't // specify this parameter, the value defaults to ALLOW , and IAM users and roles // with the required permissions can access billing information for the new // account. IamUserAccessToBilling types.IAMUserAccessToBilling // (Optional) The name of an IAM role that Organizations automatically // preconfigures in the new member accounts in both the Amazon Web Services // GovCloud (US) Region and in the commercial Region. This role trusts the // management account, allowing users in the management account to assume the role, // as permitted by the management account administrator. The role has administrator // permissions in the new member account. If you don't specify this parameter, the // role name defaults to OrganizationAccountAccessRole . For more information about // how to use this role to access the member account, see Accessing and // Administering the Member Accounts in Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html#orgs_manage_accounts_create-cross-account-role) // in the Organizations User Guide and steps 2 and 3 in Tutorial: Delegate Access // Across Amazon Web Services accounts Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html) // in the IAM User Guide. The regex pattern (http://wikipedia.org/wiki/regex) that // is used to validate this parameter. The pattern can include uppercase letters, // lowercase letters, digits with no spaces, and any of the following characters: // =,.@- RoleName *string // A list of tags that you want to attach to the newly created account. These tags // are attached to the commercial account associated with the GovCloud account, and // not to the GovCloud account itself. To add tags to the actual GovCloud account, // call the TagResource operation in the GovCloud region after the new GovCloud // account exists. For each tag in the list, you must specify both a tag key and a // value. You can set the value to an empty string, but you can't set it to null . // For more information about tagging, see Tagging Organizations resources (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html) // in the Organizations User Guide. If any one of the tags is not valid or if you // exceed the maximum allowed number of tags for an account, then the entire // request fails and the account is not created. Tags []types.Tag noSmithyDocumentSerde } type CreateGovCloudAccountOutput struct { // Contains the status about a CreateAccount or CreateGovCloudAccount request to // create an Amazon Web Services account or an Amazon Web Services GovCloud (US) // account in an organization. CreateAccountStatus *types.CreateAccountStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateGovCloudAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateGovCloudAccount{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateGovCloudAccount{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateGovCloudAccountValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateGovCloudAccount(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateGovCloudAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "CreateGovCloudAccount", } }
287
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates an Amazon Web Services organization. The account whose user is calling // the CreateOrganization operation automatically becomes the management account (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#account) // of the new organization. This operation must be called using credentials from // the account that is to become the new organization's management account. The // principal must also have the relevant IAM permissions. By default (or if you set // the FeatureSet parameter to ALL ), the new organization is created with all // features enabled and service control policies automatically enabled in the root. // If you instead choose to create the organization supporting only the // consolidated billing features by setting the FeatureSet parameter to // CONSOLIDATED_BILLING" , no policy types are enabled by default, and you can't // use organization policies func (c *Client) CreateOrganization(ctx context.Context, params *CreateOrganizationInput, optFns ...func(*Options)) (*CreateOrganizationOutput, error) { if params == nil { params = &CreateOrganizationInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateOrganization", params, optFns, c.addOperationCreateOrganizationMiddlewares) if err != nil { return nil, err } out := result.(*CreateOrganizationOutput) out.ResultMetadata = metadata return out, nil } type CreateOrganizationInput struct { // Specifies the feature set supported by the new organization. Each feature set // supports different levels of functionality. // - CONSOLIDATED_BILLING : All member accounts have their bills consolidated to // and paid by the management account. For more information, see Consolidated // billing (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#feature-set-cb-only) // in the Organizations User Guide. The consolidated billing feature subset isn't // available for organizations in the Amazon Web Services GovCloud (US) Region. // - ALL : In addition to all the features supported by the consolidated billing // feature set, the management account can also apply any policy type to any member // account in the organization. For more information, see All features (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#feature-set-all) // in the Organizations User Guide. FeatureSet types.OrganizationFeatureSet noSmithyDocumentSerde } type CreateOrganizationOutput struct { // A structure that contains details about the newly created organization. Organization *types.Organization // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateOrganization{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateOrganization{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opCreateOrganization(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateOrganization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "CreateOrganization", } }
140
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates an organizational unit (OU) within a root or parent OU. An OU is a // container for accounts that enables you to organize your accounts to apply // policies according to your business requirements. The number of levels deep that // you can nest OUs is dependent upon the policy types enabled for that root. For // service control policies, the limit is five. For more information about OUs, see // Managing Organizational Units (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_ous.html) // in the Organizations User Guide. If the request includes tags, then the // requester must have the organizations:TagResource permission. This operation // can be called only from the organization's management account. func (c *Client) CreateOrganizationalUnit(ctx context.Context, params *CreateOrganizationalUnitInput, optFns ...func(*Options)) (*CreateOrganizationalUnitOutput, error) { if params == nil { params = &CreateOrganizationalUnitInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateOrganizationalUnit", params, optFns, c.addOperationCreateOrganizationalUnitMiddlewares) if err != nil { return nil, err } out := result.(*CreateOrganizationalUnitOutput) out.ResultMetadata = metadata return out, nil } type CreateOrganizationalUnitInput struct { // The friendly name to assign to the new OU. // // This member is required. Name *string // The unique identifier (ID) of the parent root or OU that you want to create the // new OU in. The regex pattern (http://wikipedia.org/wiki/regex) for a parent ID // string requires one of the following: // - Root - A string that begins with "r-" followed by from 4 to 32 lowercase // letters or digits. // - Organizational unit (OU) - A string that begins with "ou-" followed by from // 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This // string is followed by a second "-" dash and from 8 to 32 additional lowercase // letters or digits. // // This member is required. ParentId *string // A list of tags that you want to attach to the newly created OU. For each tag in // the list, you must specify both a tag key and a value. You can set the value to // an empty string, but you can't set it to null . For more information about // tagging, see Tagging Organizations resources (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html) // in the Organizations User Guide. If any one of the tags is not valid or if you // exceed the allowed number of tags for an OU, then the entire request fails and // the OU is not created. Tags []types.Tag noSmithyDocumentSerde } type CreateOrganizationalUnitOutput struct { // A structure that contains details about the newly created OU. OrganizationalUnit *types.OrganizationalUnit // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateOrganizationalUnitMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateOrganizationalUnit{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateOrganizationalUnit{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateOrganizationalUnitValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateOrganizationalUnit(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateOrganizationalUnit(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "CreateOrganizationalUnit", } }
155
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a policy of a specified type that you can attach to a root, an // organizational unit (OU), or an individual Amazon Web Services account. For more // information about policies and their use, see Managing Organization Policies (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html) // . If the request includes tags, then the requester must have the // organizations:TagResource permission. This operation can be called only from the // organization's management account. func (c *Client) CreatePolicy(ctx context.Context, params *CreatePolicyInput, optFns ...func(*Options)) (*CreatePolicyOutput, error) { if params == nil { params = &CreatePolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "CreatePolicy", params, optFns, c.addOperationCreatePolicyMiddlewares) if err != nil { return nil, err } out := result.(*CreatePolicyOutput) out.ResultMetadata = metadata return out, nil } type CreatePolicyInput struct { // The policy text content to add to the new policy. The text that you supply must // adhere to the rules of the policy type you specify in the Type parameter. // // This member is required. Content *string // An optional description to assign to the policy. // // This member is required. Description *string // The friendly name to assign to the policy. The regex pattern (http://wikipedia.org/wiki/regex) // that is used to validate this parameter is a string of any of the characters in // the ASCII character range. // // This member is required. Name *string // The type of policy to create. You can specify one of the following values: // - AISERVICES_OPT_OUT_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html) // - BACKUP_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html) // - SERVICE_CONTROL_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html) // - TAG_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) // // This member is required. Type types.PolicyType // A list of tags that you want to attach to the newly created policy. For each // tag in the list, you must specify both a tag key and a value. You can set the // value to an empty string, but you can't set it to null . For more information // about tagging, see Tagging Organizations resources (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html) // in the Organizations User Guide. If any one of the tags is not valid or if you // exceed the allowed number of tags for a policy, then the entire request fails // and the policy is not created. Tags []types.Tag noSmithyDocumentSerde } type CreatePolicyOutput struct { // A structure that contains details about the newly created policy. Policy *types.Policy // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreatePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreatePolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreatePolicy{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreatePolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePolicy(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreatePolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "CreatePolicy", } }
161
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Declines a handshake request. This sets the handshake state to DECLINED and // effectively deactivates the request. This operation can be called only from the // account that received the handshake. The originator of the handshake can use // CancelHandshake instead. The originator can't reactivate a declined request, but // can reinitiate the process with a new handshake request. After you decline a // handshake, it continues to appear in the results of relevant APIs for only 30 // days. After that, it's deleted. func (c *Client) DeclineHandshake(ctx context.Context, params *DeclineHandshakeInput, optFns ...func(*Options)) (*DeclineHandshakeOutput, error) { if params == nil { params = &DeclineHandshakeInput{} } result, metadata, err := c.invokeOperation(ctx, "DeclineHandshake", params, optFns, c.addOperationDeclineHandshakeMiddlewares) if err != nil { return nil, err } out := result.(*DeclineHandshakeOutput) out.ResultMetadata = metadata return out, nil } type DeclineHandshakeInput struct { // The unique identifier (ID) of the handshake that you want to decline. You can // get the ID from the ListHandshakesForAccount operation. The regex pattern (http://wikipedia.org/wiki/regex) // for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters // or digits. // // This member is required. HandshakeId *string noSmithyDocumentSerde } type DeclineHandshakeOutput struct { // A structure that contains details about the declined handshake. The state is // updated to show the value DECLINED . Handshake *types.Handshake // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeclineHandshakeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeclineHandshake{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeclineHandshake{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeclineHandshakeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeclineHandshake(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeclineHandshake(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "DeclineHandshake", } }
135
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes the organization. You can delete an organization only by using // credentials from the management account. The organization must be empty of // member accounts. func (c *Client) DeleteOrganization(ctx context.Context, params *DeleteOrganizationInput, optFns ...func(*Options)) (*DeleteOrganizationOutput, error) { if params == nil { params = &DeleteOrganizationInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteOrganization", params, optFns, c.addOperationDeleteOrganizationMiddlewares) if err != nil { return nil, err } out := result.(*DeleteOrganizationOutput) out.ResultMetadata = metadata return out, nil } type DeleteOrganizationInput struct { noSmithyDocumentSerde } type DeleteOrganizationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteOrganization{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteOrganization{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opDeleteOrganization(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteOrganization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "DeleteOrganization", } }
113
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes an organizational unit (OU) from a root or another OU. You must first // remove all accounts and child OUs from the OU that you want to delete. This // operation can be called only from the organization's management account. func (c *Client) DeleteOrganizationalUnit(ctx context.Context, params *DeleteOrganizationalUnitInput, optFns ...func(*Options)) (*DeleteOrganizationalUnitOutput, error) { if params == nil { params = &DeleteOrganizationalUnitInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteOrganizationalUnit", params, optFns, c.addOperationDeleteOrganizationalUnitMiddlewares) if err != nil { return nil, err } out := result.(*DeleteOrganizationalUnitOutput) out.ResultMetadata = metadata return out, nil } type DeleteOrganizationalUnitInput struct { // The unique identifier (ID) of the organizational unit that you want to delete. // You can get the ID from the ListOrganizationalUnitsForParent operation. The // regex pattern (http://wikipedia.org/wiki/regex) for an organizational unit ID // string requires "ou-" followed by from 4 to 32 lowercase letters or digits (the // ID of the root that contains the OU). This string is followed by a second "-" // dash and from 8 to 32 additional lowercase letters or digits. // // This member is required. OrganizationalUnitId *string noSmithyDocumentSerde } type DeleteOrganizationalUnitOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteOrganizationalUnitMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteOrganizationalUnit{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteOrganizationalUnit{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteOrganizationalUnitValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteOrganizationalUnit(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteOrganizationalUnit(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "DeleteOrganizationalUnit", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes the specified policy from your organization. Before you perform this // operation, you must first detach the policy from all organizational units (OUs), // roots, and accounts. This operation can be called only from the organization's // management account. func (c *Client) DeletePolicy(ctx context.Context, params *DeletePolicyInput, optFns ...func(*Options)) (*DeletePolicyOutput, error) { if params == nil { params = &DeletePolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "DeletePolicy", params, optFns, c.addOperationDeletePolicyMiddlewares) if err != nil { return nil, err } out := result.(*DeletePolicyOutput) out.ResultMetadata = metadata return out, nil } type DeletePolicyInput struct { // The unique identifier (ID) of the policy that you want to delete. You can get // the ID from the ListPolicies or ListPoliciesForTarget operations. The regex // pattern (http://wikipedia.org/wiki/regex) for a policy ID string requires "p-" // followed by from 8 to 128 lowercase or uppercase letters, digits, or the // underscore character (_). // // This member is required. PolicyId *string noSmithyDocumentSerde } type DeletePolicyOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeletePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeletePolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeletePolicy{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeletePolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePolicy(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeletePolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "DeletePolicy", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes the resource policy from your organization. You can only call this // operation from the organization's management account. func (c *Client) DeleteResourcePolicy(ctx context.Context, params *DeleteResourcePolicyInput, optFns ...func(*Options)) (*DeleteResourcePolicyOutput, error) { if params == nil { params = &DeleteResourcePolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteResourcePolicy", params, optFns, c.addOperationDeleteResourcePolicyMiddlewares) if err != nil { return nil, err } out := result.(*DeleteResourcePolicyOutput) out.ResultMetadata = metadata return out, nil } type DeleteResourcePolicyInput struct { noSmithyDocumentSerde } type DeleteResourcePolicyOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteResourcePolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteResourcePolicy{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResourcePolicy(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opDeleteResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "DeleteResourcePolicy", } }
112
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Removes the specified member Amazon Web Services account as a delegated // administrator for the specified Amazon Web Services service. Deregistering a // delegated administrator can have unintended impacts on the functionality of the // enabled Amazon Web Services service. See the documentation for the enabled // service before you deregister a delegated administrator so that you understand // any potential impacts. You can run this action only for Amazon Web Services // services that support this feature. For a current list of services that support // it, see the column Supports Delegated Administrator in the table at Amazon Web // Services Services that you can use with Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services_list.html) // in the Organizations User Guide. This operation can be called only from the // organization's management account. func (c *Client) DeregisterDelegatedAdministrator(ctx context.Context, params *DeregisterDelegatedAdministratorInput, optFns ...func(*Options)) (*DeregisterDelegatedAdministratorOutput, error) { if params == nil { params = &DeregisterDelegatedAdministratorInput{} } result, metadata, err := c.invokeOperation(ctx, "DeregisterDelegatedAdministrator", params, optFns, c.addOperationDeregisterDelegatedAdministratorMiddlewares) if err != nil { return nil, err } out := result.(*DeregisterDelegatedAdministratorOutput) out.ResultMetadata = metadata return out, nil } type DeregisterDelegatedAdministratorInput struct { // The account ID number of the member account in the organization that you want // to deregister as a delegated administrator. // // This member is required. AccountId *string // The service principal name of an Amazon Web Services service for which the // account is a delegated administrator. Delegated administrator privileges are // revoked for only the specified Amazon Web Services service from the member // account. If the specified service is the only service for which the member // account is a delegated administrator, the operation also revokes Organizations // read action permissions. // // This member is required. ServicePrincipal *string noSmithyDocumentSerde } type DeregisterDelegatedAdministratorOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeregisterDelegatedAdministratorMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeregisterDelegatedAdministrator{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeregisterDelegatedAdministrator{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeregisterDelegatedAdministratorValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterDelegatedAdministrator(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeregisterDelegatedAdministrator(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "DeregisterDelegatedAdministrator", } }
141
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves Organizations-related information about the specified account. This // operation can be called only from the organization's management account or by a // member account that is a delegated administrator for an Amazon Web Services // service. func (c *Client) DescribeAccount(ctx context.Context, params *DescribeAccountInput, optFns ...func(*Options)) (*DescribeAccountOutput, error) { if params == nil { params = &DescribeAccountInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeAccount", params, optFns, c.addOperationDescribeAccountMiddlewares) if err != nil { return nil, err } out := result.(*DescribeAccountOutput) out.ResultMetadata = metadata return out, nil } type DescribeAccountInput struct { // The unique identifier (ID) of the Amazon Web Services account that you want // information about. You can get the ID from the ListAccounts or // ListAccountsForParent operations. The regex pattern (http://wikipedia.org/wiki/regex) // for an account ID string requires exactly 12 digits. // // This member is required. AccountId *string noSmithyDocumentSerde } type DescribeAccountOutput struct { // A structure that contains information about the requested account. Account *types.Account // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAccount{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAccount{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeAccountValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAccount(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "DescribeAccount", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves the current status of an asynchronous request to create an account. // This operation can be called only from the organization's management account or // by a member account that is a delegated administrator for an Amazon Web Services // service. func (c *Client) DescribeCreateAccountStatus(ctx context.Context, params *DescribeCreateAccountStatusInput, optFns ...func(*Options)) (*DescribeCreateAccountStatusOutput, error) { if params == nil { params = &DescribeCreateAccountStatusInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeCreateAccountStatus", params, optFns, c.addOperationDescribeCreateAccountStatusMiddlewares) if err != nil { return nil, err } out := result.(*DescribeCreateAccountStatusOutput) out.ResultMetadata = metadata return out, nil } type DescribeCreateAccountStatusInput struct { // Specifies the Id value that uniquely identifies the CreateAccount request. You // can get the value from the CreateAccountStatus.Id response in an earlier // CreateAccount request, or from the ListCreateAccountStatus operation. The regex // pattern (http://wikipedia.org/wiki/regex) for a create account request ID string // requires "car-" followed by from 8 to 32 lowercase letters or digits. // // This member is required. CreateAccountRequestId *string noSmithyDocumentSerde } type DescribeCreateAccountStatusOutput struct { // A structure that contains the current status of an account creation request. CreateAccountStatus *types.CreateAccountStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeCreateAccountStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeCreateAccountStatus{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeCreateAccountStatus{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeCreateAccountStatusValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCreateAccountStatus(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeCreateAccountStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "DescribeCreateAccountStatus", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the contents of the effective policy for specified policy type and // account. The effective policy is the aggregation of any policies of the // specified type that the account inherits, plus any policy of that type that is // directly attached to the account. This operation applies only to policy types // other than service control policies (SCPs). For more information about policy // inheritance, see How Policy Inheritance Works (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies-inheritance.html) // in the Organizations User Guide. This operation can be called only from the // organization's management account or by a member account that is a delegated // administrator for an Amazon Web Services service. func (c *Client) DescribeEffectivePolicy(ctx context.Context, params *DescribeEffectivePolicyInput, optFns ...func(*Options)) (*DescribeEffectivePolicyOutput, error) { if params == nil { params = &DescribeEffectivePolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeEffectivePolicy", params, optFns, c.addOperationDescribeEffectivePolicyMiddlewares) if err != nil { return nil, err } out := result.(*DescribeEffectivePolicyOutput) out.ResultMetadata = metadata return out, nil } type DescribeEffectivePolicyInput struct { // The type of policy that you want information about. You can specify one of the // following values: // - AISERVICES_OPT_OUT_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html) // - BACKUP_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html) // - TAG_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) // // This member is required. PolicyType types.EffectivePolicyType // When you're signed in as the management account, specify the ID of the account // that you want details about. Specifying an organization root or organizational // unit (OU) as the target is not supported. TargetId *string noSmithyDocumentSerde } type DescribeEffectivePolicyOutput struct { // The contents of the effective policy. EffectivePolicy *types.EffectivePolicy // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeEffectivePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeEffectivePolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeEffectivePolicy{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeEffectivePolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEffectivePolicy(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeEffectivePolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "DescribeEffectivePolicy", } }
142
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves information about a previously requested handshake. The handshake ID // comes from the response to the original InviteAccountToOrganization operation // that generated the handshake. You can access handshakes that are ACCEPTED , // DECLINED , or CANCELED for only 30 days after they change to that state. // They're then deleted and no longer accessible. This operation can be called from // any account in the organization. func (c *Client) DescribeHandshake(ctx context.Context, params *DescribeHandshakeInput, optFns ...func(*Options)) (*DescribeHandshakeOutput, error) { if params == nil { params = &DescribeHandshakeInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeHandshake", params, optFns, c.addOperationDescribeHandshakeMiddlewares) if err != nil { return nil, err } out := result.(*DescribeHandshakeOutput) out.ResultMetadata = metadata return out, nil } type DescribeHandshakeInput struct { // The unique identifier (ID) of the handshake that you want information about. // You can get the ID from the original call to InviteAccountToOrganization , or // from a call to ListHandshakesForAccount or ListHandshakesForOrganization . The // regex pattern (http://wikipedia.org/wiki/regex) for handshake ID string requires // "h-" followed by from 8 to 32 lowercase letters or digits. // // This member is required. HandshakeId *string noSmithyDocumentSerde } type DescribeHandshakeOutput struct { // A structure that contains information about the specified handshake. Handshake *types.Handshake // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeHandshakeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeHandshake{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeHandshake{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeHandshakeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeHandshake(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeHandshake(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "DescribeHandshake", } }
134
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves information about the organization that the user's account belongs // to. This operation can be called from any account in the organization. Even if a // policy type is shown as available in the organization, you can disable it // separately at the root level with DisablePolicyType . Use ListRoots to see the // status of policy types for a specified root. func (c *Client) DescribeOrganization(ctx context.Context, params *DescribeOrganizationInput, optFns ...func(*Options)) (*DescribeOrganizationOutput, error) { if params == nil { params = &DescribeOrganizationInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeOrganization", params, optFns, c.addOperationDescribeOrganizationMiddlewares) if err != nil { return nil, err } out := result.(*DescribeOrganizationOutput) out.ResultMetadata = metadata return out, nil } type DescribeOrganizationInput struct { noSmithyDocumentSerde } type DescribeOrganizationOutput struct { // A structure that contains information about the organization. The // AvailablePolicyTypes part of the response is deprecated, and you shouldn't use // it in your apps. It doesn't include any policy type supported by Organizations // other than SCPs. To determine which policy types are enabled in your // organization, use the ListRoots operation. Organization *types.Organization // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeOrganization{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeOrganization{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opDescribeOrganization(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeOrganization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "DescribeOrganization", } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves information about an organizational unit (OU). This operation can be // called only from the organization's management account or by a member account // that is a delegated administrator for an Amazon Web Services service. func (c *Client) DescribeOrganizationalUnit(ctx context.Context, params *DescribeOrganizationalUnitInput, optFns ...func(*Options)) (*DescribeOrganizationalUnitOutput, error) { if params == nil { params = &DescribeOrganizationalUnitInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeOrganizationalUnit", params, optFns, c.addOperationDescribeOrganizationalUnitMiddlewares) if err != nil { return nil, err } out := result.(*DescribeOrganizationalUnitOutput) out.ResultMetadata = metadata return out, nil } type DescribeOrganizationalUnitInput struct { // The unique identifier (ID) of the organizational unit that you want details // about. You can get the ID from the ListOrganizationalUnitsForParent operation. // The regex pattern (http://wikipedia.org/wiki/regex) for an organizational unit // ID string requires "ou-" followed by from 4 to 32 lowercase letters or digits // (the ID of the root that contains the OU). This string is followed by a second // "-" dash and from 8 to 32 additional lowercase letters or digits. // // This member is required. OrganizationalUnitId *string noSmithyDocumentSerde } type DescribeOrganizationalUnitOutput struct { // A structure that contains details about the specified OU. OrganizationalUnit *types.OrganizationalUnit // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeOrganizationalUnitMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeOrganizationalUnit{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeOrganizationalUnit{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeOrganizationalUnitValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeOrganizationalUnit(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeOrganizationalUnit(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "DescribeOrganizationalUnit", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves information about a policy. This operation can be called only from // the organization's management account or by a member account that is a delegated // administrator for an Amazon Web Services service. func (c *Client) DescribePolicy(ctx context.Context, params *DescribePolicyInput, optFns ...func(*Options)) (*DescribePolicyOutput, error) { if params == nil { params = &DescribePolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribePolicy", params, optFns, c.addOperationDescribePolicyMiddlewares) if err != nil { return nil, err } out := result.(*DescribePolicyOutput) out.ResultMetadata = metadata return out, nil } type DescribePolicyInput struct { // The unique identifier (ID) of the policy that you want details about. You can // get the ID from the ListPolicies or ListPoliciesForTarget operations. The regex // pattern (http://wikipedia.org/wiki/regex) for a policy ID string requires "p-" // followed by from 8 to 128 lowercase or uppercase letters, digits, or the // underscore character (_). // // This member is required. PolicyId *string noSmithyDocumentSerde } type DescribePolicyOutput struct { // A structure that contains details about the specified policy. Policy *types.Policy // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribePolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribePolicy{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribePolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePolicy(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribePolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "DescribePolicy", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves information about a resource policy. You can only call this operation // from the organization's management account or by a member account that is a // delegated administrator for an Amazon Web Services service. func (c *Client) DescribeResourcePolicy(ctx context.Context, params *DescribeResourcePolicyInput, optFns ...func(*Options)) (*DescribeResourcePolicyOutput, error) { if params == nil { params = &DescribeResourcePolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeResourcePolicy", params, optFns, c.addOperationDescribeResourcePolicyMiddlewares) if err != nil { return nil, err } out := result.(*DescribeResourcePolicyOutput) out.ResultMetadata = metadata return out, nil } type DescribeResourcePolicyInput struct { noSmithyDocumentSerde } type DescribeResourcePolicyOutput struct { // A structure that contains details about the resource policy. ResourcePolicy *types.ResourcePolicy // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeResourcePolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeResourcePolicy{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opDescribeResourcePolicy(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "DescribeResourcePolicy", } }
118
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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" ) // Detaches a policy from a target root, organizational unit (OU), or account. If // the policy being detached is a service control policy (SCP), the changes to // permissions for Identity and Access Management (IAM) users and roles in affected // accounts are immediate. Every root, OU, and account must have at least one SCP // attached. If you want to replace the default FullAWSAccess policy with an SCP // that limits the permissions that can be delegated, you must attach the // replacement SCP before you can remove the default SCP. This is the authorization // strategy of an " allow list (https://docs.aws.amazon.com/organizations/latest/userguide/SCP_strategies.html#orgs_policies_allowlist) // ". If you instead attach a second SCP and leave the FullAWSAccess SCP still // attached, and specify "Effect": "Deny" in the second SCP to override the // "Effect": "Allow" in the FullAWSAccess policy (or any other attached SCP), // you're using the authorization strategy of a " deny list (https://docs.aws.amazon.com/organizations/latest/userguide/SCP_strategies.html#orgs_policies_denylist) // ". This operation can be called only from the organization's management account. func (c *Client) DetachPolicy(ctx context.Context, params *DetachPolicyInput, optFns ...func(*Options)) (*DetachPolicyOutput, error) { if params == nil { params = &DetachPolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "DetachPolicy", params, optFns, c.addOperationDetachPolicyMiddlewares) if err != nil { return nil, err } out := result.(*DetachPolicyOutput) out.ResultMetadata = metadata return out, nil } type DetachPolicyInput struct { // The unique identifier (ID) of the policy you want to detach. You can get the ID // from the ListPolicies or ListPoliciesForTarget operations. The regex pattern (http://wikipedia.org/wiki/regex) // for a policy ID string requires "p-" followed by from 8 to 128 lowercase or // uppercase letters, digits, or the underscore character (_). // // This member is required. PolicyId *string // The unique identifier (ID) of the root, OU, or account that you want to detach // the policy from. You can get the ID from the ListRoots , // ListOrganizationalUnitsForParent , or ListAccounts operations. The regex pattern (http://wikipedia.org/wiki/regex) // for a target ID string requires one of the following: // - Root - A string that begins with "r-" followed by from 4 to 32 lowercase // letters or digits. // - Account - A string that consists of exactly 12 digits. // - Organizational unit (OU) - A string that begins with "ou-" followed by from // 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This // string is followed by a second "-" dash and from 8 to 32 additional lowercase // letters or digits. // // This member is required. TargetId *string noSmithyDocumentSerde } type DetachPolicyOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDetachPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDetachPolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDetachPolicy{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDetachPolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDetachPolicy(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDetachPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "DetachPolicy", } }
150
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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" ) // Disables the integration of an Amazon Web Services service (the service that is // specified by ServicePrincipal ) with Organizations. When you disable // integration, the specified service no longer can create a service-linked role (https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html) // in new accounts in your organization. This means the service can't perform // operations on your behalf on any new accounts in your organization. The service // can still perform operations in older accounts until the service completes its // clean-up from Organizations. We strongly recommend that you don't use this // command to disable integration between Organizations and the specified Amazon // Web Services service. Instead, use the console or commands that are provided by // the specified service. This lets the trusted service perform any required // initialization when enabling trusted access, such as creating any required // resources and any required clean up of resources when disabling trusted access. // For information about how to disable trusted service access to your organization // using the trusted service, see the Learn more link under the Supports Trusted // Access column at Amazon Web Services services that you can use with // Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services_list.html) // . on this page. If you disable access by using this command, it causes the // following actions to occur: // - The service can no longer create a service-linked role in the accounts in // your organization. This means that the service can't perform operations on your // behalf on any new accounts in your organization. The service can still perform // operations in older accounts until the service completes its clean-up from // Organizations. // - The service can no longer perform tasks in the member accounts in the // organization, unless those operations are explicitly permitted by the IAM // policies that are attached to your roles. This includes any data aggregation // from the member accounts to the management account, or to a delegated // administrator account, where relevant. // - Some services detect this and clean up any remaining data or resources // related to the integration, while other services stop accessing the organization // but leave any historical data and configuration in place to support a possible // re-enabling of the integration. // // Using the other service's console or commands to disable the integration // ensures that the other service is aware that it can clean up any resources that // are required only for the integration. How the service cleans up its resources // in the organization's accounts depends on that service. For more information, // see the documentation for the other Amazon Web Services service. After you // perform the DisableAWSServiceAccess operation, the specified service can no // longer perform operations in your organization's accounts For more information // about integrating other services with Organizations, including the list of // services that work with Organizations, see Integrating Organizations with Other // Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) // in the Organizations User Guide. This operation can be called only from the // organization's management account. func (c *Client) DisableAWSServiceAccess(ctx context.Context, params *DisableAWSServiceAccessInput, optFns ...func(*Options)) (*DisableAWSServiceAccessOutput, error) { if params == nil { params = &DisableAWSServiceAccessInput{} } result, metadata, err := c.invokeOperation(ctx, "DisableAWSServiceAccess", params, optFns, c.addOperationDisableAWSServiceAccessMiddlewares) if err != nil { return nil, err } out := result.(*DisableAWSServiceAccessOutput) out.ResultMetadata = metadata return out, nil } type DisableAWSServiceAccessInput struct { // The service principal name of the Amazon Web Services service for which you // want to disable integration with your organization. This is typically in the // form of a URL, such as service-abbreviation.amazonaws.com . // // This member is required. ServicePrincipal *string noSmithyDocumentSerde } type DisableAWSServiceAccessOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDisableAWSServiceAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisableAWSServiceAccess{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisableAWSServiceAccess{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDisableAWSServiceAccessValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableAWSServiceAccess(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDisableAWSServiceAccess(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "DisableAWSServiceAccess", } }
166
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Disables an organizational policy type in a root. A policy of a certain type // can be attached to entities in a root only if that type is enabled in the root. // After you perform this operation, you no longer can attach policies of the // specified type to that root or to any organizational unit (OU) or account in // that root. You can undo this by using the EnablePolicyType operation. This is // an asynchronous request that Amazon Web Services performs in the background. If // you disable a policy type for a root, it still appears enabled for the // organization if all features (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) // are enabled for the organization. Amazon Web Services recommends that you first // use ListRoots to see the status of policy types for a specified root, and then // use this operation. This operation can be called only from the organization's // management account. To view the status of available policy types in the // organization, use DescribeOrganization . func (c *Client) DisablePolicyType(ctx context.Context, params *DisablePolicyTypeInput, optFns ...func(*Options)) (*DisablePolicyTypeOutput, error) { if params == nil { params = &DisablePolicyTypeInput{} } result, metadata, err := c.invokeOperation(ctx, "DisablePolicyType", params, optFns, c.addOperationDisablePolicyTypeMiddlewares) if err != nil { return nil, err } out := result.(*DisablePolicyTypeOutput) out.ResultMetadata = metadata return out, nil } type DisablePolicyTypeInput struct { // The policy type that you want to disable in this root. You can specify one of // the following values: // - AISERVICES_OPT_OUT_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html) // - BACKUP_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html) // - SERVICE_CONTROL_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html) // - TAG_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) // // This member is required. PolicyType types.PolicyType // The unique identifier (ID) of the root in which you want to disable a policy // type. You can get the ID from the ListRoots operation. The regex pattern (http://wikipedia.org/wiki/regex) // for a root ID string requires "r-" followed by from 4 to 32 lowercase letters or // digits. // // This member is required. RootId *string noSmithyDocumentSerde } type DisablePolicyTypeOutput struct { // A structure that shows the root with the updated list of enabled policy types. Root *types.Root // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDisablePolicyTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisablePolicyType{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisablePolicyType{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDisablePolicyTypeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisablePolicyType(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDisablePolicyType(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "DisablePolicyType", } }
150
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Enables all features in an organization. This enables the use of organization // policies that can restrict the services and actions that can be called in each // account. Until you enable all features, you have access only to consolidated // billing, and you can't use any of the advanced account administration features // that Organizations supports. For more information, see Enabling All Features in // Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) // in the Organizations User Guide. This operation is required only for // organizations that were created explicitly with only the consolidated billing // features enabled. Calling this operation sends a handshake to every invited // account in the organization. The feature set change can be finalized and the // additional features enabled only after all administrators in the invited // accounts approve the change by accepting the handshake. After you enable all // features, you can separately enable or disable individual policy types in a root // using EnablePolicyType and DisablePolicyType . To see the status of policy types // in a root, use ListRoots . After all invited member accounts accept the // handshake, you finalize the feature set change by accepting the handshake that // contains "Action": "ENABLE_ALL_FEATURES" . This completes the change. After you // enable all features in your organization, the management account in the // organization can apply policies on all member accounts. These policies can // restrict what users and even administrators in those accounts can do. The // management account can apply policies that prevent accounts from leaving the // organization. Ensure that your account administrators are aware of this. This // operation can be called only from the organization's management account. func (c *Client) EnableAllFeatures(ctx context.Context, params *EnableAllFeaturesInput, optFns ...func(*Options)) (*EnableAllFeaturesOutput, error) { if params == nil { params = &EnableAllFeaturesInput{} } result, metadata, err := c.invokeOperation(ctx, "EnableAllFeatures", params, optFns, c.addOperationEnableAllFeaturesMiddlewares) if err != nil { return nil, err } out := result.(*EnableAllFeaturesOutput) out.ResultMetadata = metadata return out, nil } type EnableAllFeaturesInput struct { noSmithyDocumentSerde } type EnableAllFeaturesOutput struct { // A structure that contains details about the handshake created to support this // request to enable all features in the organization. Handshake *types.Handshake // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationEnableAllFeaturesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpEnableAllFeatures{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpEnableAllFeatures{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opEnableAllFeatures(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opEnableAllFeatures(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "EnableAllFeatures", } }
139
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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" ) // Enables the integration of an Amazon Web Services service (the service that is // specified by ServicePrincipal ) with Organizations. When you enable integration, // you allow the specified service to create a service-linked role (https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html) // in all the accounts in your organization. This allows the service to perform // operations on your behalf in your organization and its accounts. We recommend // that you enable integration between Organizations and the specified Amazon Web // Services service by using the console or commands that are provided by the // specified service. Doing so ensures that the service is aware that it can create // the resources that are required for the integration. How the service creates // those resources in the organization's accounts depends on that service. For more // information, see the documentation for the other Amazon Web Services service. // For more information about enabling services to integrate with Organizations, // see Integrating Organizations with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) // in the Organizations User Guide. You can only call this operation from the // organization's management account and only if the organization has enabled all // features (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) // . func (c *Client) EnableAWSServiceAccess(ctx context.Context, params *EnableAWSServiceAccessInput, optFns ...func(*Options)) (*EnableAWSServiceAccessOutput, error) { if params == nil { params = &EnableAWSServiceAccessInput{} } result, metadata, err := c.invokeOperation(ctx, "EnableAWSServiceAccess", params, optFns, c.addOperationEnableAWSServiceAccessMiddlewares) if err != nil { return nil, err } out := result.(*EnableAWSServiceAccessOutput) out.ResultMetadata = metadata return out, nil } type EnableAWSServiceAccessInput struct { // The service principal name of the Amazon Web Services service for which you // want to enable integration with your organization. This is typically in the form // of a URL, such as service-abbreviation.amazonaws.com . // // This member is required. ServicePrincipal *string noSmithyDocumentSerde } type EnableAWSServiceAccessOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationEnableAWSServiceAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpEnableAWSServiceAccess{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpEnableAWSServiceAccess{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpEnableAWSServiceAccessValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableAWSServiceAccess(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opEnableAWSServiceAccess(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "EnableAWSServiceAccess", } }
138
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Enables a policy type in a root. After you enable a policy type in a root, you // can attach policies of that type to the root, any organizational unit (OU), or // account in that root. You can undo this by using the DisablePolicyType // operation. This is an asynchronous request that Amazon Web Services performs in // the background. Amazon Web Services recommends that you first use ListRoots to // see the status of policy types for a specified root, and then use this // operation. This operation can be called only from the organization's management // account. You can enable a policy type in a root only if that policy type is // available in the organization. To view the status of available policy types in // the organization, use DescribeOrganization . func (c *Client) EnablePolicyType(ctx context.Context, params *EnablePolicyTypeInput, optFns ...func(*Options)) (*EnablePolicyTypeOutput, error) { if params == nil { params = &EnablePolicyTypeInput{} } result, metadata, err := c.invokeOperation(ctx, "EnablePolicyType", params, optFns, c.addOperationEnablePolicyTypeMiddlewares) if err != nil { return nil, err } out := result.(*EnablePolicyTypeOutput) out.ResultMetadata = metadata return out, nil } type EnablePolicyTypeInput struct { // The policy type that you want to enable. You can specify one of the following // values: // - AISERVICES_OPT_OUT_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html) // - BACKUP_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html) // - SERVICE_CONTROL_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html) // - TAG_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) // // This member is required. PolicyType types.PolicyType // The unique identifier (ID) of the root in which you want to enable a policy // type. You can get the ID from the ListRoots operation. The regex pattern (http://wikipedia.org/wiki/regex) // for a root ID string requires "r-" followed by from 4 to 32 lowercase letters or // digits. // // This member is required. RootId *string noSmithyDocumentSerde } type EnablePolicyTypeOutput struct { // A structure that shows the root with the updated list of enabled policy types. Root *types.Root // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationEnablePolicyTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpEnablePolicyType{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpEnablePolicyType{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpEnablePolicyTypeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnablePolicyType(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opEnablePolicyType(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "EnablePolicyType", } }
147
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Sends an invitation to another account to join your organization as a member // account. Organizations sends email on your behalf to the email address that is // associated with the other account's owner. The invitation is implemented as a // Handshake whose details are in the response. // - You can invite Amazon Web Services accounts only from the same seller as // the management account. For example, if your organization's management account // was created by Amazon Internet Services Pvt. Ltd (AISPL), an Amazon Web Services // seller in India, you can invite only other AISPL accounts to your organization. // You can't combine accounts from AISPL and Amazon Web Services or from any other // Amazon Web Services seller. For more information, see Consolidated Billing in // India (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/useconsolidatedbilliing-India.html) // . // - If you receive an exception that indicates that you exceeded your account // limits for the organization or that the operation failed because your // organization is still initializing, wait one hour and then try again. If the // error persists after an hour, contact Amazon Web Services Support (https://console.aws.amazon.com/support/home#/) // . // // If the request includes tags, then the requester must have the // organizations:TagResource permission. This operation can be called only from the // organization's management account. func (c *Client) InviteAccountToOrganization(ctx context.Context, params *InviteAccountToOrganizationInput, optFns ...func(*Options)) (*InviteAccountToOrganizationOutput, error) { if params == nil { params = &InviteAccountToOrganizationInput{} } result, metadata, err := c.invokeOperation(ctx, "InviteAccountToOrganization", params, optFns, c.addOperationInviteAccountToOrganizationMiddlewares) if err != nil { return nil, err } out := result.(*InviteAccountToOrganizationOutput) out.ResultMetadata = metadata return out, nil } type InviteAccountToOrganizationInput struct { // The identifier (ID) of the Amazon Web Services account that you want to invite // to join your organization. This is a JSON object that contains the following // elements: { "Type": "ACCOUNT", "Id": "< account id number >" } If you use the // CLI, you can submit this as a single string, similar to the following example: // --target Id=123456789012,Type=ACCOUNT If you specify "Type": "ACCOUNT" , you // must provide the Amazon Web Services account ID number as the Id . If you // specify "Type": "EMAIL" , you must specify the email address that is associated // with the account. --target Id=diego@example.com,Type=EMAIL // // This member is required. Target *types.HandshakeParty // Additional information that you want to include in the generated email to the // recipient account owner. Notes *string // A list of tags that you want to attach to the account when it becomes a member // of the organization. For each tag in the list, you must specify both a tag key // and a value. You can set the value to an empty string, but you can't set it to // null . For more information about tagging, see Tagging Organizations resources (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html) // in the Organizations User Guide. Any tags in the request are checked for // compliance with any applicable tag policies when the request is made. The // request is rejected if the tags in the request don't match the requirements of // the policy at that time. Tag policy compliance is not checked again when the // invitation is accepted and the tags are actually attached to the account. That // means that if the tag policy changes between the invitation and the acceptance, // then that tags could potentially be non-compliant. If any one of the tags is not // valid or if you exceed the allowed number of tags for an account, then the // entire request fails and invitations are not sent. Tags []types.Tag noSmithyDocumentSerde } type InviteAccountToOrganizationOutput struct { // A structure that contains details about the handshake that is created to // support this invitation request. Handshake *types.Handshake // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationInviteAccountToOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpInviteAccountToOrganization{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpInviteAccountToOrganization{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpInviteAccountToOrganizationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opInviteAccountToOrganization(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opInviteAccountToOrganization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "InviteAccountToOrganization", } }
172
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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 member account from its parent organization. This version of the // operation is performed by the account that wants to leave. To remove a member // account as a user in the management account, use RemoveAccountFromOrganization // instead. This operation can be called only from a member account in the // organization. // - The management account in an organization with all features enabled can set // service control policies (SCPs) that can restrict what administrators of member // accounts can do. This includes preventing them from successfully calling // LeaveOrganization and leaving the organization. // - You can leave an organization as a member account only if the account is // configured with the information required to operate as a standalone account. // When you create an account in an organization using the Organizations console, // API, or CLI commands, the information required of standalone accounts is not // automatically collected. For each account that you want to make standalone, you // must perform the following steps. If any of the steps are already completed for // this account, that step doesn't appear. // - Choose a support plan // - Provide and verify the required contact information // - Provide a current payment method Amazon Web Services uses the payment // method to charge for any billable (not free tier) Amazon Web Services activity // that occurs while the account isn't attached to an organization. Follow the // steps at To leave an organization when all required account information has // not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) // in the Organizations User Guide. // - The account that you want to leave must not be a delegated administrator // account for any Amazon Web Services service enabled for your organization. If // the account is a delegated administrator, you must first change the delegated // administrator account to another account that is remaining in the organization. // - You can leave an organization only after you enable IAM user access to // billing in your account. For more information, see Activating Access to the // Billing and Cost Management Console (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate) // in the Amazon Web Services Billing and Cost Management User Guide. // - After the account leaves the organization, all tags that were attached to // the account object in the organization are deleted. Amazon Web Services accounts // outside of an organization do not support tags. // - A newly created account has a waiting period before it can be removed from // its organization. If you get an error that indicates that a wait period is // required, then try again in a few days. func (c *Client) LeaveOrganization(ctx context.Context, params *LeaveOrganizationInput, optFns ...func(*Options)) (*LeaveOrganizationOutput, error) { if params == nil { params = &LeaveOrganizationInput{} } result, metadata, err := c.invokeOperation(ctx, "LeaveOrganization", params, optFns, c.addOperationLeaveOrganizationMiddlewares) if err != nil { return nil, err } out := result.(*LeaveOrganizationOutput) out.ResultMetadata = metadata return out, nil } type LeaveOrganizationInput struct { noSmithyDocumentSerde } type LeaveOrganizationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationLeaveOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpLeaveOrganization{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpLeaveOrganization{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opLeaveOrganization(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opLeaveOrganization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "LeaveOrganization", } }
148
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all the accounts in the organization. To request only the accounts in a // specified root or organizational unit (OU), use the ListAccountsForParent // operation instead. Always check the NextToken response parameter for a null // value when calling a List* operation. These operations can occasionally return // an empty set of results even when there are more results available. The // NextToken response parameter value is null only when there are no more results // to display. This operation can be called only from the organization's management // account or by a member account that is a delegated administrator for an Amazon // Web Services service. func (c *Client) ListAccounts(ctx context.Context, params *ListAccountsInput, optFns ...func(*Options)) (*ListAccountsOutput, error) { if params == nil { params = &ListAccountsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListAccounts", params, optFns, c.addOperationListAccountsMiddlewares) if err != nil { return nil, err } out := result.(*ListAccountsOutput) out.ResultMetadata = metadata return out, nil } type ListAccountsInput struct { // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. MaxResults *int32 // The parameter for receiving additional results if you receive a NextToken // response in a previous request. A NextToken response indicates that more output // is available. Set this parameter to the value of the previous call's NextToken // response to indicate where the output should continue from. NextToken *string noSmithyDocumentSerde } type ListAccountsOutput struct { // A list of objects in the organization. Accounts []types.Account // If present, indicates that more output is available than is included in the // current response. Use this value in the NextToken request parameter in a // subsequent call to the operation to get the next part of the output. You should // repeat this until the NextToken response element comes back as null . NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListAccountsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAccounts{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAccounts{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListAccounts(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListAccountsAPIClient is a client that implements the ListAccounts operation. type ListAccountsAPIClient interface { ListAccounts(context.Context, *ListAccountsInput, ...func(*Options)) (*ListAccountsOutput, error) } var _ ListAccountsAPIClient = (*Client)(nil) // ListAccountsPaginatorOptions is the paginator options for ListAccounts type ListAccountsPaginatorOptions struct { // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListAccountsPaginator is a paginator for ListAccounts type ListAccountsPaginator struct { options ListAccountsPaginatorOptions client ListAccountsAPIClient params *ListAccountsInput nextToken *string firstPage bool } // NewListAccountsPaginator returns a new ListAccountsPaginator func NewListAccountsPaginator(client ListAccountsAPIClient, params *ListAccountsInput, optFns ...func(*ListAccountsPaginatorOptions)) *ListAccountsPaginator { if params == nil { params = &ListAccountsInput{} } options := ListAccountsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListAccountsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListAccountsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListAccounts page. func (p *ListAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountsOutput, 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.ListAccounts(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_opListAccounts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "ListAccounts", } }
246
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the accounts in an organization that are contained by the specified // target root or organizational unit (OU). If you specify the root, you get a list // of all the accounts that aren't in any OU. If you specify an OU, you get a list // of all the accounts in only that OU and not in any child OUs. To get a list of // all accounts in the organization, use the ListAccounts operation. Always check // the NextToken response parameter for a null value when calling a List* // operation. These operations can occasionally return an empty set of results even // when there are more results available. The NextToken response parameter value // is null only when there are no more results to display. This operation can be // called only from the organization's management account or by a member account // that is a delegated administrator for an Amazon Web Services service. func (c *Client) ListAccountsForParent(ctx context.Context, params *ListAccountsForParentInput, optFns ...func(*Options)) (*ListAccountsForParentOutput, error) { if params == nil { params = &ListAccountsForParentInput{} } result, metadata, err := c.invokeOperation(ctx, "ListAccountsForParent", params, optFns, c.addOperationListAccountsForParentMiddlewares) if err != nil { return nil, err } out := result.(*ListAccountsForParentOutput) out.ResultMetadata = metadata return out, nil } type ListAccountsForParentInput struct { // The unique identifier (ID) for the parent root or organization unit (OU) whose // accounts you want to list. // // This member is required. ParentId *string // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. MaxResults *int32 // The parameter for receiving additional results if you receive a NextToken // response in a previous request. A NextToken response indicates that more output // is available. Set this parameter to the value of the previous call's NextToken // response to indicate where the output should continue from. NextToken *string noSmithyDocumentSerde } type ListAccountsForParentOutput struct { // A list of the accounts in the specified root or OU. Accounts []types.Account // If present, indicates that more output is available than is included in the // current response. Use this value in the NextToken request parameter in a // subsequent call to the operation to get the next part of the output. You should // repeat this until the NextToken response element comes back as null . NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListAccountsForParentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAccountsForParent{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAccountsForParent{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListAccountsForParentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccountsForParent(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListAccountsForParentAPIClient is a client that implements the // ListAccountsForParent operation. type ListAccountsForParentAPIClient interface { ListAccountsForParent(context.Context, *ListAccountsForParentInput, ...func(*Options)) (*ListAccountsForParentOutput, error) } var _ ListAccountsForParentAPIClient = (*Client)(nil) // ListAccountsForParentPaginatorOptions is the paginator options for // ListAccountsForParent type ListAccountsForParentPaginatorOptions struct { // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListAccountsForParentPaginator is a paginator for ListAccountsForParent type ListAccountsForParentPaginator struct { options ListAccountsForParentPaginatorOptions client ListAccountsForParentAPIClient params *ListAccountsForParentInput nextToken *string firstPage bool } // NewListAccountsForParentPaginator returns a new ListAccountsForParentPaginator func NewListAccountsForParentPaginator(client ListAccountsForParentAPIClient, params *ListAccountsForParentInput, optFns ...func(*ListAccountsForParentPaginatorOptions)) *ListAccountsForParentPaginator { if params == nil { params = &ListAccountsForParentInput{} } options := ListAccountsForParentPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListAccountsForParentPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListAccountsForParentPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListAccountsForParent page. func (p *ListAccountsForParentPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountsForParentOutput, 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.ListAccountsForParent(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_opListAccountsForParent(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "ListAccountsForParent", } }
259
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of the Amazon Web Services services that you enabled to // integrate with your organization. After a service on this list creates the // resources that it requires for the integration, it can perform operations on // your organization and its accounts. For more information about integrating other // services with Organizations, including the list of services that currently work // with Organizations, see Integrating Organizations with Other Amazon Web // Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) // in the Organizations User Guide. This operation can be called only from the // organization's management account or by a member account that is a delegated // administrator for an Amazon Web Services service. func (c *Client) ListAWSServiceAccessForOrganization(ctx context.Context, params *ListAWSServiceAccessForOrganizationInput, optFns ...func(*Options)) (*ListAWSServiceAccessForOrganizationOutput, error) { if params == nil { params = &ListAWSServiceAccessForOrganizationInput{} } result, metadata, err := c.invokeOperation(ctx, "ListAWSServiceAccessForOrganization", params, optFns, c.addOperationListAWSServiceAccessForOrganizationMiddlewares) if err != nil { return nil, err } out := result.(*ListAWSServiceAccessForOrganizationOutput) out.ResultMetadata = metadata return out, nil } type ListAWSServiceAccessForOrganizationInput struct { // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. MaxResults *int32 // The parameter for receiving additional results if you receive a NextToken // response in a previous request. A NextToken response indicates that more output // is available. Set this parameter to the value of the previous call's NextToken // response to indicate where the output should continue from. NextToken *string noSmithyDocumentSerde } type ListAWSServiceAccessForOrganizationOutput struct { // A list of the service principals for the services that are enabled to integrate // with your organization. Each principal is a structure that includes the name and // the date that it was enabled for integration with Organizations. EnabledServicePrincipals []types.EnabledServicePrincipal // If present, indicates that more output is available than is included in the // current response. Use this value in the NextToken request parameter in a // subsequent call to the operation to get the next part of the output. You should // repeat this until the NextToken response element comes back as null . NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListAWSServiceAccessForOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAWSServiceAccessForOrganization{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAWSServiceAccessForOrganization{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListAWSServiceAccessForOrganization(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListAWSServiceAccessForOrganizationAPIClient is a client that implements the // ListAWSServiceAccessForOrganization operation. type ListAWSServiceAccessForOrganizationAPIClient interface { ListAWSServiceAccessForOrganization(context.Context, *ListAWSServiceAccessForOrganizationInput, ...func(*Options)) (*ListAWSServiceAccessForOrganizationOutput, error) } var _ ListAWSServiceAccessForOrganizationAPIClient = (*Client)(nil) // ListAWSServiceAccessForOrganizationPaginatorOptions is the paginator options // for ListAWSServiceAccessForOrganization type ListAWSServiceAccessForOrganizationPaginatorOptions struct { // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListAWSServiceAccessForOrganizationPaginator is a paginator for // ListAWSServiceAccessForOrganization type ListAWSServiceAccessForOrganizationPaginator struct { options ListAWSServiceAccessForOrganizationPaginatorOptions client ListAWSServiceAccessForOrganizationAPIClient params *ListAWSServiceAccessForOrganizationInput nextToken *string firstPage bool } // NewListAWSServiceAccessForOrganizationPaginator returns a new // ListAWSServiceAccessForOrganizationPaginator func NewListAWSServiceAccessForOrganizationPaginator(client ListAWSServiceAccessForOrganizationAPIClient, params *ListAWSServiceAccessForOrganizationInput, optFns ...func(*ListAWSServiceAccessForOrganizationPaginatorOptions)) *ListAWSServiceAccessForOrganizationPaginator { if params == nil { params = &ListAWSServiceAccessForOrganizationInput{} } options := ListAWSServiceAccessForOrganizationPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListAWSServiceAccessForOrganizationPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListAWSServiceAccessForOrganizationPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListAWSServiceAccessForOrganization page. func (p *ListAWSServiceAccessForOrganizationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAWSServiceAccessForOrganizationOutput, 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.ListAWSServiceAccessForOrganization(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_opListAWSServiceAccessForOrganization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "ListAWSServiceAccessForOrganization", } }
253
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all of the organizational units (OUs) or accounts that are contained in // the specified parent OU or root. This operation, along with ListParents enables // you to traverse the tree structure that makes up this root. Always check the // NextToken response parameter for a null value when calling a List* operation. // These operations can occasionally return an empty set of results even when there // are more results available. The NextToken response parameter value is null only // when there are no more results to display. This operation can be called only // from the organization's management account or by a member account that is a // delegated administrator for an Amazon Web Services service. func (c *Client) ListChildren(ctx context.Context, params *ListChildrenInput, optFns ...func(*Options)) (*ListChildrenOutput, error) { if params == nil { params = &ListChildrenInput{} } result, metadata, err := c.invokeOperation(ctx, "ListChildren", params, optFns, c.addOperationListChildrenMiddlewares) if err != nil { return nil, err } out := result.(*ListChildrenOutput) out.ResultMetadata = metadata return out, nil } type ListChildrenInput struct { // Filters the output to include only the specified child type. // // This member is required. ChildType types.ChildType // The unique identifier (ID) for the parent root or OU whose children you want to // list. The regex pattern (http://wikipedia.org/wiki/regex) for a parent ID // string requires one of the following: // - Root - A string that begins with "r-" followed by from 4 to 32 lowercase // letters or digits. // - Organizational unit (OU) - A string that begins with "ou-" followed by from // 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This // string is followed by a second "-" dash and from 8 to 32 additional lowercase // letters or digits. // // This member is required. ParentId *string // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. MaxResults *int32 // The parameter for receiving additional results if you receive a NextToken // response in a previous request. A NextToken response indicates that more output // is available. Set this parameter to the value of the previous call's NextToken // response to indicate where the output should continue from. NextToken *string noSmithyDocumentSerde } type ListChildrenOutput struct { // The list of children of the specified parent container. Children []types.Child // If present, indicates that more output is available than is included in the // current response. Use this value in the NextToken request parameter in a // subsequent call to the operation to get the next part of the output. You should // repeat this until the NextToken response element comes back as null . NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListChildrenMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListChildren{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListChildren{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListChildrenValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListChildren(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListChildrenAPIClient is a client that implements the ListChildren operation. type ListChildrenAPIClient interface { ListChildren(context.Context, *ListChildrenInput, ...func(*Options)) (*ListChildrenOutput, error) } var _ ListChildrenAPIClient = (*Client)(nil) // ListChildrenPaginatorOptions is the paginator options for ListChildren type ListChildrenPaginatorOptions struct { // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListChildrenPaginator is a paginator for ListChildren type ListChildrenPaginator struct { options ListChildrenPaginatorOptions client ListChildrenAPIClient params *ListChildrenInput nextToken *string firstPage bool } // NewListChildrenPaginator returns a new ListChildrenPaginator func NewListChildrenPaginator(client ListChildrenAPIClient, params *ListChildrenInput, optFns ...func(*ListChildrenPaginatorOptions)) *ListChildrenPaginator { if params == nil { params = &ListChildrenInput{} } options := ListChildrenPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListChildrenPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListChildrenPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListChildren page. func (p *ListChildrenPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChildrenOutput, 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.ListChildren(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_opListChildren(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "ListChildren", } }
267
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the account creation requests that match the specified status that is // currently being tracked for the organization. Always check the NextToken // response parameter for a null value when calling a List* operation. These // operations can occasionally return an empty set of results even when there are // more results available. The NextToken response parameter value is null only // when there are no more results to display. This operation can be called only // from the organization's management account or by a member account that is a // delegated administrator for an Amazon Web Services service. func (c *Client) ListCreateAccountStatus(ctx context.Context, params *ListCreateAccountStatusInput, optFns ...func(*Options)) (*ListCreateAccountStatusOutput, error) { if params == nil { params = &ListCreateAccountStatusInput{} } result, metadata, err := c.invokeOperation(ctx, "ListCreateAccountStatus", params, optFns, c.addOperationListCreateAccountStatusMiddlewares) if err != nil { return nil, err } out := result.(*ListCreateAccountStatusOutput) out.ResultMetadata = metadata return out, nil } type ListCreateAccountStatusInput struct { // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. MaxResults *int32 // The parameter for receiving additional results if you receive a NextToken // response in a previous request. A NextToken response indicates that more output // is available. Set this parameter to the value of the previous call's NextToken // response to indicate where the output should continue from. NextToken *string // A list of one or more states that you want included in the response. If this // parameter isn't present, all requests are included in the response. States []types.CreateAccountState noSmithyDocumentSerde } type ListCreateAccountStatusOutput struct { // A list of objects with details about the requests. Certain elements, such as // the accountId number, are present in the output only after the account has been // successfully created. CreateAccountStatuses []types.CreateAccountStatus // If present, indicates that more output is available than is included in the // current response. Use this value in the NextToken request parameter in a // subsequent call to the operation to get the next part of the output. You should // repeat this until the NextToken response element comes back as null . NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListCreateAccountStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListCreateAccountStatus{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListCreateAccountStatus{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListCreateAccountStatus(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListCreateAccountStatusAPIClient is a client that implements the // ListCreateAccountStatus operation. type ListCreateAccountStatusAPIClient interface { ListCreateAccountStatus(context.Context, *ListCreateAccountStatusInput, ...func(*Options)) (*ListCreateAccountStatusOutput, error) } var _ ListCreateAccountStatusAPIClient = (*Client)(nil) // ListCreateAccountStatusPaginatorOptions is the paginator options for // ListCreateAccountStatus type ListCreateAccountStatusPaginatorOptions struct { // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListCreateAccountStatusPaginator is a paginator for ListCreateAccountStatus type ListCreateAccountStatusPaginator struct { options ListCreateAccountStatusPaginatorOptions client ListCreateAccountStatusAPIClient params *ListCreateAccountStatusInput nextToken *string firstPage bool } // NewListCreateAccountStatusPaginator returns a new // ListCreateAccountStatusPaginator func NewListCreateAccountStatusPaginator(client ListCreateAccountStatusAPIClient, params *ListCreateAccountStatusInput, optFns ...func(*ListCreateAccountStatusPaginatorOptions)) *ListCreateAccountStatusPaginator { if params == nil { params = &ListCreateAccountStatusInput{} } options := ListCreateAccountStatusPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListCreateAccountStatusPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListCreateAccountStatusPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListCreateAccountStatus page. func (p *ListCreateAccountStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCreateAccountStatusOutput, 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.ListCreateAccountStatus(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_opListCreateAccountStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "ListCreateAccountStatus", } }
254
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the Amazon Web Services accounts that are designated as delegated // administrators in this organization. This operation can be called only from the // organization's management account or by a member account that is a delegated // administrator for an Amazon Web Services service. func (c *Client) ListDelegatedAdministrators(ctx context.Context, params *ListDelegatedAdministratorsInput, optFns ...func(*Options)) (*ListDelegatedAdministratorsOutput, error) { if params == nil { params = &ListDelegatedAdministratorsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListDelegatedAdministrators", params, optFns, c.addOperationListDelegatedAdministratorsMiddlewares) if err != nil { return nil, err } out := result.(*ListDelegatedAdministratorsOutput) out.ResultMetadata = metadata return out, nil } type ListDelegatedAdministratorsInput struct { // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. MaxResults *int32 // The parameter for receiving additional results if you receive a NextToken // response in a previous request. A NextToken response indicates that more output // is available. Set this parameter to the value of the previous call's NextToken // response to indicate where the output should continue from. NextToken *string // Specifies a service principal name. If specified, then the operation lists the // delegated administrators only for the specified service. If you don't specify a // service principal, the operation lists all delegated administrators for all // services in your organization. ServicePrincipal *string noSmithyDocumentSerde } type ListDelegatedAdministratorsOutput struct { // The list of delegated administrators in your organization. DelegatedAdministrators []types.DelegatedAdministrator // If present, indicates that more output is available than is included in the // current response. Use this value in the NextToken request parameter in a // subsequent call to the operation to get the next part of the output. You should // repeat this until the NextToken response element comes back as null . NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListDelegatedAdministratorsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListDelegatedAdministrators{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListDelegatedAdministrators{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListDelegatedAdministrators(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListDelegatedAdministratorsAPIClient is a client that implements the // ListDelegatedAdministrators operation. type ListDelegatedAdministratorsAPIClient interface { ListDelegatedAdministrators(context.Context, *ListDelegatedAdministratorsInput, ...func(*Options)) (*ListDelegatedAdministratorsOutput, error) } var _ ListDelegatedAdministratorsAPIClient = (*Client)(nil) // ListDelegatedAdministratorsPaginatorOptions is the paginator options for // ListDelegatedAdministrators type ListDelegatedAdministratorsPaginatorOptions struct { // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListDelegatedAdministratorsPaginator is a paginator for // ListDelegatedAdministrators type ListDelegatedAdministratorsPaginator struct { options ListDelegatedAdministratorsPaginatorOptions client ListDelegatedAdministratorsAPIClient params *ListDelegatedAdministratorsInput nextToken *string firstPage bool } // NewListDelegatedAdministratorsPaginator returns a new // ListDelegatedAdministratorsPaginator func NewListDelegatedAdministratorsPaginator(client ListDelegatedAdministratorsAPIClient, params *ListDelegatedAdministratorsInput, optFns ...func(*ListDelegatedAdministratorsPaginatorOptions)) *ListDelegatedAdministratorsPaginator { if params == nil { params = &ListDelegatedAdministratorsInput{} } options := ListDelegatedAdministratorsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListDelegatedAdministratorsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListDelegatedAdministratorsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListDelegatedAdministrators page. func (p *ListDelegatedAdministratorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDelegatedAdministratorsOutput, 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.ListDelegatedAdministrators(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_opListDelegatedAdministrators(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "ListDelegatedAdministrators", } }
251
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // List the Amazon Web Services services for which the specified account is a // delegated administrator. This operation can be called only from the // organization's management account or by a member account that is a delegated // administrator for an Amazon Web Services service. func (c *Client) ListDelegatedServicesForAccount(ctx context.Context, params *ListDelegatedServicesForAccountInput, optFns ...func(*Options)) (*ListDelegatedServicesForAccountOutput, error) { if params == nil { params = &ListDelegatedServicesForAccountInput{} } result, metadata, err := c.invokeOperation(ctx, "ListDelegatedServicesForAccount", params, optFns, c.addOperationListDelegatedServicesForAccountMiddlewares) if err != nil { return nil, err } out := result.(*ListDelegatedServicesForAccountOutput) out.ResultMetadata = metadata return out, nil } type ListDelegatedServicesForAccountInput struct { // The account ID number of a delegated administrator account in the organization. // // This member is required. AccountId *string // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. MaxResults *int32 // The parameter for receiving additional results if you receive a NextToken // response in a previous request. A NextToken response indicates that more output // is available. Set this parameter to the value of the previous call's NextToken // response to indicate where the output should continue from. NextToken *string noSmithyDocumentSerde } type ListDelegatedServicesForAccountOutput struct { // The services for which the account is a delegated administrator. DelegatedServices []types.DelegatedService // If present, indicates that more output is available than is included in the // current response. Use this value in the NextToken request parameter in a // subsequent call to the operation to get the next part of the output. You should // repeat this until the NextToken response element comes back as null . NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListDelegatedServicesForAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListDelegatedServicesForAccount{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListDelegatedServicesForAccount{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListDelegatedServicesForAccountValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDelegatedServicesForAccount(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListDelegatedServicesForAccountAPIClient is a client that implements the // ListDelegatedServicesForAccount operation. type ListDelegatedServicesForAccountAPIClient interface { ListDelegatedServicesForAccount(context.Context, *ListDelegatedServicesForAccountInput, ...func(*Options)) (*ListDelegatedServicesForAccountOutput, error) } var _ ListDelegatedServicesForAccountAPIClient = (*Client)(nil) // ListDelegatedServicesForAccountPaginatorOptions is the paginator options for // ListDelegatedServicesForAccount type ListDelegatedServicesForAccountPaginatorOptions struct { // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListDelegatedServicesForAccountPaginator is a paginator for // ListDelegatedServicesForAccount type ListDelegatedServicesForAccountPaginator struct { options ListDelegatedServicesForAccountPaginatorOptions client ListDelegatedServicesForAccountAPIClient params *ListDelegatedServicesForAccountInput nextToken *string firstPage bool } // NewListDelegatedServicesForAccountPaginator returns a new // ListDelegatedServicesForAccountPaginator func NewListDelegatedServicesForAccountPaginator(client ListDelegatedServicesForAccountAPIClient, params *ListDelegatedServicesForAccountInput, optFns ...func(*ListDelegatedServicesForAccountPaginatorOptions)) *ListDelegatedServicesForAccountPaginator { if params == nil { params = &ListDelegatedServicesForAccountInput{} } options := ListDelegatedServicesForAccountPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListDelegatedServicesForAccountPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListDelegatedServicesForAccountPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListDelegatedServicesForAccount page. func (p *ListDelegatedServicesForAccountPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDelegatedServicesForAccountOutput, 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.ListDelegatedServicesForAccount(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_opListDelegatedServicesForAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "ListDelegatedServicesForAccount", } }
253
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the current handshakes that are associated with the account of the // requesting user. Handshakes that are ACCEPTED , DECLINED , CANCELED , or EXPIRED // appear in the results of this API for only 30 days after changing to that state. // After that, they're deleted and no longer accessible. Always check the NextToken // response parameter for a null value when calling a List* operation. These // operations can occasionally return an empty set of results even when there are // more results available. The NextToken response parameter value is null only // when there are no more results to display. This operation can be called from any // account in the organization. func (c *Client) ListHandshakesForAccount(ctx context.Context, params *ListHandshakesForAccountInput, optFns ...func(*Options)) (*ListHandshakesForAccountOutput, error) { if params == nil { params = &ListHandshakesForAccountInput{} } result, metadata, err := c.invokeOperation(ctx, "ListHandshakesForAccount", params, optFns, c.addOperationListHandshakesForAccountMiddlewares) if err != nil { return nil, err } out := result.(*ListHandshakesForAccountOutput) out.ResultMetadata = metadata return out, nil } type ListHandshakesForAccountInput struct { // Filters the handshakes that you want included in the response. The default is // all types. Use the ActionType element to limit the output to only a specified // type, such as INVITE , ENABLE_ALL_FEATURES , or APPROVE_ALL_FEATURES . // Alternatively, for the ENABLE_ALL_FEATURES handshake that generates a separate // child handshake for each member account, you can specify ParentHandshakeId to // see only the handshakes that were generated by that parent request. Filter *types.HandshakeFilter // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. MaxResults *int32 // The parameter for receiving additional results if you receive a NextToken // response in a previous request. A NextToken response indicates that more output // is available. Set this parameter to the value of the previous call's NextToken // response to indicate where the output should continue from. NextToken *string noSmithyDocumentSerde } type ListHandshakesForAccountOutput struct { // A list of Handshake objects with details about each of the handshakes that is // associated with the specified account. Handshakes []types.Handshake // If present, indicates that more output is available than is included in the // current response. Use this value in the NextToken request parameter in a // subsequent call to the operation to get the next part of the output. You should // repeat this until the NextToken response element comes back as null . NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListHandshakesForAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListHandshakesForAccount{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListHandshakesForAccount{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListHandshakesForAccount(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListHandshakesForAccountAPIClient is a client that implements the // ListHandshakesForAccount operation. type ListHandshakesForAccountAPIClient interface { ListHandshakesForAccount(context.Context, *ListHandshakesForAccountInput, ...func(*Options)) (*ListHandshakesForAccountOutput, error) } var _ ListHandshakesForAccountAPIClient = (*Client)(nil) // ListHandshakesForAccountPaginatorOptions is the paginator options for // ListHandshakesForAccount type ListHandshakesForAccountPaginatorOptions struct { // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListHandshakesForAccountPaginator is a paginator for ListHandshakesForAccount type ListHandshakesForAccountPaginator struct { options ListHandshakesForAccountPaginatorOptions client ListHandshakesForAccountAPIClient params *ListHandshakesForAccountInput nextToken *string firstPage bool } // NewListHandshakesForAccountPaginator returns a new // ListHandshakesForAccountPaginator func NewListHandshakesForAccountPaginator(client ListHandshakesForAccountAPIClient, params *ListHandshakesForAccountInput, optFns ...func(*ListHandshakesForAccountPaginatorOptions)) *ListHandshakesForAccountPaginator { if params == nil { params = &ListHandshakesForAccountInput{} } options := ListHandshakesForAccountPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListHandshakesForAccountPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListHandshakesForAccountPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListHandshakesForAccount page. func (p *ListHandshakesForAccountPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHandshakesForAccountOutput, 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.ListHandshakesForAccount(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_opListHandshakesForAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "ListHandshakesForAccount", } }
258
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the handshakes that are associated with the organization that the // requesting user is part of. The ListHandshakesForOrganization operation returns // a list of handshake structures. Each structure contains details and status about // a handshake. Handshakes that are ACCEPTED , DECLINED , CANCELED , or EXPIRED // appear in the results of this API for only 30 days after changing to that state. // After that, they're deleted and no longer accessible. Always check the NextToken // response parameter for a null value when calling a List* operation. These // operations can occasionally return an empty set of results even when there are // more results available. The NextToken response parameter value is null only // when there are no more results to display. This operation can be called only // from the organization's management account or by a member account that is a // delegated administrator for an Amazon Web Services service. func (c *Client) ListHandshakesForOrganization(ctx context.Context, params *ListHandshakesForOrganizationInput, optFns ...func(*Options)) (*ListHandshakesForOrganizationOutput, error) { if params == nil { params = &ListHandshakesForOrganizationInput{} } result, metadata, err := c.invokeOperation(ctx, "ListHandshakesForOrganization", params, optFns, c.addOperationListHandshakesForOrganizationMiddlewares) if err != nil { return nil, err } out := result.(*ListHandshakesForOrganizationOutput) out.ResultMetadata = metadata return out, nil } type ListHandshakesForOrganizationInput struct { // A filter of the handshakes that you want included in the response. The default // is all types. Use the ActionType element to limit the output to only a // specified type, such as INVITE , ENABLE-ALL-FEATURES , or APPROVE-ALL-FEATURES . // Alternatively, for the ENABLE-ALL-FEATURES handshake that generates a separate // child handshake for each member account, you can specify the ParentHandshakeId // to see only the handshakes that were generated by that parent request. Filter *types.HandshakeFilter // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. MaxResults *int32 // The parameter for receiving additional results if you receive a NextToken // response in a previous request. A NextToken response indicates that more output // is available. Set this parameter to the value of the previous call's NextToken // response to indicate where the output should continue from. NextToken *string noSmithyDocumentSerde } type ListHandshakesForOrganizationOutput struct { // A list of Handshake objects with details about each of the handshakes that are // associated with an organization. Handshakes []types.Handshake // If present, indicates that more output is available than is included in the // current response. Use this value in the NextToken request parameter in a // subsequent call to the operation to get the next part of the output. You should // repeat this until the NextToken response element comes back as null . NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListHandshakesForOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListHandshakesForOrganization{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListHandshakesForOrganization{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListHandshakesForOrganization(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListHandshakesForOrganizationAPIClient is a client that implements the // ListHandshakesForOrganization operation. type ListHandshakesForOrganizationAPIClient interface { ListHandshakesForOrganization(context.Context, *ListHandshakesForOrganizationInput, ...func(*Options)) (*ListHandshakesForOrganizationOutput, error) } var _ ListHandshakesForOrganizationAPIClient = (*Client)(nil) // ListHandshakesForOrganizationPaginatorOptions is the paginator options for // ListHandshakesForOrganization type ListHandshakesForOrganizationPaginatorOptions struct { // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListHandshakesForOrganizationPaginator is a paginator for // ListHandshakesForOrganization type ListHandshakesForOrganizationPaginator struct { options ListHandshakesForOrganizationPaginatorOptions client ListHandshakesForOrganizationAPIClient params *ListHandshakesForOrganizationInput nextToken *string firstPage bool } // NewListHandshakesForOrganizationPaginator returns a new // ListHandshakesForOrganizationPaginator func NewListHandshakesForOrganizationPaginator(client ListHandshakesForOrganizationAPIClient, params *ListHandshakesForOrganizationInput, optFns ...func(*ListHandshakesForOrganizationPaginatorOptions)) *ListHandshakesForOrganizationPaginator { if params == nil { params = &ListHandshakesForOrganizationInput{} } options := ListHandshakesForOrganizationPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListHandshakesForOrganizationPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListHandshakesForOrganizationPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListHandshakesForOrganization page. func (p *ListHandshakesForOrganizationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHandshakesForOrganizationOutput, 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.ListHandshakesForOrganization(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_opListHandshakesForOrganization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "ListHandshakesForOrganization", } }
262
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the organizational units (OUs) in a parent organizational unit or root. // Always check the NextToken response parameter for a null value when calling a // List* operation. These operations can occasionally return an empty set of // results even when there are more results available. The NextToken response // parameter value is null only when there are no more results to display. This // operation can be called only from the organization's management account or by a // member account that is a delegated administrator for an Amazon Web Services // service. func (c *Client) ListOrganizationalUnitsForParent(ctx context.Context, params *ListOrganizationalUnitsForParentInput, optFns ...func(*Options)) (*ListOrganizationalUnitsForParentOutput, error) { if params == nil { params = &ListOrganizationalUnitsForParentInput{} } result, metadata, err := c.invokeOperation(ctx, "ListOrganizationalUnitsForParent", params, optFns, c.addOperationListOrganizationalUnitsForParentMiddlewares) if err != nil { return nil, err } out := result.(*ListOrganizationalUnitsForParentOutput) out.ResultMetadata = metadata return out, nil } type ListOrganizationalUnitsForParentInput struct { // The unique identifier (ID) of the root or OU whose child OUs you want to list. // The regex pattern (http://wikipedia.org/wiki/regex) for a parent ID string // requires one of the following: // - Root - A string that begins with "r-" followed by from 4 to 32 lowercase // letters or digits. // - Organizational unit (OU) - A string that begins with "ou-" followed by from // 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This // string is followed by a second "-" dash and from 8 to 32 additional lowercase // letters or digits. // // This member is required. ParentId *string // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. MaxResults *int32 // The parameter for receiving additional results if you receive a NextToken // response in a previous request. A NextToken response indicates that more output // is available. Set this parameter to the value of the previous call's NextToken // response to indicate where the output should continue from. NextToken *string noSmithyDocumentSerde } type ListOrganizationalUnitsForParentOutput struct { // If present, indicates that more output is available than is included in the // current response. Use this value in the NextToken request parameter in a // subsequent call to the operation to get the next part of the output. You should // repeat this until the NextToken response element comes back as null . NextToken *string // A list of the OUs in the specified root or parent OU. OrganizationalUnits []types.OrganizationalUnit // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListOrganizationalUnitsForParentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListOrganizationalUnitsForParent{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListOrganizationalUnitsForParent{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListOrganizationalUnitsForParentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListOrganizationalUnitsForParent(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListOrganizationalUnitsForParentAPIClient is a client that implements the // ListOrganizationalUnitsForParent operation. type ListOrganizationalUnitsForParentAPIClient interface { ListOrganizationalUnitsForParent(context.Context, *ListOrganizationalUnitsForParentInput, ...func(*Options)) (*ListOrganizationalUnitsForParentOutput, error) } var _ ListOrganizationalUnitsForParentAPIClient = (*Client)(nil) // ListOrganizationalUnitsForParentPaginatorOptions is the paginator options for // ListOrganizationalUnitsForParent type ListOrganizationalUnitsForParentPaginatorOptions struct { // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListOrganizationalUnitsForParentPaginator is a paginator for // ListOrganizationalUnitsForParent type ListOrganizationalUnitsForParentPaginator struct { options ListOrganizationalUnitsForParentPaginatorOptions client ListOrganizationalUnitsForParentAPIClient params *ListOrganizationalUnitsForParentInput nextToken *string firstPage bool } // NewListOrganizationalUnitsForParentPaginator returns a new // ListOrganizationalUnitsForParentPaginator func NewListOrganizationalUnitsForParentPaginator(client ListOrganizationalUnitsForParentAPIClient, params *ListOrganizationalUnitsForParentInput, optFns ...func(*ListOrganizationalUnitsForParentPaginatorOptions)) *ListOrganizationalUnitsForParentPaginator { if params == nil { params = &ListOrganizationalUnitsForParentInput{} } options := ListOrganizationalUnitsForParentPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListOrganizationalUnitsForParentPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListOrganizationalUnitsForParentPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListOrganizationalUnitsForParent page. func (p *ListOrganizationalUnitsForParentPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOrganizationalUnitsForParentOutput, 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.ListOrganizationalUnitsForParent(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_opListOrganizationalUnitsForParent(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "ListOrganizationalUnitsForParent", } }
265
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the root or organizational units (OUs) that serve as the immediate parent // of the specified child OU or account. This operation, along with ListChildren // enables you to traverse the tree structure that makes up this root. Always check // the NextToken response parameter for a null value when calling a List* // operation. These operations can occasionally return an empty set of results even // when there are more results available. The NextToken response parameter value // is null only when there are no more results to display. This operation can be // called only from the organization's management account or by a member account // that is a delegated administrator for an Amazon Web Services service. In the // current release, a child can have only a single parent. func (c *Client) ListParents(ctx context.Context, params *ListParentsInput, optFns ...func(*Options)) (*ListParentsOutput, error) { if params == nil { params = &ListParentsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListParents", params, optFns, c.addOperationListParentsMiddlewares) if err != nil { return nil, err } out := result.(*ListParentsOutput) out.ResultMetadata = metadata return out, nil } type ListParentsInput struct { // The unique identifier (ID) of the OU or account whose parent containers you // want to list. Don't specify a root. The regex pattern (http://wikipedia.org/wiki/regex) // for a child ID string requires one of the following: // - Account - A string that consists of exactly 12 digits. // - Organizational unit (OU) - A string that begins with "ou-" followed by from // 4 to 32 lowercase letters or digits (the ID of the root that contains the OU). // This string is followed by a second "-" dash and from 8 to 32 additional // lowercase letters or digits. // // This member is required. ChildId *string // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. MaxResults *int32 // The parameter for receiving additional results if you receive a NextToken // response in a previous request. A NextToken response indicates that more output // is available. Set this parameter to the value of the previous call's NextToken // response to indicate where the output should continue from. NextToken *string noSmithyDocumentSerde } type ListParentsOutput struct { // If present, indicates that more output is available than is included in the // current response. Use this value in the NextToken request parameter in a // subsequent call to the operation to get the next part of the output. You should // repeat this until the NextToken response element comes back as null . NextToken *string // A list of parents for the specified child account or OU. Parents []types.Parent // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListParentsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListParents{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListParents{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListParentsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListParents(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListParentsAPIClient is a client that implements the ListParents operation. type ListParentsAPIClient interface { ListParents(context.Context, *ListParentsInput, ...func(*Options)) (*ListParentsOutput, error) } var _ ListParentsAPIClient = (*Client)(nil) // ListParentsPaginatorOptions is the paginator options for ListParents type ListParentsPaginatorOptions struct { // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListParentsPaginator is a paginator for ListParents type ListParentsPaginator struct { options ListParentsPaginatorOptions client ListParentsAPIClient params *ListParentsInput nextToken *string firstPage bool } // NewListParentsPaginator returns a new ListParentsPaginator func NewListParentsPaginator(client ListParentsAPIClient, params *ListParentsInput, optFns ...func(*ListParentsPaginatorOptions)) *ListParentsPaginator { if params == nil { params = &ListParentsInput{} } options := ListParentsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListParentsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListParentsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListParents page. func (p *ListParentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListParentsOutput, 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.ListParents(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_opListParents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "ListParents", } }
262
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves the list of all policies in an organization of a specified type. // Always check the NextToken response parameter for a null value when calling a // List* operation. These operations can occasionally return an empty set of // results even when there are more results available. The NextToken response // parameter value is null only when there are no more results to display. This // operation can be called only from the organization's management account or by a // member account that is a delegated administrator for an Amazon Web Services // service. func (c *Client) ListPolicies(ctx context.Context, params *ListPoliciesInput, optFns ...func(*Options)) (*ListPoliciesOutput, error) { if params == nil { params = &ListPoliciesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListPolicies", params, optFns, c.addOperationListPoliciesMiddlewares) if err != nil { return nil, err } out := result.(*ListPoliciesOutput) out.ResultMetadata = metadata return out, nil } type ListPoliciesInput struct { // Specifies the type of policy that you want to include in the response. You must // specify one of the following values: // - AISERVICES_OPT_OUT_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html) // - BACKUP_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html) // - SERVICE_CONTROL_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html) // - TAG_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) // // This member is required. Filter types.PolicyType // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. MaxResults *int32 // The parameter for receiving additional results if you receive a NextToken // response in a previous request. A NextToken response indicates that more output // is available. Set this parameter to the value of the previous call's NextToken // response to indicate where the output should continue from. NextToken *string noSmithyDocumentSerde } type ListPoliciesOutput struct { // If present, indicates that more output is available than is included in the // current response. Use this value in the NextToken request parameter in a // subsequent call to the operation to get the next part of the output. You should // repeat this until the NextToken response element comes back as null . NextToken *string // A list of policies that match the filter criteria in the request. The output // list doesn't include the policy contents. To see the content for a policy, see // DescribePolicy . Policies []types.PolicySummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListPolicies{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListPolicies{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListPoliciesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPolicies(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListPoliciesAPIClient is a client that implements the ListPolicies operation. type ListPoliciesAPIClient interface { ListPolicies(context.Context, *ListPoliciesInput, ...func(*Options)) (*ListPoliciesOutput, error) } var _ ListPoliciesAPIClient = (*Client)(nil) // ListPoliciesPaginatorOptions is the paginator options for ListPolicies type ListPoliciesPaginatorOptions struct { // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListPoliciesPaginator is a paginator for ListPolicies type ListPoliciesPaginator struct { options ListPoliciesPaginatorOptions client ListPoliciesAPIClient params *ListPoliciesInput nextToken *string firstPage bool } // NewListPoliciesPaginator returns a new ListPoliciesPaginator func NewListPoliciesPaginator(client ListPoliciesAPIClient, params *ListPoliciesInput, optFns ...func(*ListPoliciesPaginatorOptions)) *ListPoliciesPaginator { if params == nil { params = &ListPoliciesInput{} } options := ListPoliciesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListPoliciesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListPoliciesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListPolicies page. func (p *ListPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPoliciesOutput, 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.ListPolicies(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_opListPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "ListPolicies", } }
260
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the policies that are directly attached to the specified target root, // organizational unit (OU), or account. You must specify the policy type that you // want included in the returned list. Always check the NextToken response // parameter for a null value when calling a List* operation. These operations can // occasionally return an empty set of results even when there are more results // available. The NextToken response parameter value is null only when there are // no more results to display. This operation can be called only from the // organization's management account or by a member account that is a delegated // administrator for an Amazon Web Services service. func (c *Client) ListPoliciesForTarget(ctx context.Context, params *ListPoliciesForTargetInput, optFns ...func(*Options)) (*ListPoliciesForTargetOutput, error) { if params == nil { params = &ListPoliciesForTargetInput{} } result, metadata, err := c.invokeOperation(ctx, "ListPoliciesForTarget", params, optFns, c.addOperationListPoliciesForTargetMiddlewares) if err != nil { return nil, err } out := result.(*ListPoliciesForTargetOutput) out.ResultMetadata = metadata return out, nil } type ListPoliciesForTargetInput struct { // The type of policy that you want to include in the returned list. You must // specify one of the following values: // - AISERVICES_OPT_OUT_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html) // - BACKUP_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html) // - SERVICE_CONTROL_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html) // - TAG_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) // // This member is required. Filter types.PolicyType // The unique identifier (ID) of the root, organizational unit, or account whose // policies you want to list. The regex pattern (http://wikipedia.org/wiki/regex) // for a target ID string requires one of the following: // - Root - A string that begins with "r-" followed by from 4 to 32 lowercase // letters or digits. // - Account - A string that consists of exactly 12 digits. // - Organizational unit (OU) - A string that begins with "ou-" followed by from // 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This // string is followed by a second "-" dash and from 8 to 32 additional lowercase // letters or digits. // // This member is required. TargetId *string // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. MaxResults *int32 // The parameter for receiving additional results if you receive a NextToken // response in a previous request. A NextToken response indicates that more output // is available. Set this parameter to the value of the previous call's NextToken // response to indicate where the output should continue from. NextToken *string noSmithyDocumentSerde } type ListPoliciesForTargetOutput struct { // If present, indicates that more output is available than is included in the // current response. Use this value in the NextToken request parameter in a // subsequent call to the operation to get the next part of the output. You should // repeat this until the NextToken response element comes back as null . NextToken *string // The list of policies that match the criteria in the request. Policies []types.PolicySummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListPoliciesForTargetMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListPoliciesForTarget{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListPoliciesForTarget{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListPoliciesForTargetValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPoliciesForTarget(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListPoliciesForTargetAPIClient is a client that implements the // ListPoliciesForTarget operation. type ListPoliciesForTargetAPIClient interface { ListPoliciesForTarget(context.Context, *ListPoliciesForTargetInput, ...func(*Options)) (*ListPoliciesForTargetOutput, error) } var _ ListPoliciesForTargetAPIClient = (*Client)(nil) // ListPoliciesForTargetPaginatorOptions is the paginator options for // ListPoliciesForTarget type ListPoliciesForTargetPaginatorOptions struct { // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListPoliciesForTargetPaginator is a paginator for ListPoliciesForTarget type ListPoliciesForTargetPaginator struct { options ListPoliciesForTargetPaginatorOptions client ListPoliciesForTargetAPIClient params *ListPoliciesForTargetInput nextToken *string firstPage bool } // NewListPoliciesForTargetPaginator returns a new ListPoliciesForTargetPaginator func NewListPoliciesForTargetPaginator(client ListPoliciesForTargetAPIClient, params *ListPoliciesForTargetInput, optFns ...func(*ListPoliciesForTargetPaginatorOptions)) *ListPoliciesForTargetPaginator { if params == nil { params = &ListPoliciesForTargetInput{} } options := ListPoliciesForTargetPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListPoliciesForTargetPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListPoliciesForTargetPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListPoliciesForTarget page. func (p *ListPoliciesForTargetPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPoliciesForTargetOutput, 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.ListPoliciesForTarget(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_opListPoliciesForTarget(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "ListPoliciesForTarget", } }
275
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the roots that are defined in the current organization. Always check the // NextToken response parameter for a null value when calling a List* operation. // These operations can occasionally return an empty set of results even when there // are more results available. The NextToken response parameter value is null only // when there are no more results to display. This operation can be called only // from the organization's management account or by a member account that is a // delegated administrator for an Amazon Web Services service. Policy types can be // enabled and disabled in roots. This is distinct from whether they're available // in the organization. When you enable all features, you make policy types // available for use in that organization. Individual policy types can then be // enabled and disabled in a root. To see the availability of a policy type in an // organization, use DescribeOrganization . func (c *Client) ListRoots(ctx context.Context, params *ListRootsInput, optFns ...func(*Options)) (*ListRootsOutput, error) { if params == nil { params = &ListRootsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListRoots", params, optFns, c.addOperationListRootsMiddlewares) if err != nil { return nil, err } out := result.(*ListRootsOutput) out.ResultMetadata = metadata return out, nil } type ListRootsInput struct { // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. MaxResults *int32 // The parameter for receiving additional results if you receive a NextToken // response in a previous request. A NextToken response indicates that more output // is available. Set this parameter to the value of the previous call's NextToken // response to indicate where the output should continue from. NextToken *string noSmithyDocumentSerde } type ListRootsOutput struct { // If present, indicates that more output is available than is included in the // current response. Use this value in the NextToken request parameter in a // subsequent call to the operation to get the next part of the output. You should // repeat this until the NextToken response element comes back as null . NextToken *string // A list of roots that are defined in an organization. Roots []types.Root // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListRootsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListRoots{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListRoots{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListRoots(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListRootsAPIClient is a client that implements the ListRoots operation. type ListRootsAPIClient interface { ListRoots(context.Context, *ListRootsInput, ...func(*Options)) (*ListRootsOutput, error) } var _ ListRootsAPIClient = (*Client)(nil) // ListRootsPaginatorOptions is the paginator options for ListRoots type ListRootsPaginatorOptions struct { // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListRootsPaginator is a paginator for ListRoots type ListRootsPaginator struct { options ListRootsPaginatorOptions client ListRootsAPIClient params *ListRootsInput nextToken *string firstPage bool } // NewListRootsPaginator returns a new ListRootsPaginator func NewListRootsPaginator(client ListRootsAPIClient, params *ListRootsInput, optFns ...func(*ListRootsPaginatorOptions)) *ListRootsPaginator { if params == nil { params = &ListRootsInput{} } options := ListRootsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListRootsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListRootsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListRoots page. func (p *ListRootsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRootsOutput, 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.ListRoots(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_opListRoots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "ListRoots", } }
249
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists tags that are attached to the specified resource. You can attach tags to // the following resources in Organizations. // - Amazon Web Services account // - Organization root // - Organizational unit (OU) // - Policy (any type) // // This operation can be called only from the organization's management account or // by a member account that is a delegated administrator for an Amazon Web Services // service. 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 ID of the resource with the tags to list. You can specify any of the // following taggable resources. // - Amazon Web Services account – specify the account ID number. // - Organizational unit – specify the OU ID that begins with ou- and looks // similar to: ou-1a2b-34uvwxyz // - Root – specify the root ID that begins with r- and looks similar to: r-1a2b // - Policy – specify the policy ID that begins with p- andlooks similar to: // p-12abcdefg3 // // This member is required. ResourceId *string // The parameter for receiving additional results if you receive a NextToken // response in a previous request. A NextToken response indicates that more output // is available. Set this parameter to the value of the previous call's NextToken // response to indicate where the output should continue from. NextToken *string noSmithyDocumentSerde } type ListTagsForResourceOutput struct { // If present, indicates that more output is available than is included in the // current response. Use this value in the NextToken request parameter in a // subsequent call to the operation to get the next part of the output. You should // repeat this until the NextToken response element comes back as null . NextToken *string // The tags that are assigned to the resource. Tags []types.Tag // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_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 } // ListTagsForResourceAPIClient is a client that implements the // ListTagsForResource operation. type ListTagsForResourceAPIClient interface { ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) } var _ ListTagsForResourceAPIClient = (*Client)(nil) // ListTagsForResourcePaginatorOptions is the paginator options for // ListTagsForResource type ListTagsForResourcePaginatorOptions struct { // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListTagsForResourcePaginator is a paginator for ListTagsForResource type ListTagsForResourcePaginator struct { options ListTagsForResourcePaginatorOptions client ListTagsForResourceAPIClient params *ListTagsForResourceInput nextToken *string firstPage bool } // NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { if params == nil { params = &ListTagsForResourceInput{} } options := ListTagsForResourcePaginatorOptions{} for _, fn := range optFns { fn(&options) } return &ListTagsForResourcePaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListTagsForResourcePaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListTagsForResource page. func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken result, err := p.client.ListTagsForResource(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_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "ListTagsForResource", } }
233
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all the roots, organizational units (OUs), and accounts that the // specified policy is attached to. Always check the NextToken response parameter // for a null value when calling a List* operation. These operations can // occasionally return an empty set of results even when there are more results // available. The NextToken response parameter value is null only when there are // no more results to display. This operation can be called only from the // organization's management account or by a member account that is a delegated // administrator for an Amazon Web Services service. func (c *Client) ListTargetsForPolicy(ctx context.Context, params *ListTargetsForPolicyInput, optFns ...func(*Options)) (*ListTargetsForPolicyOutput, error) { if params == nil { params = &ListTargetsForPolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "ListTargetsForPolicy", params, optFns, c.addOperationListTargetsForPolicyMiddlewares) if err != nil { return nil, err } out := result.(*ListTargetsForPolicyOutput) out.ResultMetadata = metadata return out, nil } type ListTargetsForPolicyInput struct { // The unique identifier (ID) of the policy whose attachments you want to know. // The regex pattern (http://wikipedia.org/wiki/regex) for a policy ID string // requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, // or the underscore character (_). // // This member is required. PolicyId *string // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. MaxResults *int32 // The parameter for receiving additional results if you receive a NextToken // response in a previous request. A NextToken response indicates that more output // is available. Set this parameter to the value of the previous call's NextToken // response to indicate where the output should continue from. NextToken *string noSmithyDocumentSerde } type ListTargetsForPolicyOutput struct { // If present, indicates that more output is available than is included in the // current response. Use this value in the NextToken request parameter in a // subsequent call to the operation to get the next part of the output. You should // repeat this until the NextToken response element comes back as null . NextToken *string // A list of structures, each of which contains details about one of the entities // to which the specified policy is attached. Targets []types.PolicyTargetSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListTargetsForPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTargetsForPolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTargetsForPolicy{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListTargetsForPolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTargetsForPolicy(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListTargetsForPolicyAPIClient is a client that implements the // ListTargetsForPolicy operation. type ListTargetsForPolicyAPIClient interface { ListTargetsForPolicy(context.Context, *ListTargetsForPolicyInput, ...func(*Options)) (*ListTargetsForPolicyOutput, error) } var _ ListTargetsForPolicyAPIClient = (*Client)(nil) // ListTargetsForPolicyPaginatorOptions is the paginator options for // ListTargetsForPolicy type ListTargetsForPolicyPaginatorOptions struct { // The total number of results that you want included on each page of the // response. If you do not include this parameter, it defaults to a value that is // specific to the operation. If additional items exist beyond the maximum you // specify, the NextToken response element is present and has a value (is not // null). Include that value as the NextToken request parameter in the next call // to the operation to get the next part of the results. Note that Organizations // might return fewer results than the maximum even when there are more results // available. You should check NextToken after every operation to ensure that you // receive all of the results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListTargetsForPolicyPaginator is a paginator for ListTargetsForPolicy type ListTargetsForPolicyPaginator struct { options ListTargetsForPolicyPaginatorOptions client ListTargetsForPolicyAPIClient params *ListTargetsForPolicyInput nextToken *string firstPage bool } // NewListTargetsForPolicyPaginator returns a new ListTargetsForPolicyPaginator func NewListTargetsForPolicyPaginator(client ListTargetsForPolicyAPIClient, params *ListTargetsForPolicyInput, optFns ...func(*ListTargetsForPolicyPaginatorOptions)) *ListTargetsForPolicyPaginator { if params == nil { params = &ListTargetsForPolicyInput{} } options := ListTargetsForPolicyPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListTargetsForPolicyPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListTargetsForPolicyPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListTargetsForPolicy page. func (p *ListTargetsForPolicyPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTargetsForPolicyOutput, 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.ListTargetsForPolicy(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_opListTargetsForPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "ListTargetsForPolicy", } }
259
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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" ) // Moves an account from its current source parent root or organizational unit // (OU) to the specified destination parent root or OU. This operation can be // called only from the organization's management account. func (c *Client) MoveAccount(ctx context.Context, params *MoveAccountInput, optFns ...func(*Options)) (*MoveAccountOutput, error) { if params == nil { params = &MoveAccountInput{} } result, metadata, err := c.invokeOperation(ctx, "MoveAccount", params, optFns, c.addOperationMoveAccountMiddlewares) if err != nil { return nil, err } out := result.(*MoveAccountOutput) out.ResultMetadata = metadata return out, nil } type MoveAccountInput struct { // The unique identifier (ID) of the account that you want to move. The regex // pattern (http://wikipedia.org/wiki/regex) for an account ID string requires // exactly 12 digits. // // This member is required. AccountId *string // The unique identifier (ID) of the root or organizational unit that you want to // move the account to. The regex pattern (http://wikipedia.org/wiki/regex) for a // parent ID string requires one of the following: // - Root - A string that begins with "r-" followed by from 4 to 32 lowercase // letters or digits. // - Organizational unit (OU) - A string that begins with "ou-" followed by from // 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This // string is followed by a second "-" dash and from 8 to 32 additional lowercase // letters or digits. // // This member is required. DestinationParentId *string // The unique identifier (ID) of the root or organizational unit that you want to // move the account from. The regex pattern (http://wikipedia.org/wiki/regex) for // a parent ID string requires one of the following: // - Root - A string that begins with "r-" followed by from 4 to 32 lowercase // letters or digits. // - Organizational unit (OU) - A string that begins with "ou-" followed by from // 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This // string is followed by a second "-" dash and from 8 to 32 additional lowercase // letters or digits. // // This member is required. SourceParentId *string noSmithyDocumentSerde } type MoveAccountOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationMoveAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpMoveAccount{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpMoveAccount{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpMoveAccountValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opMoveAccount(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opMoveAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "MoveAccount", } }
150
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates or updates a resource policy. You can only call this operation from the // organization's management account. func (c *Client) PutResourcePolicy(ctx context.Context, params *PutResourcePolicyInput, optFns ...func(*Options)) (*PutResourcePolicyOutput, error) { if params == nil { params = &PutResourcePolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "PutResourcePolicy", params, optFns, c.addOperationPutResourcePolicyMiddlewares) if err != nil { return nil, err } out := result.(*PutResourcePolicyOutput) out.ResultMetadata = metadata return out, nil } type PutResourcePolicyInput struct { // If provided, the new content for the resource policy. The text must be // correctly formatted JSON that complies with the syntax for the resource policy's // type. For more information, see Service Control Policy Syntax (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_scp-syntax.html) // in the Organizations User Guide. // // This member is required. Content *string // A list of tags that you want to attach to the newly created resource policy. // For each tag in the list, you must specify both a tag key and a value. You can // set the value to an empty string, but you can't set it to null . For more // information about tagging, see Tagging Organizations resources (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html) // in the Organizations User Guide. Calls with tags apply to the initial creation // of the resource policy, otherwise an exception is thrown. If any one of the tags // is not valid or if you exceed the allowed number of tags for the resource // policy, then the entire request fails and the resource policy is not created. Tags []types.Tag noSmithyDocumentSerde } type PutResourcePolicyOutput struct { // A structure that contains details about the resource policy. ResourcePolicy *types.ResourcePolicy // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationPutResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutResourcePolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutResourcePolicy{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpPutResourcePolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutResourcePolicy(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opPutResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "PutResourcePolicy", } }
139
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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" ) // Enables the specified member account to administer the Organizations features // of the specified Amazon Web Services service. It grants read-only access to // Organizations service data. The account still requires IAM permissions to access // and administer the Amazon Web Services service. You can run this action only for // Amazon Web Services services that support this feature. For a current list of // services that support it, see the column Supports Delegated Administrator in the // table at Amazon Web Services Services that you can use with Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services_list.html) // in the Organizations User Guide. This operation can be called only from the // organization's management account. func (c *Client) RegisterDelegatedAdministrator(ctx context.Context, params *RegisterDelegatedAdministratorInput, optFns ...func(*Options)) (*RegisterDelegatedAdministratorOutput, error) { if params == nil { params = &RegisterDelegatedAdministratorInput{} } result, metadata, err := c.invokeOperation(ctx, "RegisterDelegatedAdministrator", params, optFns, c.addOperationRegisterDelegatedAdministratorMiddlewares) if err != nil { return nil, err } out := result.(*RegisterDelegatedAdministratorOutput) out.ResultMetadata = metadata return out, nil } type RegisterDelegatedAdministratorInput struct { // The account ID number of the member account in the organization to register as // a delegated administrator. // // This member is required. AccountId *string // The service principal of the Amazon Web Services service for which you want to // make the member account a delegated administrator. // // This member is required. ServicePrincipal *string noSmithyDocumentSerde } type RegisterDelegatedAdministratorOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRegisterDelegatedAdministratorMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpRegisterDelegatedAdministrator{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRegisterDelegatedAdministrator{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpRegisterDelegatedAdministratorValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterDelegatedAdministrator(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opRegisterDelegatedAdministrator(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "RegisterDelegatedAdministrator", } }
135
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Removes the specified account from the organization. The removed account // becomes a standalone account that isn't a member of any organization. It's no // longer subject to any policies and is responsible for its own bill payments. The // organization's management account is no longer charged for any expenses accrued // by the member account after it's removed from the organization. This operation // can be called only from the organization's management account. Member accounts // can remove themselves with LeaveOrganization instead. // - You can remove an account from your organization only if the account is // configured with the information required to operate as a standalone account. // When you create an account in an organization using the Organizations console, // API, or CLI commands, the information required of standalone accounts is not // automatically collected. For an account that you want to make standalone, you // must choose a support plan, provide and verify the required contact information, // and provide a current payment method. Amazon Web Services uses the payment // method to charge for any billable (not free tier) Amazon Web Services activity // that occurs while the account isn't attached to an organization. To remove an // account that doesn't yet have this information, you must sign in as the member // account and follow the steps at To leave an organization when all required // account information has not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) // in the Organizations User Guide. // - The account that you want to leave must not be a delegated administrator // account for any Amazon Web Services service enabled for your organization. If // the account is a delegated administrator, you must first change the delegated // administrator account to another account that is remaining in the organization. // - After the account leaves the organization, all tags that were attached to // the account object in the organization are deleted. Amazon Web Services accounts // outside of an organization do not support tags. func (c *Client) RemoveAccountFromOrganization(ctx context.Context, params *RemoveAccountFromOrganizationInput, optFns ...func(*Options)) (*RemoveAccountFromOrganizationOutput, error) { if params == nil { params = &RemoveAccountFromOrganizationInput{} } result, metadata, err := c.invokeOperation(ctx, "RemoveAccountFromOrganization", params, optFns, c.addOperationRemoveAccountFromOrganizationMiddlewares) if err != nil { return nil, err } out := result.(*RemoveAccountFromOrganizationOutput) out.ResultMetadata = metadata return out, nil } type RemoveAccountFromOrganizationInput struct { // The unique identifier (ID) of the member account that you want to remove from // the organization. The regex pattern (http://wikipedia.org/wiki/regex) for an // account ID string requires exactly 12 digits. // // This member is required. AccountId *string noSmithyDocumentSerde } type RemoveAccountFromOrganizationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRemoveAccountFromOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpRemoveAccountFromOrganization{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRemoveAccountFromOrganization{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpRemoveAccountFromOrganizationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveAccountFromOrganization(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opRemoveAccountFromOrganization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "RemoveAccountFromOrganization", } }
148
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Adds one or more tags to the specified resource. Currently, you can attach tags // to the following resources in Organizations. // - Amazon Web Services account // - Organization root // - Organizational unit (OU) // - Policy (any type) // // This operation can be called only from the organization's management account. func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { params = &TagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) if err != nil { return nil, err } out := result.(*TagResourceOutput) out.ResultMetadata = metadata return out, nil } type TagResourceInput struct { // The ID of the resource to add a tag to. You can specify any of the following // taggable resources. // - Amazon Web Services account – specify the account ID number. // - Organizational unit – specify the OU ID that begins with ou- and looks // similar to: ou-1a2b-34uvwxyz // - Root – specify the root ID that begins with r- and looks similar to: r-1a2b // - Policy – specify the policy ID that begins with p- andlooks similar to: // p-12abcdefg3 // // This member is required. ResourceId *string // A list of tags to add to the specified resource. For each tag in the list, you // must specify both a tag key and a value. The value can be an empty string, but // you can't set it to null . If any one of the tags is not valid or if you exceed // the maximum allowed number of tags for a resource, then the entire request // fails. // // This member is required. Tags []types.Tag noSmithyDocumentSerde } type TagResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_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: "organizations", OperationName: "TagResource", } }
144
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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 any tags with the specified keys from the specified resource. You can // attach tags to the following resources in Organizations. // - Amazon Web Services account // - Organization root // - Organizational unit (OU) // - Policy (any type) // // This operation can be called only from the organization's management account. 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 ID of the resource to remove a tag from. You can specify any of the // following taggable resources. // - Amazon Web Services account – specify the account ID number. // - Organizational unit – specify the OU ID that begins with ou- and looks // similar to: ou-1a2b-34uvwxyz // - Root – specify the root ID that begins with r- and looks similar to: r-1a2b // - Policy – specify the policy ID that begins with p- andlooks similar to: // p-12abcdefg3 // // This member is required. ResourceId *string // The list of keys for tags to remove from the specified resource. // // 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(&awsAwsjson11_serializeOpUntagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_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: "organizations", OperationName: "UntagResource", } }
139
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Renames the specified organizational unit (OU). The ID and ARN don't change. // The child OUs and accounts remain in place, and any attached policies of the OU // remain attached. This operation can be called only from the organization's // management account. func (c *Client) UpdateOrganizationalUnit(ctx context.Context, params *UpdateOrganizationalUnitInput, optFns ...func(*Options)) (*UpdateOrganizationalUnitOutput, error) { if params == nil { params = &UpdateOrganizationalUnitInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateOrganizationalUnit", params, optFns, c.addOperationUpdateOrganizationalUnitMiddlewares) if err != nil { return nil, err } out := result.(*UpdateOrganizationalUnitOutput) out.ResultMetadata = metadata return out, nil } type UpdateOrganizationalUnitInput struct { // The unique identifier (ID) of the OU that you want to rename. You can get the // ID from the ListOrganizationalUnitsForParent operation. The regex pattern (http://wikipedia.org/wiki/regex) // for an organizational unit ID string requires "ou-" followed by from 4 to 32 // lowercase letters or digits (the ID of the root that contains the OU). This // string is followed by a second "-" dash and from 8 to 32 additional lowercase // letters or digits. // // This member is required. OrganizationalUnitId *string // The new name that you want to assign to the OU. The regex pattern (http://wikipedia.org/wiki/regex) // that is used to validate this parameter is a string of any of the characters in // the ASCII character range. Name *string noSmithyDocumentSerde } type UpdateOrganizationalUnitOutput struct { // A structure that contains the details about the specified OU, including its new // name. OrganizationalUnit *types.OrganizationalUnit // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateOrganizationalUnitMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateOrganizationalUnit{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateOrganizationalUnit{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateOrganizationalUnitValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateOrganizationalUnit(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateOrganizationalUnit(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "UpdateOrganizationalUnit", } }
139
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates an existing policy with a new name, description, or content. If you // don't supply any parameter, that value remains unchanged. You can't change a // policy's type. This operation can be called only from the organization's // management account. func (c *Client) UpdatePolicy(ctx context.Context, params *UpdatePolicyInput, optFns ...func(*Options)) (*UpdatePolicyOutput, error) { if params == nil { params = &UpdatePolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdatePolicy", params, optFns, c.addOperationUpdatePolicyMiddlewares) if err != nil { return nil, err } out := result.(*UpdatePolicyOutput) out.ResultMetadata = metadata return out, nil } type UpdatePolicyInput struct { // The unique identifier (ID) of the policy that you want to update. The regex // pattern (http://wikipedia.org/wiki/regex) for a policy ID string requires "p-" // followed by from 8 to 128 lowercase or uppercase letters, digits, or the // underscore character (_). // // This member is required. PolicyId *string // If provided, the new content for the policy. The text must be correctly // formatted JSON that complies with the syntax for the policy's type. For more // information, see Service Control Policy Syntax (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_scp-syntax.html) // in the Organizations User Guide. Content *string // If provided, the new description for the policy. Description *string // If provided, the new name for the policy. The regex pattern (http://wikipedia.org/wiki/regex) // that is used to validate this parameter is a string of any of the characters in // the ASCII character range. Name *string noSmithyDocumentSerde } type UpdatePolicyOutput struct { // A structure that contains details about the updated policy, showing the // requested changes. Policy *types.Policy // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdatePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdatePolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdatePolicy{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdatePolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePolicy(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdatePolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "organizations", OperationName: "UpdatePolicy", } }
146
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/organizations/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "io/ioutil" "strings" ) type awsAwsjson11_deserializeOpAcceptHandshake struct { } func (*awsAwsjson11_deserializeOpAcceptHandshake) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpAcceptHandshake) 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_deserializeOpErrorAcceptHandshake(response, &metadata) } output := &AcceptHandshakeOutput{} 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_deserializeOpDocumentAcceptHandshakeOutput(&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_deserializeOpErrorAcceptHandshake(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("AccessDeniedForDependencyException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedForDependencyException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("HandshakeAlreadyInStateException", errorCode): return awsAwsjson11_deserializeErrorHandshakeAlreadyInStateException(response, errorBody) case strings.EqualFold("HandshakeConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorHandshakeConstraintViolationException(response, errorBody) case strings.EqualFold("HandshakeNotFoundException", errorCode): return awsAwsjson11_deserializeErrorHandshakeNotFoundException(response, errorBody) case strings.EqualFold("InvalidHandshakeTransitionException", errorCode): return awsAwsjson11_deserializeErrorInvalidHandshakeTransitionException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpAttachPolicy struct { } func (*awsAwsjson11_deserializeOpAttachPolicy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpAttachPolicy) 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_deserializeOpErrorAttachPolicy(response, &metadata) } output := &AttachPolicyOutput{} 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_deserializeOpErrorAttachPolicy(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("DuplicatePolicyAttachmentException", errorCode): return awsAwsjson11_deserializeErrorDuplicatePolicyAttachmentException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("PolicyChangesInProgressException", errorCode): return awsAwsjson11_deserializeErrorPolicyChangesInProgressException(response, errorBody) case strings.EqualFold("PolicyNotFoundException", errorCode): return awsAwsjson11_deserializeErrorPolicyNotFoundException(response, errorBody) case strings.EqualFold("PolicyTypeNotEnabledException", errorCode): return awsAwsjson11_deserializeErrorPolicyTypeNotEnabledException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TargetNotFoundException", errorCode): return awsAwsjson11_deserializeErrorTargetNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCancelHandshake struct { } func (*awsAwsjson11_deserializeOpCancelHandshake) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCancelHandshake) 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_deserializeOpErrorCancelHandshake(response, &metadata) } output := &CancelHandshakeOutput{} 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_deserializeOpDocumentCancelHandshakeOutput(&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_deserializeOpErrorCancelHandshake(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("HandshakeAlreadyInStateException", errorCode): return awsAwsjson11_deserializeErrorHandshakeAlreadyInStateException(response, errorBody) case strings.EqualFold("HandshakeNotFoundException", errorCode): return awsAwsjson11_deserializeErrorHandshakeNotFoundException(response, errorBody) case strings.EqualFold("InvalidHandshakeTransitionException", errorCode): return awsAwsjson11_deserializeErrorInvalidHandshakeTransitionException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCloseAccount struct { } func (*awsAwsjson11_deserializeOpCloseAccount) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCloseAccount) 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_deserializeOpErrorCloseAccount(response, &metadata) } output := &CloseAccountOutput{} 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_deserializeOpErrorCloseAccount(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("AccountAlreadyClosedException", errorCode): return awsAwsjson11_deserializeErrorAccountAlreadyClosedException(response, errorBody) case strings.EqualFold("AccountNotFoundException", errorCode): return awsAwsjson11_deserializeErrorAccountNotFoundException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsAwsjson11_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateAccount struct { } func (*awsAwsjson11_deserializeOpCreateAccount) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateAccount) 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_deserializeOpErrorCreateAccount(response, &metadata) } output := &CreateAccountOutput{} 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_deserializeOpDocumentCreateAccountOutput(&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_deserializeOpErrorCreateAccount(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("FinalizingOrganizationException", errorCode): return awsAwsjson11_deserializeErrorFinalizingOrganizationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateGovCloudAccount struct { } func (*awsAwsjson11_deserializeOpCreateGovCloudAccount) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateGovCloudAccount) 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_deserializeOpErrorCreateGovCloudAccount(response, &metadata) } output := &CreateGovCloudAccountOutput{} 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_deserializeOpDocumentCreateGovCloudAccountOutput(&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_deserializeOpErrorCreateGovCloudAccount(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("FinalizingOrganizationException", errorCode): return awsAwsjson11_deserializeErrorFinalizingOrganizationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateOrganization struct { } func (*awsAwsjson11_deserializeOpCreateOrganization) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateOrganization) 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_deserializeOpErrorCreateOrganization(response, &metadata) } output := &CreateOrganizationOutput{} 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_deserializeOpDocumentCreateOrganizationOutput(&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_deserializeOpErrorCreateOrganization(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("AccessDeniedForDependencyException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedForDependencyException(response, errorBody) case strings.EqualFold("AlreadyInOrganizationException", errorCode): return awsAwsjson11_deserializeErrorAlreadyInOrganizationException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateOrganizationalUnit struct { } func (*awsAwsjson11_deserializeOpCreateOrganizationalUnit) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateOrganizationalUnit) 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_deserializeOpErrorCreateOrganizationalUnit(response, &metadata) } output := &CreateOrganizationalUnitOutput{} 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_deserializeOpDocumentCreateOrganizationalUnitOutput(&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_deserializeOpErrorCreateOrganizationalUnit(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("DuplicateOrganizationalUnitException", errorCode): return awsAwsjson11_deserializeErrorDuplicateOrganizationalUnitException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ParentNotFoundException", errorCode): return awsAwsjson11_deserializeErrorParentNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreatePolicy struct { } func (*awsAwsjson11_deserializeOpCreatePolicy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreatePolicy) 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_deserializeOpErrorCreatePolicy(response, &metadata) } output := &CreatePolicyOutput{} 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_deserializeOpDocumentCreatePolicyOutput(&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_deserializeOpErrorCreatePolicy(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("DuplicatePolicyException", errorCode): return awsAwsjson11_deserializeErrorDuplicatePolicyException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("MalformedPolicyDocumentException", errorCode): return awsAwsjson11_deserializeErrorMalformedPolicyDocumentException(response, errorBody) case strings.EqualFold("PolicyTypeNotAvailableForOrganizationException", errorCode): return awsAwsjson11_deserializeErrorPolicyTypeNotAvailableForOrganizationException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeclineHandshake struct { } func (*awsAwsjson11_deserializeOpDeclineHandshake) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeclineHandshake) 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_deserializeOpErrorDeclineHandshake(response, &metadata) } output := &DeclineHandshakeOutput{} 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_deserializeOpDocumentDeclineHandshakeOutput(&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_deserializeOpErrorDeclineHandshake(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("HandshakeAlreadyInStateException", errorCode): return awsAwsjson11_deserializeErrorHandshakeAlreadyInStateException(response, errorBody) case strings.EqualFold("HandshakeNotFoundException", errorCode): return awsAwsjson11_deserializeErrorHandshakeNotFoundException(response, errorBody) case strings.EqualFold("InvalidHandshakeTransitionException", errorCode): return awsAwsjson11_deserializeErrorInvalidHandshakeTransitionException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteOrganization struct { } func (*awsAwsjson11_deserializeOpDeleteOrganization) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteOrganization) 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_deserializeOpErrorDeleteOrganization(response, &metadata) } output := &DeleteOrganizationOutput{} 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_deserializeOpErrorDeleteOrganization(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("OrganizationNotEmptyException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotEmptyException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteOrganizationalUnit struct { } func (*awsAwsjson11_deserializeOpDeleteOrganizationalUnit) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteOrganizationalUnit) 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_deserializeOpErrorDeleteOrganizationalUnit(response, &metadata) } output := &DeleteOrganizationalUnitOutput{} 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_deserializeOpErrorDeleteOrganizationalUnit(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("OrganizationalUnitNotEmptyException", errorCode): return awsAwsjson11_deserializeErrorOrganizationalUnitNotEmptyException(response, errorBody) case strings.EqualFold("OrganizationalUnitNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationalUnitNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeletePolicy struct { } func (*awsAwsjson11_deserializeOpDeletePolicy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeletePolicy) 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_deserializeOpErrorDeletePolicy(response, &metadata) } output := &DeletePolicyOutput{} 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_deserializeOpErrorDeletePolicy(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("PolicyInUseException", errorCode): return awsAwsjson11_deserializeErrorPolicyInUseException(response, errorBody) case strings.EqualFold("PolicyNotFoundException", errorCode): return awsAwsjson11_deserializeErrorPolicyNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteResourcePolicy struct { } func (*awsAwsjson11_deserializeOpDeleteResourcePolicy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response, &metadata) } output := &DeleteResourcePolicyOutput{} 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_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("ResourcePolicyNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourcePolicyNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeregisterDelegatedAdministrator struct { } func (*awsAwsjson11_deserializeOpDeregisterDelegatedAdministrator) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeregisterDelegatedAdministrator) 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_deserializeOpErrorDeregisterDelegatedAdministrator(response, &metadata) } output := &DeregisterDelegatedAdministratorOutput{} 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_deserializeOpErrorDeregisterDelegatedAdministrator(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("AccountNotFoundException", errorCode): return awsAwsjson11_deserializeErrorAccountNotFoundException(response, errorBody) case strings.EqualFold("AccountNotRegisteredException", errorCode): return awsAwsjson11_deserializeErrorAccountNotRegisteredException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeAccount struct { } func (*awsAwsjson11_deserializeOpDescribeAccount) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeAccount) 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_deserializeOpErrorDescribeAccount(response, &metadata) } output := &DescribeAccountOutput{} 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_deserializeOpDocumentDescribeAccountOutput(&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_deserializeOpErrorDescribeAccount(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("AccountNotFoundException", errorCode): return awsAwsjson11_deserializeErrorAccountNotFoundException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeCreateAccountStatus struct { } func (*awsAwsjson11_deserializeOpDescribeCreateAccountStatus) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeCreateAccountStatus) 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_deserializeOpErrorDescribeCreateAccountStatus(response, &metadata) } output := &DescribeCreateAccountStatusOutput{} 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_deserializeOpDocumentDescribeCreateAccountStatusOutput(&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_deserializeOpErrorDescribeCreateAccountStatus(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("CreateAccountStatusNotFoundException", errorCode): return awsAwsjson11_deserializeErrorCreateAccountStatusNotFoundException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeEffectivePolicy struct { } func (*awsAwsjson11_deserializeOpDescribeEffectivePolicy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeEffectivePolicy) 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_deserializeOpErrorDescribeEffectivePolicy(response, &metadata) } output := &DescribeEffectivePolicyOutput{} 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_deserializeOpDocumentDescribeEffectivePolicyOutput(&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_deserializeOpErrorDescribeEffectivePolicy(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("EffectivePolicyNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEffectivePolicyNotFoundException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TargetNotFoundException", errorCode): return awsAwsjson11_deserializeErrorTargetNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeHandshake struct { } func (*awsAwsjson11_deserializeOpDescribeHandshake) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeHandshake) 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_deserializeOpErrorDescribeHandshake(response, &metadata) } output := &DescribeHandshakeOutput{} 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_deserializeOpDocumentDescribeHandshakeOutput(&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_deserializeOpErrorDescribeHandshake(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("HandshakeNotFoundException", errorCode): return awsAwsjson11_deserializeErrorHandshakeNotFoundException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeOrganization struct { } func (*awsAwsjson11_deserializeOpDescribeOrganization) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeOrganization) 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_deserializeOpErrorDescribeOrganization(response, &metadata) } output := &DescribeOrganizationOutput{} 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_deserializeOpDocumentDescribeOrganizationOutput(&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_deserializeOpErrorDescribeOrganization(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeOrganizationalUnit struct { } func (*awsAwsjson11_deserializeOpDescribeOrganizationalUnit) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeOrganizationalUnit) 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_deserializeOpErrorDescribeOrganizationalUnit(response, &metadata) } output := &DescribeOrganizationalUnitOutput{} 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_deserializeOpDocumentDescribeOrganizationalUnitOutput(&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_deserializeOpErrorDescribeOrganizationalUnit(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("OrganizationalUnitNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationalUnitNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribePolicy struct { } func (*awsAwsjson11_deserializeOpDescribePolicy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribePolicy) 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_deserializeOpErrorDescribePolicy(response, &metadata) } output := &DescribePolicyOutput{} 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_deserializeOpDocumentDescribePolicyOutput(&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_deserializeOpErrorDescribePolicy(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("PolicyNotFoundException", errorCode): return awsAwsjson11_deserializeErrorPolicyNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeResourcePolicy struct { } func (*awsAwsjson11_deserializeOpDescribeResourcePolicy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeResourcePolicy) 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_deserializeOpErrorDescribeResourcePolicy(response, &metadata) } output := &DescribeResourcePolicyOutput{} 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_deserializeOpDocumentDescribeResourcePolicyOutput(&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_deserializeOpErrorDescribeResourcePolicy(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("ResourcePolicyNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourcePolicyNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDetachPolicy struct { } func (*awsAwsjson11_deserializeOpDetachPolicy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDetachPolicy) 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_deserializeOpErrorDetachPolicy(response, &metadata) } output := &DetachPolicyOutput{} 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_deserializeOpErrorDetachPolicy(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("PolicyChangesInProgressException", errorCode): return awsAwsjson11_deserializeErrorPolicyChangesInProgressException(response, errorBody) case strings.EqualFold("PolicyNotAttachedException", errorCode): return awsAwsjson11_deserializeErrorPolicyNotAttachedException(response, errorBody) case strings.EqualFold("PolicyNotFoundException", errorCode): return awsAwsjson11_deserializeErrorPolicyNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TargetNotFoundException", errorCode): return awsAwsjson11_deserializeErrorTargetNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDisableAWSServiceAccess struct { } func (*awsAwsjson11_deserializeOpDisableAWSServiceAccess) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDisableAWSServiceAccess) 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_deserializeOpErrorDisableAWSServiceAccess(response, &metadata) } output := &DisableAWSServiceAccessOutput{} 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_deserializeOpErrorDisableAWSServiceAccess(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDisablePolicyType struct { } func (*awsAwsjson11_deserializeOpDisablePolicyType) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDisablePolicyType) 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_deserializeOpErrorDisablePolicyType(response, &metadata) } output := &DisablePolicyTypeOutput{} 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_deserializeOpDocumentDisablePolicyTypeOutput(&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_deserializeOpErrorDisablePolicyType(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("PolicyChangesInProgressException", errorCode): return awsAwsjson11_deserializeErrorPolicyChangesInProgressException(response, errorBody) case strings.EqualFold("PolicyTypeNotEnabledException", errorCode): return awsAwsjson11_deserializeErrorPolicyTypeNotEnabledException(response, errorBody) case strings.EqualFold("RootNotFoundException", errorCode): return awsAwsjson11_deserializeErrorRootNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpEnableAllFeatures struct { } func (*awsAwsjson11_deserializeOpEnableAllFeatures) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpEnableAllFeatures) 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_deserializeOpErrorEnableAllFeatures(response, &metadata) } output := &EnableAllFeaturesOutput{} 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_deserializeOpDocumentEnableAllFeaturesOutput(&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_deserializeOpErrorEnableAllFeatures(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("HandshakeConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorHandshakeConstraintViolationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpEnableAWSServiceAccess struct { } func (*awsAwsjson11_deserializeOpEnableAWSServiceAccess) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpEnableAWSServiceAccess) 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_deserializeOpErrorEnableAWSServiceAccess(response, &metadata) } output := &EnableAWSServiceAccessOutput{} 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_deserializeOpErrorEnableAWSServiceAccess(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpEnablePolicyType struct { } func (*awsAwsjson11_deserializeOpEnablePolicyType) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpEnablePolicyType) 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_deserializeOpErrorEnablePolicyType(response, &metadata) } output := &EnablePolicyTypeOutput{} 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_deserializeOpDocumentEnablePolicyTypeOutput(&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_deserializeOpErrorEnablePolicyType(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("PolicyChangesInProgressException", errorCode): return awsAwsjson11_deserializeErrorPolicyChangesInProgressException(response, errorBody) case strings.EqualFold("PolicyTypeAlreadyEnabledException", errorCode): return awsAwsjson11_deserializeErrorPolicyTypeAlreadyEnabledException(response, errorBody) case strings.EqualFold("PolicyTypeNotAvailableForOrganizationException", errorCode): return awsAwsjson11_deserializeErrorPolicyTypeNotAvailableForOrganizationException(response, errorBody) case strings.EqualFold("RootNotFoundException", errorCode): return awsAwsjson11_deserializeErrorRootNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpInviteAccountToOrganization struct { } func (*awsAwsjson11_deserializeOpInviteAccountToOrganization) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpInviteAccountToOrganization) 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_deserializeOpErrorInviteAccountToOrganization(response, &metadata) } output := &InviteAccountToOrganizationOutput{} 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_deserializeOpDocumentInviteAccountToOrganizationOutput(&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_deserializeOpErrorInviteAccountToOrganization(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("AccountOwnerNotVerifiedException", errorCode): return awsAwsjson11_deserializeErrorAccountOwnerNotVerifiedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("DuplicateHandshakeException", errorCode): return awsAwsjson11_deserializeErrorDuplicateHandshakeException(response, errorBody) case strings.EqualFold("FinalizingOrganizationException", errorCode): return awsAwsjson11_deserializeErrorFinalizingOrganizationException(response, errorBody) case strings.EqualFold("HandshakeConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorHandshakeConstraintViolationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpLeaveOrganization struct { } func (*awsAwsjson11_deserializeOpLeaveOrganization) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpLeaveOrganization) 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_deserializeOpErrorLeaveOrganization(response, &metadata) } output := &LeaveOrganizationOutput{} 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_deserializeOpErrorLeaveOrganization(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("AccountNotFoundException", errorCode): return awsAwsjson11_deserializeErrorAccountNotFoundException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("MasterCannotLeaveOrganizationException", errorCode): return awsAwsjson11_deserializeErrorMasterCannotLeaveOrganizationException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListAccounts struct { } func (*awsAwsjson11_deserializeOpListAccounts) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListAccounts) 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_deserializeOpErrorListAccounts(response, &metadata) } output := &ListAccountsOutput{} 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_deserializeOpDocumentListAccountsOutput(&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_deserializeOpErrorListAccounts(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListAccountsForParent struct { } func (*awsAwsjson11_deserializeOpListAccountsForParent) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListAccountsForParent) 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_deserializeOpErrorListAccountsForParent(response, &metadata) } output := &ListAccountsForParentOutput{} 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_deserializeOpDocumentListAccountsForParentOutput(&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_deserializeOpErrorListAccountsForParent(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ParentNotFoundException", errorCode): return awsAwsjson11_deserializeErrorParentNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListAWSServiceAccessForOrganization struct { } func (*awsAwsjson11_deserializeOpListAWSServiceAccessForOrganization) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListAWSServiceAccessForOrganization) 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_deserializeOpErrorListAWSServiceAccessForOrganization(response, &metadata) } output := &ListAWSServiceAccessForOrganizationOutput{} 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_deserializeOpDocumentListAWSServiceAccessForOrganizationOutput(&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_deserializeOpErrorListAWSServiceAccessForOrganization(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListChildren struct { } func (*awsAwsjson11_deserializeOpListChildren) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListChildren) 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_deserializeOpErrorListChildren(response, &metadata) } output := &ListChildrenOutput{} 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_deserializeOpDocumentListChildrenOutput(&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_deserializeOpErrorListChildren(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ParentNotFoundException", errorCode): return awsAwsjson11_deserializeErrorParentNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListCreateAccountStatus struct { } func (*awsAwsjson11_deserializeOpListCreateAccountStatus) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListCreateAccountStatus) 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_deserializeOpErrorListCreateAccountStatus(response, &metadata) } output := &ListCreateAccountStatusOutput{} 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_deserializeOpDocumentListCreateAccountStatusOutput(&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_deserializeOpErrorListCreateAccountStatus(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListDelegatedAdministrators struct { } func (*awsAwsjson11_deserializeOpListDelegatedAdministrators) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListDelegatedAdministrators) 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_deserializeOpErrorListDelegatedAdministrators(response, &metadata) } output := &ListDelegatedAdministratorsOutput{} 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_deserializeOpDocumentListDelegatedAdministratorsOutput(&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_deserializeOpErrorListDelegatedAdministrators(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListDelegatedServicesForAccount struct { } func (*awsAwsjson11_deserializeOpListDelegatedServicesForAccount) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListDelegatedServicesForAccount) 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_deserializeOpErrorListDelegatedServicesForAccount(response, &metadata) } output := &ListDelegatedServicesForAccountOutput{} 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_deserializeOpDocumentListDelegatedServicesForAccountOutput(&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_deserializeOpErrorListDelegatedServicesForAccount(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("AccountNotFoundException", errorCode): return awsAwsjson11_deserializeErrorAccountNotFoundException(response, errorBody) case strings.EqualFold("AccountNotRegisteredException", errorCode): return awsAwsjson11_deserializeErrorAccountNotRegisteredException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListHandshakesForAccount struct { } func (*awsAwsjson11_deserializeOpListHandshakesForAccount) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListHandshakesForAccount) 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_deserializeOpErrorListHandshakesForAccount(response, &metadata) } output := &ListHandshakesForAccountOutput{} 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_deserializeOpDocumentListHandshakesForAccountOutput(&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_deserializeOpErrorListHandshakesForAccount(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListHandshakesForOrganization struct { } func (*awsAwsjson11_deserializeOpListHandshakesForOrganization) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListHandshakesForOrganization) 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_deserializeOpErrorListHandshakesForOrganization(response, &metadata) } output := &ListHandshakesForOrganizationOutput{} 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_deserializeOpDocumentListHandshakesForOrganizationOutput(&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_deserializeOpErrorListHandshakesForOrganization(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListOrganizationalUnitsForParent struct { } func (*awsAwsjson11_deserializeOpListOrganizationalUnitsForParent) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListOrganizationalUnitsForParent) 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_deserializeOpErrorListOrganizationalUnitsForParent(response, &metadata) } output := &ListOrganizationalUnitsForParentOutput{} 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_deserializeOpDocumentListOrganizationalUnitsForParentOutput(&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_deserializeOpErrorListOrganizationalUnitsForParent(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ParentNotFoundException", errorCode): return awsAwsjson11_deserializeErrorParentNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListParents struct { } func (*awsAwsjson11_deserializeOpListParents) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListParents) 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_deserializeOpErrorListParents(response, &metadata) } output := &ListParentsOutput{} 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_deserializeOpDocumentListParentsOutput(&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_deserializeOpErrorListParents(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ChildNotFoundException", errorCode): return awsAwsjson11_deserializeErrorChildNotFoundException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListPolicies struct { } func (*awsAwsjson11_deserializeOpListPolicies) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListPolicies) 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_deserializeOpErrorListPolicies(response, &metadata) } output := &ListPoliciesOutput{} 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_deserializeOpDocumentListPoliciesOutput(&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_deserializeOpErrorListPolicies(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListPoliciesForTarget struct { } func (*awsAwsjson11_deserializeOpListPoliciesForTarget) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListPoliciesForTarget) 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_deserializeOpErrorListPoliciesForTarget(response, &metadata) } output := &ListPoliciesForTargetOutput{} 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_deserializeOpDocumentListPoliciesForTargetOutput(&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_deserializeOpErrorListPoliciesForTarget(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TargetNotFoundException", errorCode): return awsAwsjson11_deserializeErrorTargetNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListRoots struct { } func (*awsAwsjson11_deserializeOpListRoots) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListRoots) 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_deserializeOpErrorListRoots(response, &metadata) } output := &ListRootsOutput{} 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_deserializeOpDocumentListRootsOutput(&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_deserializeOpErrorListRoots(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListTagsForResource struct { } func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_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, awsAwsjson11_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 = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&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_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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TargetNotFoundException", errorCode): return awsAwsjson11_deserializeErrorTargetNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListTargetsForPolicy struct { } func (*awsAwsjson11_deserializeOpListTargetsForPolicy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListTargetsForPolicy) 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_deserializeOpErrorListTargetsForPolicy(response, &metadata) } output := &ListTargetsForPolicyOutput{} 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_deserializeOpDocumentListTargetsForPolicyOutput(&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_deserializeOpErrorListTargetsForPolicy(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("PolicyNotFoundException", errorCode): return awsAwsjson11_deserializeErrorPolicyNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpMoveAccount struct { } func (*awsAwsjson11_deserializeOpMoveAccount) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpMoveAccount) 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_deserializeOpErrorMoveAccount(response, &metadata) } output := &MoveAccountOutput{} 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_deserializeOpErrorMoveAccount(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("AccountNotFoundException", errorCode): return awsAwsjson11_deserializeErrorAccountNotFoundException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("DestinationParentNotFoundException", errorCode): return awsAwsjson11_deserializeErrorDestinationParentNotFoundException(response, errorBody) case strings.EqualFold("DuplicateAccountException", errorCode): return awsAwsjson11_deserializeErrorDuplicateAccountException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("SourceParentNotFoundException", errorCode): return awsAwsjson11_deserializeErrorSourceParentNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpPutResourcePolicy struct { } func (*awsAwsjson11_deserializeOpPutResourcePolicy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpPutResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorPutResourcePolicy(response, &metadata) } output := &PutResourcePolicyOutput{} 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_deserializeOpDocumentPutResourcePolicyOutput(&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_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpRegisterDelegatedAdministrator struct { } func (*awsAwsjson11_deserializeOpRegisterDelegatedAdministrator) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpRegisterDelegatedAdministrator) 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_deserializeOpErrorRegisterDelegatedAdministrator(response, &metadata) } output := &RegisterDelegatedAdministratorOutput{} 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_deserializeOpErrorRegisterDelegatedAdministrator(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("AccountAlreadyRegisteredException", errorCode): return awsAwsjson11_deserializeErrorAccountAlreadyRegisteredException(response, errorBody) case strings.EqualFold("AccountNotFoundException", errorCode): return awsAwsjson11_deserializeErrorAccountNotFoundException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpRemoveAccountFromOrganization struct { } func (*awsAwsjson11_deserializeOpRemoveAccountFromOrganization) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpRemoveAccountFromOrganization) 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_deserializeOpErrorRemoveAccountFromOrganization(response, &metadata) } output := &RemoveAccountFromOrganizationOutput{} 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_deserializeOpErrorRemoveAccountFromOrganization(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("AccountNotFoundException", errorCode): return awsAwsjson11_deserializeErrorAccountNotFoundException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("MasterCannotLeaveOrganizationException", errorCode): return awsAwsjson11_deserializeErrorMasterCannotLeaveOrganizationException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpTagResource struct { } func (*awsAwsjson11_deserializeOpTagResource) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_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, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) } output := &TagResourceOutput{} 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_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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TargetNotFoundException", errorCode): return awsAwsjson11_deserializeErrorTargetNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUntagResource struct { } func (*awsAwsjson11_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_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, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) } output := &UntagResourceOutput{} 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_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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TargetNotFoundException", errorCode): return awsAwsjson11_deserializeErrorTargetNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateOrganizationalUnit struct { } func (*awsAwsjson11_deserializeOpUpdateOrganizationalUnit) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateOrganizationalUnit) 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_deserializeOpErrorUpdateOrganizationalUnit(response, &metadata) } output := &UpdateOrganizationalUnitOutput{} 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_deserializeOpDocumentUpdateOrganizationalUnitOutput(&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_deserializeOpErrorUpdateOrganizationalUnit(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("DuplicateOrganizationalUnitException", errorCode): return awsAwsjson11_deserializeErrorDuplicateOrganizationalUnitException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("OrganizationalUnitNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationalUnitNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdatePolicy struct { } func (*awsAwsjson11_deserializeOpUpdatePolicy) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdatePolicy) 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_deserializeOpErrorUpdatePolicy(response, &metadata) } output := &UpdatePolicyOutput{} 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_deserializeOpDocumentUpdatePolicyOutput(&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_deserializeOpErrorUpdatePolicy(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("AWSOrganizationsNotInUseException", errorCode): return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("ConstraintViolationException", errorCode): return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) case strings.EqualFold("DuplicatePolicyException", errorCode): return awsAwsjson11_deserializeErrorDuplicatePolicyException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("MalformedPolicyDocumentException", errorCode): return awsAwsjson11_deserializeErrorMalformedPolicyDocumentException(response, errorBody) case strings.EqualFold("PolicyChangesInProgressException", errorCode): return awsAwsjson11_deserializeErrorPolicyChangesInProgressException(response, errorBody) case strings.EqualFold("PolicyNotFoundException", errorCode): return awsAwsjson11_deserializeErrorPolicyNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsAwsjson11_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsAwsjson11_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 := awsAwsjson11_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 awsAwsjson11_deserializeErrorAccessDeniedForDependencyException(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.AccessDeniedForDependencyException{} err := awsAwsjson11_deserializeDocumentAccessDeniedForDependencyException(&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_deserializeErrorAccountAlreadyClosedException(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.AccountAlreadyClosedException{} err := awsAwsjson11_deserializeDocumentAccountAlreadyClosedException(&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_deserializeErrorAccountAlreadyRegisteredException(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.AccountAlreadyRegisteredException{} err := awsAwsjson11_deserializeDocumentAccountAlreadyRegisteredException(&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_deserializeErrorAccountNotFoundException(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.AccountNotFoundException{} err := awsAwsjson11_deserializeDocumentAccountNotFoundException(&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_deserializeErrorAccountNotRegisteredException(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.AccountNotRegisteredException{} err := awsAwsjson11_deserializeDocumentAccountNotRegisteredException(&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_deserializeErrorAccountOwnerNotVerifiedException(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.AccountOwnerNotVerifiedException{} err := awsAwsjson11_deserializeDocumentAccountOwnerNotVerifiedException(&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_deserializeErrorAlreadyInOrganizationException(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.AlreadyInOrganizationException{} err := awsAwsjson11_deserializeDocumentAlreadyInOrganizationException(&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_deserializeErrorAWSOrganizationsNotInUseException(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.AWSOrganizationsNotInUseException{} err := awsAwsjson11_deserializeDocumentAWSOrganizationsNotInUseException(&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_deserializeErrorChildNotFoundException(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.ChildNotFoundException{} err := awsAwsjson11_deserializeDocumentChildNotFoundException(&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_deserializeErrorConcurrentModificationException(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.ConcurrentModificationException{} err := awsAwsjson11_deserializeDocumentConcurrentModificationException(&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_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 := awsAwsjson11_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 awsAwsjson11_deserializeErrorConstraintViolationException(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.ConstraintViolationException{} err := awsAwsjson11_deserializeDocumentConstraintViolationException(&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_deserializeErrorCreateAccountStatusNotFoundException(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.CreateAccountStatusNotFoundException{} err := awsAwsjson11_deserializeDocumentCreateAccountStatusNotFoundException(&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_deserializeErrorDestinationParentNotFoundException(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.DestinationParentNotFoundException{} err := awsAwsjson11_deserializeDocumentDestinationParentNotFoundException(&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_deserializeErrorDuplicateAccountException(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.DuplicateAccountException{} err := awsAwsjson11_deserializeDocumentDuplicateAccountException(&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_deserializeErrorDuplicateHandshakeException(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.DuplicateHandshakeException{} err := awsAwsjson11_deserializeDocumentDuplicateHandshakeException(&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_deserializeErrorDuplicateOrganizationalUnitException(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.DuplicateOrganizationalUnitException{} err := awsAwsjson11_deserializeDocumentDuplicateOrganizationalUnitException(&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_deserializeErrorDuplicatePolicyAttachmentException(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.DuplicatePolicyAttachmentException{} err := awsAwsjson11_deserializeDocumentDuplicatePolicyAttachmentException(&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_deserializeErrorDuplicatePolicyException(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.DuplicatePolicyException{} err := awsAwsjson11_deserializeDocumentDuplicatePolicyException(&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_deserializeErrorEffectivePolicyNotFoundException(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.EffectivePolicyNotFoundException{} err := awsAwsjson11_deserializeDocumentEffectivePolicyNotFoundException(&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_deserializeErrorFinalizingOrganizationException(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.FinalizingOrganizationException{} err := awsAwsjson11_deserializeDocumentFinalizingOrganizationException(&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_deserializeErrorHandshakeAlreadyInStateException(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.HandshakeAlreadyInStateException{} err := awsAwsjson11_deserializeDocumentHandshakeAlreadyInStateException(&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_deserializeErrorHandshakeConstraintViolationException(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.HandshakeConstraintViolationException{} err := awsAwsjson11_deserializeDocumentHandshakeConstraintViolationException(&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_deserializeErrorHandshakeNotFoundException(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.HandshakeNotFoundException{} err := awsAwsjson11_deserializeDocumentHandshakeNotFoundException(&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_deserializeErrorInvalidHandshakeTransitionException(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.InvalidHandshakeTransitionException{} err := awsAwsjson11_deserializeDocumentInvalidHandshakeTransitionException(&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_deserializeErrorInvalidInputException(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.InvalidInputException{} err := awsAwsjson11_deserializeDocumentInvalidInputException(&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_deserializeErrorMalformedPolicyDocumentException(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.MalformedPolicyDocumentException{} err := awsAwsjson11_deserializeDocumentMalformedPolicyDocumentException(&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_deserializeErrorMasterCannotLeaveOrganizationException(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.MasterCannotLeaveOrganizationException{} err := awsAwsjson11_deserializeDocumentMasterCannotLeaveOrganizationException(&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_deserializeErrorOrganizationalUnitNotEmptyException(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.OrganizationalUnitNotEmptyException{} err := awsAwsjson11_deserializeDocumentOrganizationalUnitNotEmptyException(&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_deserializeErrorOrganizationalUnitNotFoundException(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.OrganizationalUnitNotFoundException{} err := awsAwsjson11_deserializeDocumentOrganizationalUnitNotFoundException(&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_deserializeErrorOrganizationNotEmptyException(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.OrganizationNotEmptyException{} err := awsAwsjson11_deserializeDocumentOrganizationNotEmptyException(&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_deserializeErrorParentNotFoundException(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.ParentNotFoundException{} err := awsAwsjson11_deserializeDocumentParentNotFoundException(&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_deserializeErrorPolicyChangesInProgressException(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.PolicyChangesInProgressException{} err := awsAwsjson11_deserializeDocumentPolicyChangesInProgressException(&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_deserializeErrorPolicyInUseException(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.PolicyInUseException{} err := awsAwsjson11_deserializeDocumentPolicyInUseException(&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_deserializeErrorPolicyNotAttachedException(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.PolicyNotAttachedException{} err := awsAwsjson11_deserializeDocumentPolicyNotAttachedException(&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_deserializeErrorPolicyNotFoundException(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.PolicyNotFoundException{} err := awsAwsjson11_deserializeDocumentPolicyNotFoundException(&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_deserializeErrorPolicyTypeAlreadyEnabledException(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.PolicyTypeAlreadyEnabledException{} err := awsAwsjson11_deserializeDocumentPolicyTypeAlreadyEnabledException(&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_deserializeErrorPolicyTypeNotAvailableForOrganizationException(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.PolicyTypeNotAvailableForOrganizationException{} err := awsAwsjson11_deserializeDocumentPolicyTypeNotAvailableForOrganizationException(&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_deserializeErrorPolicyTypeNotEnabledException(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.PolicyTypeNotEnabledException{} err := awsAwsjson11_deserializeDocumentPolicyTypeNotEnabledException(&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_deserializeErrorResourcePolicyNotFoundException(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.ResourcePolicyNotFoundException{} err := awsAwsjson11_deserializeDocumentResourcePolicyNotFoundException(&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_deserializeErrorRootNotFoundException(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.RootNotFoundException{} err := awsAwsjson11_deserializeDocumentRootNotFoundException(&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_deserializeErrorServiceException(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.ServiceException{} err := awsAwsjson11_deserializeDocumentServiceException(&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_deserializeErrorSourceParentNotFoundException(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.SourceParentNotFoundException{} err := awsAwsjson11_deserializeDocumentSourceParentNotFoundException(&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_deserializeErrorTargetNotFoundException(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.TargetNotFoundException{} err := awsAwsjson11_deserializeDocumentTargetNotFoundException(&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_deserializeErrorTooManyRequestsException(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.TooManyRequestsException{} err := awsAwsjson11_deserializeDocumentTooManyRequestsException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(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.UnsupportedAPIEndpointException{} err := awsAwsjson11_deserializeDocumentUnsupportedAPIEndpointException(&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_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 ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentAccessDeniedForDependencyException(v **types.AccessDeniedForDependencyException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AccessDeniedForDependencyException if *v == nil { sv = &types.AccessDeniedForDependencyException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccessDeniedForDependencyExceptionReason to be of type string, got %T instead", value) } sv.Reason = types.AccessDeniedForDependencyExceptionReason(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentAccount(v **types.Account, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Account if *v == nil { sv = &types.Account{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(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 "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "JoinedMethod": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountJoinedMethod to be of type string, got %T instead", value) } sv.JoinedMethod = types.AccountJoinedMethod(jtv) } case "JoinedTimestamp": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.JoinedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountName 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 AccountStatus to be of type string, got %T instead", value) } sv.Status = types.AccountStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentAccountAlreadyClosedException(v **types.AccountAlreadyClosedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AccountAlreadyClosedException if *v == nil { sv = &types.AccountAlreadyClosedException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentAccountAlreadyRegisteredException(v **types.AccountAlreadyRegisteredException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AccountAlreadyRegisteredException if *v == nil { sv = &types.AccountAlreadyRegisteredException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentAccountNotFoundException(v **types.AccountNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AccountNotFoundException if *v == nil { sv = &types.AccountNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentAccountNotRegisteredException(v **types.AccountNotRegisteredException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AccountNotRegisteredException if *v == nil { sv = &types.AccountNotRegisteredException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentAccountOwnerNotVerifiedException(v **types.AccountOwnerNotVerifiedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AccountOwnerNotVerifiedException if *v == nil { sv = &types.AccountOwnerNotVerifiedException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentAccounts(v *[]types.Account, 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.Account if *v == nil { cv = []types.Account{} } else { cv = *v } for _, value := range shape { var col types.Account destAddr := &col if err := awsAwsjson11_deserializeDocumentAccount(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentAlreadyInOrganizationException(v **types.AlreadyInOrganizationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AlreadyInOrganizationException if *v == nil { sv = &types.AlreadyInOrganizationException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentAWSOrganizationsNotInUseException(v **types.AWSOrganizationsNotInUseException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AWSOrganizationsNotInUseException if *v == nil { sv = &types.AWSOrganizationsNotInUseException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentChild(v **types.Child, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Child if *v == nil { sv = &types.Child{} } else { sv = *v } for key, value := range shape { switch key { case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChildId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChildType to be of type string, got %T instead", value) } sv.Type = types.ChildType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentChildNotFoundException(v **types.ChildNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ChildNotFoundException if *v == nil { sv = &types.ChildNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentChildren(v *[]types.Child, 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.Child if *v == nil { cv = []types.Child{} } else { cv = *v } for _, value := range shape { var col types.Child destAddr := &col if err := awsAwsjson11_deserializeDocumentChild(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentConcurrentModificationException(v **types.ConcurrentModificationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ConcurrentModificationException if *v == nil { sv = &types.ConcurrentModificationException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_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 ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentConstraintViolationException(v **types.ConstraintViolationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ConstraintViolationException if *v == nil { sv = &types.ConstraintViolationException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConstraintViolationExceptionReason to be of type string, got %T instead", value) } sv.Reason = types.ConstraintViolationExceptionReason(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentCreateAccountStatus(v **types.CreateAccountStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CreateAccountStatus if *v == nil { sv = &types.CreateAccountStatus{} } else { sv = *v } for key, value := range shape { switch key { case "AccountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) } sv.AccountId = ptr.String(jtv) } case "AccountName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CreateAccountName to be of type string, got %T instead", value) } sv.AccountName = ptr.String(jtv) } case "CompletedTimestamp": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CompletedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "FailureReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CreateAccountFailureReason to be of type string, got %T instead", value) } sv.FailureReason = types.CreateAccountFailureReason(jtv) } case "GovCloudAccountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) } sv.GovCloudAccountId = ptr.String(jtv) } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CreateAccountRequestId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "RequestedTimestamp": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.RequestedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CreateAccountState to be of type string, got %T instead", value) } sv.State = types.CreateAccountState(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentCreateAccountStatuses(v *[]types.CreateAccountStatus, 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.CreateAccountStatus if *v == nil { cv = []types.CreateAccountStatus{} } else { cv = *v } for _, value := range shape { var col types.CreateAccountStatus destAddr := &col if err := awsAwsjson11_deserializeDocumentCreateAccountStatus(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentCreateAccountStatusNotFoundException(v **types.CreateAccountStatusNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CreateAccountStatusNotFoundException if *v == nil { sv = &types.CreateAccountStatusNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDelegatedAdministrator(v **types.DelegatedAdministrator, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DelegatedAdministrator if *v == nil { sv = &types.DelegatedAdministrator{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "DelegationEnabledDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.DelegationEnabledDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } 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 "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "JoinedMethod": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountJoinedMethod to be of type string, got %T instead", value) } sv.JoinedMethod = types.AccountJoinedMethod(jtv) } case "JoinedTimestamp": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.JoinedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountName 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 AccountStatus to be of type string, got %T instead", value) } sv.Status = types.AccountStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDelegatedAdministrators(v *[]types.DelegatedAdministrator, 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.DelegatedAdministrator if *v == nil { cv = []types.DelegatedAdministrator{} } else { cv = *v } for _, value := range shape { var col types.DelegatedAdministrator destAddr := &col if err := awsAwsjson11_deserializeDocumentDelegatedAdministrator(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentDelegatedService(v **types.DelegatedService, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DelegatedService if *v == nil { sv = &types.DelegatedService{} } else { sv = *v } for key, value := range shape { switch key { case "DelegationEnabledDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.DelegationEnabledDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "ServicePrincipal": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServicePrincipal to be of type string, got %T instead", value) } sv.ServicePrincipal = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDelegatedServices(v *[]types.DelegatedService, 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.DelegatedService if *v == nil { cv = []types.DelegatedService{} } else { cv = *v } for _, value := range shape { var col types.DelegatedService destAddr := &col if err := awsAwsjson11_deserializeDocumentDelegatedService(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentDestinationParentNotFoundException(v **types.DestinationParentNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DestinationParentNotFoundException if *v == nil { sv = &types.DestinationParentNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDuplicateAccountException(v **types.DuplicateAccountException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DuplicateAccountException if *v == nil { sv = &types.DuplicateAccountException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDuplicateHandshakeException(v **types.DuplicateHandshakeException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DuplicateHandshakeException if *v == nil { sv = &types.DuplicateHandshakeException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDuplicateOrganizationalUnitException(v **types.DuplicateOrganizationalUnitException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DuplicateOrganizationalUnitException if *v == nil { sv = &types.DuplicateOrganizationalUnitException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDuplicatePolicyAttachmentException(v **types.DuplicatePolicyAttachmentException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DuplicatePolicyAttachmentException if *v == nil { sv = &types.DuplicatePolicyAttachmentException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDuplicatePolicyException(v **types.DuplicatePolicyException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DuplicatePolicyException if *v == nil { sv = &types.DuplicatePolicyException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentEffectivePolicy(v **types.EffectivePolicy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.EffectivePolicy if *v == nil { sv = &types.EffectivePolicy{} } else { sv = *v } for key, value := range shape { switch key { case "LastUpdatedTimestamp": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "PolicyContent": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyContent to be of type string, got %T instead", value) } sv.PolicyContent = ptr.String(jtv) } case "PolicyType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EffectivePolicyType to be of type string, got %T instead", value) } sv.PolicyType = types.EffectivePolicyType(jtv) } case "TargetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyTargetId to be of type string, got %T instead", value) } sv.TargetId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentEffectivePolicyNotFoundException(v **types.EffectivePolicyNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.EffectivePolicyNotFoundException if *v == nil { sv = &types.EffectivePolicyNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentEnabledServicePrincipal(v **types.EnabledServicePrincipal, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.EnabledServicePrincipal if *v == nil { sv = &types.EnabledServicePrincipal{} } else { sv = *v } for key, value := range shape { switch key { case "DateEnabled": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.DateEnabled = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "ServicePrincipal": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServicePrincipal to be of type string, got %T instead", value) } sv.ServicePrincipal = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentEnabledServicePrincipals(v *[]types.EnabledServicePrincipal, 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.EnabledServicePrincipal if *v == nil { cv = []types.EnabledServicePrincipal{} } else { cv = *v } for _, value := range shape { var col types.EnabledServicePrincipal destAddr := &col if err := awsAwsjson11_deserializeDocumentEnabledServicePrincipal(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentFinalizingOrganizationException(v **types.FinalizingOrganizationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FinalizingOrganizationException if *v == nil { sv = &types.FinalizingOrganizationException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHandshake(v **types.Handshake, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Handshake if *v == nil { sv = &types.Handshake{} } else { sv = *v } for key, value := range shape { switch key { case "Action": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionType to be of type string, got %T instead", value) } sv.Action = types.ActionType(jtv) } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HandshakeArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "ExpirationTimestamp": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.ExpirationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HandshakeId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Parties": if err := awsAwsjson11_deserializeDocumentHandshakeParties(&sv.Parties, value); err != nil { return err } case "RequestedTimestamp": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.RequestedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Resources": if err := awsAwsjson11_deserializeDocumentHandshakeResources(&sv.Resources, value); err != nil { return err } case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HandshakeState to be of type string, got %T instead", value) } sv.State = types.HandshakeState(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHandshakeAlreadyInStateException(v **types.HandshakeAlreadyInStateException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.HandshakeAlreadyInStateException if *v == nil { sv = &types.HandshakeAlreadyInStateException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHandshakeConstraintViolationException(v **types.HandshakeConstraintViolationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.HandshakeConstraintViolationException if *v == nil { sv = &types.HandshakeConstraintViolationException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HandshakeConstraintViolationExceptionReason to be of type string, got %T instead", value) } sv.Reason = types.HandshakeConstraintViolationExceptionReason(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHandshakeNotFoundException(v **types.HandshakeNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.HandshakeNotFoundException if *v == nil { sv = &types.HandshakeNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHandshakeParties(v *[]types.HandshakeParty, 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.HandshakeParty if *v == nil { cv = []types.HandshakeParty{} } else { cv = *v } for _, value := range shape { var col types.HandshakeParty destAddr := &col if err := awsAwsjson11_deserializeDocumentHandshakeParty(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentHandshakeParty(v **types.HandshakeParty, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.HandshakeParty if *v == nil { sv = &types.HandshakeParty{} } else { sv = *v } for key, value := range shape { switch key { case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HandshakePartyId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HandshakePartyType to be of type string, got %T instead", value) } sv.Type = types.HandshakePartyType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHandshakeResource(v **types.HandshakeResource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.HandshakeResource if *v == nil { sv = &types.HandshakeResource{} } else { sv = *v } for key, value := range shape { switch key { case "Resources": if err := awsAwsjson11_deserializeDocumentHandshakeResources(&sv.Resources, value); err != nil { return err } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HandshakeResourceType to be of type string, got %T instead", value) } sv.Type = types.HandshakeResourceType(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HandshakeResourceValue to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHandshakeResources(v *[]types.HandshakeResource, 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.HandshakeResource if *v == nil { cv = []types.HandshakeResource{} } else { cv = *v } for _, value := range shape { var col types.HandshakeResource destAddr := &col if err := awsAwsjson11_deserializeDocumentHandshakeResource(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentHandshakes(v *[]types.Handshake, 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.Handshake if *v == nil { cv = []types.Handshake{} } else { cv = *v } for _, value := range shape { var col types.Handshake destAddr := &col if err := awsAwsjson11_deserializeDocumentHandshake(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentInvalidHandshakeTransitionException(v **types.InvalidHandshakeTransitionException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.InvalidHandshakeTransitionException if *v == nil { sv = &types.InvalidHandshakeTransitionException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentInvalidInputException(v **types.InvalidInputException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.InvalidInputException if *v == nil { sv = &types.InvalidInputException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected InvalidInputExceptionReason to be of type string, got %T instead", value) } sv.Reason = types.InvalidInputExceptionReason(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentMalformedPolicyDocumentException(v **types.MalformedPolicyDocumentException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.MalformedPolicyDocumentException if *v == nil { sv = &types.MalformedPolicyDocumentException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentMasterCannotLeaveOrganizationException(v **types.MasterCannotLeaveOrganizationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.MasterCannotLeaveOrganizationException if *v == nil { sv = &types.MasterCannotLeaveOrganizationException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentOrganization(v **types.Organization, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Organization if *v == nil { sv = &types.Organization{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OrganizationArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AvailablePolicyTypes": if err := awsAwsjson11_deserializeDocumentPolicyTypes(&sv.AvailablePolicyTypes, value); err != nil { return err } case "FeatureSet": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OrganizationFeatureSet to be of type string, got %T instead", value) } sv.FeatureSet = types.OrganizationFeatureSet(jtv) } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OrganizationId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "MasterAccountArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountArn to be of type string, got %T instead", value) } sv.MasterAccountArn = ptr.String(jtv) } case "MasterAccountEmail": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Email to be of type string, got %T instead", value) } sv.MasterAccountEmail = ptr.String(jtv) } case "MasterAccountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) } sv.MasterAccountId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentOrganizationalUnit(v **types.OrganizationalUnit, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.OrganizationalUnit if *v == nil { sv = &types.OrganizationalUnit{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OrganizationalUnitArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OrganizationalUnitId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OrganizationalUnitName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentOrganizationalUnitNotEmptyException(v **types.OrganizationalUnitNotEmptyException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.OrganizationalUnitNotEmptyException if *v == nil { sv = &types.OrganizationalUnitNotEmptyException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentOrganizationalUnitNotFoundException(v **types.OrganizationalUnitNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.OrganizationalUnitNotFoundException if *v == nil { sv = &types.OrganizationalUnitNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentOrganizationalUnits(v *[]types.OrganizationalUnit, 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.OrganizationalUnit if *v == nil { cv = []types.OrganizationalUnit{} } else { cv = *v } for _, value := range shape { var col types.OrganizationalUnit destAddr := &col if err := awsAwsjson11_deserializeDocumentOrganizationalUnit(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentOrganizationNotEmptyException(v **types.OrganizationNotEmptyException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.OrganizationNotEmptyException if *v == nil { sv = &types.OrganizationNotEmptyException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentParent(v **types.Parent, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Parent if *v == nil { sv = &types.Parent{} } else { sv = *v } for key, value := range shape { switch key { case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParentId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParentType to be of type string, got %T instead", value) } sv.Type = types.ParentType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentParentNotFoundException(v **types.ParentNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ParentNotFoundException if *v == nil { sv = &types.ParentNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentParents(v *[]types.Parent, 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.Parent if *v == nil { cv = []types.Parent{} } else { cv = *v } for _, value := range shape { var col types.Parent destAddr := &col if err := awsAwsjson11_deserializeDocumentParent(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentPolicies(v *[]types.PolicySummary, 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.PolicySummary if *v == nil { cv = []types.PolicySummary{} } else { cv = *v } for _, value := range shape { var col types.PolicySummary destAddr := &col if err := awsAwsjson11_deserializeDocumentPolicySummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentPolicy(v **types.Policy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Policy if *v == nil { sv = &types.Policy{} } else { sv = *v } for key, value := range shape { switch key { case "Content": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyContent to be of type string, got %T instead", value) } sv.Content = ptr.String(jtv) } case "PolicySummary": if err := awsAwsjson11_deserializeDocumentPolicySummary(&sv.PolicySummary, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentPolicyChangesInProgressException(v **types.PolicyChangesInProgressException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PolicyChangesInProgressException if *v == nil { sv = &types.PolicyChangesInProgressException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentPolicyInUseException(v **types.PolicyInUseException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PolicyInUseException if *v == nil { sv = &types.PolicyInUseException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentPolicyNotAttachedException(v **types.PolicyNotAttachedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PolicyNotAttachedException if *v == nil { sv = &types.PolicyNotAttachedException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentPolicyNotFoundException(v **types.PolicyNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PolicyNotFoundException if *v == nil { sv = &types.PolicyNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentPolicySummary(v **types.PolicySummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PolicySummary if *v == nil { sv = &types.PolicySummary{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AwsManaged": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected AwsManagedPolicy to be of type *bool, got %T instead", value) } sv.AwsManaged = jtv } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyType to be of type string, got %T instead", value) } sv.Type = types.PolicyType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentPolicyTargets(v *[]types.PolicyTargetSummary, 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.PolicyTargetSummary if *v == nil { cv = []types.PolicyTargetSummary{} } else { cv = *v } for _, value := range shape { var col types.PolicyTargetSummary destAddr := &col if err := awsAwsjson11_deserializeDocumentPolicyTargetSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentPolicyTargetSummary(v **types.PolicyTargetSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PolicyTargetSummary if *v == nil { sv = &types.PolicyTargetSummary{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TargetName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "TargetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyTargetId to be of type string, got %T instead", value) } sv.TargetId = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TargetType to be of type string, got %T instead", value) } sv.Type = types.TargetType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentPolicyTypeAlreadyEnabledException(v **types.PolicyTypeAlreadyEnabledException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PolicyTypeAlreadyEnabledException if *v == nil { sv = &types.PolicyTypeAlreadyEnabledException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentPolicyTypeNotAvailableForOrganizationException(v **types.PolicyTypeNotAvailableForOrganizationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PolicyTypeNotAvailableForOrganizationException if *v == nil { sv = &types.PolicyTypeNotAvailableForOrganizationException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentPolicyTypeNotEnabledException(v **types.PolicyTypeNotEnabledException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PolicyTypeNotEnabledException if *v == nil { sv = &types.PolicyTypeNotEnabledException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentPolicyTypes(v *[]types.PolicyTypeSummary, 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.PolicyTypeSummary if *v == nil { cv = []types.PolicyTypeSummary{} } else { cv = *v } for _, value := range shape { var col types.PolicyTypeSummary destAddr := &col if err := awsAwsjson11_deserializeDocumentPolicyTypeSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentPolicyTypeSummary(v **types.PolicyTypeSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PolicyTypeSummary if *v == nil { sv = &types.PolicyTypeSummary{} } else { sv = *v } for key, value := range shape { switch key { case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyTypeStatus to be of type string, got %T instead", value) } sv.Status = types.PolicyTypeStatus(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PolicyType to be of type string, got %T instead", value) } sv.Type = types.PolicyType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentResourcePolicy(v **types.ResourcePolicy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ResourcePolicy if *v == nil { sv = &types.ResourcePolicy{} } else { sv = *v } for key, value := range shape { switch key { case "Content": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourcePolicyContent to be of type string, got %T instead", value) } sv.Content = ptr.String(jtv) } case "ResourcePolicySummary": if err := awsAwsjson11_deserializeDocumentResourcePolicySummary(&sv.ResourcePolicySummary, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentResourcePolicyNotFoundException(v **types.ResourcePolicyNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ResourcePolicyNotFoundException if *v == nil { sv = &types.ResourcePolicyNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentResourcePolicySummary(v **types.ResourcePolicySummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ResourcePolicySummary if *v == nil { sv = &types.ResourcePolicySummary{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourcePolicyArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourcePolicyId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentRoot(v **types.Root, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Root if *v == nil { sv = &types.Root{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RootArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RootId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RootName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "PolicyTypes": if err := awsAwsjson11_deserializeDocumentPolicyTypes(&sv.PolicyTypes, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentRootNotFoundException(v **types.RootNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RootNotFoundException if *v == nil { sv = &types.RootNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentRoots(v *[]types.Root, 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.Root if *v == nil { cv = []types.Root{} } else { cv = *v } for _, value := range shape { var col types.Root destAddr := &col if err := awsAwsjson11_deserializeDocumentRoot(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentServiceException(v **types.ServiceException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ServiceException if *v == nil { sv = &types.ServiceException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentSourceParentNotFoundException(v **types.SourceParentNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SourceParentNotFoundException if *v == nil { sv = &types.SourceParentNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_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_deserializeDocumentTags(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_deserializeDocumentTargetNotFoundException(v **types.TargetNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TargetNotFoundException if *v == nil { sv = &types.TargetNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentTooManyRequestsException(v **types.TooManyRequestsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.TooManyRequestsException if *v == nil { sv = &types.TooManyRequestsException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionType to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentUnsupportedAPIEndpointException(v **types.UnsupportedAPIEndpointException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.UnsupportedAPIEndpointException if *v == nil { sv = &types.UnsupportedAPIEndpointException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentAcceptHandshakeOutput(v **AcceptHandshakeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *AcceptHandshakeOutput if *v == nil { sv = &AcceptHandshakeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Handshake": if err := awsAwsjson11_deserializeDocumentHandshake(&sv.Handshake, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCancelHandshakeOutput(v **CancelHandshakeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CancelHandshakeOutput if *v == nil { sv = &CancelHandshakeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Handshake": if err := awsAwsjson11_deserializeDocumentHandshake(&sv.Handshake, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateAccountOutput(v **CreateAccountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateAccountOutput if *v == nil { sv = &CreateAccountOutput{} } else { sv = *v } for key, value := range shape { switch key { case "CreateAccountStatus": if err := awsAwsjson11_deserializeDocumentCreateAccountStatus(&sv.CreateAccountStatus, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateGovCloudAccountOutput(v **CreateGovCloudAccountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateGovCloudAccountOutput if *v == nil { sv = &CreateGovCloudAccountOutput{} } else { sv = *v } for key, value := range shape { switch key { case "CreateAccountStatus": if err := awsAwsjson11_deserializeDocumentCreateAccountStatus(&sv.CreateAccountStatus, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateOrganizationalUnitOutput(v **CreateOrganizationalUnitOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateOrganizationalUnitOutput if *v == nil { sv = &CreateOrganizationalUnitOutput{} } else { sv = *v } for key, value := range shape { switch key { case "OrganizationalUnit": if err := awsAwsjson11_deserializeDocumentOrganizationalUnit(&sv.OrganizationalUnit, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateOrganizationOutput(v **CreateOrganizationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateOrganizationOutput if *v == nil { sv = &CreateOrganizationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Organization": if err := awsAwsjson11_deserializeDocumentOrganization(&sv.Organization, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreatePolicyOutput(v **CreatePolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreatePolicyOutput if *v == nil { sv = &CreatePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Policy": if err := awsAwsjson11_deserializeDocumentPolicy(&sv.Policy, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeclineHandshakeOutput(v **DeclineHandshakeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeclineHandshakeOutput if *v == nil { sv = &DeclineHandshakeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Handshake": if err := awsAwsjson11_deserializeDocumentHandshake(&sv.Handshake, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeAccountOutput(v **DescribeAccountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeAccountOutput if *v == nil { sv = &DescribeAccountOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Account": if err := awsAwsjson11_deserializeDocumentAccount(&sv.Account, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeCreateAccountStatusOutput(v **DescribeCreateAccountStatusOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeCreateAccountStatusOutput if *v == nil { sv = &DescribeCreateAccountStatusOutput{} } else { sv = *v } for key, value := range shape { switch key { case "CreateAccountStatus": if err := awsAwsjson11_deserializeDocumentCreateAccountStatus(&sv.CreateAccountStatus, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeEffectivePolicyOutput(v **DescribeEffectivePolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeEffectivePolicyOutput if *v == nil { sv = &DescribeEffectivePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "EffectivePolicy": if err := awsAwsjson11_deserializeDocumentEffectivePolicy(&sv.EffectivePolicy, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeHandshakeOutput(v **DescribeHandshakeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeHandshakeOutput if *v == nil { sv = &DescribeHandshakeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Handshake": if err := awsAwsjson11_deserializeDocumentHandshake(&sv.Handshake, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeOrganizationalUnitOutput(v **DescribeOrganizationalUnitOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeOrganizationalUnitOutput if *v == nil { sv = &DescribeOrganizationalUnitOutput{} } else { sv = *v } for key, value := range shape { switch key { case "OrganizationalUnit": if err := awsAwsjson11_deserializeDocumentOrganizationalUnit(&sv.OrganizationalUnit, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeOrganizationOutput(v **DescribeOrganizationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeOrganizationOutput if *v == nil { sv = &DescribeOrganizationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Organization": if err := awsAwsjson11_deserializeDocumentOrganization(&sv.Organization, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribePolicyOutput(v **DescribePolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribePolicyOutput if *v == nil { sv = &DescribePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Policy": if err := awsAwsjson11_deserializeDocumentPolicy(&sv.Policy, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeResourcePolicyOutput(v **DescribeResourcePolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeResourcePolicyOutput if *v == nil { sv = &DescribeResourcePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ResourcePolicy": if err := awsAwsjson11_deserializeDocumentResourcePolicy(&sv.ResourcePolicy, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDisablePolicyTypeOutput(v **DisablePolicyTypeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DisablePolicyTypeOutput if *v == nil { sv = &DisablePolicyTypeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Root": if err := awsAwsjson11_deserializeDocumentRoot(&sv.Root, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentEnableAllFeaturesOutput(v **EnableAllFeaturesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *EnableAllFeaturesOutput if *v == nil { sv = &EnableAllFeaturesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Handshake": if err := awsAwsjson11_deserializeDocumentHandshake(&sv.Handshake, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentEnablePolicyTypeOutput(v **EnablePolicyTypeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *EnablePolicyTypeOutput if *v == nil { sv = &EnablePolicyTypeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Root": if err := awsAwsjson11_deserializeDocumentRoot(&sv.Root, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentInviteAccountToOrganizationOutput(v **InviteAccountToOrganizationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *InviteAccountToOrganizationOutput if *v == nil { sv = &InviteAccountToOrganizationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Handshake": if err := awsAwsjson11_deserializeDocumentHandshake(&sv.Handshake, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListAccountsForParentOutput(v **ListAccountsForParentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListAccountsForParentOutput if *v == nil { sv = &ListAccountsForParentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Accounts": if err := awsAwsjson11_deserializeDocumentAccounts(&sv.Accounts, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListAccountsOutput(v **ListAccountsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListAccountsOutput if *v == nil { sv = &ListAccountsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Accounts": if err := awsAwsjson11_deserializeDocumentAccounts(&sv.Accounts, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListAWSServiceAccessForOrganizationOutput(v **ListAWSServiceAccessForOrganizationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListAWSServiceAccessForOrganizationOutput if *v == nil { sv = &ListAWSServiceAccessForOrganizationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "EnabledServicePrincipals": if err := awsAwsjson11_deserializeDocumentEnabledServicePrincipals(&sv.EnabledServicePrincipals, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListChildrenOutput(v **ListChildrenOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListChildrenOutput if *v == nil { sv = &ListChildrenOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Children": if err := awsAwsjson11_deserializeDocumentChildren(&sv.Children, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListCreateAccountStatusOutput(v **ListCreateAccountStatusOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListCreateAccountStatusOutput if *v == nil { sv = &ListCreateAccountStatusOutput{} } else { sv = *v } for key, value := range shape { switch key { case "CreateAccountStatuses": if err := awsAwsjson11_deserializeDocumentCreateAccountStatuses(&sv.CreateAccountStatuses, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListDelegatedAdministratorsOutput(v **ListDelegatedAdministratorsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListDelegatedAdministratorsOutput if *v == nil { sv = &ListDelegatedAdministratorsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DelegatedAdministrators": if err := awsAwsjson11_deserializeDocumentDelegatedAdministrators(&sv.DelegatedAdministrators, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListDelegatedServicesForAccountOutput(v **ListDelegatedServicesForAccountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListDelegatedServicesForAccountOutput if *v == nil { sv = &ListDelegatedServicesForAccountOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DelegatedServices": if err := awsAwsjson11_deserializeDocumentDelegatedServices(&sv.DelegatedServices, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListHandshakesForAccountOutput(v **ListHandshakesForAccountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListHandshakesForAccountOutput if *v == nil { sv = &ListHandshakesForAccountOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Handshakes": if err := awsAwsjson11_deserializeDocumentHandshakes(&sv.Handshakes, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListHandshakesForOrganizationOutput(v **ListHandshakesForOrganizationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListHandshakesForOrganizationOutput if *v == nil { sv = &ListHandshakesForOrganizationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Handshakes": if err := awsAwsjson11_deserializeDocumentHandshakes(&sv.Handshakes, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListOrganizationalUnitsForParentOutput(v **ListOrganizationalUnitsForParentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListOrganizationalUnitsForParentOutput if *v == nil { sv = &ListOrganizationalUnitsForParentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "OrganizationalUnits": if err := awsAwsjson11_deserializeDocumentOrganizationalUnits(&sv.OrganizationalUnits, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListParentsOutput(v **ListParentsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListParentsOutput if *v == nil { sv = &ListParentsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "Parents": if err := awsAwsjson11_deserializeDocumentParents(&sv.Parents, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListPoliciesForTargetOutput(v **ListPoliciesForTargetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListPoliciesForTargetOutput if *v == nil { sv = &ListPoliciesForTargetOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "Policies": if err := awsAwsjson11_deserializeDocumentPolicies(&sv.Policies, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListPoliciesOutput(v **ListPoliciesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListPoliciesOutput if *v == nil { sv = &ListPoliciesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "Policies": if err := awsAwsjson11_deserializeDocumentPolicies(&sv.Policies, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListRootsOutput(v **ListRootsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListRootsOutput if *v == nil { sv = &ListRootsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "Roots": if err := awsAwsjson11_deserializeDocumentRoots(&sv.Roots, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_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 "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "Tags": if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListTargetsForPolicyOutput(v **ListTargetsForPolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTargetsForPolicyOutput if *v == nil { sv = &ListTargetsForPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "Targets": if err := awsAwsjson11_deserializeDocumentPolicyTargets(&sv.Targets, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentPutResourcePolicyOutput(v **PutResourcePolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *PutResourcePolicyOutput if *v == nil { sv = &PutResourcePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ResourcePolicy": if err := awsAwsjson11_deserializeDocumentResourcePolicy(&sv.ResourcePolicy, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateOrganizationalUnitOutput(v **UpdateOrganizationalUnitOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateOrganizationalUnitOutput if *v == nil { sv = &UpdateOrganizationalUnitOutput{} } else { sv = *v } for key, value := range shape { switch key { case "OrganizationalUnit": if err := awsAwsjson11_deserializeDocumentOrganizationalUnit(&sv.OrganizationalUnit, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdatePolicyOutput(v **UpdatePolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdatePolicyOutput if *v == nil { sv = &UpdatePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Policy": if err := awsAwsjson11_deserializeDocumentPolicy(&sv.Policy, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil }
14,032
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package organizations provides the API client, operations, and parameter types // for AWS Organizations. // // Organizations is a web service that enables you to consolidate your multiple // Amazon Web Services accounts into an organization and centrally manage your // accounts and their resources. This guide provides descriptions of the // Organizations operations. For more information about using this service, see the // Organizations User Guide (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html) // . Support and feedback for Organizations We welcome your feedback. Send your // comments to feedback-awsorganizations@amazon.com (mailto:feedback-awsorganizations@amazon.com) // or post your feedback and questions in the Organizations support forum (http://forums.aws.amazon.com/forum.jspa?forumID=219) // . For more information about the Amazon Web Services support forums, see Forums // Help (http://forums.aws.amazon.com/help.jspa) . Endpoint to call When using the // CLI or the Amazon Web Services SDK For the current release of Organizations, // specify the us-east-1 region for all Amazon Web Services API and CLI calls made // from the commercial Amazon Web Services Regions outside of China. If calling // from one of the Amazon Web Services Regions in China, then specify // cn-northwest-1 . You can do this in the CLI by using these parameters and // commands: // - Use the following parameter with each command to specify both the endpoint // and its region: --endpoint-url https://organizations.us-east-1.amazonaws.com // (from commercial Amazon Web Services Regions outside of China) or // --endpoint-url https://organizations.cn-northwest-1.amazonaws.com.cn (from // Amazon Web Services Regions in China) // - Use the default endpoint, but configure your default region with this // command: aws configure set default.region us-east-1 (from commercial Amazon // Web Services Regions outside of China) or aws configure set default.region // cn-northwest-1 (from Amazon Web Services Regions in China) // - Use the following parameter with each command to specify the endpoint: // --region us-east-1 (from commercial Amazon Web Services Regions outside of // China) or --region cn-northwest-1 (from Amazon Web Services Regions in China) // // Recording API Requests Organizations supports CloudTrail, a service that // records Amazon Web Services API calls for your Amazon Web Services account and // delivers log files to an Amazon S3 bucket. By using information collected by // CloudTrail, you can determine which requests the Organizations service received, // who made the request and when, and so on. For more about Organizations and its // support for CloudTrail, see Logging Organizations Events with CloudTrail (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_incident-response.html#orgs_cloudtrail-integration) // in the Organizations User Guide. To learn more about CloudTrail, including how // to turn it on and find your log files, see the CloudTrail User Guide (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html) // . package organizations
45
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations 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/organizations/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 = "organizations" } 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 organizations // goModuleVersion is the tagged release for this module const goModuleVersion = "1.19.8"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/organizations/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" "strings" ) type awsAwsjson11_serializeOpAcceptHandshake struct { } func (*awsAwsjson11_serializeOpAcceptHandshake) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpAcceptHandshake) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*AcceptHandshakeInput) _ = 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("AWSOrganizationsV20161128.AcceptHandshake") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentAcceptHandshakeInput(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_serializeOpAttachPolicy struct { } func (*awsAwsjson11_serializeOpAttachPolicy) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpAttachPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*AttachPolicyInput) _ = 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("AWSOrganizationsV20161128.AttachPolicy") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentAttachPolicyInput(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_serializeOpCancelHandshake struct { } func (*awsAwsjson11_serializeOpCancelHandshake) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCancelHandshake) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CancelHandshakeInput) _ = 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("AWSOrganizationsV20161128.CancelHandshake") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCancelHandshakeInput(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_serializeOpCloseAccount struct { } func (*awsAwsjson11_serializeOpCloseAccount) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCloseAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CloseAccountInput) _ = 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("AWSOrganizationsV20161128.CloseAccount") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCloseAccountInput(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_serializeOpCreateAccount struct { } func (*awsAwsjson11_serializeOpCreateAccount) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateAccountInput) _ = 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("AWSOrganizationsV20161128.CreateAccount") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateAccountInput(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_serializeOpCreateGovCloudAccount struct { } func (*awsAwsjson11_serializeOpCreateGovCloudAccount) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateGovCloudAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateGovCloudAccountInput) _ = 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("AWSOrganizationsV20161128.CreateGovCloudAccount") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateGovCloudAccountInput(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_serializeOpCreateOrganization struct { } func (*awsAwsjson11_serializeOpCreateOrganization) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateOrganizationInput) _ = 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("AWSOrganizationsV20161128.CreateOrganization") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateOrganizationInput(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_serializeOpCreateOrganizationalUnit struct { } func (*awsAwsjson11_serializeOpCreateOrganizationalUnit) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateOrganizationalUnit) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateOrganizationalUnitInput) _ = 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("AWSOrganizationsV20161128.CreateOrganizationalUnit") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateOrganizationalUnitInput(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_serializeOpCreatePolicy struct { } func (*awsAwsjson11_serializeOpCreatePolicy) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreatePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreatePolicyInput) _ = 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("AWSOrganizationsV20161128.CreatePolicy") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreatePolicyInput(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_serializeOpDeclineHandshake struct { } func (*awsAwsjson11_serializeOpDeclineHandshake) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeclineHandshake) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeclineHandshakeInput) _ = 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("AWSOrganizationsV20161128.DeclineHandshake") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeclineHandshakeInput(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_serializeOpDeleteOrganization struct { } func (*awsAwsjson11_serializeOpDeleteOrganization) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteOrganizationInput) _ = 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("AWSOrganizationsV20161128.DeleteOrganization") if request, err = request.SetStream(strings.NewReader(`{}`)); 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_serializeOpDeleteOrganizationalUnit struct { } func (*awsAwsjson11_serializeOpDeleteOrganizationalUnit) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteOrganizationalUnit) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteOrganizationalUnitInput) _ = 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("AWSOrganizationsV20161128.DeleteOrganizationalUnit") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteOrganizationalUnitInput(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_serializeOpDeletePolicy struct { } func (*awsAwsjson11_serializeOpDeletePolicy) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeletePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeletePolicyInput) _ = 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("AWSOrganizationsV20161128.DeletePolicy") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeletePolicyInput(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_serializeOpDeleteResourcePolicy struct { } func (*awsAwsjson11_serializeOpDeleteResourcePolicy) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteResourcePolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } 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("AWSOrganizationsV20161128.DeleteResourcePolicy") if request, err = request.SetStream(strings.NewReader(`{}`)); 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_serializeOpDeregisterDelegatedAdministrator struct { } func (*awsAwsjson11_serializeOpDeregisterDelegatedAdministrator) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeregisterDelegatedAdministrator) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeregisterDelegatedAdministratorInput) _ = 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("AWSOrganizationsV20161128.DeregisterDelegatedAdministrator") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeregisterDelegatedAdministratorInput(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_serializeOpDescribeAccount struct { } func (*awsAwsjson11_serializeOpDescribeAccount) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeAccountInput) _ = 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("AWSOrganizationsV20161128.DescribeAccount") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeAccountInput(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_serializeOpDescribeCreateAccountStatus struct { } func (*awsAwsjson11_serializeOpDescribeCreateAccountStatus) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeCreateAccountStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeCreateAccountStatusInput) _ = 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("AWSOrganizationsV20161128.DescribeCreateAccountStatus") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeCreateAccountStatusInput(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_serializeOpDescribeEffectivePolicy struct { } func (*awsAwsjson11_serializeOpDescribeEffectivePolicy) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeEffectivePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeEffectivePolicyInput) _ = 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("AWSOrganizationsV20161128.DescribeEffectivePolicy") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeEffectivePolicyInput(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_serializeOpDescribeHandshake struct { } func (*awsAwsjson11_serializeOpDescribeHandshake) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeHandshake) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeHandshakeInput) _ = 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("AWSOrganizationsV20161128.DescribeHandshake") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeHandshakeInput(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_serializeOpDescribeOrganization struct { } func (*awsAwsjson11_serializeOpDescribeOrganization) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeOrganizationInput) _ = 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("AWSOrganizationsV20161128.DescribeOrganization") if request, err = request.SetStream(strings.NewReader(`{}`)); 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_serializeOpDescribeOrganizationalUnit struct { } func (*awsAwsjson11_serializeOpDescribeOrganizationalUnit) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeOrganizationalUnit) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeOrganizationalUnitInput) _ = 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("AWSOrganizationsV20161128.DescribeOrganizationalUnit") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeOrganizationalUnitInput(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_serializeOpDescribePolicy struct { } func (*awsAwsjson11_serializeOpDescribePolicy) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribePolicyInput) _ = 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("AWSOrganizationsV20161128.DescribePolicy") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribePolicyInput(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_serializeOpDescribeResourcePolicy struct { } func (*awsAwsjson11_serializeOpDescribeResourcePolicy) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeResourcePolicyInput) _ = 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("AWSOrganizationsV20161128.DescribeResourcePolicy") if request, err = request.SetStream(strings.NewReader(`{}`)); 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_serializeOpDetachPolicy struct { } func (*awsAwsjson11_serializeOpDetachPolicy) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDetachPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DetachPolicyInput) _ = 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("AWSOrganizationsV20161128.DetachPolicy") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDetachPolicyInput(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_serializeOpDisableAWSServiceAccess struct { } func (*awsAwsjson11_serializeOpDisableAWSServiceAccess) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDisableAWSServiceAccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisableAWSServiceAccessInput) _ = 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("AWSOrganizationsV20161128.DisableAWSServiceAccess") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDisableAWSServiceAccessInput(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_serializeOpDisablePolicyType struct { } func (*awsAwsjson11_serializeOpDisablePolicyType) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDisablePolicyType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisablePolicyTypeInput) _ = 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("AWSOrganizationsV20161128.DisablePolicyType") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDisablePolicyTypeInput(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_serializeOpEnableAllFeatures struct { } func (*awsAwsjson11_serializeOpEnableAllFeatures) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpEnableAllFeatures) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*EnableAllFeaturesInput) _ = 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("AWSOrganizationsV20161128.EnableAllFeatures") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentEnableAllFeaturesInput(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_serializeOpEnableAWSServiceAccess struct { } func (*awsAwsjson11_serializeOpEnableAWSServiceAccess) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpEnableAWSServiceAccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*EnableAWSServiceAccessInput) _ = 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("AWSOrganizationsV20161128.EnableAWSServiceAccess") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentEnableAWSServiceAccessInput(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_serializeOpEnablePolicyType struct { } func (*awsAwsjson11_serializeOpEnablePolicyType) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpEnablePolicyType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*EnablePolicyTypeInput) _ = 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("AWSOrganizationsV20161128.EnablePolicyType") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentEnablePolicyTypeInput(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_serializeOpInviteAccountToOrganization struct { } func (*awsAwsjson11_serializeOpInviteAccountToOrganization) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpInviteAccountToOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*InviteAccountToOrganizationInput) _ = 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("AWSOrganizationsV20161128.InviteAccountToOrganization") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentInviteAccountToOrganizationInput(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_serializeOpLeaveOrganization struct { } func (*awsAwsjson11_serializeOpLeaveOrganization) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpLeaveOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*LeaveOrganizationInput) _ = 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("AWSOrganizationsV20161128.LeaveOrganization") if request, err = request.SetStream(strings.NewReader(`{}`)); 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_serializeOpListAccounts struct { } func (*awsAwsjson11_serializeOpListAccounts) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListAccounts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListAccountsInput) _ = 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("AWSOrganizationsV20161128.ListAccounts") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListAccountsInput(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_serializeOpListAccountsForParent struct { } func (*awsAwsjson11_serializeOpListAccountsForParent) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListAccountsForParent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListAccountsForParentInput) _ = 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("AWSOrganizationsV20161128.ListAccountsForParent") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListAccountsForParentInput(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_serializeOpListAWSServiceAccessForOrganization struct { } func (*awsAwsjson11_serializeOpListAWSServiceAccessForOrganization) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListAWSServiceAccessForOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListAWSServiceAccessForOrganizationInput) _ = 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("AWSOrganizationsV20161128.ListAWSServiceAccessForOrganization") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListAWSServiceAccessForOrganizationInput(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_serializeOpListChildren struct { } func (*awsAwsjson11_serializeOpListChildren) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListChildren) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListChildrenInput) _ = 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("AWSOrganizationsV20161128.ListChildren") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListChildrenInput(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_serializeOpListCreateAccountStatus struct { } func (*awsAwsjson11_serializeOpListCreateAccountStatus) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListCreateAccountStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListCreateAccountStatusInput) _ = 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("AWSOrganizationsV20161128.ListCreateAccountStatus") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListCreateAccountStatusInput(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_serializeOpListDelegatedAdministrators struct { } func (*awsAwsjson11_serializeOpListDelegatedAdministrators) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListDelegatedAdministrators) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListDelegatedAdministratorsInput) _ = 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("AWSOrganizationsV20161128.ListDelegatedAdministrators") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListDelegatedAdministratorsInput(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_serializeOpListDelegatedServicesForAccount struct { } func (*awsAwsjson11_serializeOpListDelegatedServicesForAccount) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListDelegatedServicesForAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListDelegatedServicesForAccountInput) _ = 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("AWSOrganizationsV20161128.ListDelegatedServicesForAccount") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListDelegatedServicesForAccountInput(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_serializeOpListHandshakesForAccount struct { } func (*awsAwsjson11_serializeOpListHandshakesForAccount) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListHandshakesForAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListHandshakesForAccountInput) _ = 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("AWSOrganizationsV20161128.ListHandshakesForAccount") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListHandshakesForAccountInput(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_serializeOpListHandshakesForOrganization struct { } func (*awsAwsjson11_serializeOpListHandshakesForOrganization) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListHandshakesForOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListHandshakesForOrganizationInput) _ = 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("AWSOrganizationsV20161128.ListHandshakesForOrganization") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListHandshakesForOrganizationInput(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_serializeOpListOrganizationalUnitsForParent struct { } func (*awsAwsjson11_serializeOpListOrganizationalUnitsForParent) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListOrganizationalUnitsForParent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListOrganizationalUnitsForParentInput) _ = 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("AWSOrganizationsV20161128.ListOrganizationalUnitsForParent") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListOrganizationalUnitsForParentInput(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_serializeOpListParents struct { } func (*awsAwsjson11_serializeOpListParents) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListParents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListParentsInput) _ = 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("AWSOrganizationsV20161128.ListParents") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListParentsInput(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_serializeOpListPolicies struct { } func (*awsAwsjson11_serializeOpListPolicies) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListPolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListPoliciesInput) _ = 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("AWSOrganizationsV20161128.ListPolicies") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListPoliciesInput(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_serializeOpListPoliciesForTarget struct { } func (*awsAwsjson11_serializeOpListPoliciesForTarget) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListPoliciesForTarget) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListPoliciesForTargetInput) _ = 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("AWSOrganizationsV20161128.ListPoliciesForTarget") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListPoliciesForTargetInput(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_serializeOpListRoots struct { } func (*awsAwsjson11_serializeOpListRoots) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListRoots) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListRootsInput) _ = 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("AWSOrganizationsV20161128.ListRoots") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListRootsInput(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_serializeOpListTagsForResource struct { } func (*awsAwsjson11_serializeOpListTagsForResource) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListTagsForResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListTagsForResource") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpListTargetsForPolicy struct { } func (*awsAwsjson11_serializeOpListTargetsForPolicy) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListTargetsForPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListTargetsForPolicyInput) _ = 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("AWSOrganizationsV20161128.ListTargetsForPolicy") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListTargetsForPolicyInput(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_serializeOpMoveAccount struct { } func (*awsAwsjson11_serializeOpMoveAccount) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpMoveAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*MoveAccountInput) _ = 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("AWSOrganizationsV20161128.MoveAccount") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentMoveAccountInput(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_serializeOpPutResourcePolicy struct { } func (*awsAwsjson11_serializeOpPutResourcePolicy) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpPutResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*PutResourcePolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } 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("AWSOrganizationsV20161128.PutResourcePolicy") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentPutResourcePolicyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpRegisterDelegatedAdministrator struct { } func (*awsAwsjson11_serializeOpRegisterDelegatedAdministrator) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpRegisterDelegatedAdministrator) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RegisterDelegatedAdministratorInput) _ = 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("AWSOrganizationsV20161128.RegisterDelegatedAdministrator") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentRegisterDelegatedAdministratorInput(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_serializeOpRemoveAccountFromOrganization struct { } func (*awsAwsjson11_serializeOpRemoveAccountFromOrganization) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpRemoveAccountFromOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RemoveAccountFromOrganizationInput) _ = 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("AWSOrganizationsV20161128.RemoveAccountFromOrganization") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentRemoveAccountFromOrganizationInput(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_serializeOpTagResource struct { } func (*awsAwsjson11_serializeOpTagResource) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*TagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.TagResource") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpUntagResource struct { } func (*awsAwsjson11_serializeOpUntagResource) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UntagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.UntagResource") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpUpdateOrganizationalUnit struct { } func (*awsAwsjson11_serializeOpUpdateOrganizationalUnit) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateOrganizationalUnit) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateOrganizationalUnitInput) _ = 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("AWSOrganizationsV20161128.UpdateOrganizationalUnit") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateOrganizationalUnitInput(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_serializeOpUpdatePolicy struct { } func (*awsAwsjson11_serializeOpUpdatePolicy) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdatePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdatePolicyInput) _ = 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("AWSOrganizationsV20161128.UpdatePolicy") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdatePolicyInput(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_serializeDocumentCreateAccountStates(v []types.CreateAccountState, 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_serializeDocumentHandshakeFilter(v *types.HandshakeFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.ActionType) > 0 { ok := object.Key("ActionType") ok.String(string(v.ActionType)) } if v.ParentHandshakeId != nil { ok := object.Key("ParentHandshakeId") ok.String(*v.ParentHandshakeId) } return nil } func awsAwsjson11_serializeDocumentHandshakeParty(v *types.HandshakeParty, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Id != nil { ok := object.Key("Id") ok.String(*v.Id) } if len(v.Type) > 0 { ok := object.Key("Type") ok.String(string(v.Type)) } return nil } func 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_serializeDocumentTagKeys(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_serializeDocumentTags(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_serializeOpDocumentAcceptHandshakeInput(v *AcceptHandshakeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.HandshakeId != nil { ok := object.Key("HandshakeId") ok.String(*v.HandshakeId) } return nil } func awsAwsjson11_serializeOpDocumentAttachPolicyInput(v *AttachPolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.PolicyId != nil { ok := object.Key("PolicyId") ok.String(*v.PolicyId) } if v.TargetId != nil { ok := object.Key("TargetId") ok.String(*v.TargetId) } return nil } func awsAwsjson11_serializeOpDocumentCancelHandshakeInput(v *CancelHandshakeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.HandshakeId != nil { ok := object.Key("HandshakeId") ok.String(*v.HandshakeId) } return nil } func awsAwsjson11_serializeOpDocumentCloseAccountInput(v *CloseAccountInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccountId != nil { ok := object.Key("AccountId") ok.String(*v.AccountId) } return nil } func awsAwsjson11_serializeOpDocumentCreateAccountInput(v *CreateAccountInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccountName != nil { ok := object.Key("AccountName") ok.String(*v.AccountName) } if v.Email != nil { ok := object.Key("Email") ok.String(*v.Email) } if len(v.IamUserAccessToBilling) > 0 { ok := object.Key("IamUserAccessToBilling") ok.String(string(v.IamUserAccessToBilling)) } if v.RoleName != nil { ok := object.Key("RoleName") ok.String(*v.RoleName) } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentCreateGovCloudAccountInput(v *CreateGovCloudAccountInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccountName != nil { ok := object.Key("AccountName") ok.String(*v.AccountName) } if v.Email != nil { ok := object.Key("Email") ok.String(*v.Email) } if len(v.IamUserAccessToBilling) > 0 { ok := object.Key("IamUserAccessToBilling") ok.String(string(v.IamUserAccessToBilling)) } if v.RoleName != nil { ok := object.Key("RoleName") ok.String(*v.RoleName) } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentCreateOrganizationalUnitInput(v *CreateOrganizationalUnitInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.ParentId != nil { ok := object.Key("ParentId") ok.String(*v.ParentId) } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentCreateOrganizationInput(v *CreateOrganizationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.FeatureSet) > 0 { ok := object.Key("FeatureSet") ok.String(string(v.FeatureSet)) } return nil } func awsAwsjson11_serializeOpDocumentCreatePolicyInput(v *CreatePolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Content != nil { ok := object.Key("Content") ok.String(*v.Content) } if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { return err } } if len(v.Type) > 0 { ok := object.Key("Type") ok.String(string(v.Type)) } return nil } func awsAwsjson11_serializeOpDocumentDeclineHandshakeInput(v *DeclineHandshakeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.HandshakeId != nil { ok := object.Key("HandshakeId") ok.String(*v.HandshakeId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteOrganizationalUnitInput(v *DeleteOrganizationalUnitInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.OrganizationalUnitId != nil { ok := object.Key("OrganizationalUnitId") ok.String(*v.OrganizationalUnitId) } return nil } func awsAwsjson11_serializeOpDocumentDeletePolicyInput(v *DeletePolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.PolicyId != nil { ok := object.Key("PolicyId") ok.String(*v.PolicyId) } return nil } func awsAwsjson11_serializeOpDocumentDeregisterDelegatedAdministratorInput(v *DeregisterDelegatedAdministratorInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccountId != nil { ok := object.Key("AccountId") ok.String(*v.AccountId) } if v.ServicePrincipal != nil { ok := object.Key("ServicePrincipal") ok.String(*v.ServicePrincipal) } return nil } func awsAwsjson11_serializeOpDocumentDescribeAccountInput(v *DescribeAccountInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccountId != nil { ok := object.Key("AccountId") ok.String(*v.AccountId) } return nil } func awsAwsjson11_serializeOpDocumentDescribeCreateAccountStatusInput(v *DescribeCreateAccountStatusInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CreateAccountRequestId != nil { ok := object.Key("CreateAccountRequestId") ok.String(*v.CreateAccountRequestId) } return nil } func awsAwsjson11_serializeOpDocumentDescribeEffectivePolicyInput(v *DescribeEffectivePolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.PolicyType) > 0 { ok := object.Key("PolicyType") ok.String(string(v.PolicyType)) } if v.TargetId != nil { ok := object.Key("TargetId") ok.String(*v.TargetId) } return nil } func awsAwsjson11_serializeOpDocumentDescribeHandshakeInput(v *DescribeHandshakeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.HandshakeId != nil { ok := object.Key("HandshakeId") ok.String(*v.HandshakeId) } return nil } func awsAwsjson11_serializeOpDocumentDescribeOrganizationalUnitInput(v *DescribeOrganizationalUnitInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.OrganizationalUnitId != nil { ok := object.Key("OrganizationalUnitId") ok.String(*v.OrganizationalUnitId) } return nil } func awsAwsjson11_serializeOpDocumentDescribePolicyInput(v *DescribePolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.PolicyId != nil { ok := object.Key("PolicyId") ok.String(*v.PolicyId) } return nil } func awsAwsjson11_serializeOpDocumentDetachPolicyInput(v *DetachPolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.PolicyId != nil { ok := object.Key("PolicyId") ok.String(*v.PolicyId) } if v.TargetId != nil { ok := object.Key("TargetId") ok.String(*v.TargetId) } return nil } func awsAwsjson11_serializeOpDocumentDisableAWSServiceAccessInput(v *DisableAWSServiceAccessInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ServicePrincipal != nil { ok := object.Key("ServicePrincipal") ok.String(*v.ServicePrincipal) } return nil } func awsAwsjson11_serializeOpDocumentDisablePolicyTypeInput(v *DisablePolicyTypeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.PolicyType) > 0 { ok := object.Key("PolicyType") ok.String(string(v.PolicyType)) } if v.RootId != nil { ok := object.Key("RootId") ok.String(*v.RootId) } return nil } func awsAwsjson11_serializeOpDocumentEnableAllFeaturesInput(v *EnableAllFeaturesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() return nil } func awsAwsjson11_serializeOpDocumentEnableAWSServiceAccessInput(v *EnableAWSServiceAccessInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ServicePrincipal != nil { ok := object.Key("ServicePrincipal") ok.String(*v.ServicePrincipal) } return nil } func awsAwsjson11_serializeOpDocumentEnablePolicyTypeInput(v *EnablePolicyTypeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.PolicyType) > 0 { ok := object.Key("PolicyType") ok.String(string(v.PolicyType)) } if v.RootId != nil { ok := object.Key("RootId") ok.String(*v.RootId) } return nil } func awsAwsjson11_serializeOpDocumentInviteAccountToOrganizationInput(v *InviteAccountToOrganizationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Notes != nil { ok := object.Key("Notes") ok.String(*v.Notes) } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { return err } } if v.Target != nil { ok := object.Key("Target") if err := awsAwsjson11_serializeDocumentHandshakeParty(v.Target, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentListAccountsForParentInput(v *ListAccountsForParentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } if v.ParentId != nil { ok := object.Key("ParentId") ok.String(*v.ParentId) } return nil } func awsAwsjson11_serializeOpDocumentListAccountsInput(v *ListAccountsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() 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 awsAwsjson11_serializeOpDocumentListAWSServiceAccessForOrganizationInput(v *ListAWSServiceAccessForOrganizationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() 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 awsAwsjson11_serializeOpDocumentListChildrenInput(v *ListChildrenInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.ChildType) > 0 { ok := object.Key("ChildType") ok.String(string(v.ChildType)) } if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } if v.ParentId != nil { ok := object.Key("ParentId") ok.String(*v.ParentId) } return nil } func awsAwsjson11_serializeOpDocumentListCreateAccountStatusInput(v *ListCreateAccountStatusInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } if v.States != nil { ok := object.Key("States") if err := awsAwsjson11_serializeDocumentCreateAccountStates(v.States, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentListDelegatedAdministratorsInput(v *ListDelegatedAdministratorsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } if v.ServicePrincipal != nil { ok := object.Key("ServicePrincipal") ok.String(*v.ServicePrincipal) } return nil } func awsAwsjson11_serializeOpDocumentListDelegatedServicesForAccountInput(v *ListDelegatedServicesForAccountInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccountId != nil { ok := object.Key("AccountId") ok.String(*v.AccountId) } 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 awsAwsjson11_serializeOpDocumentListHandshakesForAccountInput(v *ListHandshakesForAccountInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filter != nil { ok := object.Key("Filter") if err := awsAwsjson11_serializeDocumentHandshakeFilter(v.Filter, ok); err != nil { return err } } if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } return nil } func awsAwsjson11_serializeOpDocumentListHandshakesForOrganizationInput(v *ListHandshakesForOrganizationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filter != nil { ok := object.Key("Filter") if err := awsAwsjson11_serializeDocumentHandshakeFilter(v.Filter, ok); err != nil { return err } } if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } return nil } func awsAwsjson11_serializeOpDocumentListOrganizationalUnitsForParentInput(v *ListOrganizationalUnitsForParentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } if v.ParentId != nil { ok := object.Key("ParentId") ok.String(*v.ParentId) } return nil } func awsAwsjson11_serializeOpDocumentListParentsInput(v *ListParentsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ChildId != nil { ok := object.Key("ChildId") ok.String(*v.ChildId) } 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 awsAwsjson11_serializeOpDocumentListPoliciesForTargetInput(v *ListPoliciesForTargetInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Filter) > 0 { ok := object.Key("Filter") ok.String(string(v.Filter)) } if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } if v.TargetId != nil { ok := object.Key("TargetId") ok.String(*v.TargetId) } return nil } func awsAwsjson11_serializeOpDocumentListPoliciesInput(v *ListPoliciesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Filter) > 0 { ok := object.Key("Filter") ok.String(string(v.Filter)) } 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 awsAwsjson11_serializeOpDocumentListRootsInput(v *ListRootsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() 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 awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } if v.ResourceId != nil { ok := object.Key("ResourceId") ok.String(*v.ResourceId) } return nil } func awsAwsjson11_serializeOpDocumentListTargetsForPolicyInput(v *ListTargetsForPolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } if v.PolicyId != nil { ok := object.Key("PolicyId") ok.String(*v.PolicyId) } return nil } func awsAwsjson11_serializeOpDocumentMoveAccountInput(v *MoveAccountInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccountId != nil { ok := object.Key("AccountId") ok.String(*v.AccountId) } if v.DestinationParentId != nil { ok := object.Key("DestinationParentId") ok.String(*v.DestinationParentId) } if v.SourceParentId != nil { ok := object.Key("SourceParentId") ok.String(*v.SourceParentId) } return nil } func awsAwsjson11_serializeOpDocumentPutResourcePolicyInput(v *PutResourcePolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Content != nil { ok := object.Key("Content") ok.String(*v.Content) } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentRegisterDelegatedAdministratorInput(v *RegisterDelegatedAdministratorInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccountId != nil { ok := object.Key("AccountId") ok.String(*v.AccountId) } if v.ServicePrincipal != nil { ok := object.Key("ServicePrincipal") ok.String(*v.ServicePrincipal) } return nil } func awsAwsjson11_serializeOpDocumentRemoveAccountFromOrganizationInput(v *RemoveAccountFromOrganizationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AccountId != nil { ok := object.Key("AccountId") ok.String(*v.AccountId) } return nil } func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ResourceId != nil { ok := object.Key("ResourceId") ok.String(*v.ResourceId) } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ResourceId != nil { ok := object.Key("ResourceId") ok.String(*v.ResourceId) } if v.TagKeys != nil { ok := object.Key("TagKeys") if err := awsAwsjson11_serializeDocumentTagKeys(v.TagKeys, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentUpdateOrganizationalUnitInput(v *UpdateOrganizationalUnitInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.OrganizationalUnitId != nil { ok := object.Key("OrganizationalUnitId") ok.String(*v.OrganizationalUnitId) } return nil } func awsAwsjson11_serializeOpDocumentUpdatePolicyInput(v *UpdatePolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Content != nil { ok := object.Key("Content") ok.String(*v.Content) } if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.PolicyId != nil { ok := object.Key("PolicyId") ok.String(*v.PolicyId) } return nil }
4,032
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package organizations import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/organizations/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpAcceptHandshake struct { } func (*validateOpAcceptHandshake) ID() string { return "OperationInputValidation" } func (m *validateOpAcceptHandshake) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AcceptHandshakeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAcceptHandshakeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpAttachPolicy struct { } func (*validateOpAttachPolicy) ID() string { return "OperationInputValidation" } func (m *validateOpAttachPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AttachPolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAttachPolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCancelHandshake struct { } func (*validateOpCancelHandshake) ID() string { return "OperationInputValidation" } func (m *validateOpCancelHandshake) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CancelHandshakeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCancelHandshakeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCloseAccount struct { } func (*validateOpCloseAccount) ID() string { return "OperationInputValidation" } func (m *validateOpCloseAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CloseAccountInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCloseAccountInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateAccount struct { } func (*validateOpCreateAccount) ID() string { return "OperationInputValidation" } func (m *validateOpCreateAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateAccountInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateAccountInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateGovCloudAccount struct { } func (*validateOpCreateGovCloudAccount) ID() string { return "OperationInputValidation" } func (m *validateOpCreateGovCloudAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateGovCloudAccountInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateGovCloudAccountInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateOrganizationalUnit struct { } func (*validateOpCreateOrganizationalUnit) ID() string { return "OperationInputValidation" } func (m *validateOpCreateOrganizationalUnit) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateOrganizationalUnitInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateOrganizationalUnitInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreatePolicy struct { } func (*validateOpCreatePolicy) ID() string { return "OperationInputValidation" } func (m *validateOpCreatePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreatePolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreatePolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeclineHandshake struct { } func (*validateOpDeclineHandshake) ID() string { return "OperationInputValidation" } func (m *validateOpDeclineHandshake) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeclineHandshakeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeclineHandshakeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteOrganizationalUnit struct { } func (*validateOpDeleteOrganizationalUnit) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteOrganizationalUnit) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteOrganizationalUnitInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteOrganizationalUnitInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeletePolicy struct { } func (*validateOpDeletePolicy) ID() string { return "OperationInputValidation" } func (m *validateOpDeletePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeletePolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeletePolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeregisterDelegatedAdministrator struct { } func (*validateOpDeregisterDelegatedAdministrator) ID() string { return "OperationInputValidation" } func (m *validateOpDeregisterDelegatedAdministrator) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeregisterDelegatedAdministratorInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeregisterDelegatedAdministratorInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeAccount struct { } func (*validateOpDescribeAccount) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeAccountInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeAccountInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeCreateAccountStatus struct { } func (*validateOpDescribeCreateAccountStatus) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeCreateAccountStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeCreateAccountStatusInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeCreateAccountStatusInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeEffectivePolicy struct { } func (*validateOpDescribeEffectivePolicy) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeEffectivePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeEffectivePolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeEffectivePolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeHandshake struct { } func (*validateOpDescribeHandshake) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeHandshake) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeHandshakeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeHandshakeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeOrganizationalUnit struct { } func (*validateOpDescribeOrganizationalUnit) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeOrganizationalUnit) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeOrganizationalUnitInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeOrganizationalUnitInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribePolicy struct { } func (*validateOpDescribePolicy) ID() string { return "OperationInputValidation" } func (m *validateOpDescribePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribePolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribePolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDetachPolicy struct { } func (*validateOpDetachPolicy) ID() string { return "OperationInputValidation" } func (m *validateOpDetachPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DetachPolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDetachPolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDisableAWSServiceAccess struct { } func (*validateOpDisableAWSServiceAccess) ID() string { return "OperationInputValidation" } func (m *validateOpDisableAWSServiceAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DisableAWSServiceAccessInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDisableAWSServiceAccessInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDisablePolicyType struct { } func (*validateOpDisablePolicyType) ID() string { return "OperationInputValidation" } func (m *validateOpDisablePolicyType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DisablePolicyTypeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDisablePolicyTypeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpEnableAWSServiceAccess struct { } func (*validateOpEnableAWSServiceAccess) ID() string { return "OperationInputValidation" } func (m *validateOpEnableAWSServiceAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*EnableAWSServiceAccessInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpEnableAWSServiceAccessInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpEnablePolicyType struct { } func (*validateOpEnablePolicyType) ID() string { return "OperationInputValidation" } func (m *validateOpEnablePolicyType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*EnablePolicyTypeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpEnablePolicyTypeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpInviteAccountToOrganization struct { } func (*validateOpInviteAccountToOrganization) ID() string { return "OperationInputValidation" } func (m *validateOpInviteAccountToOrganization) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*InviteAccountToOrganizationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpInviteAccountToOrganizationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListAccountsForParent struct { } func (*validateOpListAccountsForParent) ID() string { return "OperationInputValidation" } func (m *validateOpListAccountsForParent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListAccountsForParentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListAccountsForParentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListChildren struct { } func (*validateOpListChildren) ID() string { return "OperationInputValidation" } func (m *validateOpListChildren) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListChildrenInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListChildrenInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListDelegatedServicesForAccount struct { } func (*validateOpListDelegatedServicesForAccount) ID() string { return "OperationInputValidation" } func (m *validateOpListDelegatedServicesForAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListDelegatedServicesForAccountInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListDelegatedServicesForAccountInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListOrganizationalUnitsForParent struct { } func (*validateOpListOrganizationalUnitsForParent) ID() string { return "OperationInputValidation" } func (m *validateOpListOrganizationalUnitsForParent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListOrganizationalUnitsForParentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListOrganizationalUnitsForParentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListParents struct { } func (*validateOpListParents) ID() string { return "OperationInputValidation" } func (m *validateOpListParents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListParentsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListParentsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListPoliciesForTarget struct { } func (*validateOpListPoliciesForTarget) ID() string { return "OperationInputValidation" } func (m *validateOpListPoliciesForTarget) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListPoliciesForTargetInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListPoliciesForTargetInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListPolicies struct { } func (*validateOpListPolicies) ID() string { return "OperationInputValidation" } func (m *validateOpListPolicies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListPoliciesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListPoliciesInput(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 validateOpListTargetsForPolicy struct { } func (*validateOpListTargetsForPolicy) ID() string { return "OperationInputValidation" } func (m *validateOpListTargetsForPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListTargetsForPolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListTargetsForPolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpMoveAccount struct { } func (*validateOpMoveAccount) ID() string { return "OperationInputValidation" } func (m *validateOpMoveAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*MoveAccountInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpMoveAccountInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpPutResourcePolicy struct { } func (*validateOpPutResourcePolicy) ID() string { return "OperationInputValidation" } func (m *validateOpPutResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PutResourcePolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPutResourcePolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRegisterDelegatedAdministrator struct { } func (*validateOpRegisterDelegatedAdministrator) ID() string { return "OperationInputValidation" } func (m *validateOpRegisterDelegatedAdministrator) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RegisterDelegatedAdministratorInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRegisterDelegatedAdministratorInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRemoveAccountFromOrganization struct { } func (*validateOpRemoveAccountFromOrganization) ID() string { return "OperationInputValidation" } func (m *validateOpRemoveAccountFromOrganization) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RemoveAccountFromOrganizationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRemoveAccountFromOrganizationInput(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 validateOpUpdateOrganizationalUnit struct { } func (*validateOpUpdateOrganizationalUnit) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateOrganizationalUnit) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateOrganizationalUnitInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateOrganizationalUnitInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdatePolicy struct { } func (*validateOpUpdatePolicy) ID() string { return "OperationInputValidation" } func (m *validateOpUpdatePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdatePolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdatePolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpAcceptHandshakeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAcceptHandshake{}, middleware.After) } func addOpAttachPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAttachPolicy{}, middleware.After) } func addOpCancelHandshakeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCancelHandshake{}, middleware.After) } func addOpCloseAccountValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCloseAccount{}, middleware.After) } func addOpCreateAccountValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateAccount{}, middleware.After) } func addOpCreateGovCloudAccountValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateGovCloudAccount{}, middleware.After) } func addOpCreateOrganizationalUnitValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateOrganizationalUnit{}, middleware.After) } func addOpCreatePolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreatePolicy{}, middleware.After) } func addOpDeclineHandshakeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeclineHandshake{}, middleware.After) } func addOpDeleteOrganizationalUnitValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteOrganizationalUnit{}, middleware.After) } func addOpDeletePolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeletePolicy{}, middleware.After) } func addOpDeregisterDelegatedAdministratorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeregisterDelegatedAdministrator{}, middleware.After) } func addOpDescribeAccountValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeAccount{}, middleware.After) } func addOpDescribeCreateAccountStatusValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeCreateAccountStatus{}, middleware.After) } func addOpDescribeEffectivePolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeEffectivePolicy{}, middleware.After) } func addOpDescribeHandshakeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeHandshake{}, middleware.After) } func addOpDescribeOrganizationalUnitValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeOrganizationalUnit{}, middleware.After) } func addOpDescribePolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribePolicy{}, middleware.After) } func addOpDetachPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDetachPolicy{}, middleware.After) } func addOpDisableAWSServiceAccessValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisableAWSServiceAccess{}, middleware.After) } func addOpDisablePolicyTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisablePolicyType{}, middleware.After) } func addOpEnableAWSServiceAccessValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpEnableAWSServiceAccess{}, middleware.After) } func addOpEnablePolicyTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpEnablePolicyType{}, middleware.After) } func addOpInviteAccountToOrganizationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpInviteAccountToOrganization{}, middleware.After) } func addOpListAccountsForParentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListAccountsForParent{}, middleware.After) } func addOpListChildrenValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListChildren{}, middleware.After) } func addOpListDelegatedServicesForAccountValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListDelegatedServicesForAccount{}, middleware.After) } func addOpListOrganizationalUnitsForParentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListOrganizationalUnitsForParent{}, middleware.After) } func addOpListParentsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListParents{}, middleware.After) } func addOpListPoliciesForTargetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListPoliciesForTarget{}, middleware.After) } func addOpListPoliciesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListPolicies{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } func addOpListTargetsForPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTargetsForPolicy{}, middleware.After) } func addOpMoveAccountValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpMoveAccount{}, middleware.After) } func addOpPutResourcePolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutResourcePolicy{}, middleware.After) } func addOpRegisterDelegatedAdministratorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRegisterDelegatedAdministrator{}, middleware.After) } func addOpRemoveAccountFromOrganizationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRemoveAccountFromOrganization{}, 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 addOpUpdateOrganizationalUnitValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateOrganizationalUnit{}, middleware.After) } func addOpUpdatePolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdatePolicy{}, middleware.After) } func validateHandshakeParty(v *types.HandshakeParty) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "HandshakeParty"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTag(v *types.Tag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Tag"} if v.Key == nil { invalidParams.Add(smithy.NewErrParamRequired("Key")) } if v.Value == nil { invalidParams.Add(smithy.NewErrParamRequired("Value")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTags(v []types.Tag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Tags"} for i := range v { if err := validateTag(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAcceptHandshakeInput(v *AcceptHandshakeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AcceptHandshakeInput"} if v.HandshakeId == nil { invalidParams.Add(smithy.NewErrParamRequired("HandshakeId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAttachPolicyInput(v *AttachPolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AttachPolicyInput"} if v.PolicyId == nil { invalidParams.Add(smithy.NewErrParamRequired("PolicyId")) } if v.TargetId == nil { invalidParams.Add(smithy.NewErrParamRequired("TargetId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCancelHandshakeInput(v *CancelHandshakeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CancelHandshakeInput"} if v.HandshakeId == nil { invalidParams.Add(smithy.NewErrParamRequired("HandshakeId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCloseAccountInput(v *CloseAccountInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CloseAccountInput"} if v.AccountId == nil { invalidParams.Add(smithy.NewErrParamRequired("AccountId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateAccountInput(v *CreateAccountInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateAccountInput"} if v.Email == nil { invalidParams.Add(smithy.NewErrParamRequired("Email")) } if v.AccountName == nil { invalidParams.Add(smithy.NewErrParamRequired("AccountName")) } if v.Tags != nil { if err := validateTags(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateGovCloudAccountInput(v *CreateGovCloudAccountInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateGovCloudAccountInput"} if v.Email == nil { invalidParams.Add(smithy.NewErrParamRequired("Email")) } if v.AccountName == nil { invalidParams.Add(smithy.NewErrParamRequired("AccountName")) } if v.Tags != nil { if err := validateTags(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateOrganizationalUnitInput(v *CreateOrganizationalUnitInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateOrganizationalUnitInput"} if v.ParentId == nil { invalidParams.Add(smithy.NewErrParamRequired("ParentId")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Tags != nil { if err := validateTags(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreatePolicyInput(v *CreatePolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreatePolicyInput"} if v.Content == nil { invalidParams.Add(smithy.NewErrParamRequired("Content")) } if v.Description == nil { invalidParams.Add(smithy.NewErrParamRequired("Description")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } if v.Tags != nil { if err := validateTags(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeclineHandshakeInput(v *DeclineHandshakeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeclineHandshakeInput"} if v.HandshakeId == nil { invalidParams.Add(smithy.NewErrParamRequired("HandshakeId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteOrganizationalUnitInput(v *DeleteOrganizationalUnitInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteOrganizationalUnitInput"} if v.OrganizationalUnitId == nil { invalidParams.Add(smithy.NewErrParamRequired("OrganizationalUnitId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeletePolicyInput(v *DeletePolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeletePolicyInput"} if v.PolicyId == nil { invalidParams.Add(smithy.NewErrParamRequired("PolicyId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeregisterDelegatedAdministratorInput(v *DeregisterDelegatedAdministratorInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeregisterDelegatedAdministratorInput"} if v.AccountId == nil { invalidParams.Add(smithy.NewErrParamRequired("AccountId")) } if v.ServicePrincipal == nil { invalidParams.Add(smithy.NewErrParamRequired("ServicePrincipal")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeAccountInput(v *DescribeAccountInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeAccountInput"} if v.AccountId == nil { invalidParams.Add(smithy.NewErrParamRequired("AccountId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeCreateAccountStatusInput(v *DescribeCreateAccountStatusInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeCreateAccountStatusInput"} if v.CreateAccountRequestId == nil { invalidParams.Add(smithy.NewErrParamRequired("CreateAccountRequestId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeEffectivePolicyInput(v *DescribeEffectivePolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeEffectivePolicyInput"} if len(v.PolicyType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("PolicyType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeHandshakeInput(v *DescribeHandshakeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeHandshakeInput"} if v.HandshakeId == nil { invalidParams.Add(smithy.NewErrParamRequired("HandshakeId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeOrganizationalUnitInput(v *DescribeOrganizationalUnitInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeOrganizationalUnitInput"} if v.OrganizationalUnitId == nil { invalidParams.Add(smithy.NewErrParamRequired("OrganizationalUnitId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribePolicyInput(v *DescribePolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribePolicyInput"} if v.PolicyId == nil { invalidParams.Add(smithy.NewErrParamRequired("PolicyId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDetachPolicyInput(v *DetachPolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DetachPolicyInput"} if v.PolicyId == nil { invalidParams.Add(smithy.NewErrParamRequired("PolicyId")) } if v.TargetId == nil { invalidParams.Add(smithy.NewErrParamRequired("TargetId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDisableAWSServiceAccessInput(v *DisableAWSServiceAccessInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DisableAWSServiceAccessInput"} if v.ServicePrincipal == nil { invalidParams.Add(smithy.NewErrParamRequired("ServicePrincipal")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDisablePolicyTypeInput(v *DisablePolicyTypeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DisablePolicyTypeInput"} if v.RootId == nil { invalidParams.Add(smithy.NewErrParamRequired("RootId")) } if len(v.PolicyType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("PolicyType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpEnableAWSServiceAccessInput(v *EnableAWSServiceAccessInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "EnableAWSServiceAccessInput"} if v.ServicePrincipal == nil { invalidParams.Add(smithy.NewErrParamRequired("ServicePrincipal")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpEnablePolicyTypeInput(v *EnablePolicyTypeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "EnablePolicyTypeInput"} if v.RootId == nil { invalidParams.Add(smithy.NewErrParamRequired("RootId")) } if len(v.PolicyType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("PolicyType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpInviteAccountToOrganizationInput(v *InviteAccountToOrganizationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "InviteAccountToOrganizationInput"} if v.Target == nil { invalidParams.Add(smithy.NewErrParamRequired("Target")) } else if v.Target != nil { if err := validateHandshakeParty(v.Target); err != nil { invalidParams.AddNested("Target", err.(smithy.InvalidParamsError)) } } if v.Tags != nil { if err := validateTags(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListAccountsForParentInput(v *ListAccountsForParentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListAccountsForParentInput"} if v.ParentId == nil { invalidParams.Add(smithy.NewErrParamRequired("ParentId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListChildrenInput(v *ListChildrenInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListChildrenInput"} if v.ParentId == nil { invalidParams.Add(smithy.NewErrParamRequired("ParentId")) } if len(v.ChildType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("ChildType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListDelegatedServicesForAccountInput(v *ListDelegatedServicesForAccountInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListDelegatedServicesForAccountInput"} if v.AccountId == nil { invalidParams.Add(smithy.NewErrParamRequired("AccountId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListOrganizationalUnitsForParentInput(v *ListOrganizationalUnitsForParentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListOrganizationalUnitsForParentInput"} if v.ParentId == nil { invalidParams.Add(smithy.NewErrParamRequired("ParentId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListParentsInput(v *ListParentsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListParentsInput"} if v.ChildId == nil { invalidParams.Add(smithy.NewErrParamRequired("ChildId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListPoliciesForTargetInput(v *ListPoliciesForTargetInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListPoliciesForTargetInput"} if v.TargetId == nil { invalidParams.Add(smithy.NewErrParamRequired("TargetId")) } if len(v.Filter) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Filter")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListPoliciesInput(v *ListPoliciesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListPoliciesInput"} if len(v.Filter) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Filter")) } 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.ResourceId == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListTargetsForPolicyInput(v *ListTargetsForPolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListTargetsForPolicyInput"} if v.PolicyId == nil { invalidParams.Add(smithy.NewErrParamRequired("PolicyId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpMoveAccountInput(v *MoveAccountInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "MoveAccountInput"} if v.AccountId == nil { invalidParams.Add(smithy.NewErrParamRequired("AccountId")) } if v.SourceParentId == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceParentId")) } if v.DestinationParentId == nil { invalidParams.Add(smithy.NewErrParamRequired("DestinationParentId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpPutResourcePolicyInput(v *PutResourcePolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PutResourcePolicyInput"} if v.Content == nil { invalidParams.Add(smithy.NewErrParamRequired("Content")) } if v.Tags != nil { if err := validateTags(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRegisterDelegatedAdministratorInput(v *RegisterDelegatedAdministratorInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RegisterDelegatedAdministratorInput"} if v.AccountId == nil { invalidParams.Add(smithy.NewErrParamRequired("AccountId")) } if v.ServicePrincipal == nil { invalidParams.Add(smithy.NewErrParamRequired("ServicePrincipal")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRemoveAccountFromOrganizationInput(v *RemoveAccountFromOrganizationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RemoveAccountFromOrganizationInput"} if v.AccountId == nil { invalidParams.Add(smithy.NewErrParamRequired("AccountId")) } 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.ResourceId == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceId")) } if v.Tags == nil { invalidParams.Add(smithy.NewErrParamRequired("Tags")) } else if v.Tags != nil { if err := validateTags(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUntagResourceInput(v *UntagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} if v.ResourceId == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceId")) } if v.TagKeys == nil { invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateOrganizationalUnitInput(v *UpdateOrganizationalUnitInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateOrganizationalUnitInput"} if v.OrganizationalUnitId == nil { invalidParams.Add(smithy.NewErrParamRequired("OrganizationalUnitId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdatePolicyInput(v *UpdatePolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdatePolicyInput"} if v.PolicyId == nil { invalidParams.Add(smithy.NewErrParamRequired("PolicyId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
1,756
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 Organizations 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: "organizations.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "organizations-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "organizations-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "organizations.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: false, PartitionEndpoint: "aws-global", Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "aws-global", }: endpoints.Endpoint{ Hostname: "organizations.us-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-1", }, }, endpoints.EndpointKey{ Region: "aws-global", Variant: endpoints.FIPSVariant, }: { Hostname: "organizations-fips.us-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-1", }, }, endpoints.EndpointKey{ Region: "fips-aws-global", }: endpoints.Endpoint{ Hostname: "organizations-fips.us-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-1", }, Deprecated: aws.TrueTernary, }, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "organizations.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "organizations-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "organizations-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "organizations.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: false, PartitionEndpoint: "aws-cn-global", Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "aws-cn-global", }: endpoints.Endpoint{ Hostname: "organizations.cn-northwest-1.amazonaws.com.cn", CredentialScope: endpoints.CredentialScope{ Region: "cn-northwest-1", }, }, }, }, { ID: "aws-iso", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "organizations-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "organizations.{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: "organizations-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "organizations.{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: "organizations-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "organizations.{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: "organizations-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "organizations.{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: "organizations.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "organizations-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "organizations-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "organizations.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: false, PartitionEndpoint: "aws-us-gov-global", Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "aws-us-gov-global", }: endpoints.Endpoint{ Hostname: "organizations.us-gov-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-west-1", }, }, endpoints.EndpointKey{ Region: "aws-us-gov-global", Variant: endpoints.FIPSVariant, }: { Hostname: "organizations.us-gov-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-west-1", }, }, endpoints.EndpointKey{ Region: "fips-aws-us-gov-global", }: endpoints.Endpoint{ Hostname: "organizations.us-gov-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-west-1", }, Deprecated: aws.TrueTernary, }, }, }, }
366
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 AccessDeniedForDependencyExceptionReason string // Enum values for AccessDeniedForDependencyExceptionReason const ( AccessDeniedForDependencyExceptionReasonAccessDeniedDuringCreateServiceLinkedRole AccessDeniedForDependencyExceptionReason = "ACCESS_DENIED_DURING_CREATE_SERVICE_LINKED_ROLE" ) // Values returns all known values for AccessDeniedForDependencyExceptionReason. // 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 (AccessDeniedForDependencyExceptionReason) Values() []AccessDeniedForDependencyExceptionReason { return []AccessDeniedForDependencyExceptionReason{ "ACCESS_DENIED_DURING_CREATE_SERVICE_LINKED_ROLE", } } type AccountJoinedMethod string // Enum values for AccountJoinedMethod const ( AccountJoinedMethodInvited AccountJoinedMethod = "INVITED" AccountJoinedMethodCreated AccountJoinedMethod = "CREATED" ) // Values returns all known values for AccountJoinedMethod. 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 (AccountJoinedMethod) Values() []AccountJoinedMethod { return []AccountJoinedMethod{ "INVITED", "CREATED", } } type AccountStatus string // Enum values for AccountStatus const ( AccountStatusActive AccountStatus = "ACTIVE" AccountStatusSuspended AccountStatus = "SUSPENDED" AccountStatusPendingClosure AccountStatus = "PENDING_CLOSURE" ) // Values returns all known values for AccountStatus. 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 (AccountStatus) Values() []AccountStatus { return []AccountStatus{ "ACTIVE", "SUSPENDED", "PENDING_CLOSURE", } } type ActionType string // Enum values for ActionType const ( ActionTypeInviteAccountToOrganization ActionType = "INVITE" ActionTypeEnableAllFeatures ActionType = "ENABLE_ALL_FEATURES" ActionTypeApproveAllFeatures ActionType = "APPROVE_ALL_FEATURES" ActionTypeAddOrganizationsServiceLinkedRole ActionType = "ADD_ORGANIZATIONS_SERVICE_LINKED_ROLE" ) // Values returns all known values for ActionType. 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 (ActionType) Values() []ActionType { return []ActionType{ "INVITE", "ENABLE_ALL_FEATURES", "APPROVE_ALL_FEATURES", "ADD_ORGANIZATIONS_SERVICE_LINKED_ROLE", } } type ChildType string // Enum values for ChildType const ( ChildTypeAccount ChildType = "ACCOUNT" ChildTypeOrganizationalUnit ChildType = "ORGANIZATIONAL_UNIT" ) // Values returns all known values for ChildType. 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 (ChildType) Values() []ChildType { return []ChildType{ "ACCOUNT", "ORGANIZATIONAL_UNIT", } } type ConstraintViolationExceptionReason string // Enum values for ConstraintViolationExceptionReason const ( ConstraintViolationExceptionReasonAccountNumberLimitExceeded ConstraintViolationExceptionReason = "ACCOUNT_NUMBER_LIMIT_EXCEEDED" ConstraintViolationExceptionReasonHandshakeRateLimitExceeded ConstraintViolationExceptionReason = "HANDSHAKE_RATE_LIMIT_EXCEEDED" ConstraintViolationExceptionReasonOuNumberLimitExceeded ConstraintViolationExceptionReason = "OU_NUMBER_LIMIT_EXCEEDED" ConstraintViolationExceptionReasonOuDepthLimitExceeded ConstraintViolationExceptionReason = "OU_DEPTH_LIMIT_EXCEEDED" ConstraintViolationExceptionReasonPolicyNumberLimitExceeded ConstraintViolationExceptionReason = "POLICY_NUMBER_LIMIT_EXCEEDED" ConstraintViolationExceptionReasonPolicyContentLimitExceeded ConstraintViolationExceptionReason = "POLICY_CONTENT_LIMIT_EXCEEDED" ConstraintViolationExceptionReasonMaxPolicyTypeAttachmentLimitExceeded ConstraintViolationExceptionReason = "MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED" ConstraintViolationExceptionReasonMinPolicyTypeAttachmentLimitExceeded ConstraintViolationExceptionReason = "MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED" ConstraintViolationExceptionReasonAccountCannotLeaveOrganization ConstraintViolationExceptionReason = "ACCOUNT_CANNOT_LEAVE_ORGANIZATION" ConstraintViolationExceptionReasonAccountCannotLeaveWithoutEula ConstraintViolationExceptionReason = "ACCOUNT_CANNOT_LEAVE_WITHOUT_EULA" ConstraintViolationExceptionReasonAccountCannotLeaveWithoutPhoneVerification ConstraintViolationExceptionReason = "ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION" ConstraintViolationExceptionReasonMasterAccountPaymentInstrumentRequired ConstraintViolationExceptionReason = "MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED" ConstraintViolationExceptionReasonMemberAccountPaymentInstrumentRequired ConstraintViolationExceptionReason = "MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED" ConstraintViolationExceptionReasonAccountCreationRateLimitExceeded ConstraintViolationExceptionReason = "ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED" ConstraintViolationExceptionReasonMasterAccountAddressDoesNotMatchMarketplace ConstraintViolationExceptionReason = "MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE" ConstraintViolationExceptionReasonMasterAccountMissingContactInfo ConstraintViolationExceptionReason = "MASTER_ACCOUNT_MISSING_CONTACT_INFO" ConstraintViolationExceptionReasonMasterAccountNotGovcloudEnabled ConstraintViolationExceptionReason = "MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED" ConstraintViolationExceptionReasonOrganizationNotInAllFeaturesMode ConstraintViolationExceptionReason = "ORGANIZATION_NOT_IN_ALL_FEATURES_MODE" ConstraintViolationExceptionReasonCreateOrganizationInBillingModeUnsupportedRegion ConstraintViolationExceptionReason = "CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION" ConstraintViolationExceptionReasonEmailVerificationCodeExpired ConstraintViolationExceptionReason = "EMAIL_VERIFICATION_CODE_EXPIRED" ConstraintViolationExceptionReasonWaitPeriodActive ConstraintViolationExceptionReason = "WAIT_PERIOD_ACTIVE" ConstraintViolationExceptionReasonMaxTagLimitExceeded ConstraintViolationExceptionReason = "MAX_TAG_LIMIT_EXCEEDED" ConstraintViolationExceptionReasonTagPolicyViolation ConstraintViolationExceptionReason = "TAG_POLICY_VIOLATION" ConstraintViolationExceptionReasonMaxDelegatedAdministratorsForServiceLimitExceeded ConstraintViolationExceptionReason = "MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED" ConstraintViolationExceptionReasonCannotRegisterMasterAsDelegatedAdministrator ConstraintViolationExceptionReason = "CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR" ConstraintViolationExceptionReasonCannotRemoveDelegatedAdministratorFromOrg ConstraintViolationExceptionReason = "CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG" ConstraintViolationExceptionReasonDelegatedAdministratorExistsForThisService ConstraintViolationExceptionReason = "DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE" ConstraintViolationExceptionReasonMasterAccountMissingBusinessLicense ConstraintViolationExceptionReason = "MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE" ConstraintViolationExceptionReasonCannotCloseManagementAccount ConstraintViolationExceptionReason = "CANNOT_CLOSE_MANAGEMENT_ACCOUNT" ConstraintViolationExceptionReasonCloseAccountQuotaExceeded ConstraintViolationExceptionReason = "CLOSE_ACCOUNT_QUOTA_EXCEEDED" ConstraintViolationExceptionReasonCloseAccountRequestsLimitExceeded ConstraintViolationExceptionReason = "CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED" ConstraintViolationExceptionReasonServiceAccessNotEnabled ConstraintViolationExceptionReason = "SERVICE_ACCESS_NOT_ENABLED" ConstraintViolationExceptionReasonInvalidPaymentInstrument ConstraintViolationExceptionReason = "INVALID_PAYMENT_INSTRUMENT" ConstraintViolationExceptionReasonAccountCreationNotComplete ConstraintViolationExceptionReason = "ACCOUNT_CREATION_NOT_COMPLETE" ) // Values returns all known values for ConstraintViolationExceptionReason. 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 (ConstraintViolationExceptionReason) Values() []ConstraintViolationExceptionReason { return []ConstraintViolationExceptionReason{ "ACCOUNT_NUMBER_LIMIT_EXCEEDED", "HANDSHAKE_RATE_LIMIT_EXCEEDED", "OU_NUMBER_LIMIT_EXCEEDED", "OU_DEPTH_LIMIT_EXCEEDED", "POLICY_NUMBER_LIMIT_EXCEEDED", "POLICY_CONTENT_LIMIT_EXCEEDED", "MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED", "MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED", "ACCOUNT_CANNOT_LEAVE_ORGANIZATION", "ACCOUNT_CANNOT_LEAVE_WITHOUT_EULA", "ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION", "MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED", "MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED", "ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED", "MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE", "MASTER_ACCOUNT_MISSING_CONTACT_INFO", "MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED", "ORGANIZATION_NOT_IN_ALL_FEATURES_MODE", "CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION", "EMAIL_VERIFICATION_CODE_EXPIRED", "WAIT_PERIOD_ACTIVE", "MAX_TAG_LIMIT_EXCEEDED", "TAG_POLICY_VIOLATION", "MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED", "CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR", "CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG", "DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE", "MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE", "CANNOT_CLOSE_MANAGEMENT_ACCOUNT", "CLOSE_ACCOUNT_QUOTA_EXCEEDED", "CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED", "SERVICE_ACCESS_NOT_ENABLED", "INVALID_PAYMENT_INSTRUMENT", "ACCOUNT_CREATION_NOT_COMPLETE", } } type CreateAccountFailureReason string // Enum values for CreateAccountFailureReason const ( CreateAccountFailureReasonAccountLimitExceeded CreateAccountFailureReason = "ACCOUNT_LIMIT_EXCEEDED" CreateAccountFailureReasonEmailAlreadyExists CreateAccountFailureReason = "EMAIL_ALREADY_EXISTS" CreateAccountFailureReasonInvalidAddress CreateAccountFailureReason = "INVALID_ADDRESS" CreateAccountFailureReasonInvalidEmail CreateAccountFailureReason = "INVALID_EMAIL" CreateAccountFailureReasonConcurrentAccountModification CreateAccountFailureReason = "CONCURRENT_ACCOUNT_MODIFICATION" CreateAccountFailureReasonInternalFailure CreateAccountFailureReason = "INTERNAL_FAILURE" CreateAccountFailureReasonGovcloudAccountAlreadyExists CreateAccountFailureReason = "GOVCLOUD_ACCOUNT_ALREADY_EXISTS" CreateAccountFailureReasonMissingBusinessValidation CreateAccountFailureReason = "MISSING_BUSINESS_VALIDATION" CreateAccountFailureReasonFailedBusinessValidation CreateAccountFailureReason = "FAILED_BUSINESS_VALIDATION" CreateAccountFailureReasonPendingBusinessVALIDATIONv CreateAccountFailureReason = "PENDING_BUSINESS_VALIDATION" CreateAccountFailureReasonInvalidIdentityForBusinessValidation CreateAccountFailureReason = "INVALID_IDENTITY_FOR_BUSINESS_VALIDATION" CreateAccountFailureReasonUnknownBusinessValidation CreateAccountFailureReason = "UNKNOWN_BUSINESS_VALIDATION" CreateAccountFailureReasonMissingPaymentInstrument CreateAccountFailureReason = "MISSING_PAYMENT_INSTRUMENT" CreateAccountFailureReasonInvalidPaymentInstrument CreateAccountFailureReason = "INVALID_PAYMENT_INSTRUMENT" CreateAccountFailureReasonUpdateExistingResourcePolicyWithTagsNotSupported CreateAccountFailureReason = "UPDATE_EXISTING_RESOURCE_POLICY_WITH_TAGS_NOT_SUPPORTED" ) // Values returns all known values for CreateAccountFailureReason. 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 (CreateAccountFailureReason) Values() []CreateAccountFailureReason { return []CreateAccountFailureReason{ "ACCOUNT_LIMIT_EXCEEDED", "EMAIL_ALREADY_EXISTS", "INVALID_ADDRESS", "INVALID_EMAIL", "CONCURRENT_ACCOUNT_MODIFICATION", "INTERNAL_FAILURE", "GOVCLOUD_ACCOUNT_ALREADY_EXISTS", "MISSING_BUSINESS_VALIDATION", "FAILED_BUSINESS_VALIDATION", "PENDING_BUSINESS_VALIDATION", "INVALID_IDENTITY_FOR_BUSINESS_VALIDATION", "UNKNOWN_BUSINESS_VALIDATION", "MISSING_PAYMENT_INSTRUMENT", "INVALID_PAYMENT_INSTRUMENT", "UPDATE_EXISTING_RESOURCE_POLICY_WITH_TAGS_NOT_SUPPORTED", } } type CreateAccountState string // Enum values for CreateAccountState const ( CreateAccountStateInProgress CreateAccountState = "IN_PROGRESS" CreateAccountStateSucceeded CreateAccountState = "SUCCEEDED" CreateAccountStateFailed CreateAccountState = "FAILED" ) // Values returns all known values for CreateAccountState. 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 (CreateAccountState) Values() []CreateAccountState { return []CreateAccountState{ "IN_PROGRESS", "SUCCEEDED", "FAILED", } } type EffectivePolicyType string // Enum values for EffectivePolicyType const ( EffectivePolicyTypeTagPolicy EffectivePolicyType = "TAG_POLICY" EffectivePolicyTypeBackupPolicy EffectivePolicyType = "BACKUP_POLICY" EffectivePolicyTypeAiservicesOptOutPolicy EffectivePolicyType = "AISERVICES_OPT_OUT_POLICY" ) // Values returns all known values for EffectivePolicyType. 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 (EffectivePolicyType) Values() []EffectivePolicyType { return []EffectivePolicyType{ "TAG_POLICY", "BACKUP_POLICY", "AISERVICES_OPT_OUT_POLICY", } } type HandshakeConstraintViolationExceptionReason string // Enum values for HandshakeConstraintViolationExceptionReason const ( HandshakeConstraintViolationExceptionReasonAccountNumberLimitExceeded HandshakeConstraintViolationExceptionReason = "ACCOUNT_NUMBER_LIMIT_EXCEEDED" HandshakeConstraintViolationExceptionReasonHandshakeRateLimitExceeded HandshakeConstraintViolationExceptionReason = "HANDSHAKE_RATE_LIMIT_EXCEEDED" HandshakeConstraintViolationExceptionReasonAlreadyInAnOrganization HandshakeConstraintViolationExceptionReason = "ALREADY_IN_AN_ORGANIZATION" HandshakeConstraintViolationExceptionReasonOrganizationAlreadyHasAllFeatures HandshakeConstraintViolationExceptionReason = "ORGANIZATION_ALREADY_HAS_ALL_FEATURES" HandshakeConstraintViolationExceptionReasonOrganizationIsAlreadyPendingAllFeaturesMigration HandshakeConstraintViolationExceptionReason = "ORGANIZATION_IS_ALREADY_PENDING_ALL_FEATURES_MIGRATION" HandshakeConstraintViolationExceptionReasonInviteDisabledDuringEnableAllFeatures HandshakeConstraintViolationExceptionReason = "INVITE_DISABLED_DURING_ENABLE_ALL_FEATURES" HandshakeConstraintViolationExceptionReasonPaymentInstrumentRequired HandshakeConstraintViolationExceptionReason = "PAYMENT_INSTRUMENT_REQUIRED" HandshakeConstraintViolationExceptionReasonOrganizationFromDifferentSellerOfRecord HandshakeConstraintViolationExceptionReason = "ORGANIZATION_FROM_DIFFERENT_SELLER_OF_RECORD" HandshakeConstraintViolationExceptionReasonOrganizationMembershipChangeRateLimitExceeded HandshakeConstraintViolationExceptionReason = "ORGANIZATION_MEMBERSHIP_CHANGE_RATE_LIMIT_EXCEEDED" HandshakeConstraintViolationExceptionReasonManagementAccountEmailNotVerified HandshakeConstraintViolationExceptionReason = "MANAGEMENT_ACCOUNT_EMAIL_NOT_VERIFIED" ) // Values returns all known values for // HandshakeConstraintViolationExceptionReason. 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 (HandshakeConstraintViolationExceptionReason) Values() []HandshakeConstraintViolationExceptionReason { return []HandshakeConstraintViolationExceptionReason{ "ACCOUNT_NUMBER_LIMIT_EXCEEDED", "HANDSHAKE_RATE_LIMIT_EXCEEDED", "ALREADY_IN_AN_ORGANIZATION", "ORGANIZATION_ALREADY_HAS_ALL_FEATURES", "ORGANIZATION_IS_ALREADY_PENDING_ALL_FEATURES_MIGRATION", "INVITE_DISABLED_DURING_ENABLE_ALL_FEATURES", "PAYMENT_INSTRUMENT_REQUIRED", "ORGANIZATION_FROM_DIFFERENT_SELLER_OF_RECORD", "ORGANIZATION_MEMBERSHIP_CHANGE_RATE_LIMIT_EXCEEDED", "MANAGEMENT_ACCOUNT_EMAIL_NOT_VERIFIED", } } type HandshakePartyType string // Enum values for HandshakePartyType const ( HandshakePartyTypeAccount HandshakePartyType = "ACCOUNT" HandshakePartyTypeOrganization HandshakePartyType = "ORGANIZATION" HandshakePartyTypeEmail HandshakePartyType = "EMAIL" ) // Values returns all known values for HandshakePartyType. 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 (HandshakePartyType) Values() []HandshakePartyType { return []HandshakePartyType{ "ACCOUNT", "ORGANIZATION", "EMAIL", } } type HandshakeResourceType string // Enum values for HandshakeResourceType const ( HandshakeResourceTypeAccount HandshakeResourceType = "ACCOUNT" HandshakeResourceTypeOrganization HandshakeResourceType = "ORGANIZATION" HandshakeResourceTypeOrganizationFeatureSet HandshakeResourceType = "ORGANIZATION_FEATURE_SET" HandshakeResourceTypeEmail HandshakeResourceType = "EMAIL" HandshakeResourceTypeMasterEmail HandshakeResourceType = "MASTER_EMAIL" HandshakeResourceTypeMasterName HandshakeResourceType = "MASTER_NAME" HandshakeResourceTypeNotes HandshakeResourceType = "NOTES" HandshakeResourceTypeParentHandshake HandshakeResourceType = "PARENT_HANDSHAKE" ) // Values returns all known values for HandshakeResourceType. 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 (HandshakeResourceType) Values() []HandshakeResourceType { return []HandshakeResourceType{ "ACCOUNT", "ORGANIZATION", "ORGANIZATION_FEATURE_SET", "EMAIL", "MASTER_EMAIL", "MASTER_NAME", "NOTES", "PARENT_HANDSHAKE", } } type HandshakeState string // Enum values for HandshakeState const ( HandshakeStateRequested HandshakeState = "REQUESTED" HandshakeStateOpen HandshakeState = "OPEN" HandshakeStateCanceled HandshakeState = "CANCELED" HandshakeStateAccepted HandshakeState = "ACCEPTED" HandshakeStateDeclined HandshakeState = "DECLINED" HandshakeStateExpired HandshakeState = "EXPIRED" ) // Values returns all known values for HandshakeState. 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 (HandshakeState) Values() []HandshakeState { return []HandshakeState{ "REQUESTED", "OPEN", "CANCELED", "ACCEPTED", "DECLINED", "EXPIRED", } } type IAMUserAccessToBilling string // Enum values for IAMUserAccessToBilling const ( IAMUserAccessToBillingAllow IAMUserAccessToBilling = "ALLOW" IAMUserAccessToBillingDeny IAMUserAccessToBilling = "DENY" ) // Values returns all known values for IAMUserAccessToBilling. 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 (IAMUserAccessToBilling) Values() []IAMUserAccessToBilling { return []IAMUserAccessToBilling{ "ALLOW", "DENY", } } type InvalidInputExceptionReason string // Enum values for InvalidInputExceptionReason const ( InvalidInputExceptionReasonInvalidPartyTypeTarget InvalidInputExceptionReason = "INVALID_PARTY_TYPE_TARGET" InvalidInputExceptionReasonInvalidSyntaxOrganization InvalidInputExceptionReason = "INVALID_SYNTAX_ORGANIZATION_ARN" InvalidInputExceptionReasonInvalidSyntaxPolicy InvalidInputExceptionReason = "INVALID_SYNTAX_POLICY_ID" InvalidInputExceptionReasonInvalidEnum InvalidInputExceptionReason = "INVALID_ENUM" InvalidInputExceptionReasonInvalidEnumPolicyType InvalidInputExceptionReason = "INVALID_ENUM_POLICY_TYPE" InvalidInputExceptionReasonInvalidListMember InvalidInputExceptionReason = "INVALID_LIST_MEMBER" InvalidInputExceptionReasonMaxLengthExceeded InvalidInputExceptionReason = "MAX_LENGTH_EXCEEDED" InvalidInputExceptionReasonMaxValueExceeded InvalidInputExceptionReason = "MAX_VALUE_EXCEEDED" InvalidInputExceptionReasonMinLengthExceeded InvalidInputExceptionReason = "MIN_LENGTH_EXCEEDED" InvalidInputExceptionReasonMinValueExceeded InvalidInputExceptionReason = "MIN_VALUE_EXCEEDED" InvalidInputExceptionReasonImmutablePolicy InvalidInputExceptionReason = "IMMUTABLE_POLICY" InvalidInputExceptionReasonInvalidPattern InvalidInputExceptionReason = "INVALID_PATTERN" InvalidInputExceptionReasonInvalidPatternTargetId InvalidInputExceptionReason = "INVALID_PATTERN_TARGET_ID" InvalidInputExceptionReasonInputRequired InvalidInputExceptionReason = "INPUT_REQUIRED" InvalidInputExceptionReasonInvalidPaginationToken InvalidInputExceptionReason = "INVALID_NEXT_TOKEN" InvalidInputExceptionReasonMaxFilterLimitExceeded InvalidInputExceptionReason = "MAX_LIMIT_EXCEEDED_FILTER" InvalidInputExceptionReasonMovingAccountBetweenDifferentRoots InvalidInputExceptionReason = "MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS" InvalidInputExceptionReasonInvalidFullNameTarget InvalidInputExceptionReason = "INVALID_FULL_NAME_TARGET" InvalidInputExceptionReasonUnrecognizedServicePrincipal InvalidInputExceptionReason = "UNRECOGNIZED_SERVICE_PRINCIPAL" InvalidInputExceptionReasonInvalidRoleName InvalidInputExceptionReason = "INVALID_ROLE_NAME" InvalidInputExceptionReasonInvalidSystemTagsParameter InvalidInputExceptionReason = "INVALID_SYSTEM_TAGS_PARAMETER" InvalidInputExceptionReasonDuplicateTagKey InvalidInputExceptionReason = "DUPLICATE_TAG_KEY" InvalidInputExceptionReasonTargetNotSupported InvalidInputExceptionReason = "TARGET_NOT_SUPPORTED" InvalidInputExceptionReasonInvalidEmailAddressTarget InvalidInputExceptionReason = "INVALID_EMAIL_ADDRESS_TARGET" InvalidInputExceptionReasonInvalidResourcePolicyJson InvalidInputExceptionReason = "INVALID_RESOURCE_POLICY_JSON" InvalidInputExceptionReasonUnsupportedActionInResourcePolicy InvalidInputExceptionReason = "UNSUPPORTED_ACTION_IN_RESOURCE_POLICY" InvalidInputExceptionReasonUnsupportedPolicyTypeInResourcePolicy InvalidInputExceptionReason = "UNSUPPORTED_POLICY_TYPE_IN_RESOURCE_POLICY" InvalidInputExceptionReasonUnsupportedResourceInResourcePolicy InvalidInputExceptionReason = "UNSUPPORTED_RESOURCE_IN_RESOURCE_POLICY" ) // Values returns all known values for InvalidInputExceptionReason. 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 (InvalidInputExceptionReason) Values() []InvalidInputExceptionReason { return []InvalidInputExceptionReason{ "INVALID_PARTY_TYPE_TARGET", "INVALID_SYNTAX_ORGANIZATION_ARN", "INVALID_SYNTAX_POLICY_ID", "INVALID_ENUM", "INVALID_ENUM_POLICY_TYPE", "INVALID_LIST_MEMBER", "MAX_LENGTH_EXCEEDED", "MAX_VALUE_EXCEEDED", "MIN_LENGTH_EXCEEDED", "MIN_VALUE_EXCEEDED", "IMMUTABLE_POLICY", "INVALID_PATTERN", "INVALID_PATTERN_TARGET_ID", "INPUT_REQUIRED", "INVALID_NEXT_TOKEN", "MAX_LIMIT_EXCEEDED_FILTER", "MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS", "INVALID_FULL_NAME_TARGET", "UNRECOGNIZED_SERVICE_PRINCIPAL", "INVALID_ROLE_NAME", "INVALID_SYSTEM_TAGS_PARAMETER", "DUPLICATE_TAG_KEY", "TARGET_NOT_SUPPORTED", "INVALID_EMAIL_ADDRESS_TARGET", "INVALID_RESOURCE_POLICY_JSON", "UNSUPPORTED_ACTION_IN_RESOURCE_POLICY", "UNSUPPORTED_POLICY_TYPE_IN_RESOURCE_POLICY", "UNSUPPORTED_RESOURCE_IN_RESOURCE_POLICY", } } type OrganizationFeatureSet string // Enum values for OrganizationFeatureSet const ( OrganizationFeatureSetAll OrganizationFeatureSet = "ALL" OrganizationFeatureSetConsolidatedBilling OrganizationFeatureSet = "CONSOLIDATED_BILLING" ) // Values returns all known values for OrganizationFeatureSet. 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 (OrganizationFeatureSet) Values() []OrganizationFeatureSet { return []OrganizationFeatureSet{ "ALL", "CONSOLIDATED_BILLING", } } type ParentType string // Enum values for ParentType const ( ParentTypeRoot ParentType = "ROOT" ParentTypeOrganizationalUnit ParentType = "ORGANIZATIONAL_UNIT" ) // Values returns all known values for ParentType. 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 (ParentType) Values() []ParentType { return []ParentType{ "ROOT", "ORGANIZATIONAL_UNIT", } } type PolicyType string // Enum values for PolicyType const ( PolicyTypeServiceControlPolicy PolicyType = "SERVICE_CONTROL_POLICY" PolicyTypeTagPolicy PolicyType = "TAG_POLICY" PolicyTypeBackupPolicy PolicyType = "BACKUP_POLICY" PolicyTypeAiservicesOptOutPolicy PolicyType = "AISERVICES_OPT_OUT_POLICY" ) // Values returns all known values for PolicyType. 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 (PolicyType) Values() []PolicyType { return []PolicyType{ "SERVICE_CONTROL_POLICY", "TAG_POLICY", "BACKUP_POLICY", "AISERVICES_OPT_OUT_POLICY", } } type PolicyTypeStatus string // Enum values for PolicyTypeStatus const ( PolicyTypeStatusEnabled PolicyTypeStatus = "ENABLED" PolicyTypeStatusPendingEnable PolicyTypeStatus = "PENDING_ENABLE" PolicyTypeStatusPendingDisable PolicyTypeStatus = "PENDING_DISABLE" ) // Values returns all known values for PolicyTypeStatus. 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 (PolicyTypeStatus) Values() []PolicyTypeStatus { return []PolicyTypeStatus{ "ENABLED", "PENDING_ENABLE", "PENDING_DISABLE", } } type TargetType string // Enum values for TargetType const ( TargetTypeAccount TargetType = "ACCOUNT" TargetTypeOrganizationalUnit TargetType = "ORGANIZATIONAL_UNIT" TargetTypeRoot TargetType = "ROOT" ) // Values returns all known values for TargetType. 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 (TargetType) Values() []TargetType { return []TargetType{ "ACCOUNT", "ORGANIZATIONAL_UNIT", "ROOT", } }
563
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 permissions to perform the requested operation. The user or role // that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see Access // Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) in the // IAM User Guide. 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 } // The operation that you attempted requires you to have the // iam:CreateServiceLinkedRole for organizations.amazonaws.com permission so that // Organizations can create the required service-linked role. You don't have that // permission. type AccessDeniedForDependencyException struct { Message *string ErrorCodeOverride *string Reason AccessDeniedForDependencyExceptionReason noSmithyDocumentSerde } func (e *AccessDeniedForDependencyException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccessDeniedForDependencyException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccessDeniedForDependencyException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccessDeniedForDependencyException" } return *e.ErrorCodeOverride } func (e *AccessDeniedForDependencyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You attempted to close an account that is already closed. type AccountAlreadyClosedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AccountAlreadyClosedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccountAlreadyClosedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccountAlreadyClosedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccountAlreadyClosedException" } return *e.ErrorCodeOverride } func (e *AccountAlreadyClosedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified account is already a delegated administrator for this Amazon Web // Services service. type AccountAlreadyRegisteredException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AccountAlreadyRegisteredException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccountAlreadyRegisteredException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccountAlreadyRegisteredException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccountAlreadyRegisteredException" } return *e.ErrorCodeOverride } func (e *AccountAlreadyRegisteredException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // We can't find an Amazon Web Services account with the AccountId that you // specified, or the account whose credentials you used to make this request isn't // a member of an organization. type AccountNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AccountNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccountNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccountNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccountNotFoundException" } return *e.ErrorCodeOverride } func (e *AccountNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified account is not a delegated administrator for this Amazon Web // Services service. type AccountNotRegisteredException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AccountNotRegisteredException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccountNotRegisteredException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccountNotRegisteredException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccountNotRegisteredException" } return *e.ErrorCodeOverride } func (e *AccountNotRegisteredException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You can't invite an existing account to your organization until you verify that // you own the email address associated with the management account. For more // information, see Email Address Verification (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_create.html#about-email-verification) // in the Organizations User Guide. type AccountOwnerNotVerifiedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AccountOwnerNotVerifiedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccountOwnerNotVerifiedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccountOwnerNotVerifiedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccountOwnerNotVerifiedException" } return *e.ErrorCodeOverride } func (e *AccountOwnerNotVerifiedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // This account is already a member of an organization. An account can belong to // only one organization at a time. type AlreadyInOrganizationException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AlreadyInOrganizationException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AlreadyInOrganizationException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AlreadyInOrganizationException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AlreadyInOrganizationException" } return *e.ErrorCodeOverride } func (e *AlreadyInOrganizationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Your account isn't a member of an organization. To make this request, you must // use the credentials of an account that belongs to an organization. type AWSOrganizationsNotInUseException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AWSOrganizationsNotInUseException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AWSOrganizationsNotInUseException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AWSOrganizationsNotInUseException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AWSOrganizationsNotInUseException" } return *e.ErrorCodeOverride } func (e *AWSOrganizationsNotInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // We can't find an organizational unit (OU) or Amazon Web Services account with // the ChildId that you specified. type ChildNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ChildNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ChildNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ChildNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ChildNotFoundException" } return *e.ErrorCodeOverride } func (e *ChildNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The target of the operation is currently being modified by a different request. // Try again later. type ConcurrentModificationException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ConcurrentModificationException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ConcurrentModificationException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ConcurrentModificationException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ConcurrentModificationException" } return *e.ErrorCodeOverride } func (e *ConcurrentModificationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request failed because it conflicts with the current state of the specified // resource. type ConflictException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ConflictException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ConflictException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ConflictException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ConflictException" } return *e.ErrorCodeOverride } func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Performing this operation violates a minimum or maximum value limit. For // example, attempting to remove the last service control policy (SCP) from an OU // or root, inviting or creating too many accounts to the organization, or // attaching too many policies to an account, OU, or root. This exception includes // a reason that contains additional information about the violated limit: Some of // the reasons in the following list might not be applicable to this specific API // or operation. // - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management // account from the organization. You can't remove the management account. Instead, // after you remove all member accounts, delete the organization itself. // - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove an // account from the organization that doesn't yet have enough information to exist // as a standalone account. This account requires you to first complete phone // verification. Follow the steps at Removing a member account from your // organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) // in the Organizations User Guide. // - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of // accounts that you can create in one day. // - ACCOUNT_CREATION_NOT_COMPLETE: Your account setup isn't complete or your // account isn't fully active. You must complete the account setup before you // create an organization. // - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on the // number of accounts in an organization. If you need more accounts, contact // Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) to // request an increase in your limit. Or the number of invitations that you tried // to send would cause you to exceed the limit of accounts in your organization. // Send fewer invitations or contact Amazon Web Services Support to request an // increase in the number of accounts. Deleted and closed accounts still count // toward your limit. If you get this exception when running a command immediately // after creating the organization, wait one hour and try again. After an hour, if // the command continues to fail with this error, contact Amazon Web Services // Support (https://docs.aws.amazon.com/support/home#/) . // - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to // register the management account of the organization as a delegated administrator // for an Amazon Web Services service integrated with Organizations. You can // designate only a member account as a delegated administrator. // - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management // account. To close the management account for the organization, you must first // either remove or close all member accounts in the organization. Follow standard // account closure process using root credentials. // - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove an // account that is registered as a delegated administrator for a service integrated // with your organization. To complete this operation, you must first deregister // this account as a delegated administrator. // - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota for the // past 30 days. // - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number // of accounts that you can close at a time. // - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an // organization in the specified region, you must enable all features mode. // - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register // an Amazon Web Services account as a delegated administrator for an Amazon Web // Services service that already has a delegated administrator. To complete this // operation, you must first deregister any existing delegated administrators for // this service. // - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only valid // for a limited period of time. You must resubmit the request and generate a new // verfication code. // - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of // handshakes that you can send in one day. // - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no // supported payment method is associated with the account. Amazon Web Services // does not support cards issued by financial institutions in Russia or Belarus. // For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html) // . // - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account in // this organization, you first must migrate the organization's management account // to the marketplace that corresponds to the management account's address. For // example, accounts with India addresses must be associated with the AISPL // marketplace. All accounts in an organization must be associated with the same // marketplace. // - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon Web // Services /> Regions in China. To create an organization, the master must have a // valid business license. For more information, contact customer support. // - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you must // first provide a valid contact address and phone number for the management // account. Then try the operation again. // - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the // management account must have an associated account in the Amazon Web Services // GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) // in the Amazon Web Services GovCloud User Guide. // - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization with // this management account, you first must associate a valid payment instrument, // such as a credit card, with the account. Follow the steps at To leave an // organization when all required account information has not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) // in the Organizations User Guide. // - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted to // register more delegated administrators than allowed for the service principal. // - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the // number of policies of a certain type that can be attached to an entity at one // time. // - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed on // this resource. // - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation with // this member account, you first must associate a valid payment instrument, such // as a credit card, with the account. Follow the steps at To leave an // organization when all required account information has not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) // in the Organizations User Guide. // - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a policy // from an entity that would cause the entity to have fewer than the minimum number // of policies of a certain type required. // - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an // operation that requires the organization to be configured to support all // features. An organization that supports only consolidated billing features can't // perform this operation. // - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is too // many levels deep. // - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs that // you can have in an organization. // - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that is // larger than the maximum size. // - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of // policies that you can have in an organization. // - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated // administrator before you enabled service access. Call the // EnableAWSServiceAccess API first. // - TAG_POLICY_VIOLATION: You attempted to create or update a resource with // tags that are not compliant with the tag policy requirements for this account. // - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, there // is a waiting period before you can remove it from the organization. If you get // an error that indicates that a wait period is required, try again in a few days. type ConstraintViolationException struct { Message *string ErrorCodeOverride *string Reason ConstraintViolationExceptionReason noSmithyDocumentSerde } func (e *ConstraintViolationException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ConstraintViolationException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ConstraintViolationException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ConstraintViolationException" } return *e.ErrorCodeOverride } func (e *ConstraintViolationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // We can't find an create account request with the CreateAccountRequestId that // you specified. type CreateAccountStatusNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *CreateAccountStatusNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *CreateAccountStatusNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *CreateAccountStatusNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "CreateAccountStatusNotFoundException" } return *e.ErrorCodeOverride } func (e *CreateAccountStatusNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // We can't find the destination container (a root or OU) with the ParentId that // you specified. type DestinationParentNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *DestinationParentNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *DestinationParentNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *DestinationParentNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "DestinationParentNotFoundException" } return *e.ErrorCodeOverride } func (e *DestinationParentNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // That account is already present in the specified destination. type DuplicateAccountException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *DuplicateAccountException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *DuplicateAccountException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *DuplicateAccountException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "DuplicateAccountException" } return *e.ErrorCodeOverride } func (e *DuplicateAccountException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // A handshake with the same action and target already exists. For example, if you // invited an account to join your organization, the invited account might already // have a pending invitation from this organization. If you intend to resend an // invitation to an account, ensure that existing handshakes that might be // considered duplicates are canceled or declined. type DuplicateHandshakeException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *DuplicateHandshakeException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *DuplicateHandshakeException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *DuplicateHandshakeException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "DuplicateHandshakeException" } return *e.ErrorCodeOverride } func (e *DuplicateHandshakeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // An OU with the same name already exists. type DuplicateOrganizationalUnitException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *DuplicateOrganizationalUnitException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *DuplicateOrganizationalUnitException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *DuplicateOrganizationalUnitException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "DuplicateOrganizationalUnitException" } return *e.ErrorCodeOverride } func (e *DuplicateOrganizationalUnitException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The selected policy is already attached to the specified target. type DuplicatePolicyAttachmentException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *DuplicatePolicyAttachmentException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *DuplicatePolicyAttachmentException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *DuplicatePolicyAttachmentException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "DuplicatePolicyAttachmentException" } return *e.ErrorCodeOverride } func (e *DuplicatePolicyAttachmentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // A policy with the same name already exists. type DuplicatePolicyException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *DuplicatePolicyException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *DuplicatePolicyException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *DuplicatePolicyException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "DuplicatePolicyException" } return *e.ErrorCodeOverride } func (e *DuplicatePolicyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // If you ran this action on the management account, this policy type is not // enabled. If you ran the action on a member account, the account doesn't have an // effective policy of this type. Contact the administrator of your organization // about attaching a policy of this type to the account. type EffectivePolicyNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *EffectivePolicyNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *EffectivePolicyNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *EffectivePolicyNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "EffectivePolicyNotFoundException" } return *e.ErrorCodeOverride } func (e *EffectivePolicyNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Organizations couldn't perform the operation because your organization hasn't // finished initializing. This can take up to an hour. Try again later. If after // one hour you continue to receive this error, contact Amazon Web Services Support (https://console.aws.amazon.com/support/home#/) // . type FinalizingOrganizationException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *FinalizingOrganizationException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *FinalizingOrganizationException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *FinalizingOrganizationException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "FinalizingOrganizationException" } return *e.ErrorCodeOverride } func (e *FinalizingOrganizationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified handshake is already in the requested state. For example, you // can't accept a handshake that was already accepted. type HandshakeAlreadyInStateException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *HandshakeAlreadyInStateException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *HandshakeAlreadyInStateException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *HandshakeAlreadyInStateException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "HandshakeAlreadyInStateException" } return *e.ErrorCodeOverride } func (e *HandshakeAlreadyInStateException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The requested operation would violate the constraint identified in the reason // code. Some of the reasons in the following list might not be applicable to this // specific API or operation: // - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on the // number of accounts in an organization. Note that deleted and closed accounts // still count toward your limit. If you get this exception immediately after // creating the organization, wait one hour and try again. If after an hour it // continues to fail with this error, contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) // . // - ALREADY_IN_AN_ORGANIZATION: The handshake request is invalid because the // invited account is already a member of an organization. // - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of // handshakes that you can send in one day. // - INVITE_DISABLED_DURING_ENABLE_ALL_FEATURES: You can't issue new invitations // to join an organization while it's in the process of enabling all features. You // can resume inviting accounts after you finalize the process when all accounts // have agreed to the change. // - ORGANIZATION_ALREADY_HAS_ALL_FEATURES: The handshake request is invalid // because the organization has already enabled all features. // - ORGANIZATION_IS_ALREADY_PENDING_ALL_FEATURES_MIGRATION: The handshake // request is invalid because the organization has already started the process to // enable all features. // - ORGANIZATION_FROM_DIFFERENT_SELLER_OF_RECORD: The request failed because // the account is from a different marketplace than the accounts in the // organization. For example, accounts with India addresses must be associated with // the AISPL marketplace. All accounts in an organization must be from the same // marketplace. // - ORGANIZATION_MEMBERSHIP_CHANGE_RATE_LIMIT_EXCEEDED: You attempted to change // the membership of an account too quickly after its previous change. // - PAYMENT_INSTRUMENT_REQUIRED: You can't complete the operation with an // account that doesn't have a payment instrument, such as a credit card, // associated with it. type HandshakeConstraintViolationException struct { Message *string ErrorCodeOverride *string Reason HandshakeConstraintViolationExceptionReason noSmithyDocumentSerde } func (e *HandshakeConstraintViolationException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *HandshakeConstraintViolationException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *HandshakeConstraintViolationException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "HandshakeConstraintViolationException" } return *e.ErrorCodeOverride } func (e *HandshakeConstraintViolationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // We can't find a handshake with the HandshakeId that you specified. type HandshakeNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *HandshakeNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *HandshakeNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *HandshakeNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "HandshakeNotFoundException" } return *e.ErrorCodeOverride } func (e *HandshakeNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You can't perform the operation on the handshake in its current state. For // example, you can't cancel a handshake that was already accepted or accept a // handshake that was already declined. type InvalidHandshakeTransitionException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidHandshakeTransitionException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidHandshakeTransitionException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidHandshakeTransitionException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidHandshakeTransitionException" } return *e.ErrorCodeOverride } func (e *InvalidHandshakeTransitionException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The requested operation failed because you provided invalid values for one or // more of the request parameters. This exception includes a reason that contains // additional information about the violated limit: Some of the reasons in the // following list might not be applicable to this specific API or operation. // - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to the // same entity. // - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web // Services and can't be modified. // - INPUT_REQUIRED: You must include a value for all required parameters. // - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address for // the invited account owner. // - INVALID_ENUM: You specified an invalid value. // - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. // - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // - INVALID_LIST_MEMBER: You provided a list to a parameter that contains at // least one invalid value. // - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter from the // response to a previous call of the operation. // - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, // organization, or email) as a party. // - INVALID_PATTERN: You provided a value that doesn't match the required // pattern. // - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't // match the required pattern. // - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role name // can't begin with the reserved prefix AWSServiceRoleFor . // - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource // Name (ARN) for the organization. // - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. // - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system // tag. You can’t add, edit, or delete system tag keys because they're reserved for // Amazon Web Services use. System tags don’t count against your tags per resource // limit. // - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter for // the operation. // - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer than // allowed. // - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger // value than allowed. // - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter than // allowed. // - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller // value than allowed. // - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that // target entity. // - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that // isn't recognized. type InvalidInputException struct { Message *string ErrorCodeOverride *string Reason InvalidInputExceptionReason noSmithyDocumentSerde } func (e *InvalidInputException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidInputException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidInputException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidInputException" } return *e.ErrorCodeOverride } func (e *InvalidInputException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The provided policy document doesn't meet the requirements of the specified // policy type. For example, the syntax might be incorrect. For details about // service control policy syntax, see Service Control Policy Syntax (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_scp-syntax.html) // in the Organizations User Guide. type MalformedPolicyDocumentException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *MalformedPolicyDocumentException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *MalformedPolicyDocumentException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *MalformedPolicyDocumentException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "MalformedPolicyDocumentException" } return *e.ErrorCodeOverride } func (e *MalformedPolicyDocumentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You can't remove a management account from an organization. If you want the // management account to become a member account in another organization, you must // first delete the current organization of the management account. type MasterCannotLeaveOrganizationException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *MasterCannotLeaveOrganizationException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *MasterCannotLeaveOrganizationException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *MasterCannotLeaveOrganizationException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "MasterCannotLeaveOrganizationException" } return *e.ErrorCodeOverride } func (e *MasterCannotLeaveOrganizationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified OU is not empty. Move all accounts to another root or to other // OUs, remove all child OUs, and try the operation again. type OrganizationalUnitNotEmptyException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *OrganizationalUnitNotEmptyException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *OrganizationalUnitNotEmptyException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *OrganizationalUnitNotEmptyException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "OrganizationalUnitNotEmptyException" } return *e.ErrorCodeOverride } func (e *OrganizationalUnitNotEmptyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // We can't find an OU with the OrganizationalUnitId that you specified. type OrganizationalUnitNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *OrganizationalUnitNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *OrganizationalUnitNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *OrganizationalUnitNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "OrganizationalUnitNotFoundException" } return *e.ErrorCodeOverride } func (e *OrganizationalUnitNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The organization isn't empty. To delete an organization, you must first remove // all accounts except the management account, delete all OUs, and delete all // policies. type OrganizationNotEmptyException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *OrganizationNotEmptyException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *OrganizationNotEmptyException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *OrganizationNotEmptyException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "OrganizationNotEmptyException" } return *e.ErrorCodeOverride } func (e *OrganizationNotEmptyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // We can't find a root or OU with the ParentId that you specified. type ParentNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ParentNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ParentNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ParentNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ParentNotFoundException" } return *e.ErrorCodeOverride } func (e *ParentNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Changes to the effective policy are in progress, and its contents can't be // returned. Try the operation again later. type PolicyChangesInProgressException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *PolicyChangesInProgressException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *PolicyChangesInProgressException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *PolicyChangesInProgressException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "PolicyChangesInProgressException" } return *e.ErrorCodeOverride } func (e *PolicyChangesInProgressException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The policy is attached to one or more entities. You must detach it from all // roots, OUs, and accounts before performing this operation. type PolicyInUseException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *PolicyInUseException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *PolicyInUseException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *PolicyInUseException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "PolicyInUseException" } return *e.ErrorCodeOverride } func (e *PolicyInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The policy isn't attached to the specified target in the specified root. type PolicyNotAttachedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *PolicyNotAttachedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *PolicyNotAttachedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *PolicyNotAttachedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "PolicyNotAttachedException" } return *e.ErrorCodeOverride } func (e *PolicyNotAttachedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // We can't find a policy with the PolicyId that you specified. type PolicyNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *PolicyNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *PolicyNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *PolicyNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "PolicyNotFoundException" } return *e.ErrorCodeOverride } func (e *PolicyNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified policy type is already enabled in the specified root. type PolicyTypeAlreadyEnabledException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *PolicyTypeAlreadyEnabledException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *PolicyTypeAlreadyEnabledException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *PolicyTypeAlreadyEnabledException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "PolicyTypeAlreadyEnabledException" } return *e.ErrorCodeOverride } func (e *PolicyTypeAlreadyEnabledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You can't use the specified policy type with the feature set currently enabled // for this organization. For example, you can enable SCPs only after you enable // all features in the organization. For more information, see Managing // Organizations Policies (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html#enable_policies_on_root) // in the Organizations User Guide. type PolicyTypeNotAvailableForOrganizationException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *PolicyTypeNotAvailableForOrganizationException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *PolicyTypeNotAvailableForOrganizationException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *PolicyTypeNotAvailableForOrganizationException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "PolicyTypeNotAvailableForOrganizationException" } return *e.ErrorCodeOverride } func (e *PolicyTypeNotAvailableForOrganizationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified policy type isn't currently enabled in this root. You can't // attach policies of the specified type to entities in a root until you enable // that type in the root. For more information, see Enabling All Features in Your // Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) // in the Organizations User Guide. type PolicyTypeNotEnabledException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *PolicyTypeNotEnabledException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *PolicyTypeNotEnabledException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *PolicyTypeNotEnabledException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "PolicyTypeNotEnabledException" } return *e.ErrorCodeOverride } func (e *PolicyTypeNotEnabledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // We can't find a resource policy request with the parameter that you specified. type ResourcePolicyNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ResourcePolicyNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourcePolicyNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourcePolicyNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourcePolicyNotFoundException" } return *e.ErrorCodeOverride } func (e *ResourcePolicyNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // We can't find a root with the RootId that you specified. type RootNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *RootNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *RootNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *RootNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "RootNotFoundException" } return *e.ErrorCodeOverride } func (e *RootNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Organizations can't complete your request because of an internal service error. // Try again later. type ServiceException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ServiceException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ServiceException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ServiceException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ServiceException" } return *e.ErrorCodeOverride } func (e *ServiceException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // We can't find a source root or OU with the ParentId that you specified. type SourceParentNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *SourceParentNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *SourceParentNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *SourceParentNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "SourceParentNotFoundException" } return *e.ErrorCodeOverride } func (e *SourceParentNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // We can't find a root, OU, account, or policy with the TargetId that you // specified. type TargetNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *TargetNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TargetNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TargetNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "TargetNotFoundException" } return *e.ErrorCodeOverride } func (e *TargetNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You have sent too many requests in too short a period of time. The quota helps // protect against denial-of-service attacks. Try again later. For information // about quotas that affect Organizations, see Quotas for Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) // in the Organizations User Guide. type TooManyRequestsException struct { Message *string ErrorCodeOverride *string Type *string noSmithyDocumentSerde } func (e *TooManyRequestsException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TooManyRequestsException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TooManyRequestsException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "TooManyRequestsException" } return *e.ErrorCodeOverride } func (e *TooManyRequestsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // This action isn't available in the current Amazon Web Services Region. type UnsupportedAPIEndpointException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *UnsupportedAPIEndpointException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *UnsupportedAPIEndpointException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *UnsupportedAPIEndpointException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "UnsupportedAPIEndpointException" } return *e.ErrorCodeOverride } func (e *UnsupportedAPIEndpointException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
1,520
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" ) // Contains information about an Amazon Web Services account that is a member of // an organization. type Account struct { // The Amazon Resource Name (ARN) of the account. For more information about ARNs // in Organizations, see ARN Formats Supported by Organizations (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies) // in the Amazon Web Services Service Authorization Reference. Arn *string // The email address associated with the Amazon Web Services account. The regex // pattern (http://wikipedia.org/wiki/regex) for this parameter is a string of // characters that represents a standard internet email address. Email *string // The unique identifier (ID) of the account. The regex pattern (http://wikipedia.org/wiki/regex) // for an account ID string requires exactly 12 digits. Id *string // The method by which the account joined the organization. JoinedMethod AccountJoinedMethod // The date the account became a part of the organization. JoinedTimestamp *time.Time // The friendly name of the account. The regex pattern (http://wikipedia.org/wiki/regex) // that is used to validate this parameter is a string of any of the characters in // the ASCII character range. Name *string // The status of the account in the organization. Status AccountStatus noSmithyDocumentSerde } // Contains a list of child entities, either OUs or accounts. type Child struct { // The unique identifier (ID) of this child entity. The regex pattern (http://wikipedia.org/wiki/regex) // for a child ID string requires one of the following: // - Account - A string that consists of exactly 12 digits. // - Organizational unit (OU) - A string that begins with "ou-" followed by from // 4 to 32 lowercase letters or digits (the ID of the root that contains the OU). // This string is followed by a second "-" dash and from 8 to 32 additional // lowercase letters or digits. Id *string // The type of this child entity. Type ChildType noSmithyDocumentSerde } // Contains the status about a CreateAccount or CreateGovCloudAccount request to // create an Amazon Web Services account or an Amazon Web Services GovCloud (US) // account in an organization. type CreateAccountStatus struct { // If the account was created successfully, the unique identifier (ID) of the new // account. The regex pattern (http://wikipedia.org/wiki/regex) for an account ID // string requires exactly 12 digits. AccountId *string // The account name given to the account when it was created. AccountName *string // The date and time that the account was created and the request completed. CompletedTimestamp *time.Time // If the request failed, a description of the reason for the failure. // - ACCOUNT_LIMIT_EXCEEDED: The account couldn't be created because you reached // the limit on the number of accounts in your organization. // - CONCURRENT_ACCOUNT_MODIFICATION: You already submitted a request with the // same information. // - EMAIL_ALREADY_EXISTS: The account could not be created because another // Amazon Web Services account with that email address already exists. // - FAILED_BUSINESS_VALIDATION: The Amazon Web Services account that owns your // organization failed to receive business license validation. // - GOVCLOUD_ACCOUNT_ALREADY_EXISTS: The account in the Amazon Web Services // GovCloud (US) Region could not be created because this Region already includes // an account with that email address. // - IDENTITY_INVALID_BUSINESS_VALIDATION: The Amazon Web Services account that // owns your organization can't complete business license validation because it // doesn't have valid identity data. // - INVALID_ADDRESS: The account could not be created because the address you // provided is not valid. // - INVALID_EMAIL: The account could not be created because the email address // you provided is not valid. // - INVALID_PAYMENT_INSTRUMENT: The Amazon Web Services account that owns your // organization does not have a supported payment method associated with the // account. Amazon Web Services does not support cards issued by financial // institutions in Russia or Belarus. For more information, see Managing your // Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html) // . // - INTERNAL_FAILURE: The account could not be created because of an internal // failure. Try again later. If the problem persists, contact Amazon Web Services // Customer Support. // - MISSING_BUSINESS_VALIDATION: The Amazon Web Services account that owns your // organization has not received Business Validation. // - MISSING_PAYMENT_INSTRUMENT: You must configure the management account with // a valid payment method, such as a credit card. // - PENDING_BUSINESS_VALIDATION: The Amazon Web Services account that owns your // organization is still in the process of completing business license validation. // - UNKNOWN_BUSINESS_VALIDATION: The Amazon Web Services account that owns your // organization has an unknown issue with business license validation. FailureReason CreateAccountFailureReason // If the account was created successfully, the unique identifier (ID) of the new // account in the Amazon Web Services GovCloud (US) Region. GovCloudAccountId *string // The unique identifier (ID) that references this request. You get this value // from the response of the initial CreateAccount request to create the account. // The regex pattern (http://wikipedia.org/wiki/regex) for a create account // request ID string requires "car-" followed by from 8 to 32 lowercase letters or // digits. Id *string // The date and time that the request was made for the account creation. RequestedTimestamp *time.Time // The status of the asynchronous request to create an Amazon Web Services account. State CreateAccountState noSmithyDocumentSerde } // Contains information about the delegated administrator. type DelegatedAdministrator struct { // The Amazon Resource Name (ARN) of the delegated administrator's account. Arn *string // The date when the account was made a delegated administrator. DelegationEnabledDate *time.Time // The email address that is associated with the delegated administrator's Amazon // Web Services account. Email *string // The unique identifier (ID) of the delegated administrator's account. Id *string // The method by which the delegated administrator's account joined the // organization. JoinedMethod AccountJoinedMethod // The date when the delegated administrator's account became a part of the // organization. JoinedTimestamp *time.Time // The friendly name of the delegated administrator's account. Name *string // The status of the delegated administrator's account in the organization. Status AccountStatus noSmithyDocumentSerde } // Contains information about the Amazon Web Services service for which the // account is a delegated administrator. type DelegatedService struct { // The date that the account became a delegated administrator for this service. DelegationEnabledDate *time.Time // The name of an Amazon Web Services service that can request an operation for // the specified service. This is typically in the form of a URL, such as: // servicename.amazonaws.com . ServicePrincipal *string noSmithyDocumentSerde } // Contains rules to be applied to the affected accounts. The effective policy is // the aggregation of any policies the account inherits, plus any policy directly // attached to the account. type EffectivePolicy struct { // The time of the last update to this policy. LastUpdatedTimestamp *time.Time // The text content of the policy. PolicyContent *string // The policy type. PolicyType EffectivePolicyType // The account ID of the policy target. TargetId *string noSmithyDocumentSerde } // A structure that contains details of a service principal that represents an // Amazon Web Services service that is enabled to integrate with Organizations. type EnabledServicePrincipal struct { // The date that the service principal was enabled for integration with // Organizations. DateEnabled *time.Time // The name of the service principal. This is typically in the form of a URL, such // as: servicename.amazonaws.com . ServicePrincipal *string noSmithyDocumentSerde } // Contains information that must be exchanged to securely establish a // relationship between two accounts (an originator and a recipient). For example, // when a management account (the originator) invites another account (the // recipient) to join its organization, the two accounts exchange information as a // series of handshake requests and responses. Note: Handshakes that are CANCELED , // ACCEPTED , DECLINED , or EXPIRED show up in lists for only 30 days after // entering that state After that they are deleted. type Handshake struct { // The type of handshake, indicating what action occurs when the recipient accepts // the handshake. The following handshake types are supported: // - INVITE: This type of handshake represents a request to join an // organization. It is always sent from the management account to only non-member // accounts. // - ENABLE_ALL_FEATURES: This type of handshake represents a request to enable // all features in an organization. It is always sent from the management account // to only invited member accounts. Created accounts do not receive this because // those accounts were created by the organization's management account and // approval is inferred. // - APPROVE_ALL_FEATURES: This type of handshake is sent from the Organizations // service when all member accounts have approved the ENABLE_ALL_FEATURES // invitation. It is sent only to the management account and signals the master // that it can finalize the process to enable all features. Action ActionType // The Amazon Resource Name (ARN) of a handshake. For more information about ARNs // in Organizations, see ARN Formats Supported by Organizations (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies) // in the Amazon Web Services Service Authorization Reference. Arn *string // The date and time that the handshake expires. If the recipient of the handshake // request fails to respond before the specified date and time, the handshake // becomes inactive and is no longer valid. ExpirationTimestamp *time.Time // The unique identifier (ID) of a handshake. The originating account creates the // ID when it initiates the handshake. The regex pattern (http://wikipedia.org/wiki/regex) // for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters // or digits. Id *string // Information about the two accounts that are participating in the handshake. Parties []HandshakeParty // The date and time that the handshake request was made. RequestedTimestamp *time.Time // Additional information that is needed to process the handshake. Resources []HandshakeResource // The current state of the handshake. Use the state to trace the flow of the // handshake through the process from its creation to its acceptance. The meaning // of each of the valid values is as follows: // - REQUESTED: This handshake was sent to multiple recipients (applicable to // only some handshake types) and not all recipients have responded yet. The // request stays in this state until all recipients respond. // - OPEN: This handshake was sent to multiple recipients (applicable to only // some policy types) and all recipients have responded, allowing the originator to // complete the handshake action. // - CANCELED: This handshake is no longer active because it was canceled by the // originating account. // - ACCEPTED: This handshake is complete because it has been accepted by the // recipient. // - DECLINED: This handshake is no longer active because it was declined by the // recipient account. // - EXPIRED: This handshake is no longer active because the originator did not // receive a response of any kind from the recipient before the expiration time (15 // days). State HandshakeState noSmithyDocumentSerde } // Specifies the criteria that are used to select the handshakes for the operation. type HandshakeFilter struct { // Specifies the type of handshake action. If you specify ActionType , you cannot // also specify ParentHandshakeId . ActionType ActionType // Specifies the parent handshake. Only used for handshake types that are a child // of another type. If you specify ParentHandshakeId , you cannot also specify // ActionType . The regex pattern (http://wikipedia.org/wiki/regex) for handshake // ID string requires "h-" followed by from 8 to 32 lowercase letters or digits. ParentHandshakeId *string noSmithyDocumentSerde } // Identifies a participant in a handshake. type HandshakeParty struct { // The unique identifier (ID) for the party. The regex pattern (http://wikipedia.org/wiki/regex) // for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters // or digits. // // This member is required. Id *string // The type of party. // // This member is required. Type HandshakePartyType noSmithyDocumentSerde } // Contains additional data that is needed to process a handshake. type HandshakeResource struct { // When needed, contains an additional array of HandshakeResource objects. Resources []HandshakeResource // The type of information being passed, specifying how the value is to be // interpreted by the other party: // - ACCOUNT - Specifies an Amazon Web Services account ID number. // - ORGANIZATION - Specifies an organization ID number. // - EMAIL - Specifies the email address that is associated with the account that // receives the handshake. // - OWNER_EMAIL - Specifies the email address associated with the management // account. Included as information about an organization. // - OWNER_NAME - Specifies the name associated with the management account. // Included as information about an organization. // - NOTES - Additional text provided by the handshake initiator and intended for // the recipient to read. Type HandshakeResourceType // The information that is passed to the other party in the handshake. The format // of the value string must match the requirements of the specified type. Value *string noSmithyDocumentSerde } // Contains details about an organization. An organization is a collection of // accounts that are centrally managed together using consolidated billing, // organized hierarchically with organizational units (OUs), and controlled with // policies . type Organization struct { // The Amazon Resource Name (ARN) of an organization. For more information about // ARNs in Organizations, see ARN Formats Supported by Organizations (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies) // in the Amazon Web Services Service Authorization Reference. Arn *string // Do not use. This field is deprecated and doesn't provide complete information // about the policies in your organization. To determine the policies that are // enabled and available for use in your organization, use the ListRoots operation // instead. AvailablePolicyTypes []PolicyTypeSummary // Specifies the functionality that currently is available to the organization. If // set to "ALL", then all features are enabled and policies can be applied to // accounts in the organization. If set to "CONSOLIDATED_BILLING", then only // consolidated billing functionality is available. For more information, see // Enabling All Features in Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) // in the Organizations User Guide. FeatureSet OrganizationFeatureSet // The unique identifier (ID) of an organization. The regex pattern (http://wikipedia.org/wiki/regex) // for an organization ID string requires "o-" followed by from 10 to 32 lowercase // letters or digits. Id *string // The Amazon Resource Name (ARN) of the account that is designated as the // management account for the organization. For more information about ARNs in // Organizations, see ARN Formats Supported by Organizations (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies) // in the Amazon Web Services Service Authorization Reference. MasterAccountArn *string // The email address that is associated with the Amazon Web Services account that // is designated as the management account for the organization. MasterAccountEmail *string // The unique identifier (ID) of the management account of an organization. The // regex pattern (http://wikipedia.org/wiki/regex) for an account ID string // requires exactly 12 digits. MasterAccountId *string noSmithyDocumentSerde } // Contains details about an organizational unit (OU). An OU is a container of // Amazon Web Services accounts within a root of an organization. Policies that are // attached to an OU apply to all accounts contained in that OU and in any child // OUs. type OrganizationalUnit struct { // The Amazon Resource Name (ARN) of this OU. For more information about ARNs in // Organizations, see ARN Formats Supported by Organizations (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies) // in the Amazon Web Services Service Authorization Reference. Arn *string // The unique identifier (ID) associated with this OU. The regex pattern (http://wikipedia.org/wiki/regex) // for an organizational unit ID string requires "ou-" followed by from 4 to 32 // lowercase letters or digits (the ID of the root that contains the OU). This // string is followed by a second "-" dash and from 8 to 32 additional lowercase // letters or digits. Id *string // The friendly name of this OU. The regex pattern (http://wikipedia.org/wiki/regex) // that is used to validate this parameter is a string of any of the characters in // the ASCII character range. Name *string noSmithyDocumentSerde } // Contains information about either a root or an organizational unit (OU) that // can contain OUs or accounts in an organization. type Parent struct { // The unique identifier (ID) of the parent entity. The regex pattern (http://wikipedia.org/wiki/regex) // for a parent ID string requires one of the following: // - Root - A string that begins with "r-" followed by from 4 to 32 lowercase // letters or digits. // - Organizational unit (OU) - A string that begins with "ou-" followed by from // 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This // string is followed by a second "-" dash and from 8 to 32 additional lowercase // letters or digits. Id *string // The type of the parent entity. Type ParentType noSmithyDocumentSerde } // Contains rules to be applied to the affected accounts. Policies can be attached // directly to accounts, or to roots and OUs to affect all accounts in those // hierarchies. type Policy struct { // The text content of the policy. Content *string // A structure that contains additional details about the policy. PolicySummary *PolicySummary noSmithyDocumentSerde } // Contains information about a policy, but does not include the content. To see // the content of a policy, see DescribePolicy . type PolicySummary struct { // The Amazon Resource Name (ARN) of the policy. For more information about ARNs // in Organizations, see ARN Formats Supported by Organizations (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies) // in the Amazon Web Services Service Authorization Reference. Arn *string // A boolean value that indicates whether the specified policy is an Amazon Web // Services managed policy. If true, then you can attach the policy to roots, OUs, // or accounts, but you cannot edit it. AwsManaged bool // The description of the policy. Description *string // The unique identifier (ID) of the policy. The regex pattern (http://wikipedia.org/wiki/regex) // for a policy ID string requires "p-" followed by from 8 to 128 lowercase or // uppercase letters, digits, or the underscore character (_). Id *string // The friendly name of the policy. The regex pattern (http://wikipedia.org/wiki/regex) // that is used to validate this parameter is a string of any of the characters in // the ASCII character range. Name *string // The type of policy. Type PolicyType noSmithyDocumentSerde } // Contains information about a root, OU, or account that a policy is attached to. type PolicyTargetSummary struct { // The Amazon Resource Name (ARN) of the policy target. For more information about // ARNs in Organizations, see ARN Formats Supported by Organizations (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies) // in the Amazon Web Services Service Authorization Reference. Arn *string // The friendly name of the policy target. The regex pattern (http://wikipedia.org/wiki/regex) // that is used to validate this parameter is a string of any of the characters in // the ASCII character range. Name *string // The unique identifier (ID) of the policy target. The regex pattern (http://wikipedia.org/wiki/regex) // for a target ID string requires one of the following: // - Root - A string that begins with "r-" followed by from 4 to 32 lowercase // letters or digits. // - Account - A string that consists of exactly 12 digits. // - Organizational unit (OU) - A string that begins with "ou-" followed by from // 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This // string is followed by a second "-" dash and from 8 to 32 additional lowercase // letters or digits. TargetId *string // The type of the policy target. Type TargetType noSmithyDocumentSerde } // Contains information about a policy type and its status in the associated root. type PolicyTypeSummary struct { // The status of the policy type as it relates to the associated root. To attach a // policy of the specified type to a root or to an OU or account in that root, it // must be available in the organization and enabled for that root. Status PolicyTypeStatus // The name of the policy type. Type PolicyType noSmithyDocumentSerde } // A structure that contains details about a resource policy. type ResourcePolicy struct { // The policy text of the resource policy. Content *string // A structure that contains resource policy ID and Amazon Resource Name (ARN). ResourcePolicySummary *ResourcePolicySummary noSmithyDocumentSerde } // A structure that contains resource policy ID and Amazon Resource Name (ARN). type ResourcePolicySummary struct { // The Amazon Resource Name (ARN) of the resource policy. Arn *string // The unique identifier (ID) of the resource policy. Id *string noSmithyDocumentSerde } // Contains details about a root. A root is a top-level parent node in the // hierarchy of an organization that can contain organizational units (OUs) and // accounts. The root contains every Amazon Web Services account in the // organization. type Root struct { // The Amazon Resource Name (ARN) of the root. For more information about ARNs in // Organizations, see ARN Formats Supported by Organizations (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies) // in the Amazon Web Services Service Authorization Reference. Arn *string // The unique identifier (ID) for the root. The regex pattern (http://wikipedia.org/wiki/regex) // for a root ID string requires "r-" followed by from 4 to 32 lowercase letters or // digits. Id *string // The friendly name of the root. The regex pattern (http://wikipedia.org/wiki/regex) // that is used to validate this parameter is a string of any of the characters in // the ASCII character range. Name *string // The types of policies that are currently enabled for the root and therefore can // be attached to the root or to its OUs or accounts. Even if a policy type is // shown as available in the organization, you can separately enable and disable // them at the root level by using EnablePolicyType and DisablePolicyType . Use // DescribeOrganization to see the availability of the policy types in that // organization. PolicyTypes []PolicyTypeSummary noSmithyDocumentSerde } // A custom key-value pair associated with a resource within your organization. // You can attach tags to any of the following organization resources. // - Amazon Web Services account // - Organizational unit (OU) // - Organization root // - Policy type Tag struct { // The key identifier, or name, of the tag. // // This member is required. Key *string // The string value that's associated with the key of the tag. You can set the // value of a tag to an empty string, but you can't set the value of a tag to null. // // This member is required. Value *string noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
618
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package osis 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 = "OSIS" const ServiceAPIVersion = "2022-01-01" // Client provides the API client to make operations call for Amazon OpenSearch // Ingestion. 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, "osis", 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 osis 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 osis 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/osis/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates an OpenSearch Ingestion pipeline. For more information, see Creating // Amazon OpenSearch Ingestion pipelines (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/creating-pipeline.html) // . func (c *Client) CreatePipeline(ctx context.Context, params *CreatePipelineInput, optFns ...func(*Options)) (*CreatePipelineOutput, error) { if params == nil { params = &CreatePipelineInput{} } result, metadata, err := c.invokeOperation(ctx, "CreatePipeline", params, optFns, c.addOperationCreatePipelineMiddlewares) if err != nil { return nil, err } out := result.(*CreatePipelineOutput) out.ResultMetadata = metadata return out, nil } type CreatePipelineInput struct { // The maximum pipeline capacity, in Ingestion Compute Units (ICUs). // // This member is required. MaxUnits *int32 // The minimum pipeline capacity, in Ingestion Compute Units (ICUs). // // This member is required. MinUnits *int32 // The pipeline configuration in YAML format. The command accepts the pipeline // configuration as a string or within a .yaml file. If you provide the // configuration as a string, each new line must be escaped with \n . // // This member is required. PipelineConfigurationBody *string // The name of the OpenSearch Ingestion pipeline to create. Pipeline names are // unique across the pipelines owned by an account within an Amazon Web Services // Region. // // This member is required. PipelineName *string // Key-value pairs to configure log publishing. LogPublishingOptions *types.LogPublishingOptions // List of tags to add to the pipeline upon creation. Tags []types.Tag // Container for the values required to configure VPC access for the pipeline. If // you don't specify these values, OpenSearch Ingestion creates the pipeline with a // public endpoint. VpcOptions *types.VpcOptions noSmithyDocumentSerde } type CreatePipelineOutput struct { // Container for information about the created pipeline. Pipeline *types.Pipeline // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreatePipelineMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreatePipeline{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreatePipeline{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreatePipelineValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePipeline(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreatePipeline(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "osis", OperationName: "CreatePipeline", } }
157
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package osis import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes an OpenSearch Ingestion pipeline. For more information, see Deleting // Amazon OpenSearch Ingestion pipelines (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/delete-pipeline.html) // . func (c *Client) DeletePipeline(ctx context.Context, params *DeletePipelineInput, optFns ...func(*Options)) (*DeletePipelineOutput, error) { if params == nil { params = &DeletePipelineInput{} } result, metadata, err := c.invokeOperation(ctx, "DeletePipeline", params, optFns, c.addOperationDeletePipelineMiddlewares) if err != nil { return nil, err } out := result.(*DeletePipelineOutput) out.ResultMetadata = metadata return out, nil } type DeletePipelineInput struct { // The name of the pipeline to delete. // // This member is required. PipelineName *string noSmithyDocumentSerde } type DeletePipelineOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeletePipelineMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeletePipeline{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeletePipeline{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeletePipelineValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePipeline(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeletePipeline(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "osis", OperationName: "DeletePipeline", } }
122
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package osis 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/osis/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves information about an OpenSearch Ingestion pipeline. func (c *Client) GetPipeline(ctx context.Context, params *GetPipelineInput, optFns ...func(*Options)) (*GetPipelineOutput, error) { if params == nil { params = &GetPipelineInput{} } result, metadata, err := c.invokeOperation(ctx, "GetPipeline", params, optFns, c.addOperationGetPipelineMiddlewares) if err != nil { return nil, err } out := result.(*GetPipelineOutput) out.ResultMetadata = metadata return out, nil } type GetPipelineInput struct { // The name of the pipeline to get information about. // // This member is required. PipelineName *string noSmithyDocumentSerde } type GetPipelineOutput struct { // Detailed information about the requested pipeline. Pipeline *types.Pipeline // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetPipelineMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetPipeline{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetPipeline{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetPipelineValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPipeline(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetPipeline(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "osis", OperationName: "GetPipeline", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package osis 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/osis/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves information about a specific blueprint for OpenSearch Ingestion. // Blueprints are templates for the configuration needed for a CreatePipeline // request. For more information, see Using blueprints to create a pipeline (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/creating-pipeline.html#pipeline-blueprint) // . func (c *Client) GetPipelineBlueprint(ctx context.Context, params *GetPipelineBlueprintInput, optFns ...func(*Options)) (*GetPipelineBlueprintOutput, error) { if params == nil { params = &GetPipelineBlueprintInput{} } result, metadata, err := c.invokeOperation(ctx, "GetPipelineBlueprint", params, optFns, c.addOperationGetPipelineBlueprintMiddlewares) if err != nil { return nil, err } out := result.(*GetPipelineBlueprintOutput) out.ResultMetadata = metadata return out, nil } type GetPipelineBlueprintInput struct { // The name of the blueprint to retrieve. // // This member is required. BlueprintName *string noSmithyDocumentSerde } type GetPipelineBlueprintOutput struct { // The requested blueprint in YAML format. Blueprint *types.PipelineBlueprint // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetPipelineBlueprintMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetPipelineBlueprint{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetPipelineBlueprint{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetPipelineBlueprintValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPipelineBlueprint(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetPipelineBlueprint(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "osis", OperationName: "GetPipelineBlueprint", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package osis 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/osis/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns progress information for the current change happening on an OpenSearch // Ingestion pipeline. Currently, this operation only returns information when a // pipeline is being created. For more information, see Tracking the status of // pipeline creation (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/creating-pipeline.html#get-pipeline-progress) // . func (c *Client) GetPipelineChangeProgress(ctx context.Context, params *GetPipelineChangeProgressInput, optFns ...func(*Options)) (*GetPipelineChangeProgressOutput, error) { if params == nil { params = &GetPipelineChangeProgressInput{} } result, metadata, err := c.invokeOperation(ctx, "GetPipelineChangeProgress", params, optFns, c.addOperationGetPipelineChangeProgressMiddlewares) if err != nil { return nil, err } out := result.(*GetPipelineChangeProgressOutput) out.ResultMetadata = metadata return out, nil } type GetPipelineChangeProgressInput struct { // The name of the pipeline. // // This member is required. PipelineName *string noSmithyDocumentSerde } type GetPipelineChangeProgressOutput struct { // The current status of the change happening on the pipeline. ChangeProgressStatuses []types.ChangeProgressStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetPipelineChangeProgressMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetPipelineChangeProgress{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetPipelineChangeProgress{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetPipelineChangeProgressValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPipelineChangeProgress(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetPipelineChangeProgress(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "osis", OperationName: "GetPipelineChangeProgress", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package osis 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/osis/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves a list of all available blueprints for Data Prepper. For more // information, see Using blueprints to create a pipeline (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/creating-pipeline.html#pipeline-blueprint) // . func (c *Client) ListPipelineBlueprints(ctx context.Context, params *ListPipelineBlueprintsInput, optFns ...func(*Options)) (*ListPipelineBlueprintsOutput, error) { if params == nil { params = &ListPipelineBlueprintsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListPipelineBlueprints", params, optFns, c.addOperationListPipelineBlueprintsMiddlewares) if err != nil { return nil, err } out := result.(*ListPipelineBlueprintsOutput) out.ResultMetadata = metadata return out, nil } type ListPipelineBlueprintsInput struct { noSmithyDocumentSerde } type ListPipelineBlueprintsOutput struct { // A list of available blueprints for Data Prepper. Blueprints []types.PipelineBlueprintSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListPipelineBlueprintsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListPipelineBlueprints{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListPipelineBlueprints{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListPipelineBlueprints(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opListPipelineBlueprints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "osis", OperationName: "ListPipelineBlueprints", } }
118
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package osis 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/osis/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all OpenSearch Ingestion pipelines in the current Amazon Web Services // account and Region. For more information, see Viewing Amazon OpenSearch // Ingestion pipelines (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/list-pipeline.html) // . func (c *Client) ListPipelines(ctx context.Context, params *ListPipelinesInput, optFns ...func(*Options)) (*ListPipelinesOutput, error) { if params == nil { params = &ListPipelinesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListPipelines", params, optFns, c.addOperationListPipelinesMiddlewares) if err != nil { return nil, err } out := result.(*ListPipelinesOutput) out.ResultMetadata = metadata return out, nil } type ListPipelinesInput struct { // An optional parameter that specifies the maximum number of results to return. // You can use nextToken to get the next page of results. MaxResults *int32 // If your initial ListPipelines operation returns a nextToken , you can include // the returned nextToken in subsequent ListPipelines operations, which returns // results in the next page. NextToken *string noSmithyDocumentSerde } type ListPipelinesOutput struct { // When nextToken is returned, there are more results available. The value of // nextToken is a unique pagination token for each page. Make the call again using // the returned token to retrieve the next page. NextToken *string // A list of all existing Data Prepper pipelines. Pipelines []types.PipelineSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListPipelinesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListPipelines{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListPipelines{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListPipelines(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListPipelinesAPIClient is a client that implements the ListPipelines operation. type ListPipelinesAPIClient interface { ListPipelines(context.Context, *ListPipelinesInput, ...func(*Options)) (*ListPipelinesOutput, error) } var _ ListPipelinesAPIClient = (*Client)(nil) // ListPipelinesPaginatorOptions is the paginator options for ListPipelines type ListPipelinesPaginatorOptions struct { // An optional parameter that specifies the maximum number of results to return. // You can use nextToken to get the next page of results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListPipelinesPaginator is a paginator for ListPipelines type ListPipelinesPaginator struct { options ListPipelinesPaginatorOptions client ListPipelinesAPIClient params *ListPipelinesInput nextToken *string firstPage bool } // NewListPipelinesPaginator returns a new ListPipelinesPaginator func NewListPipelinesPaginator(client ListPipelinesAPIClient, params *ListPipelinesInput, optFns ...func(*ListPipelinesPaginatorOptions)) *ListPipelinesPaginator { if params == nil { params = &ListPipelinesInput{} } options := ListPipelinesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListPipelinesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListPipelinesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListPipelines page. func (p *ListPipelinesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPipelinesOutput, 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.ListPipelines(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_opListPipelines(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "osis", OperationName: "ListPipelines", } }
225
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package osis 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/osis/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all resource tags associated with an OpenSearch Ingestion pipeline. For // more information, see Tagging Amazon OpenSearch Ingestion pipelines (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/tag-pipeline.html) // . func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { params = &ListTagsForResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) if err != nil { return nil, err } out := result.(*ListTagsForResourceOutput) out.ResultMetadata = metadata return out, nil } type ListTagsForResourceInput struct { // The Amazon Resource Name (ARN) of the pipeline to retrieve tags for. // // This member is required. Arn *string noSmithyDocumentSerde } type ListTagsForResourceOutput struct { // A list of tags associated with the given pipeline. Tags []types.Tag // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "osis", OperationName: "ListTagsForResource", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package osis 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/osis/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Starts an OpenSearch Ingestion pipeline. For more information, see Starting an // OpenSearch Ingestion pipeline (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/pipeline--stop-start.html#pipeline--start) // . func (c *Client) StartPipeline(ctx context.Context, params *StartPipelineInput, optFns ...func(*Options)) (*StartPipelineOutput, error) { if params == nil { params = &StartPipelineInput{} } result, metadata, err := c.invokeOperation(ctx, "StartPipeline", params, optFns, c.addOperationStartPipelineMiddlewares) if err != nil { return nil, err } out := result.(*StartPipelineOutput) out.ResultMetadata = metadata return out, nil } type StartPipelineInput struct { // The name of the pipeline to start. // // This member is required. PipelineName *string noSmithyDocumentSerde } type StartPipelineOutput struct { // Information about an existing OpenSearch Ingestion pipeline. Pipeline *types.Pipeline // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartPipelineMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpStartPipeline{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartPipeline{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStartPipelineValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartPipeline(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStartPipeline(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "osis", OperationName: "StartPipeline", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package osis 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/osis/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Stops an OpenSearch Ingestion pipeline. For more information, see Stopping an // OpenSearch Ingestion pipeline (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/pipeline--stop-start.html#pipeline--stop) // . func (c *Client) StopPipeline(ctx context.Context, params *StopPipelineInput, optFns ...func(*Options)) (*StopPipelineOutput, error) { if params == nil { params = &StopPipelineInput{} } result, metadata, err := c.invokeOperation(ctx, "StopPipeline", params, optFns, c.addOperationStopPipelineMiddlewares) if err != nil { return nil, err } out := result.(*StopPipelineOutput) out.ResultMetadata = metadata return out, nil } type StopPipelineInput struct { // The name of the pipeline to stop. // // This member is required. PipelineName *string noSmithyDocumentSerde } type StopPipelineOutput struct { // Information about an existing OpenSearch Ingestion pipeline. Pipeline *types.Pipeline // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStopPipelineMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpStopPipeline{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStopPipeline{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStopPipelineValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopPipeline(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStopPipeline(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "osis", OperationName: "StopPipeline", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package osis 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/osis/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Tags an OpenSearch Ingestion pipeline. For more information, see Tagging Amazon // OpenSearch Ingestion pipelines (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/tag-pipeline.html) // . func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { params = &TagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) if err != nil { return nil, err } out := result.(*TagResourceOutput) out.ResultMetadata = metadata return out, nil } type TagResourceInput struct { // The Amazon Resource Name (ARN) of the pipeline to tag. // // This member is required. Arn *string // The list of key-value tags to add to the pipeline. // // This member is required. Tags []types.Tag noSmithyDocumentSerde } type TagResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpTagResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "osis", OperationName: "TagResource", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package osis 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 one or more tags from an OpenSearch Ingestion pipeline. For more // information, see Tagging Amazon OpenSearch Ingestion pipelines (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/tag-pipeline.html) // . func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { params = &UntagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) if err != nil { return nil, err } out := result.(*UntagResourceOutput) out.ResultMetadata = metadata return out, nil } type UntagResourceInput struct { // The Amazon Resource Name (ARN) of the pipeline to remove tags from. // // This member is required. Arn *string // The tag keys to remove. // // 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: "osis", OperationName: "UntagResource", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package osis 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/osis/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates an OpenSearch Ingestion pipeline. For more information, see Updating // Amazon OpenSearch Ingestion pipelines (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/update-pipeline.html) // . func (c *Client) UpdatePipeline(ctx context.Context, params *UpdatePipelineInput, optFns ...func(*Options)) (*UpdatePipelineOutput, error) { if params == nil { params = &UpdatePipelineInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdatePipeline", params, optFns, c.addOperationUpdatePipelineMiddlewares) if err != nil { return nil, err } out := result.(*UpdatePipelineOutput) out.ResultMetadata = metadata return out, nil } type UpdatePipelineInput struct { // The name of the pipeline to update. // // This member is required. PipelineName *string // Key-value pairs to configure log publishing. LogPublishingOptions *types.LogPublishingOptions // The maximum pipeline capacity, in Ingestion Compute Units (ICUs) MaxUnits *int32 // The minimum pipeline capacity, in Ingestion Compute Units (ICUs). MinUnits *int32 // The pipeline configuration in YAML format. The command accepts the pipeline // configuration as a string or within a .yaml file. If you provide the // configuration as a string, each new line must be escaped with \n . PipelineConfigurationBody *string noSmithyDocumentSerde } type UpdatePipelineOutput struct { // Container for information about the updated pipeline. Pipeline *types.Pipeline // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdatePipelineMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdatePipeline{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdatePipeline{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdatePipelineValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePipeline(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdatePipeline(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "osis", OperationName: "UpdatePipeline", } }
141
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package osis 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/osis/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Checks whether an OpenSearch Ingestion pipeline configuration is valid prior to // creation. For more information, see Creating Amazon OpenSearch Ingestion // pipelines (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/creating-pipeline.html) // . func (c *Client) ValidatePipeline(ctx context.Context, params *ValidatePipelineInput, optFns ...func(*Options)) (*ValidatePipelineOutput, error) { if params == nil { params = &ValidatePipelineInput{} } result, metadata, err := c.invokeOperation(ctx, "ValidatePipeline", params, optFns, c.addOperationValidatePipelineMiddlewares) if err != nil { return nil, err } out := result.(*ValidatePipelineOutput) out.ResultMetadata = metadata return out, nil } type ValidatePipelineInput struct { // The pipeline configuration in YAML format. The command accepts the pipeline // configuration as a string or within a .yaml file. If you provide the // configuration as a string, each new line must be escaped with \n . // // This member is required. PipelineConfigurationBody *string noSmithyDocumentSerde } type ValidatePipelineOutput struct { // A list of errors if the configuration is invalid. Errors []types.ValidationMessage // A boolean indicating whether or not the pipeline configuration is valid. IsValid *bool // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationValidatePipelineMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpValidatePipeline{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpValidatePipeline{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpValidatePipelineValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opValidatePipeline(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opValidatePipeline(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "osis", OperationName: "ValidatePipeline", } }
133
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package osis import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/osis/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "strings" ) type awsRestjson1_deserializeOpCreatePipeline struct { } func (*awsRestjson1_deserializeOpCreatePipeline) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreatePipeline) 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_deserializeOpErrorCreatePipeline(response, &metadata) } output := &CreatePipelineOutput{} 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_deserializeOpDocumentCreatePipelineOutput(&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_deserializeOpErrorCreatePipeline(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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreatePipelineOutput(v **CreatePipelineOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreatePipelineOutput if *v == nil { sv = &CreatePipelineOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Pipeline": if err := awsRestjson1_deserializeDocumentPipeline(&sv.Pipeline, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeletePipeline struct { } func (*awsRestjson1_deserializeOpDeletePipeline) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeletePipeline) 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_deserializeOpErrorDeletePipeline(response, &metadata) } output := &DeletePipelineOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeletePipeline(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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(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_deserializeOpGetPipeline struct { } func (*awsRestjson1_deserializeOpGetPipeline) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetPipeline) 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_deserializeOpErrorGetPipeline(response, &metadata) } output := &GetPipelineOutput{} 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_deserializeOpDocumentGetPipelineOutput(&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_deserializeOpErrorGetPipeline(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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(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_deserializeOpDocumentGetPipelineOutput(v **GetPipelineOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetPipelineOutput if *v == nil { sv = &GetPipelineOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Pipeline": if err := awsRestjson1_deserializeDocumentPipeline(&sv.Pipeline, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetPipelineBlueprint struct { } func (*awsRestjson1_deserializeOpGetPipelineBlueprint) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetPipelineBlueprint) 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_deserializeOpErrorGetPipelineBlueprint(response, &metadata) } output := &GetPipelineBlueprintOutput{} 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_deserializeOpDocumentGetPipelineBlueprintOutput(&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_deserializeOpErrorGetPipelineBlueprint(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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(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_deserializeOpDocumentGetPipelineBlueprintOutput(v **GetPipelineBlueprintOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetPipelineBlueprintOutput if *v == nil { sv = &GetPipelineBlueprintOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Blueprint": if err := awsRestjson1_deserializeDocumentPipelineBlueprint(&sv.Blueprint, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetPipelineChangeProgress struct { } func (*awsRestjson1_deserializeOpGetPipelineChangeProgress) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetPipelineChangeProgress) 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_deserializeOpErrorGetPipelineChangeProgress(response, &metadata) } output := &GetPipelineChangeProgressOutput{} 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_deserializeOpDocumentGetPipelineChangeProgressOutput(&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_deserializeOpErrorGetPipelineChangeProgress(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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(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_deserializeOpDocumentGetPipelineChangeProgressOutput(v **GetPipelineChangeProgressOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetPipelineChangeProgressOutput if *v == nil { sv = &GetPipelineChangeProgressOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ChangeProgressStatuses": if err := awsRestjson1_deserializeDocumentChangeProgressStatusList(&sv.ChangeProgressStatuses, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListPipelineBlueprints struct { } func (*awsRestjson1_deserializeOpListPipelineBlueprints) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListPipelineBlueprints) 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_deserializeOpErrorListPipelineBlueprints(response, &metadata) } output := &ListPipelineBlueprintsOutput{} 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_deserializeOpDocumentListPipelineBlueprintsOutput(&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_deserializeOpErrorListPipelineBlueprints(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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidPaginationTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListPipelineBlueprintsOutput(v **ListPipelineBlueprintsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListPipelineBlueprintsOutput if *v == nil { sv = &ListPipelineBlueprintsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Blueprints": if err := awsRestjson1_deserializeDocumentPipelineBlueprintsSummaryList(&sv.Blueprints, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListPipelines struct { } func (*awsRestjson1_deserializeOpListPipelines) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListPipelines) 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_deserializeOpErrorListPipelines(response, &metadata) } output := &ListPipelinesOutput{} 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_deserializeOpDocumentListPipelinesOutput(&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_deserializeOpErrorListPipelines(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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidPaginationTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListPipelinesOutput(v **ListPipelinesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListPipelinesOutput if *v == nil { sv = &ListPipelinesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "Pipelines": if err := awsRestjson1_deserializeDocumentPipelineSummaryList(&sv.Pipelines, 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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(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_deserializeDocumentTagList(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStartPipeline struct { } func (*awsRestjson1_deserializeOpStartPipeline) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartPipeline) 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_deserializeOpErrorStartPipeline(response, &metadata) } output := &StartPipelineOutput{} 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_deserializeOpDocumentStartPipelineOutput(&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_deserializeOpErrorStartPipeline(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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(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_deserializeOpDocumentStartPipelineOutput(v **StartPipelineOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartPipelineOutput if *v == nil { sv = &StartPipelineOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Pipeline": if err := awsRestjson1_deserializeDocumentPipeline(&sv.Pipeline, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStopPipeline struct { } func (*awsRestjson1_deserializeOpStopPipeline) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStopPipeline) 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_deserializeOpErrorStopPipeline(response, &metadata) } output := &StopPipelineOutput{} 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_deserializeOpDocumentStopPipelineOutput(&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_deserializeOpErrorStopPipeline(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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(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_deserializeOpDocumentStopPipelineOutput(v **StopPipelineOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StopPipelineOutput if *v == nil { sv = &StopPipelineOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Pipeline": if err := awsRestjson1_deserializeDocumentPipeline(&sv.Pipeline, 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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(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_deserializeOpUpdatePipeline struct { } func (*awsRestjson1_deserializeOpUpdatePipeline) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdatePipeline) 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_deserializeOpErrorUpdatePipeline(response, &metadata) } output := &UpdatePipelineOutput{} 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_deserializeOpDocumentUpdatePipelineOutput(&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_deserializeOpErrorUpdatePipeline(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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(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_deserializeOpDocumentUpdatePipelineOutput(v **UpdatePipelineOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdatePipelineOutput if *v == nil { sv = &UpdatePipelineOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Pipeline": if err := awsRestjson1_deserializeDocumentPipeline(&sv.Pipeline, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpValidatePipeline struct { } func (*awsRestjson1_deserializeOpValidatePipeline) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpValidatePipeline) 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_deserializeOpErrorValidatePipeline(response, &metadata) } output := &ValidatePipelineOutput{} 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_deserializeOpDocumentValidatePipelineOutput(&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_deserializeOpErrorValidatePipeline(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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentValidatePipelineOutput(v **ValidatePipelineOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ValidatePipelineOutput if *v == nil { sv = &ValidatePipelineOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Errors": if err := awsRestjson1_deserializeDocumentValidationMessageList(&sv.Errors, value); err != nil { return err } case "isValid": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsValid = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.AccessDeniedException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ConflictException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentConflictException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorInternalException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalException{} 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_deserializeDocumentInternalException(&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_deserializeErrorInvalidPaginationTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidPaginationTokenException{} 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_deserializeDocumentInvalidPaginationTokenException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.LimitExceededException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentLimitExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorResourceAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceAlreadyExistsException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentResourceAlreadyExistsException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_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_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ValidationException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentValidationException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AccessDeniedException if *v == nil { sv = &types.AccessDeniedException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentChangeProgressStage(v **types.ChangeProgressStage, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ChangeProgressStage if *v == nil { sv = &types.ChangeProgressStage{} } else { sv = *v } for key, value := range shape { switch key { case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "LastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChangeProgressStageStatuses to be of type string, got %T instead", value) } sv.Status = types.ChangeProgressStageStatuses(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentChangeProgressStageList(v *[]types.ChangeProgressStage, 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.ChangeProgressStage if *v == nil { cv = []types.ChangeProgressStage{} } else { cv = *v } for _, value := range shape { var col types.ChangeProgressStage destAddr := &col if err := awsRestjson1_deserializeDocumentChangeProgressStage(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentChangeProgressStatus(v **types.ChangeProgressStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ChangeProgressStatus if *v == nil { sv = &types.ChangeProgressStatus{} } else { sv = *v } for key, value := range shape { switch key { case "ChangeProgressStages": if err := awsRestjson1_deserializeDocumentChangeProgressStageList(&sv.ChangeProgressStages, value); err != nil { return err } case "StartTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ChangeProgressStatuses to be of type string, got %T instead", value) } sv.Status = types.ChangeProgressStatuses(jtv) } case "TotalNumberOfStages": 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.TotalNumberOfStages = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentChangeProgressStatusList(v *[]types.ChangeProgressStatus, 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.ChangeProgressStatus if *v == nil { cv = []types.ChangeProgressStatus{} } else { cv = *v } for _, value := range shape { var col types.ChangeProgressStatus destAddr := &col if err := awsRestjson1_deserializeDocumentChangeProgressStatus(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCloudWatchLogDestination(v **types.CloudWatchLogDestination, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CloudWatchLogDestination if *v == nil { sv = &types.CloudWatchLogDestination{} } else { sv = *v } for key, value := range shape { switch key { case "LogGroup": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LogGroup to be of type string, got %T instead", value) } sv.LogGroup = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ConflictException if *v == nil { sv = &types.ConflictException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIngestEndpointUrlsList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInternalException(v **types.InternalException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.InternalException if *v == nil { sv = &types.InternalException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInvalidPaginationTokenException(v **types.InvalidPaginationTokenException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.InvalidPaginationTokenException if *v == nil { sv = &types.InvalidPaginationTokenException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LimitExceededException if *v == nil { sv = &types.LimitExceededException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLogPublishingOptions(v **types.LogPublishingOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LogPublishingOptions if *v == nil { sv = &types.LogPublishingOptions{} } else { sv = *v } for key, value := range shape { switch key { case "CloudWatchLogDestination": if err := awsRestjson1_deserializeDocumentCloudWatchLogDestination(&sv.CloudWatchLogDestination, value); err != nil { return err } case "IsLoggingEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsLoggingEnabled = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeline(v **types.Pipeline, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Pipeline if *v == nil { sv = &types.Pipeline{} } else { sv = *v } for key, value := range shape { switch key { case "CreatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "IngestEndpointUrls": if err := awsRestjson1_deserializeDocumentIngestEndpointUrlsList(&sv.IngestEndpointUrls, value); err != nil { return err } case "LastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "LogPublishingOptions": if err := awsRestjson1_deserializeDocumentLogPublishingOptions(&sv.LogPublishingOptions, value); err != nil { return err } case "MaxUnits": 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.MaxUnits = int32(i64) } case "MinUnits": 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.MinUnits = int32(i64) } case "PipelineArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.PipelineArn = ptr.String(jtv) } case "PipelineConfigurationBody": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.PipelineConfigurationBody = ptr.String(jtv) } case "PipelineName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.PipelineName = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipelineStatus to be of type string, got %T instead", value) } sv.Status = types.PipelineStatus(jtv) } case "StatusReason": if err := awsRestjson1_deserializeDocumentPipelineStatusReason(&sv.StatusReason, value); err != nil { return err } case "VpcEndpoints": if err := awsRestjson1_deserializeDocumentVpcEndpointsList(&sv.VpcEndpoints, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipelineBlueprint(v **types.PipelineBlueprint, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PipelineBlueprint if *v == nil { sv = &types.PipelineBlueprint{} } else { sv = *v } for key, value := range shape { switch key { case "BlueprintName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.BlueprintName = ptr.String(jtv) } case "PipelineConfigurationBody": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.PipelineConfigurationBody = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipelineBlueprintsSummaryList(v *[]types.PipelineBlueprintSummary, 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.PipelineBlueprintSummary if *v == nil { cv = []types.PipelineBlueprintSummary{} } else { cv = *v } for _, value := range shape { var col types.PipelineBlueprintSummary destAddr := &col if err := awsRestjson1_deserializeDocumentPipelineBlueprintSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPipelineBlueprintSummary(v **types.PipelineBlueprintSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PipelineBlueprintSummary if *v == nil { sv = &types.PipelineBlueprintSummary{} } else { sv = *v } for key, value := range shape { switch key { case "BlueprintName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.BlueprintName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipelineStatusReason(v **types.PipelineStatusReason, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PipelineStatusReason if *v == nil { sv = &types.PipelineStatusReason{} } else { sv = *v } for key, value := range shape { switch key { case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipelineSummary(v **types.PipelineSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PipelineSummary if *v == nil { sv = &types.PipelineSummary{} } else { sv = *v } for key, value := range shape { switch key { case "CreatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "LastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "MaxUnits": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PipelineUnits to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaxUnits = ptr.Int32(int32(i64)) } case "MinUnits": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PipelineUnits to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MinUnits = ptr.Int32(int32(i64)) } case "PipelineArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipelineArn to be of type string, got %T instead", value) } sv.PipelineArn = ptr.String(jtv) } case "PipelineName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipelineName to be of type string, got %T instead", value) } sv.PipelineName = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipelineStatus to be of type string, got %T instead", value) } sv.Status = types.PipelineStatus(jtv) } case "StatusReason": if err := awsRestjson1_deserializeDocumentPipelineStatusReason(&sv.StatusReason, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipelineSummaryList(v *[]types.PipelineSummary, 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.PipelineSummary if *v == nil { cv = []types.PipelineSummary{} } else { cv = *v } for _, value := range shape { var col types.PipelineSummary destAddr := &col if err := awsRestjson1_deserializeDocumentPipelineSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentResourceAlreadyExistsException(v **types.ResourceAlreadyExistsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceAlreadyExistsException if *v == nil { sv = &types.ResourceAlreadyExistsException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSecurityGroupIds(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 SecurityGroupId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSubnetIds(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 SubnetId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTag(v **types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Tag if *v == nil { sv = &types.Tag{} } else { sv = *v } for key, value := range shape { switch key { case "Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) } sv.Key = ptr.String(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.Tag if *v == nil { cv = []types.Tag{} } else { cv = *v } for _, value := range shape { var col types.Tag destAddr := &col if err := awsRestjson1_deserializeDocumentTag(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ValidationException if *v == nil { sv = &types.ValidationException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentValidationMessage(v **types.ValidationMessage, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ValidationMessage if *v == nil { sv = &types.ValidationMessage{} } 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_deserializeDocumentValidationMessageList(v *[]types.ValidationMessage, 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.ValidationMessage if *v == nil { cv = []types.ValidationMessage{} } else { cv = *v } for _, value := range shape { var col types.ValidationMessage destAddr := &col if err := awsRestjson1_deserializeDocumentValidationMessage(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentVpcEndpoint(v **types.VpcEndpoint, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.VpcEndpoint if *v == nil { sv = &types.VpcEndpoint{} } else { sv = *v } for key, value := range shape { switch key { case "VpcEndpointId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.VpcEndpointId = ptr.String(jtv) } case "VpcId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.VpcId = ptr.String(jtv) } case "VpcOptions": if err := awsRestjson1_deserializeDocumentVpcOptions(&sv.VpcOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVpcEndpointsList(v *[]types.VpcEndpoint, 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.VpcEndpoint if *v == nil { cv = []types.VpcEndpoint{} } else { cv = *v } for _, value := range shape { var col types.VpcEndpoint destAddr := &col if err := awsRestjson1_deserializeDocumentVpcEndpoint(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentVpcOptions(v **types.VpcOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.VpcOptions if *v == nil { sv = &types.VpcOptions{} } else { sv = *v } for key, value := range shape { switch key { case "SecurityGroupIds": if err := awsRestjson1_deserializeDocumentSecurityGroupIds(&sv.SecurityGroupIds, value); err != nil { return err } case "SubnetIds": if err := awsRestjson1_deserializeDocumentSubnetIds(&sv.SubnetIds, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil }
3,812
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package osis provides the API client, operations, and parameter types for // Amazon OpenSearch Ingestion. // // Use the Amazon OpenSearch Ingestion API to create and manage ingestion // pipelines. OpenSearch Ingestion is a fully managed data collector that delivers // real-time log and trace data to OpenSearch Service domains. For more // information, see Getting data into your cluster using OpenSearch Ingestion (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/ingestion.html) // . package osis
12
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package osis 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/osis/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 = "osis" } 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 osis // goModuleVersion is the tagged release for this module const goModuleVersion = "1.0.4"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package osis
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package osis import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/osis/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_serializeOpCreatePipeline struct { } func (*awsRestjson1_serializeOpCreatePipeline) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreatePipeline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreatePipelineInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2022-01-01/osis/createPipeline") 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_serializeOpDocumentCreatePipelineInput(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_serializeOpHttpBindingsCreatePipelineInput(v *CreatePipelineInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreatePipelineInput(v *CreatePipelineInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.LogPublishingOptions != nil { ok := object.Key("LogPublishingOptions") if err := awsRestjson1_serializeDocumentLogPublishingOptions(v.LogPublishingOptions, ok); err != nil { return err } } if v.MaxUnits != nil { ok := object.Key("MaxUnits") ok.Integer(*v.MaxUnits) } if v.MinUnits != nil { ok := object.Key("MinUnits") ok.Integer(*v.MinUnits) } if v.PipelineConfigurationBody != nil { ok := object.Key("PipelineConfigurationBody") ok.String(*v.PipelineConfigurationBody) } if v.PipelineName != nil { ok := object.Key("PipelineName") ok.String(*v.PipelineName) } if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { return err } } if v.VpcOptions != nil { ok := object.Key("VpcOptions") if err := awsRestjson1_serializeDocumentVpcOptions(v.VpcOptions, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeletePipeline struct { } func (*awsRestjson1_serializeOpDeletePipeline) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeletePipeline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeletePipelineInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2022-01-01/osis/deletePipeline/{PipelineName}") 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_serializeOpHttpBindingsDeletePipelineInput(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_serializeOpHttpBindingsDeletePipelineInput(v *DeletePipelineInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.PipelineName == nil || len(*v.PipelineName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member PipelineName must not be empty")} } if v.PipelineName != nil { if err := encoder.SetURI("PipelineName").String(*v.PipelineName); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetPipeline struct { } func (*awsRestjson1_serializeOpGetPipeline) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetPipeline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetPipelineInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2022-01-01/osis/getPipeline/{PipelineName}") 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_serializeOpHttpBindingsGetPipelineInput(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_serializeOpHttpBindingsGetPipelineInput(v *GetPipelineInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.PipelineName == nil || len(*v.PipelineName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member PipelineName must not be empty")} } if v.PipelineName != nil { if err := encoder.SetURI("PipelineName").String(*v.PipelineName); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetPipelineBlueprint struct { } func (*awsRestjson1_serializeOpGetPipelineBlueprint) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetPipelineBlueprint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetPipelineBlueprintInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2022-01-01/osis/getPipelineBlueprint/{BlueprintName}") 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_serializeOpHttpBindingsGetPipelineBlueprintInput(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_serializeOpHttpBindingsGetPipelineBlueprintInput(v *GetPipelineBlueprintInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.BlueprintName == nil || len(*v.BlueprintName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member BlueprintName must not be empty")} } if v.BlueprintName != nil { if err := encoder.SetURI("BlueprintName").String(*v.BlueprintName); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetPipelineChangeProgress struct { } func (*awsRestjson1_serializeOpGetPipelineChangeProgress) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetPipelineChangeProgress) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetPipelineChangeProgressInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2022-01-01/osis/getPipelineChangeProgress/{PipelineName}") 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_serializeOpHttpBindingsGetPipelineChangeProgressInput(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_serializeOpHttpBindingsGetPipelineChangeProgressInput(v *GetPipelineChangeProgressInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.PipelineName == nil || len(*v.PipelineName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member PipelineName must not be empty")} } if v.PipelineName != nil { if err := encoder.SetURI("PipelineName").String(*v.PipelineName); err != nil { return err } } return nil } type awsRestjson1_serializeOpListPipelineBlueprints struct { } func (*awsRestjson1_serializeOpListPipelineBlueprints) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListPipelineBlueprints) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListPipelineBlueprintsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2022-01-01/osis/listPipelineBlueprints") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListPipelineBlueprintsInput(v *ListPipelineBlueprintsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpListPipelines struct { } func (*awsRestjson1_serializeOpListPipelines) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListPipelines) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListPipelinesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2022-01-01/osis/listPipelines") 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_serializeOpHttpBindingsListPipelinesInput(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_serializeOpHttpBindingsListPipelinesInput(v *ListPipelinesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_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("/2022-01-01/osis/listTagsForResource") 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.Arn != nil { encoder.SetQuery("arn").String(*v.Arn) } return nil } type awsRestjson1_serializeOpStartPipeline struct { } func (*awsRestjson1_serializeOpStartPipeline) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartPipeline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartPipelineInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2022-01-01/osis/startPipeline/{PipelineName}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsStartPipelineInput(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_serializeOpHttpBindingsStartPipelineInput(v *StartPipelineInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.PipelineName == nil || len(*v.PipelineName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member PipelineName must not be empty")} } if v.PipelineName != nil { if err := encoder.SetURI("PipelineName").String(*v.PipelineName); err != nil { return err } } return nil } type awsRestjson1_serializeOpStopPipeline struct { } func (*awsRestjson1_serializeOpStopPipeline) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStopPipeline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StopPipelineInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2022-01-01/osis/stopPipeline/{PipelineName}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsStopPipelineInput(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_serializeOpHttpBindingsStopPipelineInput(v *StopPipelineInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.PipelineName == nil || len(*v.PipelineName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member PipelineName must not be empty")} } if v.PipelineName != nil { if err := encoder.SetURI("PipelineName").String(*v.PipelineName); 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("/2022-01-01/osis/tagResource") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } 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.Arn != nil { encoder.SetQuery("arn").String(*v.Arn) } 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_serializeDocumentTagList(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUntagResource struct { } func (*awsRestjson1_serializeOpUntagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UntagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2022-01-01/osis/untagResource") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Arn != nil { encoder.SetQuery("arn").String(*v.Arn) } return nil } func awsRestjson1_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.TagKeys != nil { ok := object.Key("TagKeys") if err := awsRestjson1_serializeDocumentStringList(v.TagKeys, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdatePipeline struct { } func (*awsRestjson1_serializeOpUpdatePipeline) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdatePipeline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdatePipelineInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2022-01-01/osis/updatePipeline/{PipelineName}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdatePipelineInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdatePipelineInput(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_serializeOpHttpBindingsUpdatePipelineInput(v *UpdatePipelineInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.PipelineName == nil || len(*v.PipelineName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member PipelineName must not be empty")} } if v.PipelineName != nil { if err := encoder.SetURI("PipelineName").String(*v.PipelineName); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdatePipelineInput(v *UpdatePipelineInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.LogPublishingOptions != nil { ok := object.Key("LogPublishingOptions") if err := awsRestjson1_serializeDocumentLogPublishingOptions(v.LogPublishingOptions, ok); err != nil { return err } } if v.MaxUnits != nil { ok := object.Key("MaxUnits") ok.Integer(*v.MaxUnits) } if v.MinUnits != nil { ok := object.Key("MinUnits") ok.Integer(*v.MinUnits) } if v.PipelineConfigurationBody != nil { ok := object.Key("PipelineConfigurationBody") ok.String(*v.PipelineConfigurationBody) } return nil } type awsRestjson1_serializeOpValidatePipeline struct { } func (*awsRestjson1_serializeOpValidatePipeline) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpValidatePipeline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ValidatePipelineInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2022-01-01/osis/validatePipeline") 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_serializeOpDocumentValidatePipelineInput(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_serializeOpHttpBindingsValidatePipelineInput(v *ValidatePipelineInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentValidatePipelineInput(v *ValidatePipelineInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.PipelineConfigurationBody != nil { ok := object.Key("PipelineConfigurationBody") ok.String(*v.PipelineConfigurationBody) } return nil } func awsRestjson1_serializeDocumentCloudWatchLogDestination(v *types.CloudWatchLogDestination, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.LogGroup != nil { ok := object.Key("LogGroup") ok.String(*v.LogGroup) } return nil } func awsRestjson1_serializeDocumentLogPublishingOptions(v *types.LogPublishingOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CloudWatchLogDestination != nil { ok := object.Key("CloudWatchLogDestination") if err := awsRestjson1_serializeDocumentCloudWatchLogDestination(v.CloudWatchLogDestination, ok); err != nil { return err } } if v.IsLoggingEnabled != nil { ok := object.Key("IsLoggingEnabled") ok.Boolean(*v.IsLoggingEnabled) } return nil } func awsRestjson1_serializeDocumentSecurityGroupIds(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_serializeDocumentStringList(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_serializeDocumentSubnetIds(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_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Key != nil { ok := object.Key("Key") ok.String(*v.Key) } if v.Value != nil { ok := object.Key("Value") ok.String(*v.Value) } return nil } func awsRestjson1_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentTag(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentVpcOptions(v *types.VpcOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SecurityGroupIds != nil { ok := object.Key("SecurityGroupIds") if err := awsRestjson1_serializeDocumentSecurityGroupIds(v.SecurityGroupIds, ok); err != nil { return err } } if v.SubnetIds != nil { ok := object.Key("SubnetIds") if err := awsRestjson1_serializeDocumentSubnetIds(v.SubnetIds, ok); err != nil { return err } } return nil }
1,060
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package osis import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/osis/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpCreatePipeline struct { } func (*validateOpCreatePipeline) ID() string { return "OperationInputValidation" } func (m *validateOpCreatePipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreatePipelineInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreatePipelineInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeletePipeline struct { } func (*validateOpDeletePipeline) ID() string { return "OperationInputValidation" } func (m *validateOpDeletePipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeletePipelineInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeletePipelineInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetPipelineBlueprint struct { } func (*validateOpGetPipelineBlueprint) ID() string { return "OperationInputValidation" } func (m *validateOpGetPipelineBlueprint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetPipelineBlueprintInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetPipelineBlueprintInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetPipelineChangeProgress struct { } func (*validateOpGetPipelineChangeProgress) ID() string { return "OperationInputValidation" } func (m *validateOpGetPipelineChangeProgress) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetPipelineChangeProgressInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetPipelineChangeProgressInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetPipeline struct { } func (*validateOpGetPipeline) ID() string { return "OperationInputValidation" } func (m *validateOpGetPipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetPipelineInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetPipelineInput(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 validateOpStartPipeline struct { } func (*validateOpStartPipeline) ID() string { return "OperationInputValidation" } func (m *validateOpStartPipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartPipelineInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartPipelineInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStopPipeline struct { } func (*validateOpStopPipeline) ID() string { return "OperationInputValidation" } func (m *validateOpStopPipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StopPipelineInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStopPipelineInput(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 validateOpUpdatePipeline struct { } func (*validateOpUpdatePipeline) ID() string { return "OperationInputValidation" } func (m *validateOpUpdatePipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdatePipelineInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdatePipelineInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpValidatePipeline struct { } func (*validateOpValidatePipeline) ID() string { return "OperationInputValidation" } func (m *validateOpValidatePipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ValidatePipelineInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpValidatePipelineInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpCreatePipelineValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreatePipeline{}, middleware.After) } func addOpDeletePipelineValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeletePipeline{}, middleware.After) } func addOpGetPipelineBlueprintValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetPipelineBlueprint{}, middleware.After) } func addOpGetPipelineChangeProgressValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetPipelineChangeProgress{}, middleware.After) } func addOpGetPipelineValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetPipeline{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } func addOpStartPipelineValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartPipeline{}, middleware.After) } func addOpStopPipelineValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStopPipeline{}, 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 addOpUpdatePipelineValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdatePipeline{}, middleware.After) } func addOpValidatePipelineValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpValidatePipeline{}, middleware.After) } func validateCloudWatchLogDestination(v *types.CloudWatchLogDestination) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CloudWatchLogDestination"} if v.LogGroup == nil { invalidParams.Add(smithy.NewErrParamRequired("LogGroup")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateLogPublishingOptions(v *types.LogPublishingOptions) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "LogPublishingOptions"} if v.CloudWatchLogDestination != nil { if err := validateCloudWatchLogDestination(v.CloudWatchLogDestination); err != nil { invalidParams.AddNested("CloudWatchLogDestination", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTag(v *types.Tag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Tag"} if v.Key == nil { invalidParams.Add(smithy.NewErrParamRequired("Key")) } if v.Value == nil { invalidParams.Add(smithy.NewErrParamRequired("Value")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTagList(v []types.Tag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagList"} for i := range v { if err := validateTag(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateVpcOptions(v *types.VpcOptions) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "VpcOptions"} if v.SubnetIds == nil { invalidParams.Add(smithy.NewErrParamRequired("SubnetIds")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreatePipelineInput(v *CreatePipelineInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreatePipelineInput"} if v.PipelineName == nil { invalidParams.Add(smithy.NewErrParamRequired("PipelineName")) } if v.MinUnits == nil { invalidParams.Add(smithy.NewErrParamRequired("MinUnits")) } if v.MaxUnits == nil { invalidParams.Add(smithy.NewErrParamRequired("MaxUnits")) } if v.PipelineConfigurationBody == nil { invalidParams.Add(smithy.NewErrParamRequired("PipelineConfigurationBody")) } if v.LogPublishingOptions != nil { if err := validateLogPublishingOptions(v.LogPublishingOptions); err != nil { invalidParams.AddNested("LogPublishingOptions", err.(smithy.InvalidParamsError)) } } if v.VpcOptions != nil { if err := validateVpcOptions(v.VpcOptions); err != nil { invalidParams.AddNested("VpcOptions", err.(smithy.InvalidParamsError)) } } if v.Tags != nil { if err := validateTagList(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeletePipelineInput(v *DeletePipelineInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeletePipelineInput"} if v.PipelineName == nil { invalidParams.Add(smithy.NewErrParamRequired("PipelineName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetPipelineBlueprintInput(v *GetPipelineBlueprintInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetPipelineBlueprintInput"} if v.BlueprintName == nil { invalidParams.Add(smithy.NewErrParamRequired("BlueprintName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetPipelineChangeProgressInput(v *GetPipelineChangeProgressInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetPipelineChangeProgressInput"} if v.PipelineName == nil { invalidParams.Add(smithy.NewErrParamRequired("PipelineName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetPipelineInput(v *GetPipelineInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetPipelineInput"} if v.PipelineName == nil { invalidParams.Add(smithy.NewErrParamRequired("PipelineName")) } 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.Arn == nil { invalidParams.Add(smithy.NewErrParamRequired("Arn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartPipelineInput(v *StartPipelineInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartPipelineInput"} if v.PipelineName == nil { invalidParams.Add(smithy.NewErrParamRequired("PipelineName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStopPipelineInput(v *StopPipelineInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StopPipelineInput"} if v.PipelineName == nil { invalidParams.Add(smithy.NewErrParamRequired("PipelineName")) } 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.Arn == nil { invalidParams.Add(smithy.NewErrParamRequired("Arn")) } if v.Tags == nil { invalidParams.Add(smithy.NewErrParamRequired("Tags")) } else if v.Tags != nil { if err := validateTagList(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUntagResourceInput(v *UntagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} if v.Arn == nil { invalidParams.Add(smithy.NewErrParamRequired("Arn")) } if v.TagKeys == nil { invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdatePipelineInput(v *UpdatePipelineInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdatePipelineInput"} if v.PipelineName == nil { invalidParams.Add(smithy.NewErrParamRequired("PipelineName")) } if v.LogPublishingOptions != nil { if err := validateLogPublishingOptions(v.LogPublishingOptions); err != nil { invalidParams.AddNested("LogPublishingOptions", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpValidatePipelineInput(v *ValidatePipelineInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ValidatePipelineInput"} if v.PipelineConfigurationBody == nil { invalidParams.Add(smithy.NewErrParamRequired("PipelineConfigurationBody")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
601
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 OSIS 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: "osis.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "osis-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "osis-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "osis.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "osis.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "osis-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "osis-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "osis.{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: "osis-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "osis.{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: "osis-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "osis.{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: "osis-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "osis.{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: "osis-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "osis.{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: "osis.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "osis-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "osis-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "osis.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, }, }
329
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 ChangeProgressStageStatuses string // Enum values for ChangeProgressStageStatuses const ( ChangeProgressStageStatusesPending ChangeProgressStageStatuses = "PENDING" ChangeProgressStageStatusesInProgress ChangeProgressStageStatuses = "IN_PROGRESS" ChangeProgressStageStatusesCompleted ChangeProgressStageStatuses = "COMPLETED" ChangeProgressStageStatusesFailed ChangeProgressStageStatuses = "FAILED" ) // Values returns all known values for ChangeProgressStageStatuses. 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 (ChangeProgressStageStatuses) Values() []ChangeProgressStageStatuses { return []ChangeProgressStageStatuses{ "PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", } } type ChangeProgressStatuses string // Enum values for ChangeProgressStatuses const ( ChangeProgressStatusesPending ChangeProgressStatuses = "PENDING" ChangeProgressStatusesInProgress ChangeProgressStatuses = "IN_PROGRESS" ChangeProgressStatusesCompleted ChangeProgressStatuses = "COMPLETED" ChangeProgressStatusesFailed ChangeProgressStatuses = "FAILED" ) // Values returns all known values for ChangeProgressStatuses. 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 (ChangeProgressStatuses) Values() []ChangeProgressStatuses { return []ChangeProgressStatuses{ "PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", } } type PipelineStatus string // Enum values for PipelineStatus const ( PipelineStatusCreating PipelineStatus = "CREATING" PipelineStatusActive PipelineStatus = "ACTIVE" PipelineStatusUpdating PipelineStatus = "UPDATING" PipelineStatusDeleting PipelineStatus = "DELETING" PipelineStatusCreateFailed PipelineStatus = "CREATE_FAILED" PipelineStatusUpdateFailed PipelineStatus = "UPDATE_FAILED" PipelineStatusStarting PipelineStatus = "STARTING" PipelineStatusStartFailed PipelineStatus = "START_FAILED" PipelineStatusStopping PipelineStatus = "STOPPING" PipelineStatusStopped PipelineStatus = "STOPPED" ) // Values returns all known values for PipelineStatus. 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 (PipelineStatus) Values() []PipelineStatus { return []PipelineStatus{ "CREATING", "ACTIVE", "UPDATING", "DELETING", "CREATE_FAILED", "UPDATE_FAILED", "STARTING", "START_FAILED", "STOPPING", "STOPPED", } }
82
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( "fmt" smithy "github.com/aws/smithy-go" ) // You don't have permissions to access the resource. type AccessDeniedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AccessDeniedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccessDeniedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccessDeniedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccessDeniedException" } return *e.ErrorCodeOverride } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The client attempted to remove a resource that is currently in use. 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 } // The request failed because of an unknown error, exception, or failure (the // failure is internal to the service). type InternalException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InternalException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalException" } return *e.ErrorCodeOverride } func (e *InternalException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // An invalid pagination token provided in the request. type InvalidPaginationTokenException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidPaginationTokenException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidPaginationTokenException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidPaginationTokenException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidPaginationTokenException" } return *e.ErrorCodeOverride } func (e *InvalidPaginationTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You attempted to create more than the allowed number of tags. type LimitExceededException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *LimitExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *LimitExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *LimitExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "LimitExceededException" } return *e.ErrorCodeOverride } func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You attempted to create a resource that already exists. type ResourceAlreadyExistsException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ResourceAlreadyExistsException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceAlreadyExistsException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceAlreadyExistsException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceAlreadyExistsException" } return *e.ErrorCodeOverride } func (e *ResourceAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You attempted to access or delete a resource that does not exist. type ResourceNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ResourceNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceNotFoundException" } return *e.ErrorCodeOverride } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // An exception for missing or invalid input fields. 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 }
218
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" ) // Progress details for a specific stage of a pipeline configuration change. type ChangeProgressStage struct { // A description of the stage. Description *string // The most recent updated timestamp of the stage. LastUpdatedAt *time.Time // The name of the stage. Name *string // The current status of the stage that the change is in. Status ChangeProgressStageStatuses noSmithyDocumentSerde } // The progress details of a pipeline configuration change. type ChangeProgressStatus struct { // Information about the stages that the pipeline is going through to perform the // configuration change. ChangeProgressStages []ChangeProgressStage // The time at which the configuration change is made on the pipeline. StartTime *time.Time // The overall status of the pipeline configuration change. Status ChangeProgressStatuses // The total number of stages required for the pipeline configuration change. TotalNumberOfStages int32 noSmithyDocumentSerde } // The destination for OpenSearch Ingestion logs sent to Amazon CloudWatch. type CloudWatchLogDestination struct { // The name of the CloudWatch Logs group to send pipeline logs to. You can specify // an existing log group or create a new one. For example, // /aws/OpenSearchService/IngestionService/my-pipeline . // // This member is required. LogGroup *string noSmithyDocumentSerde } // Container for the values required to configure logging for the pipeline. If you // don't specify these values, OpenSearch Ingestion will not publish logs from your // application to CloudWatch Logs. type LogPublishingOptions struct { // The destination for OpenSearch Ingestion logs sent to Amazon CloudWatch Logs. // This parameter is required if IsLoggingEnabled is set to true . CloudWatchLogDestination *CloudWatchLogDestination // Whether logs should be published. IsLoggingEnabled *bool noSmithyDocumentSerde } // Information about an existing OpenSearch Ingestion pipeline. type Pipeline struct { // The date and time when the pipeline was created. CreatedAt *time.Time // The ingestion endpoints for the pipeline, which you can send data to. IngestEndpointUrls []string // The date and time when the pipeline was last updated. LastUpdatedAt *time.Time // Key-value pairs that represent log publishing settings. LogPublishingOptions *LogPublishingOptions // The maximum pipeline capacity, in Ingestion Compute Units (ICUs). MaxUnits int32 // The minimum pipeline capacity, in Ingestion Compute Units (ICUs). MinUnits int32 // The Amazon Resource Name (ARN) of the pipeline. PipelineArn *string // The Data Prepper pipeline configuration in YAML format. PipelineConfigurationBody *string // The name of the pipeline. PipelineName *string // The current status of the pipeline. Status PipelineStatus // The reason for the current status of the pipeline. StatusReason *PipelineStatusReason // The VPC interface endpoints that have access to the pipeline. VpcEndpoints []VpcEndpoint noSmithyDocumentSerde } // Container for information about an OpenSearch Ingestion blueprint. type PipelineBlueprint struct { // The name of the blueprint. BlueprintName *string // The YAML configuration of the blueprint. PipelineConfigurationBody *string noSmithyDocumentSerde } // A summary of an OpenSearch Ingestion blueprint. type PipelineBlueprintSummary struct { // The name of the blueprint. BlueprintName *string noSmithyDocumentSerde } // Information about a pipeline's current status. type PipelineStatusReason struct { // A description of why a pipeline has a certain status. Description *string noSmithyDocumentSerde } // Summary information for an OpenSearch Ingestion pipeline. type PipelineSummary struct { // The date and time when the pipeline was created. CreatedAt *time.Time // The date and time when the pipeline was last updated. LastUpdatedAt *time.Time // The maximum pipeline capacity, in Ingestion Compute Units (ICUs). MaxUnits *int32 // The minimum pipeline capacity, in Ingestion Compute Units (ICUs). MinUnits *int32 // The Amazon Resource Name (ARN) of the pipeline. PipelineArn *string // The name of the pipeline. PipelineName *string // The current status of the pipeline. Status PipelineStatus // Information about a pipeline's current status. StatusReason *PipelineStatusReason noSmithyDocumentSerde } // A tag (key-value pair) for an OpenSearch Ingestion pipeline. type Tag struct { // The tag key. Tag keys must be unique for the pipeline to which they are // attached. // // This member is required. Key *string // The value assigned to the corresponding tag key. Tag values can be null and // don't have to be unique in a tag set. For example, you can have a key value pair // in a tag set of project : Trinity and cost-center : Trinity // // This member is required. Value *string noSmithyDocumentSerde } // A validation message associated with a ValidatePipeline request in OpenSearch // Ingestion. type ValidationMessage struct { // The validation message. Message *string noSmithyDocumentSerde } // An OpenSearch Ingestion-managed VPC endpoint that will access one or more // pipelines. type VpcEndpoint struct { // The unique identifier of the endpoint. VpcEndpointId *string // The ID for your VPC. Amazon Web Services PrivateLink generates this value when // you create a VPC. VpcId *string // Information about the VPC, including associated subnets and security groups. VpcOptions *VpcOptions noSmithyDocumentSerde } // Options that specify the subnets and security groups for an OpenSearch // Ingestion VPC endpoint. type VpcOptions struct { // A list of subnet IDs associated with the VPC endpoint. // // This member is required. SubnetIds []string // A list of security groups associated with the VPC endpoint. SecurityGroupIds []string noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
239
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package outposts 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 = "Outposts" const ServiceAPIVersion = "2019-12-03" // Client provides the API client to make operations call for AWS Outposts. type Client struct { options Options } // New returns an initialized Client based on the functional options. Provide // additional functional options to further configure the behavior of the client, // such as changing the client's endpoint or adding custom middleware behavior. func New(options Options, optFns ...func(*Options)) *Client { options = options.Copy() resolveDefaultLogger(&options) setResolvedDefaultsMode(&options) resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) resolveDefaultEndpointConfiguration(&options) for _, fn := range optFns { fn(&options) } client := &Client{ options: options, } return client } type Options struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // Configures the events that will be sent to the configured logger. ClientLogMode aws.ClientLogMode // The credentials object to use when signing requests. Credentials aws.CredentialsProvider // The configuration DefaultsMode that the SDK should use when constructing the // clients initial default settings. DefaultsMode aws.DefaultsMode // The endpoint options to be used when attempting to resolve an endpoint. EndpointOptions EndpointResolverOptions // The service endpoint resolver. EndpointResolver EndpointResolver // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 // The logger writer interface to write logging messages to. Logger logging.Logger // The region to send requests to. (Required) Region string // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify // per operation call's retry max attempts. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. If specified in an operation call's functional // options with a value that is different than the constructed client's Options, // the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if // Retryer option is not also specified. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. Currently does not support per operation call // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. The kind of // default retry created by the API client can be changed with the RetryMode // option. Retryer aws.Retryer // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You // should not populate this structure programmatically, or rely on the values here // within your applications. RuntimeEnvironment aws.RuntimeEnvironment // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved // value was at that point in time. Currently does not support per operation call // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient } // WithAPIOptions returns a functional option for setting the Client's APIOptions // option. func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { return func(o *Options) { o.APIOptions = append(o.APIOptions, optFns...) } } // WithEndpointResolver returns a functional option for setting the Client's // EndpointResolver option. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v } } type HTTPClient interface { Do(*http.Request) (*http.Response, error) } // Copy creates a clone where the APIOptions list is deep copied. func (o Options) Copy() Options { to := o to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) copy(to.APIOptions, o.APIOptions) return to } func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() for _, fn := range optFns { fn(&options) } finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err } } for _, fn := range options.APIOptions { if err := fn(stack); err != nil { return nil, metadata, err } } handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) result, metadata, err = handler.Handle(ctx, params) if err != nil { err = &smithy.OperationError{ ServiceID: ServiceID, OperationName: opID, Err: err, } } return result, metadata, err } type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { if o.Logger != nil { return } o.Logger = logging.Nop{} } func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } func setResolvedDefaultsMode(o *Options) { if len(o.resolvedDefaultsMode) > 0 { return } var mode aws.DefaultsMode mode.SetFromString(string(o.DefaultsMode)) if mode == aws.DefaultsModeAuto { mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) } o.resolvedDefaultsMode = mode } // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, DefaultsMode: cfg.DefaultsMode, RuntimeEnvironment: cfg.RuntimeEnvironment, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { var buildable *awshttp.BuildableClient if o.HTTPClient != nil { var ok bool buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) if !ok { return } } else { buildable = awshttp.NewBuildableClient() } modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { dialer.Timeout = dialerTimeout } }) buildable = buildable.WithTransportOptions(func(transport *http.Transport) { if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { transport.TLSHandshakeTimeout = tlsHandshakeTimeout } }) } o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } if len(o.RetryMode) == 0 { modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { o.RetryMode = modeConfig.RetryMode } } if len(o.RetryMode) == 0 { o.RetryMode = aws.RetryModeStandard } var standardOptions []func(*retry.StandardOptions) if v := o.RetryMaxAttempts; v != 0 { standardOptions = append(standardOptions, func(so *retry.StandardOptions) { so.MaxAttempts = v }) } switch o.RetryMode { case aws.RetryModeAdaptive: var adaptiveOptions []func(*retry.AdaptiveModeOptions) if len(standardOptions) != 0 { adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { ao.StandardOptions = append(ao.StandardOptions, standardOptions...) }) } o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) default: o.Retryer = retry.NewStandard(standardOptions...) } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { if cfg.Retryer == nil { return } o.Retryer = cfg.Retryer() } func resolveAWSRetryMode(cfg aws.Config, o *Options) { if len(cfg.RetryMode) == 0 { return } o.RetryMode = cfg.RetryMode } func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { if cfg.RetryMaxAttempts == 0 { return } o.RetryMaxAttempts = cfg.RetryMaxAttempts } func finalizeRetryMaxAttemptOptions(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { return } o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) } func addClientUserAgent(stack *middleware.Stack) error { return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "outposts", goModuleVersion)(stack) } func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ CredentialsProvider: o.Credentials, Signer: o.HTTPSignerV4, LogSigning: o.ClientLogMode.IsSigning(), }) return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error } func resolveHTTPSignerV4(o *Options) { if o.HTTPSignerV4 != nil { return } o.HTTPSignerV4 = newDefaultV4Signer(*o) } func newDefaultV4Signer(o Options) *v4.Signer { return v4.NewSigner(func(so *v4.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() }) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, LogRetryAttempts: o.ClientLogMode.IsRetries(), } return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseDualStackEndpoint = value } return nil } // resolves FIPS endpoint configuration func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseFIPSEndpoint = value } return nil } func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ LogRequest: o.ClientLogMode.IsRequest(), LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), LogResponse: o.ClientLogMode.IsResponse(), LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) }
434
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package outposts 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 outposts import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Cancels the specified order for an Outpost. func (c *Client) CancelOrder(ctx context.Context, params *CancelOrderInput, optFns ...func(*Options)) (*CancelOrderOutput, error) { if params == nil { params = &CancelOrderInput{} } result, metadata, err := c.invokeOperation(ctx, "CancelOrder", params, optFns, c.addOperationCancelOrderMiddlewares) if err != nil { return nil, err } out := result.(*CancelOrderOutput) out.ResultMetadata = metadata return out, nil } type CancelOrderInput struct { // The ID of the order. // // This member is required. OrderId *string noSmithyDocumentSerde } type CancelOrderOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCancelOrderMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCancelOrder{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCancelOrder{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCancelOrderValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelOrder(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCancelOrder(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "outposts", OperationName: "CancelOrder", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package outposts 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/outposts/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates an order for an Outpost. func (c *Client) CreateOrder(ctx context.Context, params *CreateOrderInput, optFns ...func(*Options)) (*CreateOrderOutput, error) { if params == nil { params = &CreateOrderInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateOrder", params, optFns, c.addOperationCreateOrderMiddlewares) if err != nil { return nil, err } out := result.(*CreateOrderOutput) out.ResultMetadata = metadata return out, nil } type CreateOrderInput struct { // The line items that make up the order. // // This member is required. LineItems []types.LineItemRequest // The ID or the Amazon Resource Name (ARN) of the Outpost. // // This member is required. OutpostIdentifier *string // The payment option. // // This member is required. PaymentOption types.PaymentOption // The payment terms. PaymentTerm types.PaymentTerm noSmithyDocumentSerde } type CreateOrderOutput struct { // Information about this order. Order *types.Order // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateOrderMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateOrder{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateOrder{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateOrderValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateOrder(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateOrder(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "outposts", OperationName: "CreateOrder", } }
138